emdash 0.24.1 → 0.26.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/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +12 -11
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +2 -2
- package/dist/{api-d_0wi9fW.mjs → api-BMfveMoB.mjs} +24 -20
- package/dist/api-BMfveMoB.mjs.map +1 -0
- package/dist/{apply-BE9UaWX0.mjs → apply--IVNSdXn.mjs} +19 -16
- package/dist/apply--IVNSdXn.mjs.map +1 -0
- package/dist/astro/index.d.mts +9 -9
- package/dist/astro/index.mjs +3 -2
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +8 -8
- package/dist/astro/middleware/auth.mjs +2 -2
- package/dist/astro/middleware/redirect.mjs +4 -4
- package/dist/astro/middleware.d.mts +1 -1
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +99 -70
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -5
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +2 -2
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +3 -3
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +3 -3
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +6 -6
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +12 -12
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +12 -12
- package/dist/astro/routes/api/admin/bylines/index.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/index.mjs +9 -9
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/index.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +32 -32
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +31 -31
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +32 -32
- package/dist/astro/routes/api/admin/plugins/updates.mjs +31 -31
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +31 -31
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -3
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +31 -31
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +5 -5
- package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/index.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/register-options.mjs +5 -5
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +6 -6
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +6 -6
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +6 -6
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +5 -5
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +5 -5
- package/dist/astro/routes/api/auth/passkey/verify.mjs +5 -5
- package/dist/astro/routes/api/auth/signup/complete.mjs +5 -5
- package/dist/astro/routes/api/auth/signup/request.mjs +6 -6
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +9 -9
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/index.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -6
- package/dist/astro/routes/api/dashboard.mjs +8 -8
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/import/probe.d.mts +2 -2
- package/dist/astro/routes/api/import/probe.mjs +6 -6
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +8 -8
- package/dist/astro/routes/api/import/wordpress/execute.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/media.d.mts +13 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +13 -9
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +8 -8
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +8 -8
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +6 -6
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +9 -9
- package/dist/astro/routes/api/manifest.mjs +3 -3
- package/dist/astro/routes/api/mcp.mjs +36 -36
- package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +44 -8
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +6 -6
- package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
- package/dist/astro/routes/api/media/providers/index.mjs +3 -3
- package/dist/astro/routes/api/media/upload-url.mjs +8 -8
- package/dist/astro/routes/api/media.mjs +22 -21
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/items.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/translations.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_.mjs +8 -8
- package/dist/astro/routes/api/menus/index.mjs +8 -8
- package/dist/astro/routes/api/oauth/device/authorize.mjs +3 -3
- package/dist/astro/routes/api/oauth/device/code.mjs +4 -4
- package/dist/astro/routes/api/oauth/device/token.mjs +4 -4
- package/dist/astro/routes/api/oauth/register.mjs +2 -2
- package/dist/astro/routes/api/oauth/token/refresh.mjs +3 -3
- package/dist/astro/routes/api/oauth/token/revoke.mjs +3 -3
- package/dist/astro/routes/api/oauth/token.mjs +2 -2
- package/dist/astro/routes/api/openapi.json.mjs +3 -3
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
- package/dist/astro/routes/api/redirects/404s/index.mjs +8 -8
- package/dist/astro/routes/api/redirects/404s/summary.mjs +8 -8
- package/dist/astro/routes/api/redirects/_id_.mjs +9 -9
- package/dist/astro/routes/api/redirects/index.mjs +9 -9
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +31 -31
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +31 -31
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +31 -31
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +31 -31
- package/dist/astro/routes/api/schema/collections/index.mjs +31 -31
- package/dist/astro/routes/api/schema/index.mjs +6 -6
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +31 -31
- package/dist/astro/routes/api/schema/orphans/index.mjs +31 -31
- package/dist/astro/routes/api/search/enable.mjs +9 -9
- package/dist/astro/routes/api/search/index.mjs +8 -8
- package/dist/astro/routes/api/search/rebuild.mjs +9 -9
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +8 -8
- package/dist/astro/routes/api/sections/_slug_.mjs +8 -8
- package/dist/astro/routes/api/sections/index.mjs +8 -8
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +11 -11
- package/dist/astro/routes/api/setup/admin-verify.mjs +5 -5
- package/dist/astro/routes/api/setup/admin.mjs +5 -5
- package/dist/astro/routes/api/setup/dev-bypass.mjs +17 -17
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +20 -20
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +3 -3
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +11 -11
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +11 -11
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +11 -11
- package/dist/astro/routes/api/taxonomies/index.mjs +11 -11
- package/dist/astro/routes/api/themes/preview.mjs +3 -3
- package/dist/astro/routes/api/typegen.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +6 -6
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +8 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +8 -8
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +8 -8
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +5 -5
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +11 -10
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +6 -6
- package/dist/astro/types.d.mts +10 -10
- package/dist/{authorize-B__u-iZJ.mjs → authorize-BZnOGJFo.mjs} +2 -2
- package/dist/{authorize-B__u-iZJ.mjs.map → authorize-BZnOGJFo.mjs.map} +1 -1
- package/dist/{byline-C-YajfV7.mjs → byline-LL8lyqdb.mjs} +6 -6
- package/dist/{byline-C-YajfV7.mjs.map → byline-LL8lyqdb.mjs.map} +1 -1
- package/dist/{byline-fields-Ca56gaT6.d.mts → byline-fields-KD3JFRuH.d.mts} +24 -6
- package/dist/byline-fields-KD3JFRuH.d.mts.map +1 -0
- package/dist/{byline-fields-B-KXkg5R.mjs → byline-fields-eyJMblSr.mjs} +2 -2
- package/dist/{byline-fields-B-KXkg5R.mjs.map → byline-fields-eyJMblSr.mjs.map} +1 -1
- package/dist/{bylines-D4KADDAi.mjs → bylines-BmJ7Vg7J.mjs} +4 -4
- package/dist/{bylines-D4KADDAi.mjs.map → bylines-BmJ7Vg7J.mjs.map} +1 -1
- package/dist/{bylines-BMtJnPnG.mjs → bylines-DE47vP8d.mjs} +6 -6
- package/dist/{bylines-BMtJnPnG.mjs.map → bylines-DE47vP8d.mjs.map} +1 -1
- package/dist/{cache-BUJe2w6Z.mjs → cache-D9jF5bYw.mjs} +2 -2
- package/dist/{cache-BUJe2w6Z.mjs.map → cache-D9jF5bYw.mjs.map} +1 -1
- package/dist/{chunks-BHgcHh2C.mjs → chunks-OCG163rN.mjs} +2 -2
- package/dist/{chunks-BHgcHh2C.mjs.map → chunks-OCG163rN.mjs.map} +1 -1
- package/dist/cli/index.mjs +17 -17
- package/dist/{comment-BDx50EX5.mjs → comment-D9BLDpZI.mjs} +3 -3
- package/dist/{comment-BDx50EX5.mjs.map → comment-D9BLDpZI.mjs.map} +1 -1
- package/dist/{comment-reaction-Gv_pgfI3.mjs → comment-reaction-Drl9SkNu.mjs} +2 -2
- package/dist/{comment-reaction-Gv_pgfI3.mjs.map → comment-reaction-Drl9SkNu.mjs.map} +1 -1
- package/dist/{comments-CXHuQ6jI.mjs → comments-BjJ9SKGU.mjs} +3 -3
- package/dist/{comments-CXHuQ6jI.mjs.map → comments-BjJ9SKGU.mjs.map} +1 -1
- package/dist/{content-PoVGKjp0.mjs → content-ncUWWjna.mjs} +10 -8
- package/dist/content-ncUWWjna.mjs.map +1 -0
- package/dist/{context-Dvws41_A.mjs → context-C_g-iJVA.mjs} +14 -8
- package/dist/context-C_g-iJVA.mjs.map +1 -0
- package/dist/{dashboard-DsYU8JKS.mjs → dashboard-CotyqQrW.mjs} +4 -4
- package/dist/{dashboard-DsYU8JKS.mjs.map → dashboard-CotyqQrW.mjs.map} +1 -1
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +1 -1
- package/dist/{db-errors-UXB1CK42.mjs → db-errors-CK46D-ly.mjs} +1 -1
- package/dist/{db-errors-UXB1CK42.mjs.map → db-errors-CK46D-ly.mjs.map} +1 -1
- package/dist/{placeholder-B0s2mWu5.mjs → enrich-BQ0mxJRs.mjs} +61 -10
- package/dist/enrich-BQ0mxJRs.mjs.map +1 -0
- package/dist/{error-lq_fL-RS.mjs → error-rVGiqWDt.mjs} +3 -2
- package/dist/error-rVGiqWDt.mjs.map +1 -0
- package/dist/{field-defs-cache-CYYx8xlG.mjs → field-defs-cache-ljXzJCfc.mjs} +2 -2
- package/dist/{field-defs-cache-CYYx8xlG.mjs.map → field-defs-cache-ljXzJCfc.mjs.map} +1 -1
- package/dist/{fts-manager-DW_NR-Fs.mjs → fts-manager-BbCCbEKA.mjs} +2 -2
- package/dist/{fts-manager-DW_NR-Fs.mjs.map → fts-manager-BbCCbEKA.mjs.map} +1 -1
- package/dist/{index-BroXT-vD.d.mts → index-BRNabKrx.d.mts} +53 -15
- package/dist/index-BRNabKrx.d.mts.map +1 -0
- package/dist/{index-qbL02uhs.d.mts → index-Dt0OKJB4.d.mts} +2 -2
- package/dist/{index-qbL02uhs.d.mts.map → index-Dt0OKJB4.d.mts.map} +1 -1
- package/dist/index.d.mts +12 -12
- package/dist/index.mjs +43 -43
- package/dist/{load-DMFi4n1p.mjs → load-DMjXghbZ.mjs} +2 -2
- package/dist/{load-DMFi4n1p.mjs.map → load-DMjXghbZ.mjs.map} +1 -1
- package/dist/{loader-BR2SgfEc.mjs → loader-BA_zhkS_.mjs} +82 -19
- package/dist/loader-BA_zhkS_.mjs.map +1 -0
- package/dist/{manifest-schema-BWKnQYQF.mjs → manifest-schema-kPGX7VS-.mjs} +4 -1
- package/dist/manifest-schema-kPGX7VS-.mjs.map +1 -0
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +45 -2
- package/dist/media/index.d.mts.map +1 -1
- package/dist/media/index.mjs +5 -3
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +9 -9
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +17 -5
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-CTjJoJTh.mjs → media-C5t_eCnk.mjs} +4 -2
- package/dist/media-C5t_eCnk.mjs.map +1 -0
- package/dist/{media-allowlist-B77I5_bw.mjs → media-allowlist-Du8t1u6a.mjs} +2 -2
- package/dist/{media-allowlist-B77I5_bw.mjs.map → media-allowlist-Du8t1u6a.mjs.map} +1 -1
- package/dist/{menus-8O6xNcYW.mjs → menus-CBb6UrMU.mjs} +3 -3
- package/dist/{menus-8O6xNcYW.mjs.map → menus-CBb6UrMU.mjs.map} +1 -1
- package/dist/{menus-GvRSpgIA.mjs → menus-CYH09a41.mjs} +65 -41
- package/dist/menus-CYH09a41.mjs.map +1 -0
- package/dist/{mime-BTzvzJ8M.mjs → mime-CCEzze7W.mjs} +1 -1
- package/dist/{mime-BTzvzJ8M.mjs.map → mime-CCEzze7W.mjs.map} +1 -1
- package/dist/{normalize-ClbNIenm.mjs → normalize-CeglrBT9.mjs} +11 -2
- package/dist/normalize-CeglrBT9.mjs.map +1 -0
- package/dist/{object-cache-SEb2IM4Z.mjs → object-cache-CHbHv83-.mjs} +8 -4
- package/dist/object-cache-CHbHv83-.mjs.map +1 -0
- package/dist/{options-CqECG0gM.d.mts → options-41nCWqi9.d.mts} +3 -3
- package/dist/{options-CqECG0gM.d.mts.map → options-41nCWqi9.d.mts.map} +1 -1
- package/dist/page/index.d.mts +5 -2
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +3 -2
- package/dist/page/index.mjs.map +1 -1
- package/dist/{parse-DHI873qU.mjs → parse-BwAdS7FZ.mjs} +2 -2
- package/dist/{parse-DHI873qU.mjs.map → parse-BwAdS7FZ.mjs.map} +1 -1
- package/dist/{placeholder-QoI4gEzP.d.mts → placeholder-Cuce9U-m.d.mts} +20 -5
- package/dist/placeholder-Cuce9U-m.d.mts.map +1 -0
- package/dist/plugin-types.d.mts +5 -2
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-utils.d.mts +8 -8
- package/dist/plugins/adapt-sandbox-entry.d.mts +8 -8
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{query-DZdlS6Cu.mjs → query-BpQb-blG.mjs} +15 -15
- package/dist/{query-DZdlS6Cu.mjs.map → query-BpQb-blG.mjs.map} +1 -1
- package/dist/{rate-limit-D1Y6VFVP.mjs → rate-limit-Dap6HMNM.mjs} +2 -2
- package/dist/{rate-limit-D1Y6VFVP.mjs.map → rate-limit-Dap6HMNM.mjs.map} +1 -1
- package/dist/{redirect-C1KVGYWe.mjs → redirect-_M0trWoo.mjs} +2 -2
- package/dist/{redirect-C1KVGYWe.mjs.map → redirect-_M0trWoo.mjs.map} +1 -1
- package/dist/{redirects-x9eFPeyi.mjs → redirects-Dcbuisoj.mjs} +2 -1
- package/dist/redirects-Dcbuisoj.mjs.map +1 -0
- package/dist/{redirects-DgnypVir.mjs → redirects-w0V9vj_j.mjs} +3 -3
- package/dist/{redirects-DgnypVir.mjs.map → redirects-w0V9vj_j.mjs.map} +1 -1
- package/dist/{registry-CJkCubOJ.mjs → registry-g8yYt4cC.mjs} +14 -4
- package/dist/registry-g8yYt4cC.mjs.map +1 -0
- package/dist/{runner-CEtq-6Sm.d.mts → runner-BbR3DfrL.d.mts} +2 -2
- package/dist/{runner-CEtq-6Sm.d.mts.map → runner-BbR3DfrL.d.mts.map} +1 -1
- package/dist/{runner-BsquExlK.mjs → runner-DPdt_Wpa.mjs} +250 -178
- package/dist/runner-DPdt_Wpa.mjs.map +1 -0
- package/dist/runtime.d.mts +9 -9
- package/dist/runtime.mjs +2 -2
- package/dist/{schema-DMjXuvNU.mjs → schema-DoLd3j2e.mjs} +5 -5
- package/dist/{schema-DMjXuvNU.mjs.map → schema-DoLd3j2e.mjs.map} +1 -1
- package/dist/{search-D1wKk3lc.mjs → search-BR0ZeZmh.mjs} +4 -4
- package/dist/{search-D1wKk3lc.mjs.map → search-BR0ZeZmh.mjs.map} +1 -1
- package/dist/{sections-CCMic8dB.mjs → sections-5J2YJPqJ.mjs} +3 -3
- package/dist/{sections-CCMic8dB.mjs.map → sections-5J2YJPqJ.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +15 -15
- package/dist/seo/index.d.mts +1 -1
- package/dist/{seo-DCEF-AVr.mjs → seo-BkhuuaaE.mjs} +25 -3
- package/dist/seo-BkhuuaaE.mjs.map +1 -0
- package/dist/{seo-3QrZ1EPT.mjs → seo-DKeXHkzE.mjs} +3 -3
- package/dist/{seo-3QrZ1EPT.mjs.map → seo-DKeXHkzE.mjs.map} +1 -1
- package/dist/{service-CQHK_10l.mjs → service-BbO2s8gT.mjs} +2 -2
- package/dist/{service-CQHK_10l.mjs.map → service-BbO2s8gT.mjs.map} +1 -1
- package/dist/{settings-C3Yi5Co3.mjs → settings-BMNr9Dmi.mjs} +3 -3
- package/dist/{settings-C3Yi5Co3.mjs.map → settings-BMNr9Dmi.mjs.map} +1 -1
- package/dist/{settings-D9rvaLuY.mjs → settings-DJeki-97.mjs} +4 -4
- package/dist/{settings-D9rvaLuY.mjs.map → settings-DJeki-97.mjs.map} +1 -1
- package/dist/{taxonomies-DhLaNJji.mjs → taxonomies-CM_fUqLU.mjs} +5 -4
- package/dist/taxonomies-CM_fUqLU.mjs.map +1 -0
- package/dist/{taxonomies-CurpLtNC.mjs → taxonomies-D13i2ctt.mjs} +76 -21
- package/dist/taxonomies-D13i2ctt.mjs.map +1 -0
- package/dist/{taxonomy-BBUlGug5.mjs → taxonomy-BU0LjdVb.mjs} +4 -4
- package/dist/{taxonomy-BBUlGug5.mjs.map → taxonomy-BU0LjdVb.mjs.map} +1 -1
- package/dist/{types-TTx8uP7V.d.mts → types-BYnDBVwe.d.mts} +27 -5
- package/dist/{types-TTx8uP7V.d.mts.map → types-BYnDBVwe.d.mts.map} +1 -1
- package/dist/{types-CTLJYMhN.d.mts → types-CNlaBFzx.d.mts} +11 -1
- package/dist/{types-CTLJYMhN.d.mts.map → types-CNlaBFzx.d.mts.map} +1 -1
- package/dist/{types-CmI1OyQg.mjs → types-CZgK3EMW.mjs} +2 -2
- package/dist/{types-CmI1OyQg.mjs.map → types-CZgK3EMW.mjs.map} +1 -1
- package/dist/{types-BWh2MjmA.d.mts → types-ETmO_jQr.d.mts} +2 -2
- package/dist/{types-BWh2MjmA.d.mts.map → types-ETmO_jQr.d.mts.map} +1 -1
- package/dist/types-tM44hEcf.mjs.map +1 -1
- package/dist/{types-B-gIxFCE.d.mts → types-xIfVRNLp.d.mts} +38 -1
- package/dist/types-xIfVRNLp.d.mts.map +1 -0
- package/dist/{user-JAuc8VUf.mjs → user-DkG2jKCp.mjs} +3 -3
- package/dist/{user-JAuc8VUf.mjs.map → user-DkG2jKCp.mjs.map} +1 -1
- package/dist/{validate-DOFrIb-c.d.mts → validate-CG0V0wNR.d.mts} +3 -3
- package/dist/{validate-DOFrIb-c.d.mts.map → validate-CG0V0wNR.d.mts.map} +1 -1
- package/dist/{validate-BzXHWnkV.mjs → validate-CuJ1Ps9j.mjs} +2 -2
- package/dist/{validate-BzXHWnkV.mjs.map → validate-CuJ1Ps9j.mjs.map} +1 -1
- package/dist/{validation-CY1gk4Ar.mjs → validation-CwUfTdGF.mjs} +6 -6
- package/dist/{validation-CY1gk4Ar.mjs.map → validation-CwUfTdGF.mjs.map} +1 -1
- package/dist/version-BoNBItP_.mjs +7 -0
- package/dist/{version-C0JPFUG8.mjs.map → version-BoNBItP_.mjs.map} +1 -1
- package/dist/{widgets-Dri0spI4.mjs → widgets-BfOZ-ajY.mjs} +2 -2
- package/dist/{widgets-Dri0spI4.mjs.map → widgets-BfOZ-ajY.mjs.map} +1 -1
- package/dist/{zod-generator-xEHODMJf.mjs → zod-generator-gFsRuNNy.mjs} +6 -3
- package/dist/zod-generator-gFsRuNNy.mjs.map +1 -0
- package/package.json +6 -6
- package/src/api/errors.ts +1 -0
- package/src/api/handlers/content.ts +4 -4
- package/src/api/handlers/seo.ts +30 -2
- package/src/api/handlers/taxonomies.ts +5 -1
- package/src/api/schemas/schema.ts +1 -0
- package/src/astro/integration/virtual-modules.ts +15 -0
- package/src/astro/middleware.ts +14 -1
- package/src/astro/routes/api/import/wordpress/media.ts +9 -3
- package/src/astro/routes/api/media/[id]/confirm.ts +62 -2
- package/src/astro/routes/api/media.ts +17 -19
- package/src/astro/routes/sitemap-[collection].xml.ts +5 -4
- package/src/components/EmDashHead.astro +23 -3
- package/src/components/EmDashImage.astro +4 -7
- package/src/components/Image.astro +14 -4
- package/src/components/InlinePortableTextEditor.tsx +48 -1
- package/src/components/JsonLdScript.astro +9 -0
- package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +16 -0
- package/src/database/migrations/046_media_usage_index.ts +115 -0
- package/src/database/migrations/047_restore_taxonomy_parent_index.ts +29 -0
- package/src/database/migrations/runner.ts +4 -0
- package/src/database/repositories/content.ts +8 -5
- package/src/database/repositories/media-usage.ts +444 -0
- package/src/database/repositories/media.ts +9 -1
- package/src/database/types.ts +39 -0
- package/src/emdash-runtime.ts +72 -25
- package/src/index.ts +3 -0
- package/src/loader.ts +110 -31
- package/src/media/enrich.ts +78 -0
- package/src/media/index.ts +1 -0
- package/src/media/local-runtime.ts +19 -0
- package/src/media/normalize.ts +20 -1
- package/src/media/placeholder.ts +29 -9
- package/src/media/types.ts +14 -0
- package/src/media/usage/extractor.ts +302 -0
- package/src/media/usage/types.ts +46 -0
- package/src/object-cache/index.ts +8 -2
- package/src/page/metadata.ts +23 -3
- package/src/plugin-types.ts +12 -0
- package/src/plugins/context.ts +8 -0
- package/src/plugins/define-plugin.ts +14 -5
- package/src/plugins/hooks.ts +66 -33
- package/src/plugins/index.ts +6 -0
- package/src/plugins/manager.ts +33 -0
- package/src/plugins/manifest-schema.ts +3 -0
- package/src/plugins/types.ts +41 -2
- package/src/schema/registry.ts +25 -0
- package/src/schema/types.ts +10 -0
- package/src/schema/zod-generator.ts +9 -1
- package/src/seed/apply.ts +7 -0
- package/src/taxonomies/index.ts +121 -18
- package/dist/api-d_0wi9fW.mjs.map +0 -1
- package/dist/apply-BE9UaWX0.mjs.map +0 -1
- package/dist/byline-fields-Ca56gaT6.d.mts.map +0 -1
- package/dist/content-PoVGKjp0.mjs.map +0 -1
- package/dist/context-Dvws41_A.mjs.map +0 -1
- package/dist/error-lq_fL-RS.mjs.map +0 -1
- package/dist/index-BroXT-vD.d.mts.map +0 -1
- package/dist/loader-BR2SgfEc.mjs.map +0 -1
- package/dist/manifest-schema-BWKnQYQF.mjs.map +0 -1
- package/dist/media-CTjJoJTh.mjs.map +0 -1
- package/dist/menus-GvRSpgIA.mjs.map +0 -1
- package/dist/normalize-ClbNIenm.mjs.map +0 -1
- package/dist/object-cache-SEb2IM4Z.mjs.map +0 -1
- package/dist/placeholder-B0s2mWu5.mjs.map +0 -1
- package/dist/placeholder-QoI4gEzP.d.mts.map +0 -1
- package/dist/redirects-x9eFPeyi.mjs.map +0 -1
- package/dist/registry-CJkCubOJ.mjs.map +0 -1
- package/dist/runner-BsquExlK.mjs.map +0 -1
- package/dist/seo-DCEF-AVr.mjs.map +0 -1
- package/dist/taxonomies-CurpLtNC.mjs.map +0 -1
- package/dist/taxonomies-DhLaNJji.mjs.map +0 -1
- package/dist/types-B-gIxFCE.d.mts.map +0 -1
- package/dist/version-C0JPFUG8.mjs +0 -7
- package/dist/zod-generator-xEHODMJf.mjs.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../../../types-
|
|
2
|
+
import "../../../../../types-CZgK3EMW.mjs";
|
|
3
3
|
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-BRKb343l.mjs";
|
|
4
|
-
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-
|
|
5
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
6
|
-
import "../../../../../redirects-
|
|
7
|
-
import { m as wpPluginAnalyzeBody } from "../../../../../byline-fields-
|
|
4
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-rVGiqWDt.mjs";
|
|
5
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-BwAdS7FZ.mjs";
|
|
6
|
+
import "../../../../../redirects-Dcbuisoj.mjs";
|
|
7
|
+
import { m as wpPluginAnalyzeBody } from "../../../../../byline-fields-eyJMblSr.mjs";
|
|
8
8
|
import "../../../../../status-vUK0SA17.mjs";
|
|
9
9
|
import "../../../../../api/schemas/index.mjs";
|
|
10
10
|
import { s as getSource } from "../../../../../import-Bb1T9WJS.mjs";
|
|
11
11
|
import "../../../../../ssrf-CcX9zvMK.mjs";
|
|
12
12
|
import "../../../../../utils-B7A57fm9.mjs";
|
|
13
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
13
|
+
import { n as requirePerm } from "../../../../../authorize-BZnOGJFo.mjs";
|
|
14
14
|
import { SchemaRegistry } from "emdash";
|
|
15
15
|
|
|
16
16
|
//#region src/astro/routes/api/import/wordpress-plugin/analyze.ts
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import "../../../../../dialect-helpers-DRI5pyY3.mjs";
|
|
2
2
|
import "../../../../../after-B1IIdH3Y.mjs";
|
|
3
|
-
import "../../../../../object-cache-
|
|
3
|
+
import "../../../../../object-cache-CHbHv83-.mjs";
|
|
4
4
|
import { n as slugify } from "../../../../../slugify-Cce3dTdg.mjs";
|
|
5
5
|
import "../../../../../base64-CmWvODNW.mjs";
|
|
6
|
-
import "../../../../../types-
|
|
6
|
+
import "../../../../../types-CZgK3EMW.mjs";
|
|
7
7
|
import "../../../../../request-cache-KCNHp_RJ.mjs";
|
|
8
8
|
import "../../../../../byline-registry-BOjqDOim.mjs";
|
|
9
|
-
import "../../../../../field-defs-cache-
|
|
10
|
-
import { t as BylineRepository } from "../../../../../byline-
|
|
9
|
+
import "../../../../../field-defs-cache-ljXzJCfc.mjs";
|
|
10
|
+
import { t as BylineRepository } from "../../../../../byline-LL8lyqdb.mjs";
|
|
11
11
|
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-BRKb343l.mjs";
|
|
12
|
-
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-
|
|
13
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
14
|
-
import "../../../../../redirects-
|
|
15
|
-
import { h as wpPluginExecuteBody } from "../../../../../byline-fields-
|
|
12
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-rVGiqWDt.mjs";
|
|
13
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-BwAdS7FZ.mjs";
|
|
14
|
+
import "../../../../../redirects-Dcbuisoj.mjs";
|
|
15
|
+
import { h as wpPluginExecuteBody } from "../../../../../byline-fields-eyJMblSr.mjs";
|
|
16
16
|
import "../../../../../status-vUK0SA17.mjs";
|
|
17
17
|
import "../../../../../api/schemas/index.mjs";
|
|
18
18
|
import { s as getSource } from "../../../../../import-Bb1T9WJS.mjs";
|
|
19
19
|
import "../../../../../ssrf-CcX9zvMK.mjs";
|
|
20
20
|
import { m as resolveImportByline } from "../../../../../utils-B7A57fm9.mjs";
|
|
21
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
21
|
+
import { n as requirePerm } from "../../../../../authorize-BZnOGJFo.mjs";
|
|
22
22
|
import { ContentRepository, SchemaRegistry } from "emdash";
|
|
23
23
|
|
|
24
24
|
//#region src/astro/routes/api/import/wordpress-plugin/execute.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../types-
|
|
3
|
-
import { r as handleError } from "../../../error-
|
|
4
|
-
import { n as VERSION, t as COMMIT } from "../../../version-
|
|
2
|
+
import "../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { r as handleError } from "../../../error-rVGiqWDt.mjs";
|
|
4
|
+
import { n as VERSION, t as COMMIT } from "../../../version-BoNBItP_.mjs";
|
|
5
5
|
import { t as getAuthMode } from "../../../mode-BB0F8xTC.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/astro/routes/api/manifest.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../types-
|
|
3
|
-
import { t as apiError } from "../../../error-
|
|
4
|
-
import { Dn as contentBylineInputSchema, Tn as bylineUpdateBody, un as contentSeoInput, yn as bylineCreateBody } from "../../../redirects-
|
|
5
|
-
import "../../../byline-fields-
|
|
2
|
+
import "../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { t as apiError } from "../../../error-rVGiqWDt.mjs";
|
|
4
|
+
import { Dn as contentBylineInputSchema, Tn as bylineUpdateBody, un as contentSeoInput, yn as bylineCreateBody } from "../../../redirects-Dcbuisoj.mjs";
|
|
5
|
+
import "../../../byline-fields-eyJMblSr.mjs";
|
|
6
6
|
import "../../../status-vUK0SA17.mjs";
|
|
7
7
|
import "../../../api/schemas/index.mjs";
|
|
8
8
|
import { i as hasScope } from "../../../api-tokens-B4BQybOp.mjs";
|
|
@@ -157,7 +157,7 @@ function getEmDash(extra) {
|
|
|
157
157
|
}
|
|
158
158
|
async function getCollectionFields(ec, collection) {
|
|
159
159
|
try {
|
|
160
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
160
|
+
const { SchemaRegistry } = await import("../../../schema-DoLd3j2e.mjs").then((n) => n.t);
|
|
161
161
|
const col = await new SchemaRegistry(ec.db).getCollectionWithFields(collection);
|
|
162
162
|
return col ? col.fields : null;
|
|
163
163
|
} catch {
|
|
@@ -186,7 +186,7 @@ async function applyReadMarkdown(ec, collection, items) {
|
|
|
186
186
|
for (const item of items) if (item.data && typeof item.data === "object") item.data = convertDataForRead(item.data, fields, false);
|
|
187
187
|
}
|
|
188
188
|
async function invalidateBylines() {
|
|
189
|
-
const { invalidateBylineCache } = await import("../../../bylines-
|
|
189
|
+
const { invalidateBylineCache } = await import("../../../bylines-DE47vP8d.mjs").then((n) => n.t);
|
|
190
190
|
invalidateBylineCache();
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
@@ -701,7 +701,7 @@ function createMcpServer() {
|
|
|
701
701
|
requireScope(extra, "content:read");
|
|
702
702
|
const ec = getEmDash(extra);
|
|
703
703
|
try {
|
|
704
|
-
const { BylineRepository } = await import("../../../byline-
|
|
704
|
+
const { BylineRepository } = await import("../../../byline-LL8lyqdb.mjs").then((n) => n.n);
|
|
705
705
|
return jsonResult(await new BylineRepository(ec.db).findMany({
|
|
706
706
|
search: args.search,
|
|
707
707
|
isGuest: args.isGuest,
|
|
@@ -723,7 +723,7 @@ function createMcpServer() {
|
|
|
723
723
|
requireScope(extra, "content:read");
|
|
724
724
|
const ec = getEmDash(extra);
|
|
725
725
|
try {
|
|
726
|
-
const { BylineRepository } = await import("../../../byline-
|
|
726
|
+
const { BylineRepository } = await import("../../../byline-LL8lyqdb.mjs").then((n) => n.n);
|
|
727
727
|
const byline = await new BylineRepository(ec.db).findById(args.id);
|
|
728
728
|
if (!byline) return respondError("NOT_FOUND", `Byline '${args.id}' not found`);
|
|
729
729
|
return jsonResult(byline);
|
|
@@ -741,7 +741,7 @@ function createMcpServer() {
|
|
|
741
741
|
requireRole(extra, Role.EDITOR);
|
|
742
742
|
const ec = getEmDash(extra);
|
|
743
743
|
try {
|
|
744
|
-
const { handleBylineCreate } = await import("../../../bylines-
|
|
744
|
+
const { handleBylineCreate } = await import("../../../bylines-BmJ7Vg7J.mjs").then((n) => n.t);
|
|
745
745
|
const result = await handleBylineCreate(ec.db, args);
|
|
746
746
|
if (result.success) await invalidateBylines();
|
|
747
747
|
return unwrap(result);
|
|
@@ -761,7 +761,7 @@ function createMcpServer() {
|
|
|
761
761
|
requireRole(extra, Role.EDITOR);
|
|
762
762
|
const ec = getEmDash(extra);
|
|
763
763
|
try {
|
|
764
|
-
const { handleBylineUpdate } = await import("../../../bylines-
|
|
764
|
+
const { handleBylineUpdate } = await import("../../../bylines-BmJ7Vg7J.mjs").then((n) => n.t);
|
|
765
765
|
const { id, ...input } = args;
|
|
766
766
|
const result = await handleBylineUpdate(ec.db, id, input);
|
|
767
767
|
if (result.success) await invalidateBylines();
|
|
@@ -780,7 +780,7 @@ function createMcpServer() {
|
|
|
780
780
|
requireRole(extra, Role.EDITOR);
|
|
781
781
|
const ec = getEmDash(extra);
|
|
782
782
|
try {
|
|
783
|
-
const { BylineRepository } = await import("../../../byline-
|
|
783
|
+
const { BylineRepository } = await import("../../../byline-LL8lyqdb.mjs").then((n) => n.n);
|
|
784
784
|
if (!await new BylineRepository(ec.db).delete(args.id)) return respondError("NOT_FOUND", `Byline '${args.id}' not found`);
|
|
785
785
|
await invalidateBylines();
|
|
786
786
|
return jsonResult({ deleted: args.id });
|
|
@@ -797,7 +797,7 @@ function createMcpServer() {
|
|
|
797
797
|
requireScope(extra, "content:read");
|
|
798
798
|
const ec = getEmDash(extra);
|
|
799
799
|
try {
|
|
800
|
-
const { handleBylineTranslations } = await import("../../../bylines-
|
|
800
|
+
const { handleBylineTranslations } = await import("../../../bylines-BmJ7Vg7J.mjs").then((n) => n.t);
|
|
801
801
|
return unwrap(await handleBylineTranslations(ec.db, args.id));
|
|
802
802
|
} catch (error) {
|
|
803
803
|
return respondHandlerError(error, "BYLINE_TRANSLATIONS_ERROR");
|
|
@@ -813,7 +813,7 @@ function createMcpServer() {
|
|
|
813
813
|
requireRole(extra, Role.EDITOR);
|
|
814
814
|
const ec = getEmDash(extra);
|
|
815
815
|
try {
|
|
816
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
816
|
+
const { SchemaRegistry } = await import("../../../schema-DoLd3j2e.mjs").then((n) => n.t);
|
|
817
817
|
return jsonResult({ items: await new SchemaRegistry(ec.db).listCollections() });
|
|
818
818
|
} catch (error) {
|
|
819
819
|
return respondHandlerError(error, "SCHEMA_LIST_ERROR");
|
|
@@ -829,7 +829,7 @@ function createMcpServer() {
|
|
|
829
829
|
requireRole(extra, Role.EDITOR);
|
|
830
830
|
const ec = getEmDash(extra);
|
|
831
831
|
try {
|
|
832
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
832
|
+
const { SchemaRegistry } = await import("../../../schema-DoLd3j2e.mjs").then((n) => n.t);
|
|
833
833
|
const collection = await new SchemaRegistry(ec.db).getCollectionWithFields(args.slug);
|
|
834
834
|
if (!collection) return respondError("NOT_FOUND", `Collection '${args.slug}' not found`);
|
|
835
835
|
return jsonResult(collection);
|
|
@@ -859,7 +859,7 @@ function createMcpServer() {
|
|
|
859
859
|
requireRole(extra, Role.ADMIN);
|
|
860
860
|
const ec = getEmDash(extra);
|
|
861
861
|
try {
|
|
862
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
862
|
+
const { SchemaRegistry } = await import("../../../schema-DoLd3j2e.mjs").then((n) => n.t);
|
|
863
863
|
const collection = await new SchemaRegistry(ec.db).createCollection({
|
|
864
864
|
slug: args.slug,
|
|
865
865
|
label: args.label,
|
|
@@ -887,7 +887,7 @@ function createMcpServer() {
|
|
|
887
887
|
requireRole(extra, Role.ADMIN);
|
|
888
888
|
const ec = getEmDash(extra);
|
|
889
889
|
try {
|
|
890
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
890
|
+
const { SchemaRegistry } = await import("../../../schema-DoLd3j2e.mjs").then((n) => n.t);
|
|
891
891
|
await new SchemaRegistry(ec.db).deleteCollection(args.slug, { force: args.force });
|
|
892
892
|
ec.invalidateUrlPatternCache();
|
|
893
893
|
return jsonResult({ deleted: args.slug });
|
|
@@ -941,7 +941,7 @@ function createMcpServer() {
|
|
|
941
941
|
requireRole(extra, Role.ADMIN);
|
|
942
942
|
const ec = getEmDash(extra);
|
|
943
943
|
try {
|
|
944
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
944
|
+
const { SchemaRegistry } = await import("../../../schema-DoLd3j2e.mjs").then((n) => n.t);
|
|
945
945
|
return jsonResult(await new SchemaRegistry(ec.db).createField(args.collection, {
|
|
946
946
|
slug: args.slug,
|
|
947
947
|
label: args.label,
|
|
@@ -971,7 +971,7 @@ function createMcpServer() {
|
|
|
971
971
|
requireRole(extra, Role.ADMIN);
|
|
972
972
|
const ec = getEmDash(extra);
|
|
973
973
|
try {
|
|
974
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
974
|
+
const { SchemaRegistry } = await import("../../../schema-DoLd3j2e.mjs").then((n) => n.t);
|
|
975
975
|
await new SchemaRegistry(ec.db).deleteField(args.collection, args.fieldSlug);
|
|
976
976
|
return jsonResult({
|
|
977
977
|
deleted: args.fieldSlug,
|
|
@@ -1092,7 +1092,7 @@ function createMcpServer() {
|
|
|
1092
1092
|
requireScope(extra, "content:read");
|
|
1093
1093
|
const ec = getEmDash(extra);
|
|
1094
1094
|
try {
|
|
1095
|
-
const { searchWithDb } = await import("../../../search-
|
|
1095
|
+
const { searchWithDb } = await import("../../../search-BR0ZeZmh.mjs").then((n) => n.t);
|
|
1096
1096
|
return jsonResult(await searchWithDb(ec.db, args.query, {
|
|
1097
1097
|
collections: args.collections,
|
|
1098
1098
|
locale: args.locale,
|
|
@@ -1111,7 +1111,7 @@ function createMcpServer() {
|
|
|
1111
1111
|
requireScope(extra, "content:read");
|
|
1112
1112
|
const ec = getEmDash(extra);
|
|
1113
1113
|
try {
|
|
1114
|
-
const { handleTaxonomyList } = await import("../../../taxonomies-
|
|
1114
|
+
const { handleTaxonomyList } = await import("../../../taxonomies-CM_fUqLU.mjs").then((n) => n.l);
|
|
1115
1115
|
return unwrap(await handleTaxonomyList(ec.db, { locale: args.locale }));
|
|
1116
1116
|
} catch (error) {
|
|
1117
1117
|
return respondHandlerError(error, "TAXONOMY_LIST_ERROR");
|
|
@@ -1131,12 +1131,12 @@ function createMcpServer() {
|
|
|
1131
1131
|
requireScope(extra, "content:read");
|
|
1132
1132
|
const ec = getEmDash(extra);
|
|
1133
1133
|
try {
|
|
1134
|
-
const { handleTaxonomyList } = await import("../../../taxonomies-
|
|
1134
|
+
const { handleTaxonomyList } = await import("../../../taxonomies-CM_fUqLU.mjs").then((n) => n.l);
|
|
1135
1135
|
const listResult = await handleTaxonomyList(ec.db, { locale: args.locale });
|
|
1136
1136
|
if (!listResult.success) return unwrap(listResult);
|
|
1137
1137
|
if (!listResult.data.taxonomies.find((t) => t.name === args.taxonomy)) return respondError("NOT_FOUND", `Taxonomy '${args.taxonomy}' not found`);
|
|
1138
|
-
const { TaxonomyRepository } = await import("../../../taxonomy-
|
|
1139
|
-
const { decodeCursor, encodeCursor, InvalidCursorError } = await import("../../../types-
|
|
1138
|
+
const { TaxonomyRepository } = await import("../../../taxonomy-BU0LjdVb.mjs").then((n) => n.n);
|
|
1139
|
+
const { decodeCursor, encodeCursor, InvalidCursorError } = await import("../../../types-CZgK3EMW.mjs").then((n) => n.o);
|
|
1140
1140
|
const repo = new TaxonomyRepository(ec.db);
|
|
1141
1141
|
const limit = Math.min(args.limit ?? 50, 100);
|
|
1142
1142
|
const terms = await repo.findByName(args.taxonomy, { locale: args.locale });
|
|
@@ -1190,7 +1190,7 @@ function createMcpServer() {
|
|
|
1190
1190
|
requireRole(extra, Role.EDITOR);
|
|
1191
1191
|
const ec = getEmDash(extra);
|
|
1192
1192
|
try {
|
|
1193
|
-
const { handleTermCreate } = await import("../../../taxonomies-
|
|
1193
|
+
const { handleTermCreate } = await import("../../../taxonomies-CM_fUqLU.mjs").then((n) => n.l);
|
|
1194
1194
|
return unwrap(await handleTermCreate(ec.db, args.taxonomy, {
|
|
1195
1195
|
slug: args.slug,
|
|
1196
1196
|
label: args.label,
|
|
@@ -1219,7 +1219,7 @@ function createMcpServer() {
|
|
|
1219
1219
|
requireRole(extra, Role.EDITOR);
|
|
1220
1220
|
const ec = getEmDash(extra);
|
|
1221
1221
|
try {
|
|
1222
|
-
const { handleTermUpdate } = await import("../../../taxonomies-
|
|
1222
|
+
const { handleTermUpdate } = await import("../../../taxonomies-CM_fUqLU.mjs").then((n) => n.l);
|
|
1223
1223
|
return unwrap(await handleTermUpdate(ec.db, args.taxonomy, args.termSlug, {
|
|
1224
1224
|
slug: args.slug,
|
|
1225
1225
|
label: args.label,
|
|
@@ -1243,7 +1243,7 @@ function createMcpServer() {
|
|
|
1243
1243
|
requireRole(extra, Role.EDITOR);
|
|
1244
1244
|
const ec = getEmDash(extra);
|
|
1245
1245
|
try {
|
|
1246
|
-
const { handleTermDelete } = await import("../../../taxonomies-
|
|
1246
|
+
const { handleTermDelete } = await import("../../../taxonomies-CM_fUqLU.mjs").then((n) => n.l);
|
|
1247
1247
|
return unwrap(await handleTermDelete(ec.db, args.taxonomy, args.termSlug));
|
|
1248
1248
|
} catch (error) {
|
|
1249
1249
|
return respondHandlerError(error, "TAXONOMY_TERM_DELETE_ERROR");
|
|
@@ -1258,7 +1258,7 @@ function createMcpServer() {
|
|
|
1258
1258
|
requireScope(extra, "content:read");
|
|
1259
1259
|
const ec = getEmDash(extra);
|
|
1260
1260
|
try {
|
|
1261
|
-
const { handleTermTranslations } = await import("../../../taxonomies-
|
|
1261
|
+
const { handleTermTranslations } = await import("../../../taxonomies-CM_fUqLU.mjs").then((n) => n.l);
|
|
1262
1262
|
return unwrap(await handleTermTranslations(ec.db, args.id));
|
|
1263
1263
|
} catch (error) {
|
|
1264
1264
|
return respondHandlerError(error, "TERM_TRANSLATIONS_ERROR");
|
|
@@ -1273,7 +1273,7 @@ function createMcpServer() {
|
|
|
1273
1273
|
requireScope(extra, "content:read");
|
|
1274
1274
|
const ec = getEmDash(extra);
|
|
1275
1275
|
try {
|
|
1276
|
-
const { handleMenuList } = await import("../../../menus-
|
|
1276
|
+
const { handleMenuList } = await import("../../../menus-CBb6UrMU.mjs").then((n) => n.d);
|
|
1277
1277
|
return unwrap(await handleMenuList(ec.db, { locale: args.locale }));
|
|
1278
1278
|
} catch (error) {
|
|
1279
1279
|
return respondHandlerError(error, "MENU_LIST_ERROR");
|
|
@@ -1291,7 +1291,7 @@ function createMcpServer() {
|
|
|
1291
1291
|
requireScope(extra, "content:read");
|
|
1292
1292
|
const ec = getEmDash(extra);
|
|
1293
1293
|
try {
|
|
1294
|
-
const { handleMenuGet } = await import("../../../menus-
|
|
1294
|
+
const { handleMenuGet } = await import("../../../menus-CBb6UrMU.mjs").then((n) => n.d);
|
|
1295
1295
|
return unwrap(await handleMenuGet(ec.db, args.name, { locale: args.locale }));
|
|
1296
1296
|
} catch (error) {
|
|
1297
1297
|
return respondHandlerError(error, "MENU_GET_ERROR");
|
|
@@ -1306,7 +1306,7 @@ function createMcpServer() {
|
|
|
1306
1306
|
requireScope(extra, "content:read");
|
|
1307
1307
|
const ec = getEmDash(extra);
|
|
1308
1308
|
try {
|
|
1309
|
-
const { handleMenuTranslations } = await import("../../../menus-
|
|
1309
|
+
const { handleMenuTranslations } = await import("../../../menus-CBb6UrMU.mjs").then((n) => n.d);
|
|
1310
1310
|
return unwrap(await handleMenuTranslations(ec.db, args.id));
|
|
1311
1311
|
} catch (error) {
|
|
1312
1312
|
return respondHandlerError(error, "MENU_TRANSLATIONS_ERROR");
|
|
@@ -1326,7 +1326,7 @@ function createMcpServer() {
|
|
|
1326
1326
|
requireRole(extra, Role.EDITOR);
|
|
1327
1327
|
const ec = getEmDash(extra);
|
|
1328
1328
|
try {
|
|
1329
|
-
const { handleMenuCreate } = await import("../../../menus-
|
|
1329
|
+
const { handleMenuCreate } = await import("../../../menus-CBb6UrMU.mjs").then((n) => n.d);
|
|
1330
1330
|
return unwrap(await handleMenuCreate(ec.db, {
|
|
1331
1331
|
name: args.name,
|
|
1332
1332
|
label: args.label,
|
|
@@ -1350,7 +1350,7 @@ function createMcpServer() {
|
|
|
1350
1350
|
requireRole(extra, Role.EDITOR);
|
|
1351
1351
|
const ec = getEmDash(extra);
|
|
1352
1352
|
try {
|
|
1353
|
-
const { handleMenuUpdate } = await import("../../../menus-
|
|
1353
|
+
const { handleMenuUpdate } = await import("../../../menus-CBb6UrMU.mjs").then((n) => n.d);
|
|
1354
1354
|
return unwrap(await handleMenuUpdate(ec.db, args.name, {
|
|
1355
1355
|
label: args.label,
|
|
1356
1356
|
locale: args.locale
|
|
@@ -1372,7 +1372,7 @@ function createMcpServer() {
|
|
|
1372
1372
|
requireRole(extra, Role.EDITOR);
|
|
1373
1373
|
const ec = getEmDash(extra);
|
|
1374
1374
|
try {
|
|
1375
|
-
const { handleMenuDelete } = await import("../../../menus-
|
|
1375
|
+
const { handleMenuDelete } = await import("../../../menus-CBb6UrMU.mjs").then((n) => n.d);
|
|
1376
1376
|
return unwrap(await handleMenuDelete(ec.db, args.name, { locale: args.locale }));
|
|
1377
1377
|
} catch (error) {
|
|
1378
1378
|
return respondHandlerError(error, "MENU_DELETE_ERROR");
|
|
@@ -1407,7 +1407,7 @@ function createMcpServer() {
|
|
|
1407
1407
|
requireRole(extra, Role.EDITOR);
|
|
1408
1408
|
const ec = getEmDash(extra);
|
|
1409
1409
|
try {
|
|
1410
|
-
const { handleMenuSetItems } = await import("../../../menus-
|
|
1410
|
+
const { handleMenuSetItems } = await import("../../../menus-CBb6UrMU.mjs").then((n) => n.d);
|
|
1411
1411
|
return unwrap(await handleMenuSetItems(ec.db, args.name, args.items, { locale: args.locale }));
|
|
1412
1412
|
} catch (error) {
|
|
1413
1413
|
return respondHandlerError(error, "MENU_SET_ITEMS_ERROR");
|
|
@@ -1454,7 +1454,7 @@ function createMcpServer() {
|
|
|
1454
1454
|
requireRole(extra, Role.EDITOR);
|
|
1455
1455
|
const ec = getEmDash(extra);
|
|
1456
1456
|
try {
|
|
1457
|
-
const { handleSettingsGet } = await import("../../../settings-
|
|
1457
|
+
const { handleSettingsGet } = await import("../../../settings-BMNr9Dmi.mjs").then((n) => n.r);
|
|
1458
1458
|
return unwrap(await handleSettingsGet(ec.db, ec.storage));
|
|
1459
1459
|
} catch (error) {
|
|
1460
1460
|
return respondHandlerError(error, "SETTINGS_READ_ERROR");
|
|
@@ -1480,7 +1480,7 @@ function createMcpServer() {
|
|
|
1480
1480
|
requireRole(extra, Role.ADMIN);
|
|
1481
1481
|
const ec = getEmDash(extra);
|
|
1482
1482
|
try {
|
|
1483
|
-
const { handleSettingsUpdate } = await import("../../../settings-
|
|
1483
|
+
const { handleSettingsUpdate } = await import("../../../settings-BMNr9Dmi.mjs").then((n) => n.r);
|
|
1484
1484
|
return unwrap(await handleSettingsUpdate(ec.db, ec.storage, args));
|
|
1485
1485
|
} catch (error) {
|
|
1486
1486
|
return respondHandlerError(error, "SETTINGS_UPDATE_ERROR");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/media/[id]/confirm.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"confirm.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/media/[id]/confirm.ts"],"mappings":";;;cAmBa,SAAA;;;;cAwBA,IAAA,EAAM,QAAA"}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
import {
|
|
6
|
-
import "../../../../../
|
|
2
|
+
import "../../../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { t as enrichImageMetadata } from "../../../../../enrich-BQ0mxJRs.mjs";
|
|
4
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-rVGiqWDt.mjs";
|
|
5
|
+
import { r as parseOptionalBody, t as isParseError } from "../../../../../parse-BwAdS7FZ.mjs";
|
|
6
|
+
import { Ht as mediaConfirmBody } from "../../../../../redirects-Dcbuisoj.mjs";
|
|
7
|
+
import "../../../../../byline-fields-eyJMblSr.mjs";
|
|
7
8
|
import "../../../../../status-vUK0SA17.mjs";
|
|
8
9
|
import "../../../../../api/schemas/index.mjs";
|
|
9
|
-
import { n as requirePerm, t as requireOwnerPerm } from "../../../../../authorize-
|
|
10
|
+
import { n as requirePerm, t as requireOwnerPerm } from "../../../../../authorize-BZnOGJFo.mjs";
|
|
10
11
|
import { MediaRepository } from "emdash";
|
|
11
12
|
|
|
12
13
|
//#region src/astro/routes/api/media/[id]/confirm.ts
|
|
13
14
|
const prerender = false;
|
|
14
15
|
/**
|
|
16
|
+
* Max raw bytes to buffer for server-side LQIP generation at confirm time. The
|
|
17
|
+
* signed-URL upload flow exists so large files bypass server buffering — re-reading
|
|
18
|
+
* the whole object into a Worker's 128 MB heap to compute a blurhash would OOM
|
|
19
|
+
* on the very uploads that flow was designed for. LQIP is progressive
|
|
20
|
+
* enhancement: large images simply ship without a server-generated placeholder.
|
|
21
|
+
*/
|
|
22
|
+
const MAX_PLACEHOLDER_DOWNLOAD_BYTES = 8 * 1024 * 1024;
|
|
23
|
+
/**
|
|
15
24
|
* Add URL to media item (relative URL for portability)
|
|
16
25
|
*/
|
|
17
26
|
function addUrlToMedia(item) {
|
|
@@ -45,10 +54,37 @@ const POST = async ({ params, request, locals }) => {
|
|
|
45
54
|
return apiError("FILE_NOT_FOUND", "File was not uploaded to storage", 400);
|
|
46
55
|
}
|
|
47
56
|
}
|
|
57
|
+
let blurhash;
|
|
58
|
+
let dominantColor;
|
|
59
|
+
let width = body.width;
|
|
60
|
+
let height = body.height;
|
|
61
|
+
if (emdash.storage && existing.mimeType.startsWith("image/")) {
|
|
62
|
+
const knownSize = body.size ?? existing.size ?? void 0;
|
|
63
|
+
if (!(knownSize != null && knownSize > MAX_PLACEHOLDER_DOWNLOAD_BYTES)) try {
|
|
64
|
+
const { body: stream } = await emdash.storage.download(existing.storageKey);
|
|
65
|
+
const bytes = new Uint8Array(await new Response(stream).arrayBuffer());
|
|
66
|
+
if (bytes.byteLength > MAX_PLACEHOLDER_DOWNLOAD_BYTES) console.warn(`[media] confirm skipping placeholder: object ${existing.storageKey} is ${bytes.byteLength} bytes (> ${MAX_PLACEHOLDER_DOWNLOAD_BYTES})`);
|
|
67
|
+
else {
|
|
68
|
+
const enriched = await enrichImageMetadata(bytes, existing.mimeType, { knownDimensions: body.width != null && body.height != null ? {
|
|
69
|
+
width: body.width,
|
|
70
|
+
height: body.height
|
|
71
|
+
} : void 0 });
|
|
72
|
+
blurhash = enriched.blurhash;
|
|
73
|
+
dominantColor = enriched.dominantColor;
|
|
74
|
+
width = width ?? enriched.width;
|
|
75
|
+
height = height ?? enriched.height;
|
|
76
|
+
}
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error("[media] confirm placeholder generation failed:", error);
|
|
79
|
+
}
|
|
80
|
+
else console.warn(`[media] confirm skipping placeholder: object ${existing.storageKey} reported size ${knownSize} bytes (> ${MAX_PLACEHOLDER_DOWNLOAD_BYTES})`);
|
|
81
|
+
}
|
|
48
82
|
const item = await repo.confirmUpload(id, {
|
|
49
83
|
size: body.size,
|
|
50
|
-
width
|
|
51
|
-
height
|
|
84
|
+
width,
|
|
85
|
+
height,
|
|
86
|
+
blurhash,
|
|
87
|
+
dominantColor
|
|
52
88
|
});
|
|
53
89
|
if (!item) return apiError("CONFIRM_FAILED", "Failed to confirm upload", 500);
|
|
54
90
|
return apiSuccess({ item: addUrlToMedia(item) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/media/[id]/confirm.ts"],"sourcesContent":["/**\n * Confirm media upload endpoint\n *\n * POST /_emdash/api/media/{id}/confirm\n *\n * Confirms that the client has successfully uploaded the file to storage.\n * Marks the media record as ready and optionally updates metadata.\n */\n\nimport type { APIRoute } from \"astro\";\nimport { MediaRepository } from \"emdash\";\n\nimport { requireOwnerPerm, requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseOptionalBody } from \"#api/parse.js\";\nimport { mediaConfirmBody } from \"#api/schemas.js\";\nimport type { MediaItem } from \"#types\";\n\nexport const prerender = false;\n\n/**\n * Add URL to media item (relative URL for portability)\n */\nfunction addUrlToMedia(item: MediaItem): MediaItem & { url: string } {\n\treturn {\n\t\t...item,\n\t\turl: `/_emdash/api/media/file/${item.storageKey}`,\n\t};\n}\n\n/**\n * Confirm upload completion\n */\nexport const POST: APIRoute = async ({ params, request, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst { id } = params;\n\n\tconst denied = requirePerm(user, \"media:upload\");\n\tif (denied) return denied;\n\n\tif (!id) {\n\t\treturn apiError(\"INVALID_REQUEST\", \"Media ID is required\", 400);\n\t}\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\ttry {\n\t\tconst body = await parseOptionalBody(request, mediaConfirmBody, {});\n\t\tif (isParseError(body)) return body;\n\n\t\tconst repo = new MediaRepository(emdash.db);\n\n\t\t// Get the media item first to check status\n\t\tconst existing = await repo.findById(id);\n\t\tif (!existing) {\n\t\t\treturn apiError(\"NOT_FOUND\", `Media item not found: ${id}`, 404);\n\t\t}\n\n\t\tif (existing.status !== \"pending\") {\n\t\t\treturn apiError(\"INVALID_STATE\", `Media item is not pending: ${existing.status}`, 400);\n\t\t}\n\n\t\t// Only the uploader or a user with media:edit_any can confirm/fail a pending upload\n\t\tconst ownerDenied = requireOwnerPerm(\n\t\t\tuser,\n\t\t\texisting.authorId ?? \"\",\n\t\t\t\"media:edit_own\",\n\t\t\t\"media:edit_any\",\n\t\t);\n\t\tif (ownerDenied) return ownerDenied;\n\n\t\t// Optionally verify the file exists in storage\n\t\tif (emdash.storage) {\n\t\t\tconst exists = await emdash.storage.exists(existing.storageKey);\n\t\t\tif (!exists) {\n\t\t\t\t// Mark as failed\n\t\t\t\tawait repo.markFailed(id);\n\t\t\t\treturn apiError(\"FILE_NOT_FOUND\", \"File was not uploaded to storage\", 400);\n\t\t\t}\n\t\t}\n\n\t\t//
|
|
1
|
+
{"version":3,"file":"confirm.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/media/[id]/confirm.ts"],"sourcesContent":["/**\n * Confirm media upload endpoint\n *\n * POST /_emdash/api/media/{id}/confirm\n *\n * Confirms that the client has successfully uploaded the file to storage.\n * Marks the media record as ready and optionally updates metadata.\n */\n\nimport type { APIRoute } from \"astro\";\nimport { MediaRepository } from \"emdash\";\n\nimport { requireOwnerPerm, requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseOptionalBody } from \"#api/parse.js\";\nimport { mediaConfirmBody } from \"#api/schemas.js\";\nimport { enrichImageMetadata } from \"#media/enrich.js\";\nimport type { MediaItem } from \"#types\";\n\nexport const prerender = false;\n\n/**\n * Max raw bytes to buffer for server-side LQIP generation at confirm time. The\n * signed-URL upload flow exists so large files bypass server buffering — re-reading\n * the whole object into a Worker's 128 MB heap to compute a blurhash would OOM\n * on the very uploads that flow was designed for. LQIP is progressive\n * enhancement: large images simply ship without a server-generated placeholder.\n */\nconst MAX_PLACEHOLDER_DOWNLOAD_BYTES = 8 * 1024 * 1024;\n\n/**\n * Add URL to media item (relative URL for portability)\n */\nfunction addUrlToMedia(item: MediaItem): MediaItem & { url: string } {\n\treturn {\n\t\t...item,\n\t\turl: `/_emdash/api/media/file/${item.storageKey}`,\n\t};\n}\n\n/**\n * Confirm upload completion\n */\nexport const POST: APIRoute = async ({ params, request, locals }) => {\n\tconst { emdash, user } = locals;\n\tconst { id } = params;\n\n\tconst denied = requirePerm(user, \"media:upload\");\n\tif (denied) return denied;\n\n\tif (!id) {\n\t\treturn apiError(\"INVALID_REQUEST\", \"Media ID is required\", 400);\n\t}\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\ttry {\n\t\tconst body = await parseOptionalBody(request, mediaConfirmBody, {});\n\t\tif (isParseError(body)) return body;\n\n\t\tconst repo = new MediaRepository(emdash.db);\n\n\t\t// Get the media item first to check status\n\t\tconst existing = await repo.findById(id);\n\t\tif (!existing) {\n\t\t\treturn apiError(\"NOT_FOUND\", `Media item not found: ${id}`, 404);\n\t\t}\n\n\t\tif (existing.status !== \"pending\") {\n\t\t\treturn apiError(\"INVALID_STATE\", `Media item is not pending: ${existing.status}`, 400);\n\t\t}\n\n\t\t// Only the uploader or a user with media:edit_any can confirm/fail a pending upload\n\t\tconst ownerDenied = requireOwnerPerm(\n\t\t\tuser,\n\t\t\texisting.authorId ?? \"\",\n\t\t\t\"media:edit_own\",\n\t\t\t\"media:edit_any\",\n\t\t);\n\t\tif (ownerDenied) return ownerDenied;\n\n\t\t// Optionally verify the file exists in storage\n\t\tif (emdash.storage) {\n\t\t\tconst exists = await emdash.storage.exists(existing.storageKey);\n\t\t\tif (!exists) {\n\t\t\t\t// Mark as failed\n\t\t\t\tawait repo.markFailed(id);\n\t\t\t\treturn apiError(\"FILE_NOT_FOUND\", \"File was not uploaded to storage\", 400);\n\t\t\t}\n\t\t}\n\n\t\t// For images, read the just-uploaded bytes back from storage once to\n\t\t// generate LQIP placeholders (and server-side dimensions as a fallback).\n\t\t// The signed-URL flow uploads directly to storage, so this confirm is the\n\t\t// only point at which the server sees the bytes. Best-effort: a decode\n\t\t// failure must not block the upload from being marked ready. We also cap\n\t\t// the download size — buffering a large original into a Worker heap to\n\t\t// compute a 32px blurhash would OOM on the uploads the signed-URL path\n\t\t// exists to support, so oversized files skip the server-side placeholder.\n\t\tlet blurhash: string | undefined;\n\t\tlet dominantColor: string | undefined;\n\t\tlet width = body.width;\n\t\tlet height = body.height;\n\t\tif (emdash.storage && existing.mimeType.startsWith(\"image/\")) {\n\t\t\tconst knownSize = body.size ?? existing.size ?? undefined;\n\t\t\tconst tooLarge = knownSize != null && knownSize > MAX_PLACEHOLDER_DOWNLOAD_BYTES;\n\t\t\tif (!tooLarge) {\n\t\t\t\ttry {\n\t\t\t\t\tconst { body: stream } = await emdash.storage.download(existing.storageKey);\n\t\t\t\t\tconst bytes = new Uint8Array(await new Response(stream).arrayBuffer());\n\t\t\t\t\t// Defense-in-depth for the unknown-size case: even though we\n\t\t\t\t\t// already buffered it, refuse the decode so we don't also pay\n\t\t\t\t\t// the (larger) RGBA allocation.\n\t\t\t\t\tif (bytes.byteLength > MAX_PLACEHOLDER_DOWNLOAD_BYTES) {\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`[media] confirm skipping placeholder: object ${existing.storageKey} is ${bytes.byteLength} bytes (> ${MAX_PLACEHOLDER_DOWNLOAD_BYTES})`,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst enriched = await enrichImageMetadata(bytes, existing.mimeType, {\n\t\t\t\t\t\t\tknownDimensions:\n\t\t\t\t\t\t\t\tbody.width != null && body.height != null\n\t\t\t\t\t\t\t\t\t? { width: body.width, height: body.height }\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tblurhash = enriched.blurhash;\n\t\t\t\t\t\tdominantColor = enriched.dominantColor;\n\t\t\t\t\t\twidth = width ?? enriched.width;\n\t\t\t\t\t\theight = height ?? enriched.height;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.error(\"[media] confirm placeholder generation failed:\", error);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[media] confirm skipping placeholder: object ${existing.storageKey} reported size ${knownSize} bytes (> ${MAX_PLACEHOLDER_DOWNLOAD_BYTES})`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Confirm the upload\n\t\tconst item = await repo.confirmUpload(id, {\n\t\t\tsize: body.size,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tblurhash,\n\t\t\tdominantColor,\n\t\t});\n\n\t\tif (!item) {\n\t\t\treturn apiError(\"CONFIRM_FAILED\", \"Failed to confirm upload\", 500);\n\t\t}\n\n\t\t// Add URL to the response (relative URL for portability)\n\t\tconst itemWithUrl = addUrlToMedia(item);\n\n\t\treturn apiSuccess({ item: itemWithUrl });\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to confirm upload\", \"CONFIRM_ERROR\");\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;AAmBA,MAAa,YAAY;;;;;;;;AASzB,MAAM,iCAAiC,IAAI,OAAO;;;;AAKlD,SAAS,cAAc,MAA8C;AACpE,QAAO;EACN,GAAG;EACH,KAAK,2BAA2B,KAAK;EACrC;;;;;AAMF,MAAa,OAAiB,OAAO,EAAE,QAAQ,SAAS,aAAa;CACpE,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,EAAE,OAAO;CAEf,MAAM,SAAS,YAAY,MAAM,eAAe;AAChD,KAAI,OAAQ,QAAO;AAEnB,KAAI,CAAC,GACJ,QAAO,SAAS,mBAAmB,wBAAwB,IAAI;AAGhE,KAAI,CAAC,QAAQ,GACZ,QAAO,SAAS,kBAAkB,6BAA6B,IAAI;AAGpE,KAAI;EACH,MAAM,OAAO,MAAM,kBAAkB,SAAS,kBAAkB,EAAE,CAAC;AACnE,MAAI,aAAa,KAAK,CAAE,QAAO;EAE/B,MAAM,OAAO,IAAI,gBAAgB,OAAO,GAAG;EAG3C,MAAM,WAAW,MAAM,KAAK,SAAS,GAAG;AACxC,MAAI,CAAC,SACJ,QAAO,SAAS,aAAa,yBAAyB,MAAM,IAAI;AAGjE,MAAI,SAAS,WAAW,UACvB,QAAO,SAAS,iBAAiB,8BAA8B,SAAS,UAAU,IAAI;EAIvF,MAAM,cAAc,iBACnB,MACA,SAAS,YAAY,IACrB,kBACA,iBACA;AACD,MAAI,YAAa,QAAO;AAGxB,MAAI,OAAO,SAEV;OAAI,CADW,MAAM,OAAO,QAAQ,OAAO,SAAS,WAAW,EAClD;AAEZ,UAAM,KAAK,WAAW,GAAG;AACzB,WAAO,SAAS,kBAAkB,oCAAoC,IAAI;;;EAY5E,IAAI;EACJ,IAAI;EACJ,IAAI,QAAQ,KAAK;EACjB,IAAI,SAAS,KAAK;AAClB,MAAI,OAAO,WAAW,SAAS,SAAS,WAAW,SAAS,EAAE;GAC7D,MAAM,YAAY,KAAK,QAAQ,SAAS,QAAQ;AAEhD,OAAI,EADa,aAAa,QAAQ,YAAY,gCAEjD,KAAI;IACH,MAAM,EAAE,MAAM,WAAW,MAAM,OAAO,QAAQ,SAAS,SAAS,WAAW;IAC3E,MAAM,QAAQ,IAAI,WAAW,MAAM,IAAI,SAAS,OAAO,CAAC,aAAa,CAAC;AAItE,QAAI,MAAM,aAAa,+BACtB,SAAQ,KACP,gDAAgD,SAAS,WAAW,MAAM,MAAM,WAAW,YAAY,+BAA+B,GACtI;SACK;KACN,MAAM,WAAW,MAAM,oBAAoB,OAAO,SAAS,UAAU,EACpE,iBACC,KAAK,SAAS,QAAQ,KAAK,UAAU,OAClC;MAAE,OAAO,KAAK;MAAO,QAAQ,KAAK;MAAQ,GAC1C,QACJ,CAAC;AACF,gBAAW,SAAS;AACpB,qBAAgB,SAAS;AACzB,aAAQ,SAAS,SAAS;AAC1B,cAAS,UAAU,SAAS;;YAErB,OAAO;AACf,YAAQ,MAAM,kDAAkD,MAAM;;OAGvE,SAAQ,KACP,gDAAgD,SAAS,WAAW,iBAAiB,UAAU,YAAY,+BAA+B,GAC1I;;EAKH,MAAM,OAAO,MAAM,KAAK,cAAc,IAAI;GACzC,MAAM,KAAK;GACX;GACA;GACA;GACA;GACA,CAAC;AAEF,MAAI,CAAC,KACJ,QAAO,SAAS,kBAAkB,4BAA4B,IAAI;AAMnE,SAAO,WAAW,EAAE,MAFA,cAAc,KAAK,EAEA,CAAC;UAChC,OAAO;AACf,SAAO,YAAY,OAAO,4BAA4B,gBAAgB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../../../../base64-CmWvODNW.mjs";
|
|
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 { Xt as mediaUpdateBody } from "../../../../redirects-
|
|
6
|
-
import "../../../../byline-fields-
|
|
2
|
+
import "../../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { a as unwrapResult, r as handleError, t as apiError } from "../../../../error-rVGiqWDt.mjs";
|
|
4
|
+
import { n as parseBody, t as isParseError } from "../../../../parse-BwAdS7FZ.mjs";
|
|
5
|
+
import { Xt as mediaUpdateBody } from "../../../../redirects-Dcbuisoj.mjs";
|
|
6
|
+
import "../../../../byline-fields-eyJMblSr.mjs";
|
|
7
7
|
import "../../../../status-vUK0SA17.mjs";
|
|
8
8
|
import "../../../../api/schemas/index.mjs";
|
|
9
|
-
import { n as requirePerm, t as requireOwnerPerm } from "../../../../authorize-
|
|
9
|
+
import { n as requirePerm, t as requireOwnerPerm } from "../../../../authorize-BZnOGJFo.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/astro/routes/api/media/[id].ts
|
|
12
12
|
const prerender = false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import { r as handleError, t as apiError } from "../../../../../error-
|
|
2
|
+
import "../../../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { r as handleError, t as apiError } from "../../../../../error-rVGiqWDt.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/astro/routes/api/media/file/[...key].ts
|
|
6
6
|
const prerender = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../../../../types-
|
|
3
|
-
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../../error-
|
|
4
|
-
import { n as requirePerm } from "../../../../../../authorize-
|
|
2
|
+
import "../../../../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../../error-rVGiqWDt.mjs";
|
|
4
|
+
import { n as requirePerm } from "../../../../../../authorize-BZnOGJFo.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/astro/routes/api/media/providers/[providerId]/[itemId].ts
|
|
7
7
|
const prerender = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../../../../types-
|
|
3
|
-
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../../error-
|
|
4
|
-
import { n as requirePerm } from "../../../../../../authorize-
|
|
2
|
+
import "../../../../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../../error-rVGiqWDt.mjs";
|
|
4
|
+
import { n as requirePerm } from "../../../../../../authorize-BZnOGJFo.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/astro/routes/api/media/providers/[providerId]/index.ts
|
|
7
7
|
const prerender = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../../../types-
|
|
3
|
-
import { n as apiSuccess, t as apiError } from "../../../../../error-
|
|
4
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
2
|
+
import "../../../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { n as apiSuccess, t as apiError } from "../../../../../error-rVGiqWDt.mjs";
|
|
4
|
+
import { n as requirePerm } from "../../../../../authorize-BZnOGJFo.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/astro/routes/api/media/providers/index.ts
|
|
7
7
|
const prerender = false;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "../../../../base64-CmWvODNW.mjs";
|
|
2
|
-
import "../../../../types-
|
|
3
|
-
import { n as normalizeMime, t as matchesMimeAllowlist } from "../../../../mime-
|
|
4
|
-
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../error-
|
|
5
|
-
import { n as parseBody, t as isParseError } from "../../../../parse-
|
|
6
|
-
import { Bt as DEFAULT_MAX_UPLOAD_SIZE, Zt as mediaUploadUrlBody } from "../../../../redirects-
|
|
7
|
-
import "../../../../byline-fields-
|
|
2
|
+
import "../../../../types-CZgK3EMW.mjs";
|
|
3
|
+
import { n as normalizeMime, t as matchesMimeAllowlist } from "../../../../mime-CCEzze7W.mjs";
|
|
4
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../error-rVGiqWDt.mjs";
|
|
5
|
+
import { n as parseBody, t as isParseError } from "../../../../parse-BwAdS7FZ.mjs";
|
|
6
|
+
import { Bt as DEFAULT_MAX_UPLOAD_SIZE, Zt as mediaUploadUrlBody } from "../../../../redirects-Dcbuisoj.mjs";
|
|
7
|
+
import "../../../../byline-fields-eyJMblSr.mjs";
|
|
8
8
|
import "../../../../status-vUK0SA17.mjs";
|
|
9
9
|
import "../../../../api/schemas/index.mjs";
|
|
10
|
-
import { n as requirePerm } from "../../../../authorize-
|
|
11
|
-
import { n as resolveFieldAllowlist, t as GLOBAL_UPLOAD_ALLOWLIST } from "../../../../media-allowlist-
|
|
10
|
+
import { n as requirePerm } from "../../../../authorize-BZnOGJFo.mjs";
|
|
11
|
+
import { n as resolveFieldAllowlist, t as GLOBAL_UPLOAD_ALLOWLIST } from "../../../../media-allowlist-Du8t1u6a.mjs";
|
|
12
12
|
import { ulid } from "ulidx";
|
|
13
13
|
import * as path from "node:path";
|
|
14
14
|
import { MediaRepository } from "emdash";
|