emdash 0.21.0 → 0.22.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-BxSmgtbF.d.mts → adapters-hUy8vOB-.d.mts} +1 -1
- package/dist/{adapters-BxSmgtbF.d.mts.map → adapters-hUy8vOB-.d.mts.map} +1 -1
- package/dist/after-B1IIdH3Y.mjs +29 -0
- package/dist/after-B1IIdH3Y.mjs.map +1 -0
- package/dist/{allowed-origins-BqC8cul8.mjs → allowed-origins-DjlhyfNN.mjs} +2 -2
- package/dist/{allowed-origins-BqC8cul8.mjs.map → allowed-origins-DjlhyfNN.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +20 -19
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +4 -4
- package/dist/{api-DxjIV2o8.mjs → api-BDuM4bEy.mjs} +31 -25
- package/dist/api-BDuM4bEy.mjs.map +1 -0
- package/dist/{api-tokens-BFFkB0jB.mjs → api-tokens-ViYKeIp9.mjs} +13 -3
- package/dist/api-tokens-ViYKeIp9.mjs.map +1 -0
- package/dist/{apply-CLjxheyb.mjs → apply-wDqQoxX4.mjs} +18 -18
- package/dist/{apply-CLjxheyb.mjs.map → apply-wDqQoxX4.mjs.map} +1 -1
- package/dist/astro/image-endpoint.d.mts +8 -0
- package/dist/astro/image-endpoint.d.mts.map +1 -0
- package/dist/astro/image-endpoint.mjs +55 -0
- package/dist/astro/image-endpoint.mjs.map +1 -0
- package/dist/astro/index.d.mts +36 -11
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +114 -24
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +9 -9
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +12 -10
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +6 -6
- package/dist/astro/middleware/request-context.mjs +5 -5
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +1 -1
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +153 -79
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -7
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +10 -10
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -10
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -10
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -16
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -16
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +17 -16
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +15 -13
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -6
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -10
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -6
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/index.mjs +12 -10
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +40 -39
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +40 -39
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +40 -39
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +40 -39
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +39 -38
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +39 -38
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +4 -4
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +39 -38
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -8
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
- package/dist/astro/routes/api/admin/users/index.mjs +7 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -6
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -9
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -11
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +8 -8
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -7
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +13 -13
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/request.mjs +11 -11
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +16 -15
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +9 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +179 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +17 -15
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
- package/dist/astro/routes/api/dashboard.mjs +10 -8
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -4
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +12 -12
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +16 -15
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +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 +12 -12
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +18 -17
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +5 -5
- package/dist/astro/routes/api/mcp.mjs +213 -46
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +8 -8
- package/dist/astro/routes/api/media/_id_.mjs +8 -8
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +10 -10
- package/dist/astro/routes/api/media.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +11 -9
- 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 +7 -7
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
- package/dist/astro/routes/api/oauth/token.mjs +7 -7
- package/dist/astro/routes/api/openapi.json.mjs +5 -5
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +5 -5
- package/dist/astro/routes/api/redirects/404s/index.mjs +11 -11
- package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -11
- package/dist/astro/routes/api/redirects/_id_.mjs +12 -12
- package/dist/astro/routes/api/redirects/index.mjs +12 -12
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -4
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +39 -38
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +39 -38
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +39 -38
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +39 -38
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +39 -38
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +7 -7
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +39 -38
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +39 -38
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +11 -11
- package/dist/astro/routes/api/search/index.mjs +10 -10
- package/dist/astro/routes/api/search/rebuild.mjs +11 -11
- package/dist/astro/routes/api/search/stats.mjs +7 -7
- package/dist/astro/routes/api/search/suggest.mjs +10 -10
- package/dist/astro/routes/api/sections/_slug_.mjs +10 -10
- package/dist/astro/routes/api/sections/index.mjs +10 -10
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +16 -15
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +13 -13
- package/dist/astro/routes/api/setup/admin.mjs +12 -12
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +29 -27
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.mjs +29 -28
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -5
- package/dist/astro/routes/api/snapshot.d.mts.map +1 -1
- package/dist/astro/routes/api/snapshot.mjs +10 -9
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -14
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +16 -14
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +16 -14
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +16 -14
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +8 -8
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +8 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +11 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +11 -11
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -7
- package/dist/astro/routes/api/widget-areas/index.mjs +11 -11
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +10 -9
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -12
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +11 -10
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +16 -12
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-D5gfBVU5.mjs → authorize-C0EYoUeV.mjs} +2 -2
- package/dist/{authorize-D5gfBVU5.mjs.map → authorize-C0EYoUeV.mjs.map} +1 -1
- package/dist/{base64-CqR-7kqF.mjs → base64-CmWvODNW.mjs} +1 -1
- package/dist/{base64-CqR-7kqF.mjs.map → base64-CmWvODNW.mjs.map} +1 -1
- package/dist/{byline-V_Qp1Ziw.mjs → byline-CC0WS4Gu.mjs} +17 -8
- package/dist/byline-CC0WS4Gu.mjs.map +1 -0
- package/dist/{byline-fields-B0NO1yUB.mjs → byline-fields-53i9Et0x.mjs} +3 -3
- package/dist/{byline-fields-B0NO1yUB.mjs.map → byline-fields-53i9Et0x.mjs.map} +1 -1
- package/dist/{byline-fields-nBVqK_Ff.mjs → byline-fields-DNp0HNKc.mjs} +2 -2
- package/dist/{byline-fields-nBVqK_Ff.mjs.map → byline-fields-DNp0HNKc.mjs.map} +1 -1
- package/dist/{byline-fields-CQJRIQkn.d.mts → byline-fields-jy07PZJM.d.mts} +36 -31
- package/dist/byline-fields-jy07PZJM.d.mts.map +1 -0
- package/dist/{byline-registry-DedidtqC.mjs → byline-registry-BOjqDOim.mjs} +3 -3
- package/dist/{byline-registry-DedidtqC.mjs.map → byline-registry-BOjqDOim.mjs.map} +1 -1
- package/dist/{bylines-DfGDnred.mjs → bylines-CCO1CYnH.mjs} +8 -8
- package/dist/{bylines-DfGDnred.mjs.map → bylines-CCO1CYnH.mjs.map} +1 -1
- package/dist/{bylines-B2NWnIwS.mjs → bylines-DGekMGGm.mjs} +10 -4
- package/dist/{bylines-B2NWnIwS.mjs.map → bylines-DGekMGGm.mjs.map} +1 -1
- package/dist/{cache-DTTHWD8n.mjs → cache-pXTpun6s.mjs} +3 -3
- package/dist/{cache-DTTHWD8n.mjs.map → cache-pXTpun6s.mjs.map} +1 -1
- package/dist/{challenge-store-woE0bbCf.mjs → challenge-store-C6E_kWTs.mjs} +1 -1
- package/dist/{challenge-store-woE0bbCf.mjs.map → challenge-store-C6E_kWTs.mjs.map} +1 -1
- package/dist/{chunks-BerYVuve.mjs → chunks-SyjZaYwV.mjs} +2 -2
- package/dist/{chunks-BerYVuve.mjs.map → chunks-SyjZaYwV.mjs.map} +1 -1
- package/dist/cli/index.mjs +27 -26
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +2 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/{comment-sqQxNpN3.mjs → comment-80UyJJUR.mjs} +11 -3
- package/dist/comment-80UyJJUR.mjs.map +1 -0
- package/dist/comment-reaction-B6AdcpXw.mjs +85 -0
- package/dist/comment-reaction-B6AdcpXw.mjs.map +1 -0
- package/dist/{comments-D2hNuxNa.mjs → comments-CtPkT2tp.mjs} +3 -3
- package/dist/{comments-D2hNuxNa.mjs.map → comments-CtPkT2tp.mjs.map} +1 -1
- package/dist/{components-DYKp2gmo.mjs → components-D6ZnrzbB.mjs} +1 -1
- package/dist/{components-DYKp2gmo.mjs.map → components-D6ZnrzbB.mjs.map} +1 -1
- package/dist/{content-BIlVx-RX.mjs → content-2PTDNnoh.mjs} +22 -7
- package/dist/content-2PTDNnoh.mjs.map +1 -0
- package/dist/{context-Cm4pt1Ws.mjs → context-f1__jpzF.mjs} +11 -11
- package/dist/{context-Cm4pt1Ws.mjs.map → context-f1__jpzF.mjs.map} +1 -1
- package/dist/{cron-DdEVrQ2Y.mjs → cron-CQPxBjYs.mjs} +1 -1
- package/dist/{cron-DdEVrQ2Y.mjs.map → cron-CQPxBjYs.mjs.map} +1 -1
- package/dist/{dashboard-C-UYpps0.mjs → dashboard-BOESNcwE.mjs} +4 -4
- package/dist/{dashboard-C-UYpps0.mjs.map → dashboard-BOESNcwE.mjs.map} +1 -1
- package/dist/database/instrumentation.d.mts +19 -0
- package/dist/database/instrumentation.d.mts.map +1 -1
- package/dist/database/instrumentation.mjs +8 -1
- package/dist/database/instrumentation.mjs.map +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{db-errors-BluWkwGI.mjs → db-errors-CrC5w3Jz.mjs} +1 -1
- package/dist/{db-errors-BluWkwGI.mjs.map → db-errors-CrC5w3Jz.mjs.map} +1 -1
- package/dist/{default-NHGuJzQ3.mjs → default-CpBEPn6a.mjs} +1 -1
- package/dist/{default-NHGuJzQ3.mjs.map → default-CpBEPn6a.mjs.map} +1 -1
- package/dist/{device-flow-BQApWgnW.mjs → device-flow-Bn-qiDrw.mjs} +5 -5
- package/dist/{device-flow-BQApWgnW.mjs.map → device-flow-Bn-qiDrw.mjs.map} +1 -1
- package/dist/{email-console-BbU3RbWv.mjs → email-console-B9VS6eN4.mjs} +1 -1
- package/dist/{email-console-BbU3RbWv.mjs.map → email-console-B9VS6eN4.mjs.map} +1 -1
- package/dist/{error-CNn_w7jf.mjs → error-BQ1pxs0L.mjs} +2 -2
- package/dist/{error-CNn_w7jf.mjs.map → error-BQ1pxs0L.mjs.map} +1 -1
- package/dist/{escape-DPgcxcpL.mjs → escape-BtbJWyaW.mjs} +1 -1
- package/dist/{escape-DPgcxcpL.mjs.map → escape-BtbJWyaW.mjs.map} +1 -1
- package/dist/{fts-manager-Cx5z8jdA.mjs → fts-manager-DtiWqwNJ.mjs} +2 -2
- package/dist/{fts-manager-Cx5z8jdA.mjs.map → fts-manager-DtiWqwNJ.mjs.map} +1 -1
- package/dist/{hash-DlvIFn0b.mjs → hash-BowcuPwv.mjs} +1 -1
- package/dist/{hash-DlvIFn0b.mjs.map → hash-BowcuPwv.mjs.map} +1 -1
- package/dist/{import-KyxT1Mbs.mjs → import-DqSGOlmR.mjs} +4 -4
- package/dist/{import-KyxT1Mbs.mjs.map → import-DqSGOlmR.mjs.map} +1 -1
- package/dist/{index-D2VAiumu.d.mts → index-C2dLNT6S.d.mts} +172 -17
- package/dist/index-C2dLNT6S.d.mts.map +1 -0
- package/dist/{index-uT2yR66F.d.mts → index-ZDEwR7qW.d.mts} +3 -3
- package/dist/{index-uT2yR66F.d.mts.map → index-ZDEwR7qW.d.mts.map} +1 -1
- package/dist/index.d.mts +18 -17
- package/dist/index.mjs +63 -61
- package/dist/{init-lock-DlBHjf9-.mjs → init-lock-6b309ZrF.mjs} +2 -29
- package/dist/init-lock-6b309ZrF.mjs.map +1 -0
- package/dist/{load-Dq91b_DK.mjs → load-Dtoo7KcJ.mjs} +2 -2
- package/dist/{load-Dq91b_DK.mjs.map → load-Dtoo7KcJ.mjs.map} +1 -1
- package/dist/{loader-BqWjcH3h.mjs → loader-C8Z48Uof.mjs} +4 -4
- package/dist/{loader-BqWjcH3h.mjs.map → loader-C8Z48Uof.mjs.map} +1 -1
- package/dist/{manifest-schema-DFPeqMAn.mjs → manifest-schema-DDSbwkAL.mjs} +1 -1
- package/dist/{manifest-schema-DFPeqMAn.mjs.map → manifest-schema-DDSbwkAL.mjs.map} +1 -1
- package/dist/media/image-endpoint.d.mts +74 -0
- package/dist/media/image-endpoint.d.mts.map +1 -0
- package/dist/media/image-endpoint.mjs +162 -0
- package/dist/media/image-endpoint.mjs.map +1 -0
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +11 -11
- package/dist/media/local-runtime.mjs +9 -8
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-JOf3pNkw.mjs → media-Bw0sA6rb.mjs} +2 -2
- package/dist/{media-JOf3pNkw.mjs.map → media-Bw0sA6rb.mjs.map} +1 -1
- package/dist/{media-allowlist-_A0SuDn4.mjs → media-allowlist-DunzrKFM.mjs} +2 -2
- package/dist/{media-allowlist-_A0SuDn4.mjs.map → media-allowlist-DunzrKFM.mjs.map} +1 -1
- package/dist/{media-url-CqLd69IO.mjs → media-url-S22B6aPr.mjs} +1 -1
- package/dist/{media-url-CqLd69IO.mjs.map → media-url-S22B6aPr.mjs.map} +1 -1
- package/dist/{menus-DX4_E01q.mjs → menus-CYs0WZoL.mjs} +20 -6
- package/dist/menus-CYs0WZoL.mjs.map +1 -0
- package/dist/{menus-Ryk9L7fT.mjs → menus-DOs1MQJg.mjs} +120 -20
- package/dist/menus-DOs1MQJg.mjs.map +1 -0
- package/dist/{mime-YbtlEtvS.mjs → mime-DYpsOAny.mjs} +1 -1
- package/dist/{mime-YbtlEtvS.mjs.map → mime-DYpsOAny.mjs.map} +1 -1
- package/dist/{mode-CGXzIbD8.mjs → mode-CFh8Dw8G.mjs} +1 -1
- package/dist/{mode-CGXzIbD8.mjs.map → mode-CFh8Dw8G.mjs.map} +1 -1
- package/dist/{normalize-DKsg36ty.mjs → normalize-Uam4_Vkr.mjs} +1 -1
- package/dist/{normalize-DKsg36ty.mjs.map → normalize-Uam4_Vkr.mjs.map} +1 -1
- package/dist/{oauth-authorization-C2kVyjXI.mjs → oauth-authorization-BN-t83Uy.mjs} +5 -5
- package/dist/{oauth-authorization-C2kVyjXI.mjs.map → oauth-authorization-BN-t83Uy.mjs.map} +1 -1
- package/dist/{oauth-clients-BC873NCV.mjs → oauth-clients-R6I_V0qz.mjs} +1 -1
- package/dist/{oauth-clients-BC873NCV.mjs.map → oauth-clients-R6I_V0qz.mjs.map} +1 -1
- package/dist/{oauth-state-store-Cd--TUaq.mjs → oauth-state-store-Csoc6kkR.mjs} +1 -1
- package/dist/{oauth-state-store-Cd--TUaq.mjs.map → oauth-state-store-Csoc6kkR.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-e4wOvDud.mjs → oauth-user-lookup-d7VYjTpx.mjs} +1 -1
- package/dist/{oauth-user-lookup-e4wOvDud.mjs.map → oauth-user-lookup-d7VYjTpx.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +15 -0
- package/dist/object-cache/memory.d.mts.map +1 -0
- package/dist/object-cache/memory.mjs +56 -0
- package/dist/object-cache/memory.mjs.map +1 -0
- package/dist/object-cache-SEb2IM4Z.mjs +373 -0
- package/dist/object-cache-SEb2IM4Z.mjs.map +1 -0
- package/dist/{options-9kLgkE8m.d.mts → options-DFFpvNJU.d.mts} +3 -3
- package/dist/{options-9kLgkE8m.d.mts.map → options-DFFpvNJU.d.mts.map} +1 -1
- package/dist/{options-BPCVnesz.mjs → options-DTTML-Tx.mjs} +1 -1
- package/dist/{options-BPCVnesz.mjs.map → options-DTTML-Tx.mjs.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-DzSrk1t8.mjs → parse-qrHlnzTy.mjs} +2 -2
- package/dist/{parse-DzSrk1t8.mjs.map → parse-qrHlnzTy.mjs.map} +1 -1
- package/dist/{passkey-config-BpjbE_Uv.mjs → passkey-config-BJTbcnI5.mjs} +1 -1
- package/dist/{passkey-config-BpjbE_Uv.mjs.map → passkey-config-BJTbcnI5.mjs.map} +1 -1
- package/dist/{patterns-p-RBdTbM.mjs → patterns-BKmjvM7K.mjs} +1 -1
- package/dist/{patterns-p-RBdTbM.mjs.map → patterns-BKmjvM7K.mjs.map} +1 -1
- package/dist/{placeholder-2xumZh4g.mjs → placeholder-CIDCpyEY.mjs} +1 -1
- package/dist/{placeholder-2xumZh4g.mjs.map → placeholder-CIDCpyEY.mjs.map} +1 -1
- package/dist/{placeholder-BevVKfay.d.mts → placeholder-CirPauNG.d.mts} +1 -1
- package/dist/{placeholder-BevVKfay.d.mts.map → placeholder-CirPauNG.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +4 -2
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{transport-1cIrOb1Y.mjs → portable-text-BIFhrU6T.mjs} +2 -135
- package/dist/portable-text-BIFhrU6T.mjs.map +1 -0
- package/dist/{preview-Dqv2hwXr.mjs → preview-IDye9SPQ.mjs} +2 -2
- package/dist/{preview-Dqv2hwXr.mjs.map → preview-IDye9SPQ.mjs.map} +1 -1
- package/dist/{public-url-D_zARuvZ.mjs → public-url-8lFyQ8ZF.mjs} +1 -1
- package/dist/{public-url-D_zARuvZ.mjs.map → public-url-8lFyQ8ZF.mjs.map} +1 -1
- package/dist/{query-Crm038Mc.mjs → query-B1RVFUNM.mjs} +159 -31
- package/dist/query-B1RVFUNM.mjs.map +1 -0
- package/dist/{rate-limit-hRTBqmw1.mjs → rate-limit-DfNAqIWW.mjs} +2 -2
- package/dist/{rate-limit-hRTBqmw1.mjs.map → rate-limit-DfNAqIWW.mjs.map} +1 -1
- package/dist/{redirect-C-OOkyku.mjs → redirect-B4wuX2A5.mjs} +1 -1
- package/dist/{redirect-C-OOkyku.mjs.map → redirect-B4wuX2A5.mjs.map} +1 -1
- package/dist/{redirect-CRWIt8Zj.mjs → redirect-Bifv_yHv.mjs} +3 -3
- package/dist/{redirect-CRWIt8Zj.mjs.map → redirect-Bifv_yHv.mjs.map} +1 -1
- package/dist/{redirects-CP3TnTLO.mjs → redirects-CT_vb3NV.mjs} +6 -6
- package/dist/{redirects-CP3TnTLO.mjs.map → redirects-CT_vb3NV.mjs.map} +1 -1
- package/dist/{redirects-6Zg2SoYo.mjs → redirects-DUvXgzCX.mjs} +8 -3
- package/dist/redirects-DUvXgzCX.mjs.map +1 -0
- package/dist/{registry-diMzD1Wf.mjs → registry-CjK96fHD.mjs} +6 -6
- package/dist/{registry-diMzD1Wf.mjs.map → registry-CjK96fHD.mjs.map} +1 -1
- package/dist/{request-cache-UwmBAiUK.mjs → request-cache-KCNHp_RJ.mjs} +1 -1
- package/dist/{request-cache-UwmBAiUK.mjs.map → request-cache-KCNHp_RJ.mjs.map} +1 -1
- package/dist/{request-meta-DPechd0W.mjs → request-meta-ei3ATilC.mjs} +2 -2
- package/dist/{request-meta-DPechd0W.mjs.map → request-meta-ei3ATilC.mjs.map} +1 -1
- package/dist/{resolve-B3NUUtVY.mjs → resolve-CpbBglV0.mjs} +1 -1
- package/dist/{resolve-B3NUUtVY.mjs.map → resolve-CpbBglV0.mjs.map} +1 -1
- package/dist/{runner--4wMWwKM.mjs → runner-DYYnW530.mjs} +201 -170
- package/dist/runner-DYYnW530.mjs.map +1 -0
- package/dist/{runner-C8vcbvCe.d.mts → runner-jdXtFEd3.d.mts} +2 -2
- package/dist/{runner-C8vcbvCe.d.mts.map → runner-jdXtFEd3.d.mts.map} +1 -1
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +3 -3
- package/dist/{schema-BDOkd3OU.mjs → schema-5z2Jfnbm.mjs} +13 -8
- package/dist/schema-5z2Jfnbm.mjs.map +1 -0
- package/dist/{search-Bs_J_EW-.mjs → search-D9FkoM-k.mjs} +4 -4
- package/dist/{search-Bs_J_EW-.mjs.map → search-D9FkoM-k.mjs.map} +1 -1
- package/dist/{secrets-C8xmE6mR.mjs → secrets-BUE5UQys.mjs} +5 -5
- package/dist/{secrets-C8xmE6mR.mjs.map → secrets-BUE5UQys.mjs.map} +1 -1
- package/dist/{sections-P0zuBlyz.mjs → sections-DWYZo6HK.mjs} +3 -3
- package/dist/{sections-P0zuBlyz.mjs.map → sections-DWYZo6HK.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +22 -21
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-DpNgGQjF.mjs → seo-Cu47j3mJ.mjs} +5 -2
- package/dist/seo-Cu47j3mJ.mjs.map +1 -0
- package/dist/{seo-CLhm-Fmb.mjs → seo-DRnqnstF.mjs} +1 -1
- package/dist/{seo-CLhm-Fmb.mjs.map → seo-DRnqnstF.mjs.map} +1 -1
- package/dist/{service-CDQQnT8W.mjs → service-DTmtqCnw.mjs} +3 -3
- package/dist/{service-CDQQnT8W.mjs.map → service-DTmtqCnw.mjs.map} +1 -1
- package/dist/session-user-DmtPMNa1.mjs +51 -0
- package/dist/session-user-DmtPMNa1.mjs.map +1 -0
- package/dist/{settings-sO0Fif4p.mjs → settings-DUrVDN0c.mjs} +3 -3
- package/dist/{settings-sO0Fif4p.mjs.map → settings-DUrVDN0c.mjs.map} +1 -1
- package/dist/{settings-BjBsmVAo.mjs → settings-yaxu9mU-.mjs} +18 -10
- package/dist/settings-yaxu9mU-.mjs.map +1 -0
- package/dist/{setup-complete-CMMr-oZU.mjs → setup-complete-BWFHzgvZ.mjs} +2 -2
- package/dist/{setup-complete-CMMr-oZU.mjs.map → setup-complete-BWFHzgvZ.mjs.map} +1 -1
- package/dist/{setup-nonce-169xl4fV.mjs → setup-nonce-DFWG-J5c.mjs} +1 -1
- package/dist/{setup-nonce-169xl4fV.mjs.map → setup-nonce-DFWG-J5c.mjs.map} +1 -1
- package/dist/{single-flight-cache-C0UV1Npg.mjs → single-flight-cache-B5p5cNOL.mjs} +2 -2
- package/dist/{single-flight-cache-C0UV1Npg.mjs.map → single-flight-cache-B5p5cNOL.mjs.map} +1 -1
- package/dist/{site-url-vtsuOvSD.mjs → site-url-BOTPgmeM.mjs} +2 -2
- package/dist/{site-url-vtsuOvSD.mjs.map → site-url-BOTPgmeM.mjs.map} +1 -1
- package/dist/{slugify-Cjh1ssOZ.mjs → slugify-Cce3dTdg.mjs} +1 -1
- package/dist/{slugify-Cjh1ssOZ.mjs.map → slugify-Cce3dTdg.mjs.map} +1 -1
- package/dist/{ssrf-XO05Voq6.mjs → ssrf-B0VeRLrp.mjs} +1 -1
- package/dist/{ssrf-XO05Voq6.mjs.map → ssrf-B0VeRLrp.mjs.map} +1 -1
- package/dist/{status-2gZklYuj.mjs → status-CB2basWJ.mjs} +1 -1
- package/dist/{status-2gZklYuj.mjs.map → status-CB2basWJ.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-BBxYA38v.mjs → taxonomies-Be9B1jEj.mjs} +156 -122
- package/dist/taxonomies-Be9B1jEj.mjs.map +1 -0
- package/dist/{taxonomies-DuESHWKI.mjs → taxonomies-CJmkEpdS.mjs} +7 -7
- package/dist/{taxonomies-DuESHWKI.mjs.map → taxonomies-CJmkEpdS.mjs.map} +1 -1
- package/dist/{taxonomy-CdllE4oq.mjs → taxonomy-B2HQuVf5.mjs} +19 -6
- package/dist/taxonomy-B2HQuVf5.mjs.map +1 -0
- package/dist/{tokens-DMkVjxrx.mjs → tokens-BvrJvIB6.mjs} +2 -2
- package/dist/{tokens-DMkVjxrx.mjs.map → tokens-BvrJvIB6.mjs.map} +1 -1
- package/dist/{transaction-x2tJQ-A1.mjs → transaction-qfqpPVpu.mjs} +1 -1
- package/dist/{transaction-x2tJQ-A1.mjs.map → transaction-qfqpPVpu.mjs.map} +1 -1
- package/dist/transport-B4rXnSTf.mjs +135 -0
- package/dist/transport-B4rXnSTf.mjs.map +1 -0
- package/dist/{transport-jdvsZEIt.d.mts → transport-k7YjfmEn.d.mts} +1 -1
- package/dist/{transport-jdvsZEIt.d.mts.map → transport-k7YjfmEn.d.mts.map} +1 -1
- package/dist/{trusted-proxy-CHp41Fjj.mjs → trusted-proxy-DY1_UqHr.mjs} +1 -1
- package/dist/{trusted-proxy-CHp41Fjj.mjs.map → trusted-proxy-DY1_UqHr.mjs.map} +1 -1
- package/dist/{types-DO7whVYU.d.mts → types-CIKX2HO5.d.mts} +2 -2
- package/dist/{types-DO7whVYU.d.mts.map → types-CIKX2HO5.d.mts.map} +1 -1
- package/dist/{types-u_XxjbS8.d.mts → types-CKNXt63n.d.mts} +1 -1
- package/dist/{types-u_XxjbS8.d.mts.map → types-CKNXt63n.d.mts.map} +1 -1
- package/dist/{types-BTnnBYVX.d.mts → types-CWGYDYqF.d.mts} +2 -2
- package/dist/{types-BTnnBYVX.d.mts.map → types-CWGYDYqF.d.mts.map} +1 -1
- package/dist/{types-CkEuk-Zr.d.mts → types-CgvhU-hF.d.mts} +1 -1
- package/dist/{types-CkEuk-Zr.d.mts.map → types-CgvhU-hF.d.mts.map} +1 -1
- package/dist/{types-BFgYtuKd.d.mts → types-CmivgZbp.d.mts} +1 -1
- package/dist/{types-BFgYtuKd.d.mts.map → types-CmivgZbp.d.mts.map} +1 -1
- package/dist/{types-Del0VMij.d.mts → types-Czg1S3gB.d.mts} +9 -1
- package/dist/{types-Del0VMij.d.mts.map → types-Czg1S3gB.d.mts.map} +1 -1
- package/dist/types-DCNNfeCv.d.mts +124 -0
- package/dist/types-DCNNfeCv.d.mts.map +1 -0
- package/dist/{types-Bzfk2yC8.d.mts → types-DPCpkzvS.d.mts} +1 -1
- package/dist/{types-Bzfk2yC8.d.mts.map → types-DPCpkzvS.d.mts.map} +1 -1
- package/dist/{types-DdkL6fyv.d.mts → types-DXLVzV2w.d.mts} +1 -1
- package/dist/{types-DdkL6fyv.d.mts.map → types-DXLVzV2w.d.mts.map} +1 -1
- package/dist/{types-BXSUSAjt.mjs → types-DXOIbece.mjs} +3 -3
- package/dist/{types-BXSUSAjt.mjs.map → types-DXOIbece.mjs.map} +1 -1
- package/dist/{types-DejCHqWT.mjs → types-DYF2_Vf4.mjs} +1 -1
- package/dist/{types-DejCHqWT.mjs.map → types-DYF2_Vf4.mjs.map} +1 -1
- package/dist/{types-BIduXPJk.mjs → types-tM44hEcf.mjs} +1 -1
- package/dist/{types-BIduXPJk.mjs.map → types-tM44hEcf.mjs.map} +1 -1
- package/dist/{user-C0um7wrg.mjs → user-Db-Rti_z.mjs} +3 -3
- package/dist/{user-C0um7wrg.mjs.map → user-Db-Rti_z.mjs.map} +1 -1
- package/dist/{utils-C4M981Br.mjs → utils-LbHcSRTj.mjs} +2 -2
- package/dist/{utils-C4M981Br.mjs.map → utils-LbHcSRTj.mjs.map} +1 -1
- package/dist/{validate-DGhQPXzI.mjs → validate-Bwl64sxv.mjs} +3 -3
- package/dist/{validate-DGhQPXzI.mjs.map → validate-Bwl64sxv.mjs.map} +1 -1
- package/dist/{validate-cJOiOvT2.d.mts → validate-CE2M0nvx.d.mts} +5 -5
- package/dist/{validate-cJOiOvT2.d.mts.map → validate-CE2M0nvx.d.mts.map} +1 -1
- package/dist/{validation-DVHjPM1M.mjs → validation-C_yOvFaO.mjs} +6 -6
- package/dist/{validation-DVHjPM1M.mjs.map → validation-C_yOvFaO.mjs.map} +1 -1
- package/dist/version-RnYXYjzD.mjs +7 -0
- package/dist/{version-BOjj_cfz.mjs.map → version-RnYXYjzD.mjs.map} +1 -1
- package/dist/{widgets-Ci6hLwfO.mjs → widgets-8GONuRHo.mjs} +4 -4
- package/dist/{widgets-Ci6hLwfO.mjs.map → widgets-8GONuRHo.mjs.map} +1 -1
- package/dist/{zod-generator-CarzgPAu.mjs → zod-generator-D481JjzD.mjs} +3 -3
- package/dist/{zod-generator-CarzgPAu.mjs.map → zod-generator-D481JjzD.mjs.map} +1 -1
- package/package.json +18 -6
- package/src/api/handlers/api-tokens.ts +19 -0
- package/src/api/handlers/comment-reactions.ts +165 -0
- package/src/api/handlers/schema.ts +8 -0
- package/src/api/schemas/comments.ts +10 -0
- package/src/astro/image-endpoint.ts +84 -0
- package/src/astro/index.ts +6 -0
- package/src/astro/integration/index.ts +83 -22
- package/src/astro/integration/routes.ts +5 -0
- package/src/astro/integration/runtime.ts +65 -1
- package/src/astro/integration/virtual-modules.ts +32 -0
- package/src/astro/integration/vite-config.ts +16 -0
- package/src/astro/middleware/auth.ts +4 -3
- package/src/astro/middleware/stream-end-metrics.ts +11 -1
- package/src/astro/middleware.ts +41 -3
- package/src/astro/object-cache/adapters.ts +50 -0
- package/src/astro/prefetch.ts +77 -0
- package/src/astro/routes/api/comments/[collection]/[contentId]/reactions.ts +97 -0
- package/src/astro/routes/api/setup/dev-bypass.ts +5 -1
- package/src/astro/routes/api/snapshot.ts +3 -1
- package/src/astro/session-user.ts +57 -0
- package/src/astro/types.ts +1 -0
- package/src/comments/query.ts +78 -7
- package/src/comments/ranking.ts +58 -0
- package/src/components/Comments.astro +136 -1
- package/src/database/instrumentation.ts +21 -1
- package/src/database/migrations/044_comment_reactions.ts +56 -0
- package/src/database/migrations/runner.ts +2 -0
- package/src/database/repositories/byline.ts +13 -0
- package/src/database/repositories/comment-reaction.ts +132 -0
- package/src/database/repositories/comment.ts +10 -0
- package/src/database/repositories/content.ts +25 -3
- package/src/database/repositories/menu.ts +13 -1
- package/src/database/repositories/seo.ts +3 -0
- package/src/database/repositories/taxonomy.ts +13 -1
- package/src/database/types.ts +9 -0
- package/src/emdash-runtime.ts +18 -4
- package/src/index.ts +22 -0
- package/src/mcp/server.ts +307 -20
- package/src/media/image-endpoint.ts +167 -0
- package/src/menus/index.ts +11 -4
- package/src/object-cache/codec.ts +73 -0
- package/src/object-cache/index.ts +495 -0
- package/src/object-cache/memory.ts +91 -0
- package/src/object-cache/types.ts +124 -0
- package/src/plugins/adapt-sandbox-entry.ts +11 -1
- package/src/query.ts +196 -17
- package/src/schema/query.ts +11 -4
- package/src/settings/index.ts +18 -5
- package/src/taxonomies/index.ts +237 -165
- package/src/virtual-modules.d.ts +11 -0
- package/dist/api-DxjIV2o8.mjs.map +0 -1
- package/dist/api-tokens-BFFkB0jB.mjs.map +0 -1
- package/dist/byline-V_Qp1Ziw.mjs.map +0 -1
- package/dist/byline-fields-CQJRIQkn.d.mts.map +0 -1
- package/dist/comment-sqQxNpN3.mjs.map +0 -1
- package/dist/content-BIlVx-RX.mjs.map +0 -1
- package/dist/index-D2VAiumu.d.mts.map +0 -1
- package/dist/init-lock-DlBHjf9-.mjs.map +0 -1
- package/dist/menus-DX4_E01q.mjs.map +0 -1
- package/dist/menus-Ryk9L7fT.mjs.map +0 -1
- package/dist/query-Crm038Mc.mjs.map +0 -1
- package/dist/redirects-6Zg2SoYo.mjs.map +0 -1
- package/dist/runner--4wMWwKM.mjs.map +0 -1
- package/dist/schema-BDOkd3OU.mjs.map +0 -1
- package/dist/seo-DpNgGQjF.mjs.map +0 -1
- package/dist/settings-BjBsmVAo.mjs.map +0 -1
- package/dist/taxonomies-BBxYA38v.mjs.map +0 -1
- package/dist/taxonomy-CdllE4oq.mjs.map +0 -1
- package/dist/transport-1cIrOb1Y.mjs.map +0 -1
- package/dist/version-BOjj_cfz.mjs +0 -7
- /package/dist/{api-tokens-C7ywRx7l.mjs → api-tokens-BVH-H8Z9.mjs} +0 -0
- /package/dist/{ssrf-CRZGzjdL.mjs → ssrf-Cz1e2QPn.mjs} +0 -0
- /package/dist/{types-BoRm8-pp.mjs → types-Bfr2Pj6z.mjs} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../../../../../base64-
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-
|
|
4
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
5
|
-
import { S as allowedDomainUpdateBody } from "../../../../../redirects-
|
|
6
|
-
import "../../../../../byline-fields-
|
|
7
|
-
import "../../../../../status-
|
|
1
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
3
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
4
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-qrHlnzTy.mjs";
|
|
5
|
+
import { S as allowedDomainUpdateBody } from "../../../../../redirects-DUvXgzCX.mjs";
|
|
6
|
+
import "../../../../../byline-fields-53i9Et0x.mjs";
|
|
7
|
+
import "../../../../../status-CB2basWJ.mjs";
|
|
8
8
|
import "../../../../../api/schemas/index.mjs";
|
|
9
9
|
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
|
|
10
10
|
import { Role, roleFromLevel } from "@emdash-cms/auth";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../../../../../base64-
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-
|
|
4
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
5
|
-
import { x as allowedDomainCreateBody } from "../../../../../redirects-
|
|
6
|
-
import "../../../../../byline-fields-
|
|
7
|
-
import "../../../../../status-
|
|
1
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
3
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
4
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-qrHlnzTy.mjs";
|
|
5
|
+
import { x as allowedDomainCreateBody } from "../../../../../redirects-DUvXgzCX.mjs";
|
|
6
|
+
import "../../../../../byline-fields-53i9Et0x.mjs";
|
|
7
|
+
import "../../../../../status-CB2basWJ.mjs";
|
|
8
8
|
import "../../../../../api/schemas/index.mjs";
|
|
9
9
|
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
|
|
10
10
|
import { Role, roleFromLevel } from "@emdash-cms/auth";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../../../../base64-
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import { a as unwrapResult, r as handleError, t as apiError } from "../../../../../error-
|
|
4
|
-
import "../../../../../api-tokens-
|
|
5
|
-
import {
|
|
1
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
3
|
+
import { a as unwrapResult, r as handleError, t as apiError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
4
|
+
import "../../../../../api-tokens-BVH-H8Z9.mjs";
|
|
5
|
+
import { i as handleApiTokenRevoke } from "../../../../../api-tokens-ViYKeIp9.mjs";
|
|
6
6
|
import { Role } from "@emdash-cms/auth";
|
|
7
7
|
|
|
8
8
|
//#region src/astro/routes/api/admin/api-tokens/[id].ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../../../../../base64-
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import { a as unwrapResult, r as handleError, t as apiError } from "../../../../../error-
|
|
4
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
5
|
-
import { n as VALID_SCOPES } from "../../../../../api-tokens-
|
|
6
|
-
import { n as
|
|
1
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
3
|
+
import { a as unwrapResult, r as handleError, t as apiError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
4
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-qrHlnzTy.mjs";
|
|
5
|
+
import { n as VALID_SCOPES } from "../../../../../api-tokens-BVH-H8Z9.mjs";
|
|
6
|
+
import { n as handleApiTokenCreate, r as handleApiTokenList } from "../../../../../api-tokens-ViYKeIp9.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { Role } from "@emdash-cms/auth";
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../../../../../../base64-
|
|
2
|
-
import "../../../../../../types-
|
|
3
|
-
import "../../../../../../byline-registry-
|
|
4
|
-
import { a as unwrapResult, i as requireDb, t as apiError } from "../../../../../../error-
|
|
5
|
-
import { n as requirePerm } from "../../../../../../authorize-
|
|
6
|
-
import { s as handleBylineFieldUsage } from "../../../../../../byline-fields-
|
|
1
|
+
import "../../../../../../base64-CmWvODNW.mjs";
|
|
2
|
+
import "../../../../../../types-DXOIbece.mjs";
|
|
3
|
+
import "../../../../../../byline-registry-BOjqDOim.mjs";
|
|
4
|
+
import { a as unwrapResult, i as requireDb, t as apiError } from "../../../../../../error-BQ1pxs0L.mjs";
|
|
5
|
+
import { n as requirePerm } from "../../../../../../authorize-C0EYoUeV.mjs";
|
|
6
|
+
import { s as handleBylineFieldUsage } from "../../../../../../byline-fields-DNp0HNKc.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/astro/routes/api/admin/byline-fields/[slug]/usage.ts
|
|
9
9
|
const prerender = false;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "../../../../../base64-
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import "../../../../../byline-registry-
|
|
4
|
-
import { a as unwrapResult, i as requireDb, t as apiError } from "../../../../../error-
|
|
5
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
6
|
-
import "../../../../../redirects-
|
|
7
|
-
import { a as bylineFieldUpdateBody } from "../../../../../byline-fields-
|
|
8
|
-
import "../../../../../status-
|
|
1
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
3
|
+
import "../../../../../byline-registry-BOjqDOim.mjs";
|
|
4
|
+
import { a as unwrapResult, i as requireDb, t as apiError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
5
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-qrHlnzTy.mjs";
|
|
6
|
+
import "../../../../../redirects-DUvXgzCX.mjs";
|
|
7
|
+
import { a as bylineFieldUpdateBody } from "../../../../../byline-fields-53i9Et0x.mjs";
|
|
8
|
+
import "../../../../../status-CB2basWJ.mjs";
|
|
9
9
|
import "../../../../../api/schemas/index.mjs";
|
|
10
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
11
|
-
import { n as handleBylineFieldDelete, o as handleBylineFieldUpdate, r as handleBylineFieldGet } from "../../../../../byline-fields-
|
|
10
|
+
import { n as requirePerm } from "../../../../../authorize-C0EYoUeV.mjs";
|
|
11
|
+
import { n as handleBylineFieldDelete, o as handleBylineFieldUpdate, r as handleBylineFieldGet } from "../../../../../byline-fields-DNp0HNKc.mjs";
|
|
12
12
|
|
|
13
13
|
//#region src/astro/routes/api/admin/byline-fields/[slug].ts
|
|
14
14
|
const prerender = false;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "../../../../../base64-
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import "../../../../../byline-registry-
|
|
4
|
-
import { a as unwrapResult, i as requireDb } from "../../../../../error-
|
|
5
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
6
|
-
import "../../../../../redirects-
|
|
7
|
-
import { t as bylineFieldCreateBody } from "../../../../../byline-fields-
|
|
8
|
-
import "../../../../../status-
|
|
1
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
3
|
+
import "../../../../../byline-registry-BOjqDOim.mjs";
|
|
4
|
+
import { a as unwrapResult, i as requireDb } from "../../../../../error-BQ1pxs0L.mjs";
|
|
5
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-qrHlnzTy.mjs";
|
|
6
|
+
import "../../../../../redirects-DUvXgzCX.mjs";
|
|
7
|
+
import { t as bylineFieldCreateBody } from "../../../../../byline-fields-53i9Et0x.mjs";
|
|
8
|
+
import "../../../../../status-CB2basWJ.mjs";
|
|
9
9
|
import "../../../../../api/schemas/index.mjs";
|
|
10
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
11
|
-
import { i as handleBylineFieldList, t as handleBylineFieldCreate } from "../../../../../byline-fields-
|
|
10
|
+
import { n as requirePerm } from "../../../../../authorize-C0EYoUeV.mjs";
|
|
11
|
+
import { i as handleBylineFieldList, t as handleBylineFieldCreate } from "../../../../../byline-fields-DNp0HNKc.mjs";
|
|
12
12
|
|
|
13
13
|
//#region src/astro/routes/api/admin/byline-fields/index.ts
|
|
14
14
|
const prerender = false;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "../../../../../base64-
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import "../../../../../byline-registry-
|
|
4
|
-
import { a as unwrapResult, i as requireDb } from "../../../../../error-
|
|
5
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
6
|
-
import "../../../../../redirects-
|
|
7
|
-
import { i as bylineFieldReorderBody } from "../../../../../byline-fields-
|
|
8
|
-
import "../../../../../status-
|
|
1
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
3
|
+
import "../../../../../byline-registry-BOjqDOim.mjs";
|
|
4
|
+
import { a as unwrapResult, i as requireDb } from "../../../../../error-BQ1pxs0L.mjs";
|
|
5
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-qrHlnzTy.mjs";
|
|
6
|
+
import "../../../../../redirects-DUvXgzCX.mjs";
|
|
7
|
+
import { i as bylineFieldReorderBody } from "../../../../../byline-fields-53i9Et0x.mjs";
|
|
8
|
+
import "../../../../../status-CB2basWJ.mjs";
|
|
9
9
|
import "../../../../../api/schemas/index.mjs";
|
|
10
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
11
|
-
import { a as handleBylineFieldReorder } from "../../../../../byline-fields-
|
|
10
|
+
import { n as requirePerm } from "../../../../../authorize-C0EYoUeV.mjs";
|
|
11
|
+
import { a as handleBylineFieldReorder } from "../../../../../byline-fields-DNp0HNKc.mjs";
|
|
12
12
|
|
|
13
13
|
//#region src/astro/routes/api/admin/byline-fields/reorder.ts
|
|
14
14
|
const prerender = false;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import "../../../../../../dialect-helpers-DRI5pyY3.mjs";
|
|
2
|
-
import "../../../../../../
|
|
3
|
-
import "../../../../../../
|
|
4
|
-
import "../../../../../../
|
|
5
|
-
import "../../../../../../
|
|
6
|
-
import "../../../../../../
|
|
7
|
-
import
|
|
8
|
-
import "../../../../../../
|
|
9
|
-
import "../../../../../../
|
|
10
|
-
import
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import "../../../../../../
|
|
14
|
-
import "../../../../../../
|
|
2
|
+
import "../../../../../../after-B1IIdH3Y.mjs";
|
|
3
|
+
import "../../../../../../object-cache-SEb2IM4Z.mjs";
|
|
4
|
+
import "../../../../../../base64-CmWvODNW.mjs";
|
|
5
|
+
import "../../../../../../types-DXOIbece.mjs";
|
|
6
|
+
import "../../../../../../request-cache-KCNHp_RJ.mjs";
|
|
7
|
+
import "../../../../../../byline-registry-BOjqDOim.mjs";
|
|
8
|
+
import { t as BylineRepository } from "../../../../../../byline-CC0WS4Gu.mjs";
|
|
9
|
+
import "../../../../../../loader-C8Z48Uof.mjs";
|
|
10
|
+
import "../../../../../../resolve-CpbBglV0.mjs";
|
|
11
|
+
import { a as unwrapResult, i as requireDb, n as apiSuccess, r as handleError, t as apiError } from "../../../../../../error-BQ1pxs0L.mjs";
|
|
12
|
+
import { n as parseBody, t as isParseError } from "../../../../../../parse-qrHlnzTy.mjs";
|
|
13
|
+
import { Tn as bylineUpdateBody } from "../../../../../../redirects-DUvXgzCX.mjs";
|
|
14
|
+
import "../../../../../../byline-fields-53i9Et0x.mjs";
|
|
15
|
+
import "../../../../../../status-CB2basWJ.mjs";
|
|
15
16
|
import "../../../../../../api/schemas/index.mjs";
|
|
16
|
-
import { a as invalidateBylineCache } from "../../../../../../bylines-
|
|
17
|
-
import { n as requirePerm } from "../../../../../../authorize-
|
|
18
|
-
import {
|
|
17
|
+
import { a as invalidateBylineCache } from "../../../../../../bylines-CCO1CYnH.mjs";
|
|
18
|
+
import { n as requirePerm } from "../../../../../../authorize-C0EYoUeV.mjs";
|
|
19
|
+
import { i as handleBylineUpdate } from "../../../../../../bylines-DGekMGGm.mjs";
|
|
19
20
|
|
|
20
21
|
//#region src/astro/routes/api/admin/bylines/[id]/index.ts
|
|
21
22
|
const prerender = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/bylines/[id]/index.ts"],"sourcesContent":["import type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleBylineUpdate } from \"#api/handlers/bylines.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { bylineUpdateBody } from \"#api/schemas.js\";\nimport { invalidateBylineCache } from \"#bylines/index.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst denied = requirePerm(user, \"bylines:read\");\n\tif (denied) return denied;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\ttry {\n\t\tconst repo = new BylineRepository(emdash.db);\n\t\tconst byline = await repo.findById(params.id!);\n\t\tif (!byline) return apiError(\"NOT_FOUND\", \"Byline not found\", 404);\n\t\treturn apiSuccess(byline);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to get byline\", \"BYLINE_GET_ERROR\");\n\t}\n};\n\nexport const PUT: APIRoute = async ({ params, request, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst denied = requirePerm(user, \"bylines:manage\");\n\tif (denied) return denied;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst body = await parseBody(request, bylineUpdateBody);\n\tif (isParseError(body)) return body;\n\n\tconst result = await handleBylineUpdate(emdash.db, params.id!, {\n\t\tslug: body.slug,\n\t\tdisplayName: body.displayName,\n\t\tbio: body.bio ?? null,\n\t\tavatarMediaId: body.avatarMediaId ?? null,\n\t\twebsiteUrl: body.websiteUrl ?? null,\n\t\tuserId: body.userId ?? null,\n\t\tisGuest: body.isGuest,\n\t\t// Forward `customFields` only when present so the repo treats an\n\t\t// omitted key as \"leave existing values untouched\". An empty\n\t\t// object also no-ops by repo convention — see\n\t\t// `BylineRepository.update`. Validation (unknown slug, type\n\t\t// mismatch, select-choice) happens inside the repo and surfaces\n\t\t// as `EmDashValidationError`, which the handler maps to a 400\n\t\t// `VALIDATION_ERROR` for `unwrapResult` / `mapErrorStatus`.\n\t\tcustomFields: body.customFields,\n\t});\n\n\tif (result.success) invalidateBylineCache();\n\treturn unwrapResult(result);\n};\n\nexport const DELETE: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst denied = requirePerm(user, \"bylines:manage\");\n\tif (denied) return denied;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\ttry {\n\t\tconst repo = new BylineRepository(emdash.db);\n\t\tconst deleted = await repo.delete(params.id!);\n\t\tif (!deleted) return apiError(\"NOT_FOUND\", \"Byline not found\", 404);\n\t\tinvalidateBylineCache();\n\t\treturn apiSuccess({ deleted: true });\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to delete byline\", \"BYLINE_DELETE_ERROR\");\n\t}\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/bylines/[id]/index.ts"],"sourcesContent":["import type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleBylineUpdate } from \"#api/handlers/bylines.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { bylineUpdateBody } from \"#api/schemas.js\";\nimport { invalidateBylineCache } from \"#bylines/index.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst denied = requirePerm(user, \"bylines:read\");\n\tif (denied) return denied;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\ttry {\n\t\tconst repo = new BylineRepository(emdash.db);\n\t\tconst byline = await repo.findById(params.id!);\n\t\tif (!byline) return apiError(\"NOT_FOUND\", \"Byline not found\", 404);\n\t\treturn apiSuccess(byline);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to get byline\", \"BYLINE_GET_ERROR\");\n\t}\n};\n\nexport const PUT: APIRoute = async ({ params, request, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst denied = requirePerm(user, \"bylines:manage\");\n\tif (denied) return denied;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst body = await parseBody(request, bylineUpdateBody);\n\tif (isParseError(body)) return body;\n\n\tconst result = await handleBylineUpdate(emdash.db, params.id!, {\n\t\tslug: body.slug,\n\t\tdisplayName: body.displayName,\n\t\tbio: body.bio ?? null,\n\t\tavatarMediaId: body.avatarMediaId ?? null,\n\t\twebsiteUrl: body.websiteUrl ?? null,\n\t\tuserId: body.userId ?? null,\n\t\tisGuest: body.isGuest,\n\t\t// Forward `customFields` only when present so the repo treats an\n\t\t// omitted key as \"leave existing values untouched\". An empty\n\t\t// object also no-ops by repo convention — see\n\t\t// `BylineRepository.update`. Validation (unknown slug, type\n\t\t// mismatch, select-choice) happens inside the repo and surfaces\n\t\t// as `EmDashValidationError`, which the handler maps to a 400\n\t\t// `VALIDATION_ERROR` for `unwrapResult` / `mapErrorStatus`.\n\t\tcustomFields: body.customFields,\n\t});\n\n\tif (result.success) invalidateBylineCache();\n\treturn unwrapResult(result);\n};\n\nexport const DELETE: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst denied = requirePerm(user, \"bylines:manage\");\n\tif (denied) return denied;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\ttry {\n\t\tconst repo = new BylineRepository(emdash.db);\n\t\tconst deleted = await repo.delete(params.id!);\n\t\tif (!deleted) return apiError(\"NOT_FOUND\", \"Byline not found\", 404);\n\t\tinvalidateBylineCache();\n\t\treturn apiSuccess({ deleted: true });\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to delete byline\", \"BYLINE_DELETE_ERROR\");\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA,MAAa,YAAY;AAEzB,MAAa,MAAgB,OAAO,EAAE,QAAQ,aAAa;CAC1D,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,SAAS,YAAY,MAAM,eAAe;AAChD,KAAI,OAAQ,QAAO;AAEnB,KAAI,CAAC,QAAQ,GACZ,QAAO,SAAS,kBAAkB,6BAA6B,IAAI;AAGpE,KAAI;EAEH,MAAM,SAAS,MADF,IAAI,iBAAiB,OAAO,GAAG,CAClB,SAAS,OAAO,GAAI;AAC9C,MAAI,CAAC,OAAQ,QAAO,SAAS,aAAa,oBAAoB,IAAI;AAClE,SAAO,WAAW,OAAO;UACjB,OAAO;AACf,SAAO,YAAY,OAAO,wBAAwB,mBAAmB;;;AAIvE,MAAa,MAAgB,OAAO,EAAE,QAAQ,SAAS,aAAa;CACnE,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;CAEnB,MAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,KAAI,MAAO,QAAO;CAElB,MAAM,OAAO,MAAM,UAAU,SAAS,iBAAiB;AACvD,KAAI,aAAa,KAAK,CAAE,QAAO;CAE/B,MAAM,SAAS,MAAM,mBAAmB,OAAO,IAAI,OAAO,IAAK;EAC9D,MAAM,KAAK;EACX,aAAa,KAAK;EAClB,KAAK,KAAK,OAAO;EACjB,eAAe,KAAK,iBAAiB;EACrC,YAAY,KAAK,cAAc;EAC/B,QAAQ,KAAK,UAAU;EACvB,SAAS,KAAK;EAQd,cAAc,KAAK;EACnB,CAAC;AAEF,KAAI,OAAO,QAAS,wCAAuB;AAC3C,QAAO,aAAa,OAAO;;AAG5B,MAAa,SAAmB,OAAO,EAAE,QAAQ,aAAa;CAC7D,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI,CAAC,QAAQ,GACZ,QAAO,SAAS,kBAAkB,6BAA6B,IAAI;AAGpE,KAAI;AAGH,MAAI,CADY,MADH,IAAI,iBAAiB,OAAO,GAAG,CACjB,OAAO,OAAO,GAAI,CAC/B,QAAO,SAAS,aAAa,oBAAoB,IAAI;AACnE,yCAAuB;AACvB,SAAO,WAAW,EAAE,SAAS,MAAM,CAAC;UAC5B,OAAO;AACf,SAAO,YAAY,OAAO,2BAA2B,sBAAsB"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import "../../../../../../dialect-helpers-DRI5pyY3.mjs";
|
|
2
|
-
import "../../../../../../
|
|
3
|
-
import "../../../../../../
|
|
4
|
-
import "../../../../../../
|
|
5
|
-
import "../../../../../../
|
|
6
|
-
import "../../../../../../
|
|
7
|
-
import
|
|
8
|
-
import "../../../../../../
|
|
9
|
-
import "../../../../../../
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import "../../../../../../
|
|
14
|
-
import "../../../../../../
|
|
2
|
+
import "../../../../../../after-B1IIdH3Y.mjs";
|
|
3
|
+
import "../../../../../../object-cache-SEb2IM4Z.mjs";
|
|
4
|
+
import "../../../../../../base64-CmWvODNW.mjs";
|
|
5
|
+
import "../../../../../../types-DXOIbece.mjs";
|
|
6
|
+
import "../../../../../../request-cache-KCNHp_RJ.mjs";
|
|
7
|
+
import "../../../../../../byline-registry-BOjqDOim.mjs";
|
|
8
|
+
import { t as BylineRepository } from "../../../../../../byline-CC0WS4Gu.mjs";
|
|
9
|
+
import "../../../../../../loader-C8Z48Uof.mjs";
|
|
10
|
+
import "../../../../../../resolve-CpbBglV0.mjs";
|
|
11
|
+
import { a as unwrapResult, i as requireDb, r as handleError } from "../../../../../../error-BQ1pxs0L.mjs";
|
|
12
|
+
import { n as parseBody, t as isParseError } from "../../../../../../parse-qrHlnzTy.mjs";
|
|
13
|
+
import { Cn as bylineTranslationCreateBody } from "../../../../../../redirects-DUvXgzCX.mjs";
|
|
14
|
+
import "../../../../../../byline-fields-53i9Et0x.mjs";
|
|
15
|
+
import "../../../../../../status-CB2basWJ.mjs";
|
|
15
16
|
import "../../../../../../api/schemas/index.mjs";
|
|
16
|
-
import { a as invalidateBylineCache } from "../../../../../../bylines-
|
|
17
|
-
import { n as requirePerm } from "../../../../../../authorize-
|
|
18
|
-
import { n as
|
|
17
|
+
import { a as invalidateBylineCache } from "../../../../../../bylines-CCO1CYnH.mjs";
|
|
18
|
+
import { n as requirePerm } from "../../../../../../authorize-C0EYoUeV.mjs";
|
|
19
|
+
import { n as handleBylineCreate, r as handleBylineTranslations } from "../../../../../../bylines-DGekMGGm.mjs";
|
|
19
20
|
|
|
20
21
|
//#region src/astro/routes/api/admin/bylines/[id]/translations.ts
|
|
21
22
|
const prerender = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/bylines/[id]/translations.ts"],"sourcesContent":["/**\n * Byline translation endpoints\n *\n * GET /_emdash/api/admin/bylines/:id/translations — list every translation\n * of a byline (siblings\n * in the same\n * translation_group)\n * POST /_emdash/api/admin/bylines/:id/translations — create a new locale\n * variant joining the\n * source's\n * translation_group\n * (body: { locale, ... })\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleBylineCreate, handleBylineTranslations } from \"#api/handlers/bylines.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { bylineTranslationCreateBody } from \"#api/schemas.js\";\nimport { invalidateBylineCache } from \"#bylines/index.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst id = params.id!;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"bylines:read\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst result = await handleBylineTranslations(emdash.db, id);\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to fetch byline translations\", \"BYLINE_TRANSLATIONS_ERROR\");\n\t}\n};\n\nexport const POST: APIRoute = async ({ params, request, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst id = params.id!;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"bylines:manage\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst body = await parseBody(request, bylineTranslationCreateBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// Look up the source byline so we can:\n\t\t// (a) emit a clean 404 when it doesn't exist (route layer);\n\t\t// (b) fall back to its slug + display_name + avatar/website when\n\t\t// the body omits them. Editors creating a translation often\n\t\t// want to keep the slug stable and only enter the localized\n\t\t// bio/displayName — defaulting saves clicks.\n\t\tconst repo = new BylineRepository(emdash.db);\n\t\tconst source = await repo.findById(id);\n\t\tif (!source) {\n\t\t\treturn new Response(\n\t\t\t\tJSON.stringify({ error: { code: \"NOT_FOUND\", message: \"Byline not found\" } }),\n\t\t\t\t{ status: 404, headers: { \"Content-Type\": \"application/json\" } },\n\t\t\t);\n\t\t}\n\n\t\tconst result = await handleBylineCreate(emdash.db, {\n\t\t\tslug: body.slug ?? source.slug,\n\t\t\tdisplayName: body.displayName ?? source.displayName,\n\t\t\tbio: body.bio ?? null,\n\t\t\tavatarMediaId: body.avatarMediaId ?? source.avatarMediaId,\n\t\t\twebsiteUrl: body.websiteUrl ?? source.websiteUrl,\n\t\t\t// Translations don't inherit the source's user_id or guest flag —\n\t\t\t// the partial unique on (user_id, locale) means a single user can\n\t\t\t// own one byline per locale, but the editor must opt into linking\n\t\t\t// the new row by editing it after creation.\n\t\t\tuserId: null,\n\t\t\tisGuest: source.isGuest,\n\t\t\tlocale: body.locale,\n\t\t\ttranslationOf: id,\n\t\t});\n\n\t\tif (result.success) invalidateBylineCache();\n\t\treturn unwrapResult(result, 201);\n\t} catch (error) {\n\t\treturn handleError(\n\t\t\terror,\n\t\t\t\"Failed to create byline translation\",\n\t\t\t\"BYLINE_TRANSLATION_CREATE_ERROR\",\n\t\t);\n\t}\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/bylines/[id]/translations.ts"],"sourcesContent":["/**\n * Byline translation endpoints\n *\n * GET /_emdash/api/admin/bylines/:id/translations — list every translation\n * of a byline (siblings\n * in the same\n * translation_group)\n * POST /_emdash/api/admin/bylines/:id/translations — create a new locale\n * variant joining the\n * source's\n * translation_group\n * (body: { locale, ... })\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleBylineCreate, handleBylineTranslations } from \"#api/handlers/bylines.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { bylineTranslationCreateBody } from \"#api/schemas.js\";\nimport { invalidateBylineCache } from \"#bylines/index.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst id = params.id!;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"bylines:read\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst result = await handleBylineTranslations(emdash.db, id);\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to fetch byline translations\", \"BYLINE_TRANSLATIONS_ERROR\");\n\t}\n};\n\nexport const POST: APIRoute = async ({ params, request, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst id = params.id!;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"bylines:manage\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst body = await parseBody(request, bylineTranslationCreateBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// Look up the source byline so we can:\n\t\t// (a) emit a clean 404 when it doesn't exist (route layer);\n\t\t// (b) fall back to its slug + display_name + avatar/website when\n\t\t// the body omits them. Editors creating a translation often\n\t\t// want to keep the slug stable and only enter the localized\n\t\t// bio/displayName — defaulting saves clicks.\n\t\tconst repo = new BylineRepository(emdash.db);\n\t\tconst source = await repo.findById(id);\n\t\tif (!source) {\n\t\t\treturn new Response(\n\t\t\t\tJSON.stringify({ error: { code: \"NOT_FOUND\", message: \"Byline not found\" } }),\n\t\t\t\t{ status: 404, headers: { \"Content-Type\": \"application/json\" } },\n\t\t\t);\n\t\t}\n\n\t\tconst result = await handleBylineCreate(emdash.db, {\n\t\t\tslug: body.slug ?? source.slug,\n\t\t\tdisplayName: body.displayName ?? source.displayName,\n\t\t\tbio: body.bio ?? null,\n\t\t\tavatarMediaId: body.avatarMediaId ?? source.avatarMediaId,\n\t\t\twebsiteUrl: body.websiteUrl ?? source.websiteUrl,\n\t\t\t// Translations don't inherit the source's user_id or guest flag —\n\t\t\t// the partial unique on (user_id, locale) means a single user can\n\t\t\t// own one byline per locale, but the editor must opt into linking\n\t\t\t// the new row by editing it after creation.\n\t\t\tuserId: null,\n\t\t\tisGuest: source.isGuest,\n\t\t\tlocale: body.locale,\n\t\t\ttranslationOf: id,\n\t\t});\n\n\t\tif (result.success) invalidateBylineCache();\n\t\treturn unwrapResult(result, 201);\n\t} catch (error) {\n\t\treturn handleError(\n\t\t\terror,\n\t\t\t\"Failed to create byline translation\",\n\t\t\t\"BYLINE_TRANSLATION_CREATE_ERROR\",\n\t\t);\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,YAAY;AAEzB,MAAa,MAAgB,OAAO,EAAE,QAAQ,aAAa;CAC1D,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,KAAK,OAAO;CAElB,MAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,KAAI,MAAO,QAAO;CAElB,MAAM,SAAS,YAAY,MAAM,eAAe;AAChD,KAAI,OAAQ,QAAO;AAEnB,KAAI;AAEH,SAAO,aADQ,MAAM,yBAAyB,OAAO,IAAI,GAAG,CACjC;UACnB,OAAO;AACf,SAAO,YAAY,OAAO,uCAAuC,4BAA4B;;;AAI/F,MAAa,OAAiB,OAAO,EAAE,QAAQ,SAAS,aAAa;CACpE,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,KAAK,OAAO;CAElB,MAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,KAAI,MAAO,QAAO;CAElB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI;EACH,MAAM,OAAO,MAAM,UAAU,SAAS,4BAA4B;AAClE,MAAI,aAAa,KAAK,CAAE,QAAO;EAS/B,MAAM,SAAS,MADF,IAAI,iBAAiB,OAAO,GAAG,CAClB,SAAS,GAAG;AACtC,MAAI,CAAC,OACJ,QAAO,IAAI,SACV,KAAK,UAAU,EAAE,OAAO;GAAE,MAAM;GAAa,SAAS;GAAoB,EAAE,CAAC,EAC7E;GAAE,QAAQ;GAAK,SAAS,EAAE,gBAAgB,oBAAoB;GAAE,CAChE;EAGF,MAAM,SAAS,MAAM,mBAAmB,OAAO,IAAI;GAClD,MAAM,KAAK,QAAQ,OAAO;GAC1B,aAAa,KAAK,eAAe,OAAO;GACxC,KAAK,KAAK,OAAO;GACjB,eAAe,KAAK,iBAAiB,OAAO;GAC5C,YAAY,KAAK,cAAc,OAAO;GAKtC,QAAQ;GACR,SAAS,OAAO;GAChB,QAAQ,KAAK;GACb,eAAe;GACf,CAAC;AAEF,MAAI,OAAO,QAAS,wCAAuB;AAC3C,SAAO,aAAa,QAAQ,IAAI;UACxB,OAAO;AACf,SAAO,YACN,OACA,uCACA,kCACA"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import "../../../../../dialect-helpers-DRI5pyY3.mjs";
|
|
2
2
|
import { n as getI18nConfig } from "../../../../../config-CVssduLe.mjs";
|
|
3
|
-
import "../../../../../
|
|
4
|
-
import "../../../../../
|
|
5
|
-
import "../../../../../
|
|
6
|
-
import "../../../../../
|
|
7
|
-
import "../../../../../
|
|
8
|
-
import
|
|
9
|
-
import "../../../../../
|
|
10
|
-
import "../../../../../
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import "../../../../../
|
|
15
|
-
import "../../../../../
|
|
3
|
+
import "../../../../../after-B1IIdH3Y.mjs";
|
|
4
|
+
import "../../../../../object-cache-SEb2IM4Z.mjs";
|
|
5
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
6
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
7
|
+
import "../../../../../request-cache-KCNHp_RJ.mjs";
|
|
8
|
+
import "../../../../../byline-registry-BOjqDOim.mjs";
|
|
9
|
+
import { t as BylineRepository } from "../../../../../byline-CC0WS4Gu.mjs";
|
|
10
|
+
import "../../../../../loader-C8Z48Uof.mjs";
|
|
11
|
+
import "../../../../../resolve-CpbBglV0.mjs";
|
|
12
|
+
import { a as unwrapResult, n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
13
|
+
import { i as parseQuery, n as parseBody, t as isParseError } from "../../../../../parse-qrHlnzTy.mjs";
|
|
14
|
+
import { En as bylinesListQuery, yn as bylineCreateBody } from "../../../../../redirects-DUvXgzCX.mjs";
|
|
15
|
+
import "../../../../../byline-fields-53i9Et0x.mjs";
|
|
16
|
+
import "../../../../../status-CB2basWJ.mjs";
|
|
16
17
|
import "../../../../../api/schemas/index.mjs";
|
|
17
|
-
import { a as invalidateBylineCache } from "../../../../../bylines-
|
|
18
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
19
|
-
import {
|
|
18
|
+
import { a as invalidateBylineCache } from "../../../../../bylines-CCO1CYnH.mjs";
|
|
19
|
+
import { n as requirePerm } from "../../../../../authorize-C0EYoUeV.mjs";
|
|
20
|
+
import { n as handleBylineCreate } from "../../../../../bylines-DGekMGGm.mjs";
|
|
20
21
|
|
|
21
22
|
//#region src/astro/routes/api/admin/bylines/index.ts
|
|
22
23
|
const prerender = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/admin/bylines/index.ts"],"sourcesContent":["import type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError, unwrapResult } from \"#api/error.js\";\nimport { handleBylineCreate } from \"#api/handlers/bylines.js\";\nimport { isParseError, parseBody, parseQuery } from \"#api/parse.js\";\nimport { bylineCreateBody, bylinesListQuery } from \"#api/schemas.js\";\nimport { invalidateBylineCache } from \"#bylines/index.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\n\nimport { getI18nConfig } from \"../../../../../i18n/config.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ url, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\tconst denied = requirePerm(user, \"bylines:read\");\n\tif (denied) return denied;\n\n\tconst query = parseQuery(url, bylinesListQuery);\n\tif (isParseError(query)) return query;\n\n\tconst i18n = getI18nConfig();\n\tif (query.locale && i18n && !i18n.locales.includes(query.locale)) {\n\t\treturn apiError(\n\t\t\t\"VALIDATION_ERROR\",\n\t\t\t`Locale \"${query.locale}\" is not configured for this site`,\n\t\t\t400,\n\t\t);\n\t}\n\n\ttry {\n\t\tconst repo = new BylineRepository(emdash.db);\n\t\tconst result = await repo.findMany({\n\t\t\tsearch: query.search,\n\t\t\tisGuest: query.isGuest,\n\t\t\tuserId: query.userId,\n\t\t\tlocale: query.locale,\n\t\t\tcursor: query.cursor,\n\t\t\tlimit: query.limit,\n\t\t});\n\n\t\treturn apiSuccess(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to list bylines\", \"BYLINE_LIST_ERROR\");\n\t}\n};\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\tconst denied = requirePerm(user, \"bylines:manage\");\n\tif (denied) return denied;\n\n\tconst body = await parseBody(request, bylineCreateBody);\n\tif (isParseError(body)) return body;\n\n\ttry {\n\t\tconst result = await handleBylineCreate(emdash.db, {\n\t\t\tslug: body.slug,\n\t\t\tdisplayName: body.displayName,\n\t\t\tbio: body.bio ?? null,\n\t\t\tavatarMediaId: body.avatarMediaId ?? null,\n\t\t\twebsiteUrl: body.websiteUrl ?? null,\n\t\t\tuserId: body.userId ?? null,\n\t\t\tisGuest: body.isGuest,\n\t\t\tlocale: body.locale,\n\t\t\ttranslationOf: body.translationOf,\n\t\t\tcustomFields: body.customFields,\n\t\t});\n\n\t\tif (result.success) invalidateBylineCache();\n\t\treturn unwrapResult(result, 201);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to create byline\", \"BYLINE_CREATE_ERROR\");\n\t}\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/admin/bylines/index.ts"],"sourcesContent":["import type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError, unwrapResult } from \"#api/error.js\";\nimport { handleBylineCreate } from \"#api/handlers/bylines.js\";\nimport { isParseError, parseBody, parseQuery } from \"#api/parse.js\";\nimport { bylineCreateBody, bylinesListQuery } from \"#api/schemas.js\";\nimport { invalidateBylineCache } from \"#bylines/index.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\n\nimport { getI18nConfig } from \"../../../../../i18n/config.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ url, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\tconst denied = requirePerm(user, \"bylines:read\");\n\tif (denied) return denied;\n\n\tconst query = parseQuery(url, bylinesListQuery);\n\tif (isParseError(query)) return query;\n\n\tconst i18n = getI18nConfig();\n\tif (query.locale && i18n && !i18n.locales.includes(query.locale)) {\n\t\treturn apiError(\n\t\t\t\"VALIDATION_ERROR\",\n\t\t\t`Locale \"${query.locale}\" is not configured for this site`,\n\t\t\t400,\n\t\t);\n\t}\n\n\ttry {\n\t\tconst repo = new BylineRepository(emdash.db);\n\t\tconst result = await repo.findMany({\n\t\t\tsearch: query.search,\n\t\t\tisGuest: query.isGuest,\n\t\t\tuserId: query.userId,\n\t\t\tlocale: query.locale,\n\t\t\tcursor: query.cursor,\n\t\t\tlimit: query.limit,\n\t\t});\n\n\t\treturn apiSuccess(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to list bylines\", \"BYLINE_LIST_ERROR\");\n\t}\n};\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\tconst denied = requirePerm(user, \"bylines:manage\");\n\tif (denied) return denied;\n\n\tconst body = await parseBody(request, bylineCreateBody);\n\tif (isParseError(body)) return body;\n\n\ttry {\n\t\tconst result = await handleBylineCreate(emdash.db, {\n\t\t\tslug: body.slug,\n\t\t\tdisplayName: body.displayName,\n\t\t\tbio: body.bio ?? null,\n\t\t\tavatarMediaId: body.avatarMediaId ?? null,\n\t\t\twebsiteUrl: body.websiteUrl ?? null,\n\t\t\tuserId: body.userId ?? null,\n\t\t\tisGuest: body.isGuest,\n\t\t\tlocale: body.locale,\n\t\t\ttranslationOf: body.translationOf,\n\t\t\tcustomFields: body.customFields,\n\t\t});\n\n\t\tif (result.success) invalidateBylineCache();\n\t\treturn unwrapResult(result, 201);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to create byline\", \"BYLINE_CREATE_ERROR\");\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,YAAY;AAEzB,MAAa,MAAgB,OAAO,EAAE,KAAK,aAAa;CACvD,MAAM,EAAE,QAAQ,SAAS;AAEzB,KAAI,CAAC,QAAQ,GACZ,QAAO,SAAS,kBAAkB,6BAA6B,IAAI;CAGpE,MAAM,SAAS,YAAY,MAAM,eAAe;AAChD,KAAI,OAAQ,QAAO;CAEnB,MAAM,QAAQ,WAAW,KAAK,iBAAiB;AAC/C,KAAI,aAAa,MAAM,CAAE,QAAO;CAEhC,MAAM,OAAO,eAAe;AAC5B,KAAI,MAAM,UAAU,QAAQ,CAAC,KAAK,QAAQ,SAAS,MAAM,OAAO,CAC/D,QAAO,SACN,oBACA,WAAW,MAAM,OAAO,oCACxB,IACA;AAGF,KAAI;AAWH,SAAO,WATQ,MADF,IAAI,iBAAiB,OAAO,GAAG,CAClB,SAAS;GAClC,QAAQ,MAAM;GACd,SAAS,MAAM;GACf,QAAQ,MAAM;GACd,QAAQ,MAAM;GACd,QAAQ,MAAM;GACd,OAAO,MAAM;GACb,CAAC,CAEuB;UACjB,OAAO;AACf,SAAO,YAAY,OAAO,0BAA0B,oBAAoB;;;AAI1E,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;AAEzB,KAAI,CAAC,QAAQ,GACZ,QAAO,SAAS,kBAAkB,6BAA6B,IAAI;CAGpE,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;CAEnB,MAAM,OAAO,MAAM,UAAU,SAAS,iBAAiB;AACvD,KAAI,aAAa,KAAK,CAAE,QAAO;AAE/B,KAAI;EACH,MAAM,SAAS,MAAM,mBAAmB,OAAO,IAAI;GAClD,MAAM,KAAK;GACX,aAAa,KAAK;GAClB,KAAK,KAAK,OAAO;GACjB,eAAe,KAAK,iBAAiB;GACrC,YAAY,KAAK,cAAc;GAC/B,QAAQ,KAAK,UAAU;GACvB,SAAS,KAAK;GACd,QAAQ,KAAK;GACb,eAAe,KAAK;GACpB,cAAc,KAAK;GACnB,CAAC;AAEF,MAAI,OAAO,QAAS,wCAAuB;AAC3C,SAAO,aAAa,QAAQ,IAAI;UACxB,OAAO;AACf,SAAO,YAAY,OAAO,2BAA2B,sBAAsB"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import "../../../../../../
|
|
2
|
-
import "../../../../../../
|
|
3
|
-
import "../../../../../../
|
|
4
|
-
import "../../../../../../
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import "../../../../../../
|
|
9
|
-
import "../../../../../../
|
|
1
|
+
import "../../../../../../after-B1IIdH3Y.mjs";
|
|
2
|
+
import "../../../../../../object-cache-SEb2IM4Z.mjs";
|
|
3
|
+
import "../../../../../../base64-CmWvODNW.mjs";
|
|
4
|
+
import "../../../../../../types-DXOIbece.mjs";
|
|
5
|
+
import "../../../../../../comment-80UyJJUR.mjs";
|
|
6
|
+
import "../../../../../../options-DTTML-Tx.mjs";
|
|
7
|
+
import { a as unwrapResult, i as requireDb, n as apiSuccess, r as handleError, t as apiError } from "../../../../../../error-BQ1pxs0L.mjs";
|
|
8
|
+
import { n as parseBody, t as isParseError } from "../../../../../../parse-qrHlnzTy.mjs";
|
|
9
|
+
import { vt as commentStatusBody } from "../../../../../../redirects-DUvXgzCX.mjs";
|
|
10
|
+
import "../../../../../../byline-fields-53i9Et0x.mjs";
|
|
11
|
+
import "../../../../../../status-CB2basWJ.mjs";
|
|
10
12
|
import "../../../../../../api/schemas/index.mjs";
|
|
11
|
-
import { n as requirePerm } from "../../../../../../authorize-
|
|
12
|
-
import { a as handleCommentGet } from "../../../../../../comments-
|
|
13
|
-
import { t as getSiteBaseUrl } from "../../../../../../site-url-
|
|
14
|
-
import { i as sendCommentNotification, n as moderateComment, r as lookupContentAuthor } from "../../../../../../service-
|
|
13
|
+
import { n as requirePerm } from "../../../../../../authorize-C0EYoUeV.mjs";
|
|
14
|
+
import { a as handleCommentGet } from "../../../../../../comments-CtPkT2tp.mjs";
|
|
15
|
+
import { t as getSiteBaseUrl } from "../../../../../../site-url-BOTPgmeM.mjs";
|
|
16
|
+
import { i as sendCommentNotification, n as moderateComment, r as lookupContentAuthor } from "../../../../../../service-DTmtqCnw.mjs";
|
|
15
17
|
|
|
16
18
|
//#region src/astro/routes/api/admin/comments/[id]/status.ts
|
|
17
19
|
const prerender = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/comments/[id]/status.ts"],"sourcesContent":["/**\n * Comment status change\n *\n * PUT /_emdash/api/admin/comments/:id/status - Change comment status\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleCommentGet } from \"#api/handlers/comments.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { commentStatusBody } from \"#api/schemas.js\";\nimport { getSiteBaseUrl } from \"#api/site-url.js\";\nimport { lookupContentAuthor, sendCommentNotification } from \"#comments/notifications.js\";\nimport { moderateComment, type CommentHookRunner } from \"#comments/service.js\";\nimport type { CommentStatus } from \"#db/repositories/comment.js\";\nimport type { ModerationDecision } from \"#plugins/types.js\";\n\nexport const prerender = false;\n\nexport const PUT: APIRoute = async ({ params, request, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst { id } = params;\n\n\tif (!id) {\n\t\treturn apiError(\"VALIDATION_ERROR\", \"Comment ID required\", 400);\n\t}\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"comments:moderate\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst body = await parseBody(request, commentStatusBody);\n\t\tif (isParseError(body)) return body;\n\n\t\tconst newStatus = body.status as CommentStatus;\n\n\t\t// Build hook runner for the service\n\t\tconst hookRunner: CommentHookRunner = {\n\t\t\tasync runBeforeCreate(event) {\n\t\t\t\treturn emdash.hooks.runCommentBeforeCreate(event);\n\t\t\t},\n\t\t\tasync runModerate(event) {\n\t\t\t\tconst result = await emdash.hooks.invokeExclusiveHook(\"comment:moderate\", event);\n\t\t\t\tif (!result) return { status: \"pending\" as const, reason: \"No moderator configured\" };\n\t\t\t\tif (result.error) return { status: \"pending\" as const, reason: \"Moderation error\" };\n\t\t\t\treturn result.result as ModerationDecision;\n\t\t\t},\n\t\t\tfireAfterCreate(event) {\n\t\t\t\temdash.hooks\n\t\t\t\t\t.runCommentAfterCreate(event)\n\t\t\t\t\t.catch((err) =>\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\"[comments] afterCreate error:\",\n\t\t\t\t\t\t\terr instanceof Error ? err.message : err,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t},\n\t\t\tfireAfterModerate(event) {\n\t\t\t\temdash.hooks\n\t\t\t\t\t.runCommentAfterModerate(event)\n\t\t\t\t\t.catch((err) =>\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\"[comments] afterModerate error:\",\n\t\t\t\t\t\t\terr instanceof Error ? err.message : err,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t},\n\t\t};\n\n\t\t// Read the comment before updating so we know the previous status\n\t\tconst existing = await handleCommentGet(emdash.db, id);\n\t\tif (!existing.success) {\n\t\t\treturn unwrapResult(existing);\n\t\t}\n\t\tconst previousStatus = existing.data.status;\n\n\t\tconst updated = await moderateComment(\n\t\t\temdash.db,\n\t\t\tid,\n\t\t\tnewStatus,\n\t\t\t{ id: user!.id, name: user!.name ?? null },\n\t\t\thookRunner,\n\t\t);\n\n\t\tif (!updated) {\n\t\t\treturn apiError(\"NOT_FOUND\", \"Comment not found\", 404);\n\t\t}\n\n\t\t// Send notification when a comment is newly approved\n\t\tif (newStatus === \"approved\" && previousStatus !== \"approved\" && emdash.email) {\n\t\t\ttry {\n\t\t\t\tconst adminBaseUrl = await getSiteBaseUrl(emdash.db, request);\n\t\t\t\tconst content = await lookupContentAuthor(emdash.db, updated.collection, updated.contentId);\n\t\t\t\tif (content?.author) {\n\t\t\t\t\tawait sendCommentNotification({\n\t\t\t\t\t\temail: emdash.email,\n\t\t\t\t\t\tcomment: updated,\n\t\t\t\t\t\tcontentAuthor: content.author,\n\t\t\t\t\t\tadminBaseUrl,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(\"[comments] notification error:\", err instanceof Error ? err.message : err);\n\t\t\t}\n\t\t}\n\n\t\treturn apiSuccess(updated);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to update comment status\", \"COMMENT_STATUS_ERROR\");\n\t}\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/comments/[id]/status.ts"],"sourcesContent":["/**\n * Comment status change\n *\n * PUT /_emdash/api/admin/comments/:id/status - Change comment status\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleCommentGet } from \"#api/handlers/comments.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { commentStatusBody } from \"#api/schemas.js\";\nimport { getSiteBaseUrl } from \"#api/site-url.js\";\nimport { lookupContentAuthor, sendCommentNotification } from \"#comments/notifications.js\";\nimport { moderateComment, type CommentHookRunner } from \"#comments/service.js\";\nimport type { CommentStatus } from \"#db/repositories/comment.js\";\nimport type { ModerationDecision } from \"#plugins/types.js\";\n\nexport const prerender = false;\n\nexport const PUT: APIRoute = async ({ params, request, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst { id } = params;\n\n\tif (!id) {\n\t\treturn apiError(\"VALIDATION_ERROR\", \"Comment ID required\", 400);\n\t}\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"comments:moderate\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst body = await parseBody(request, commentStatusBody);\n\t\tif (isParseError(body)) return body;\n\n\t\tconst newStatus = body.status as CommentStatus;\n\n\t\t// Build hook runner for the service\n\t\tconst hookRunner: CommentHookRunner = {\n\t\t\tasync runBeforeCreate(event) {\n\t\t\t\treturn emdash.hooks.runCommentBeforeCreate(event);\n\t\t\t},\n\t\t\tasync runModerate(event) {\n\t\t\t\tconst result = await emdash.hooks.invokeExclusiveHook(\"comment:moderate\", event);\n\t\t\t\tif (!result) return { status: \"pending\" as const, reason: \"No moderator configured\" };\n\t\t\t\tif (result.error) return { status: \"pending\" as const, reason: \"Moderation error\" };\n\t\t\t\treturn result.result as ModerationDecision;\n\t\t\t},\n\t\t\tfireAfterCreate(event) {\n\t\t\t\temdash.hooks\n\t\t\t\t\t.runCommentAfterCreate(event)\n\t\t\t\t\t.catch((err) =>\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\"[comments] afterCreate error:\",\n\t\t\t\t\t\t\terr instanceof Error ? err.message : err,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t},\n\t\t\tfireAfterModerate(event) {\n\t\t\t\temdash.hooks\n\t\t\t\t\t.runCommentAfterModerate(event)\n\t\t\t\t\t.catch((err) =>\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\"[comments] afterModerate error:\",\n\t\t\t\t\t\t\terr instanceof Error ? err.message : err,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t},\n\t\t};\n\n\t\t// Read the comment before updating so we know the previous status\n\t\tconst existing = await handleCommentGet(emdash.db, id);\n\t\tif (!existing.success) {\n\t\t\treturn unwrapResult(existing);\n\t\t}\n\t\tconst previousStatus = existing.data.status;\n\n\t\tconst updated = await moderateComment(\n\t\t\temdash.db,\n\t\t\tid,\n\t\t\tnewStatus,\n\t\t\t{ id: user!.id, name: user!.name ?? null },\n\t\t\thookRunner,\n\t\t);\n\n\t\tif (!updated) {\n\t\t\treturn apiError(\"NOT_FOUND\", \"Comment not found\", 404);\n\t\t}\n\n\t\t// Send notification when a comment is newly approved\n\t\tif (newStatus === \"approved\" && previousStatus !== \"approved\" && emdash.email) {\n\t\t\ttry {\n\t\t\t\tconst adminBaseUrl = await getSiteBaseUrl(emdash.db, request);\n\t\t\t\tconst content = await lookupContentAuthor(emdash.db, updated.collection, updated.contentId);\n\t\t\t\tif (content?.author) {\n\t\t\t\t\tawait sendCommentNotification({\n\t\t\t\t\t\temail: emdash.email,\n\t\t\t\t\t\tcomment: updated,\n\t\t\t\t\t\tcontentAuthor: content.author,\n\t\t\t\t\t\tadminBaseUrl,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(\"[comments] notification error:\", err instanceof Error ? err.message : err);\n\t\t\t}\n\t\t}\n\n\t\treturn apiSuccess(updated);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to update comment status\", \"COMMENT_STATUS_ERROR\");\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAa,YAAY;AAEzB,MAAa,MAAgB,OAAO,EAAE,QAAQ,SAAS,aAAa;CACnE,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,EAAE,OAAO;AAEf,KAAI,CAAC,GACJ,QAAO,SAAS,oBAAoB,uBAAuB,IAAI;CAGhE,MAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,KAAI,MAAO,QAAO;CAElB,MAAM,SAAS,YAAY,MAAM,oBAAoB;AACrD,KAAI,OAAQ,QAAO;AAEnB,KAAI;EACH,MAAM,OAAO,MAAM,UAAU,SAAS,kBAAkB;AACxD,MAAI,aAAa,KAAK,CAAE,QAAO;EAE/B,MAAM,YAAY,KAAK;EAGvB,MAAM,aAAgC;GACrC,MAAM,gBAAgB,OAAO;AAC5B,WAAO,OAAO,MAAM,uBAAuB,MAAM;;GAElD,MAAM,YAAY,OAAO;IACxB,MAAM,SAAS,MAAM,OAAO,MAAM,oBAAoB,oBAAoB,MAAM;AAChF,QAAI,CAAC,OAAQ,QAAO;KAAE,QAAQ;KAAoB,QAAQ;KAA2B;AACrF,QAAI,OAAO,MAAO,QAAO;KAAE,QAAQ;KAAoB,QAAQ;KAAoB;AACnF,WAAO,OAAO;;GAEf,gBAAgB,OAAO;AACtB,WAAO,MACL,sBAAsB,MAAM,CAC5B,OAAO,QACP,QAAQ,MACP,iCACA,eAAe,QAAQ,IAAI,UAAU,IACrC,CACD;;GAEH,kBAAkB,OAAO;AACxB,WAAO,MACL,wBAAwB,MAAM,CAC9B,OAAO,QACP,QAAQ,MACP,mCACA,eAAe,QAAQ,IAAI,UAAU,IACrC,CACD;;GAEH;EAGD,MAAM,WAAW,MAAM,iBAAiB,OAAO,IAAI,GAAG;AACtD,MAAI,CAAC,SAAS,QACb,QAAO,aAAa,SAAS;EAE9B,MAAM,iBAAiB,SAAS,KAAK;EAErC,MAAM,UAAU,MAAM,gBACrB,OAAO,IACP,IACA,WACA;GAAE,IAAI,KAAM;GAAI,MAAM,KAAM,QAAQ;GAAM,EAC1C,WACA;AAED,MAAI,CAAC,QACJ,QAAO,SAAS,aAAa,qBAAqB,IAAI;AAIvD,MAAI,cAAc,cAAc,mBAAmB,cAAc,OAAO,MACvE,KAAI;GACH,MAAM,eAAe,MAAM,eAAe,OAAO,IAAI,QAAQ;GAC7D,MAAM,UAAU,MAAM,oBAAoB,OAAO,IAAI,QAAQ,YAAY,QAAQ,UAAU;AAC3F,OAAI,SAAS,OACZ,OAAM,wBAAwB;IAC7B,OAAO,OAAO;IACd,SAAS;IACT,eAAe,QAAQ;IACvB;IACA,CAAC;WAEK,KAAK;AACb,WAAQ,MAAM,kCAAkC,eAAe,QAAQ,IAAI,UAAU,IAAI;;AAI3F,SAAO,WAAW,QAAQ;UAClB,OAAO;AACf,SAAO,YAAY,OAAO,mCAAmC,uBAAuB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import "../../../../../
|
|
2
|
-
import "../../../../../
|
|
3
|
-
import "../../../../../
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { a as
|
|
1
|
+
import "../../../../../after-B1IIdH3Y.mjs";
|
|
2
|
+
import "../../../../../object-cache-SEb2IM4Z.mjs";
|
|
3
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
4
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
5
|
+
import "../../../../../comment-80UyJJUR.mjs";
|
|
6
|
+
import { a as unwrapResult, i as requireDb, r as handleError, t as apiError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
7
|
+
import { n as requirePerm } from "../../../../../authorize-C0EYoUeV.mjs";
|
|
8
|
+
import { a as handleCommentGet, i as handleCommentDelete } from "../../../../../comments-CtPkT2tp.mjs";
|
|
7
9
|
|
|
8
10
|
//#region src/astro/routes/api/admin/comments/[id].ts
|
|
9
11
|
const prerender = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_id_.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/admin/comments/[id].ts"],"sourcesContent":["/**\n * Single comment admin endpoints\n *\n * GET /_emdash/api/admin/comments/:id - Get comment detail\n * DELETE /_emdash/api/admin/comments/:id - Hard delete (ADMIN only)\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleCommentGet, handleCommentDelete } from \"#api/handlers/comments.js\";\n\nexport const prerender = false;\n\n/**\n * Get single comment detail (includes moderation_metadata)\n */\nexport const GET: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst { id } = params;\n\n\tif (!id) {\n\t\treturn apiError(\"VALIDATION_ERROR\", \"Comment ID required\", 400);\n\t}\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"comments:moderate\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst result = await handleCommentGet(emdash.db, id);\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to get comment\", \"COMMENT_GET_ERROR\");\n\t}\n};\n\n/**\n * Hard delete a comment (ADMIN only)\n */\nexport const DELETE: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst { id } = params;\n\n\tif (!id) {\n\t\treturn apiError(\"VALIDATION_ERROR\", \"Comment ID required\", 400);\n\t}\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"comments:delete\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst result = await handleCommentDelete(emdash.db, id);\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to delete comment\", \"COMMENT_DELETE_ERROR\");\n\t}\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"_id_.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/admin/comments/[id].ts"],"sourcesContent":["/**\n * Single comment admin endpoints\n *\n * GET /_emdash/api/admin/comments/:id - Get comment detail\n * DELETE /_emdash/api/admin/comments/:id - Hard delete (ADMIN only)\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleCommentGet, handleCommentDelete } from \"#api/handlers/comments.js\";\n\nexport const prerender = false;\n\n/**\n * Get single comment detail (includes moderation_metadata)\n */\nexport const GET: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst { id } = params;\n\n\tif (!id) {\n\t\treturn apiError(\"VALIDATION_ERROR\", \"Comment ID required\", 400);\n\t}\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"comments:moderate\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst result = await handleCommentGet(emdash.db, id);\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to get comment\", \"COMMENT_GET_ERROR\");\n\t}\n};\n\n/**\n * Hard delete a comment (ADMIN only)\n */\nexport const DELETE: APIRoute = async ({ params, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst { id } = params;\n\n\tif (!id) {\n\t\treturn apiError(\"VALIDATION_ERROR\", \"Comment ID required\", 400);\n\t}\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"comments:delete\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst result = await handleCommentDelete(emdash.db, id);\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to delete comment\", \"COMMENT_DELETE_ERROR\");\n\t}\n};\n"],"mappings":";;;;;;;;;;AAaA,MAAa,YAAY;;;;AAKzB,MAAa,MAAgB,OAAO,EAAE,QAAQ,aAAa;CAC1D,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,EAAE,OAAO;AAEf,KAAI,CAAC,GACJ,QAAO,SAAS,oBAAoB,uBAAuB,IAAI;CAGhE,MAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,KAAI,MAAO,QAAO;CAElB,MAAM,SAAS,YAAY,MAAM,oBAAoB;AACrD,KAAI,OAAQ,QAAO;AAEnB,KAAI;AAEH,SAAO,aADQ,MAAM,iBAAiB,OAAO,IAAI,GAAG,CACzB;UACnB,OAAO;AACf,SAAO,YAAY,OAAO,yBAAyB,oBAAoB;;;;;;AAOzE,MAAa,SAAmB,OAAO,EAAE,QAAQ,aAAa;CAC7D,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,EAAE,OAAO;AAEf,KAAI,CAAC,GACJ,QAAO,SAAS,oBAAoB,uBAAuB,IAAI;CAGhE,MAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,KAAI,MAAO,QAAO;CAElB,MAAM,SAAS,YAAY,MAAM,kBAAkB;AACnD,KAAI,OAAQ,QAAO;AAEnB,KAAI;AAEH,SAAO,aADQ,MAAM,oBAAoB,OAAO,IAAI,GAAG,CAC5B;UACnB,OAAO;AACf,SAAO,YAAY,OAAO,4BAA4B,uBAAuB"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import "../../../../../
|
|
2
|
-
import "../../../../../
|
|
3
|
-
import "../../../../../
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import "../../../../../
|
|
8
|
-
import "../../../../../
|
|
1
|
+
import "../../../../../after-B1IIdH3Y.mjs";
|
|
2
|
+
import "../../../../../object-cache-SEb2IM4Z.mjs";
|
|
3
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
4
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
5
|
+
import "../../../../../comment-80UyJJUR.mjs";
|
|
6
|
+
import { a as unwrapResult, i as requireDb, r as handleError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
7
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-qrHlnzTy.mjs";
|
|
8
|
+
import { pt as commentBulkBody } from "../../../../../redirects-DUvXgzCX.mjs";
|
|
9
|
+
import "../../../../../byline-fields-53i9Et0x.mjs";
|
|
10
|
+
import "../../../../../status-CB2basWJ.mjs";
|
|
9
11
|
import "../../../../../api/schemas/index.mjs";
|
|
10
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
11
|
-
import { n as handleCommentBulk } from "../../../../../comments-
|
|
12
|
+
import { n as requirePerm } from "../../../../../authorize-C0EYoUeV.mjs";
|
|
13
|
+
import { n as handleCommentBulk } from "../../../../../comments-CtPkT2tp.mjs";
|
|
12
14
|
|
|
13
15
|
//#region src/astro/routes/api/admin/comments/bulk.ts
|
|
14
16
|
const prerender = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/admin/comments/bulk.ts"],"sourcesContent":["/**\n * Bulk comment operations\n *\n * POST /_emdash/api/admin/comments/bulk - Bulk status change or delete\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleCommentBulk } from \"#api/handlers/comments.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { commentBulkBody } from \"#api/schemas.js\";\n\nexport const prerender = false;\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\ttry {\n\t\tconst body = await parseBody(request, commentBulkBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// Bulk delete requires ADMIN, bulk status change requires EDITOR\n\t\tif (body.action === \"delete\") {\n\t\t\tconst denied = requirePerm(user, \"comments:delete\");\n\t\t\tif (denied) return denied;\n\t\t} else {\n\t\t\tconst denied = requirePerm(user, \"comments:moderate\");\n\t\t\tif (denied) return denied;\n\t\t}\n\n\t\tconst result = await handleCommentBulk(emdash.db, body.ids, body.action);\n\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to perform bulk operation\", \"COMMENT_BULK_ERROR\");\n\t}\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bulk.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/admin/comments/bulk.ts"],"sourcesContent":["/**\n * Bulk comment operations\n *\n * POST /_emdash/api/admin/comments/bulk - Bulk status change or delete\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleCommentBulk } from \"#api/handlers/comments.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { commentBulkBody } from \"#api/schemas.js\";\n\nexport const prerender = false;\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\ttry {\n\t\tconst body = await parseBody(request, commentBulkBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// Bulk delete requires ADMIN, bulk status change requires EDITOR\n\t\tif (body.action === \"delete\") {\n\t\t\tconst denied = requirePerm(user, \"comments:delete\");\n\t\t\tif (denied) return denied;\n\t\t} else {\n\t\t\tconst denied = requirePerm(user, \"comments:moderate\");\n\t\t\tif (denied) return denied;\n\t\t}\n\n\t\tconst result = await handleCommentBulk(emdash.db, body.ids, body.action);\n\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to perform bulk operation\", \"COMMENT_BULK_ERROR\");\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,YAAY;AAEzB,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,KAAI,MAAO,QAAO;AAElB,KAAI;EACH,MAAM,OAAO,MAAM,UAAU,SAAS,gBAAgB;AACtD,MAAI,aAAa,KAAK,CAAE,QAAO;AAG/B,MAAI,KAAK,WAAW,UAAU;GAC7B,MAAM,SAAS,YAAY,MAAM,kBAAkB;AACnD,OAAI,OAAQ,QAAO;SACb;GACN,MAAM,SAAS,YAAY,MAAM,oBAAoB;AACrD,OAAI,OAAQ,QAAO;;AAKpB,SAAO,aAFQ,MAAM,kBAAkB,OAAO,IAAI,KAAK,KAAK,KAAK,OAAO,CAE7C;UACnB,OAAO;AACf,SAAO,YAAY,OAAO,oCAAoC,qBAAqB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import "../../../../../
|
|
2
|
-
import "../../../../../
|
|
3
|
-
import "../../../../../
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { r as
|
|
1
|
+
import "../../../../../after-B1IIdH3Y.mjs";
|
|
2
|
+
import "../../../../../object-cache-SEb2IM4Z.mjs";
|
|
3
|
+
import "../../../../../base64-CmWvODNW.mjs";
|
|
4
|
+
import "../../../../../types-DXOIbece.mjs";
|
|
5
|
+
import "../../../../../comment-80UyJJUR.mjs";
|
|
6
|
+
import { a as unwrapResult, i as requireDb, r as handleError } from "../../../../../error-BQ1pxs0L.mjs";
|
|
7
|
+
import { n as requirePerm } from "../../../../../authorize-C0EYoUeV.mjs";
|
|
8
|
+
import { r as handleCommentCounts } from "../../../../../comments-CtPkT2tp.mjs";
|
|
7
9
|
|
|
8
10
|
//#region src/astro/routes/api/admin/comments/counts.ts
|
|
9
11
|
const prerender = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counts.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/admin/comments/counts.ts"],"sourcesContent":["/**\n * Comment status counts for inbox badges\n *\n * GET /_emdash/api/admin/comments/counts\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleCommentCounts } from \"#api/handlers/comments.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"comments:moderate\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst result = await handleCommentCounts(emdash.db);\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to get comment counts\", \"COMMENT_COUNTS_ERROR\");\n\t}\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"counts.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/admin/comments/counts.ts"],"sourcesContent":["/**\n * Comment status counts for inbox badges\n *\n * GET /_emdash/api/admin/comments/counts\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { handleError, requireDb, unwrapResult } from \"#api/error.js\";\nimport { handleCommentCounts } from \"#api/handlers/comments.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst dbErr = requireDb(emdash?.db);\n\tif (dbErr) return dbErr;\n\n\tconst denied = requirePerm(user, \"comments:moderate\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst result = await handleCommentCounts(emdash.db);\n\t\treturn unwrapResult(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to get comment counts\", \"COMMENT_COUNTS_ERROR\");\n\t}\n};\n"],"mappings":";;;;;;;;;;AAYA,MAAa,YAAY;AAEzB,MAAa,MAAgB,OAAO,EAAE,aAAa;CAClD,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,KAAI,MAAO,QAAO;CAElB,MAAM,SAAS,YAAY,MAAM,oBAAoB;AACrD,KAAI,OAAQ,QAAO;AAEnB,KAAI;AAEH,SAAO,aADQ,MAAM,oBAAoB,OAAO,GAAG,CACxB;UACnB,OAAO;AACf,SAAO,YAAY,OAAO,gCAAgC,uBAAuB"}
|