emdash 0.33.0 → 0.34.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-BMyNSSZi.d.mts → adapters-34EN2eXO.d.mts} +26 -2
- package/dist/adapters-34EN2eXO.d.mts.map +1 -0
- package/dist/{allowed-origins-CG1pACtS.mjs → allowed-origins-DW7sYyqg.mjs} +2 -2
- package/dist/{allowed-origins-CG1pACtS.mjs.map → allowed-origins-DW7sYyqg.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +22 -21
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +6 -5
- package/dist/{api-D2hunekQ.mjs → api-DdAsirBe.mjs} +98 -407
- package/dist/api-DdAsirBe.mjs.map +1 -0
- package/dist/{api-tokens-CSND0i1z.mjs → api-tokens-CFXu8F_2.mjs} +2 -2
- package/dist/{api-tokens-CSND0i1z.mjs.map → api-tokens-CFXu8F_2.mjs.map} +1 -1
- package/dist/{apply-kwNEJW2l.mjs → apply-D5zfeD09.mjs} +131 -107
- package/dist/apply-D5zfeD09.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +93 -35
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +8 -8
- package/dist/astro/middleware/media-usage-write-fence.d.mts +7 -0
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs +35 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -0
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +10 -7
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +3 -3
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +12 -11
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +1677 -156
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- 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 +12 -11
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -17
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -17
- package/dist/astro/routes/api/admin/bylines/index.mjs +17 -17
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -11
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/index.mjs +12 -11
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +5 -5
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +4 -4
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +36 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +36 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +15 -14
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +37 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +37 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -0
- 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.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +51 -43
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +51 -43
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +50 -42
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +50 -42
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +47 -42
- 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 +47 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +50 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +50 -42
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +51 -43
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +51 -43
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +47 -42
- 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 +47 -42
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
- package/dist/astro/routes/api/admin/users/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +13 -12
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +10 -9
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -11
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +10 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +9 -8
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +13 -12
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -14
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +14 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- 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 +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +18 -17
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +18 -17
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +44 -31
- 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 +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- 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 +18 -16
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +14 -12
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +13 -12
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +14 -14
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +18 -16
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +28 -27
- 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.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +174 -72
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +13 -11
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
- package/dist/astro/routes/api/media/_id_/usage.mjs +17 -16
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +16 -15
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- 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 +11 -10
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +18 -15
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/items.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/translations.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_.mjs +11 -11
- package/dist/astro/routes/api/menus/index.mjs +11 -11
- 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 +152 -6
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +8 -7
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +12 -11
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -11
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +13 -12
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +13 -12
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +18 -17
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +13 -12
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +18 -17
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -5
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +47 -42
- 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 +47 -42
- 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 +47 -42
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +47 -42
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +47 -42
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +47 -42
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +10 -9
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +47 -42
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +47 -42
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +13 -13
- package/dist/astro/routes/api/search/index.mjs +12 -12
- package/dist/astro/routes/api/search/rebuild.mjs +13 -13
- package/dist/astro/routes/api/search/stats.mjs +8 -8
- package/dist/astro/routes/api/search/suggest.mjs +12 -12
- package/dist/astro/routes/api/sections/_slug_.mjs +12 -11
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +12 -11
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/export.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/index.mjs +8 -8
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings.mjs +14 -13
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +13 -12
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +30 -28
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
- package/dist/astro/routes/api/setup/index.mjs +32 -30
- 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.mjs +8 -8
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -15
- 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 -15
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +18 -16
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +46 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs +88 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +6 -6
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/well-known/auth.mjs +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +10 -9
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -6
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +7 -6
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +10 -10
- package/dist/astro/routes/sitemap.xml.mjs +8 -7
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +35 -17
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-qRhWQnel.mjs → authorize-1iFJzPaZ.mjs} +2 -2
- package/dist/{authorize-qRhWQnel.mjs.map → authorize-1iFJzPaZ.mjs.map} +1 -1
- package/dist/{backup-CtA6LDNw.mjs → backup-LHjIAVNP.mjs} +4 -4
- package/dist/{backup-CtA6LDNw.mjs.map → backup-LHjIAVNP.mjs.map} +1 -1
- package/dist/{base64-B-PsqheR.mjs → base64-CvLhUKQv.mjs} +1 -1
- package/dist/{base64-B-PsqheR.mjs.map → base64-CvLhUKQv.mjs.map} +1 -1
- package/dist/bundle-CBEXrBnb.mjs +663 -0
- package/dist/bundle-CBEXrBnb.mjs.map +1 -0
- package/dist/{byline-fields-CNc0Yq5i.mjs → byline-fields-C5S8wygO.mjs} +2 -2
- package/dist/{byline-fields-CNc0Yq5i.mjs.map → byline-fields-C5S8wygO.mjs.map} +1 -1
- package/dist/{byline-Cp6csL84.mjs → byline-pEcoDps8.mjs} +5 -5
- package/dist/{byline-Cp6csL84.mjs.map → byline-pEcoDps8.mjs.map} +1 -1
- package/dist/{byline-registry-ZkPKqEwC.mjs → byline-registry-DDun8sxh.mjs} +2 -2
- package/dist/{byline-registry-ZkPKqEwC.mjs.map → byline-registry-DDun8sxh.mjs.map} +1 -1
- package/dist/{bylines-CEj5CdT4.mjs → bylines-BWemdX2k.mjs} +7 -7
- package/dist/{bylines-CEj5CdT4.mjs.map → bylines-BWemdX2k.mjs.map} +1 -1
- package/dist/{bylines-cf-C9lmF.mjs → bylines-DJfSfXCL.mjs} +5 -5
- package/dist/{bylines-cf-C9lmF.mjs.map → bylines-DJfSfXCL.mjs.map} +1 -1
- package/dist/{cache-C9FptTFR.mjs → cache-CBJaDy_E.mjs} +3 -3
- package/dist/{cache-C9FptTFR.mjs.map → cache-CBJaDy_E.mjs.map} +1 -1
- package/dist/{challenge-store-D9VNKELo.mjs → challenge-store-CZyFVaad.mjs} +1 -1
- package/dist/{challenge-store-D9VNKELo.mjs.map → challenge-store-CZyFVaad.mjs.map} +1 -1
- package/dist/{chunks-DbYzib_k.mjs → chunks-DfPax1I0.mjs} +2 -2
- package/dist/{chunks-DbYzib_k.mjs.map → chunks-DfPax1I0.mjs.map} +1 -1
- package/dist/cli/index.mjs +176 -698
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +74 -4
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +25 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-C8BugSGz.mjs +779 -0
- package/dist/collection-deletion-C8BugSGz.mjs.map +1 -0
- package/dist/{comment-BIkJ6Fil.mjs → comment-Dxlep6cE.mjs} +2 -2
- package/dist/{comment-BIkJ6Fil.mjs.map → comment-Dxlep6cE.mjs.map} +1 -1
- package/dist/{comment-reaction-D-laEceb.mjs → comment-reaction-D6qfHKBc.mjs} +2 -2
- package/dist/{comment-reaction-D-laEceb.mjs.map → comment-reaction-D6qfHKBc.mjs.map} +1 -1
- package/dist/{comments-0_w6KChA.mjs → comments-CTOuhTSX.mjs} +3 -3
- package/dist/{comments-0_w6KChA.mjs.map → comments-CTOuhTSX.mjs.map} +1 -1
- package/dist/{components-BPxrRjpE.mjs → components-CQy3lh9x.mjs} +1 -1
- package/dist/{components-BPxrRjpE.mjs.map → components-CQy3lh9x.mjs.map} +1 -1
- package/dist/{config-DyF3OKg_.mjs → config-C3EBstHi.mjs} +18 -2
- package/dist/config-C3EBstHi.mjs.map +1 -0
- package/dist/{content-CJ94NEx5.mjs → content-BNfwh7xX.mjs} +509 -78
- package/dist/content-BNfwh7xX.mjs.map +1 -0
- package/dist/content-list-query-DhQ84eVV.d.mts +26 -0
- package/dist/content-list-query-DhQ84eVV.d.mts.map +1 -0
- package/dist/content-refresh-DNERP4-f.mjs +2560 -0
- package/dist/content-refresh-DNERP4-f.mjs.map +1 -0
- package/dist/{context-C_1nrqnW.mjs → context-DRgOvSnW.mjs} +25 -17
- package/dist/context-DRgOvSnW.mjs.map +1 -0
- package/dist/{cron-DRV-UC4K.mjs → cron-Y9aLtgrA.mjs} +1 -1
- package/dist/{cron-DRV-UC4K.mjs.map → cron-Y9aLtgrA.mjs.map} +1 -1
- package/dist/{dashboard-DINnNVVU.mjs → dashboard-CB8J89rJ.mjs} +44 -10
- package/dist/dashboard-CB8J89rJ.mjs.map +1 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +2 -2
- package/dist/db/index.mjs.map +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-CcWLaRiR.mjs → db-errors-Cl-sKYTm.mjs} +1 -1
- package/dist/{db-errors-CcWLaRiR.mjs.map → db-errors-Cl-sKYTm.mjs.map} +1 -1
- package/dist/{default-BD2FG0xV.mjs → default-DdDl3fxv.mjs} +1 -1
- package/dist/{default-BD2FG0xV.mjs.map → default-DdDl3fxv.mjs.map} +1 -1
- package/dist/{deferred-tasks-C-WRCcKo.d.mts → deferred-tasks-BMsa9F64.d.mts} +1 -1
- package/dist/{deferred-tasks-C-WRCcKo.d.mts.map → deferred-tasks-BMsa9F64.d.mts.map} +1 -1
- package/dist/{device-flow-CTqd8mud.mjs → device-flow-CaioYGK3.mjs} +4 -4
- package/dist/{device-flow-CTqd8mud.mjs.map → device-flow-CaioYGK3.mjs.map} +1 -1
- package/dist/dist-D_6CKR8z.mjs +810 -0
- package/dist/dist-D_6CKR8z.mjs.map +1 -0
- package/dist/{email-console-C6WdcWbL.mjs → email-console-BHNjIwiB.mjs} +1 -1
- package/dist/{email-console-C6WdcWbL.mjs.map → email-console-BHNjIwiB.mjs.map} +1 -1
- package/dist/{enrich-CFJJgxs_.mjs → enrich-_ySMEvEE.mjs} +2 -2
- package/dist/{enrich-CFJJgxs_.mjs.map → enrich-_ySMEvEE.mjs.map} +1 -1
- package/dist/{error-oh_9i6bR.mjs → error-DupyJZE2.mjs} +3 -3
- package/dist/{error-oh_9i6bR.mjs.map → error-DupyJZE2.mjs.map} +1 -1
- package/dist/{errors-BucQ8VYz.mjs → errors-CLUPm7aD.mjs} +14 -2
- package/dist/errors-CLUPm7aD.mjs.map +1 -0
- package/dist/{escape-CXps5F_v.mjs → escape-C_aLKP3H.mjs} +1 -1
- package/dist/{escape-CXps5F_v.mjs.map → escape-C_aLKP3H.mjs.map} +1 -1
- package/dist/{field-defs-cache-WD82dMQq.mjs → field-defs-cache-hg6QkjV9.mjs} +4 -4
- package/dist/{field-defs-cache-WD82dMQq.mjs.map → field-defs-cache-hg6QkjV9.mjs.map} +1 -1
- package/dist/{fts-manager-BITakW_R.mjs → fts-manager-CZ-5dVwJ.mjs} +76 -50
- package/dist/fts-manager-CZ-5dVwJ.mjs.map +1 -0
- package/dist/{hreflang-BaLCNcDx.d.mts → hreflang-D3Uehfv2.d.mts} +2 -2
- package/dist/{hreflang-BaLCNcDx.d.mts.map → hreflang-D3Uehfv2.d.mts.map} +1 -1
- package/dist/{hreflang-BdZuVBhL.mjs → hreflang-DNswoYsi.mjs} +7 -7
- package/dist/{hreflang-BdZuVBhL.mjs.map → hreflang-DNswoYsi.mjs.map} +1 -1
- package/dist/{import-C-9uqyT3.mjs → import-B41u8Rot.mjs} +5 -5
- package/dist/{import-C-9uqyT3.mjs.map → import-B41u8Rot.mjs.map} +1 -1
- package/dist/{index-M37iz29I.d.mts → index-C3Y-rsyN.d.mts} +226 -73
- package/dist/index-C3Y-rsyN.d.mts.map +1 -0
- package/dist/{index-MGw47uWq.d.mts → index-Cof4-Fab.d.mts} +5 -10
- package/dist/index-Cof4-Fab.d.mts.map +1 -0
- package/dist/index.d.mts +20 -19
- package/dist/index.mjs +73 -67
- package/dist/{init-lock-DJkX6Hto.mjs → init-lock-6b309ZrF.mjs} +1 -1
- package/dist/{init-lock-DJkX6Hto.mjs.map → init-lock-6b309ZrF.mjs.map} +1 -1
- package/dist/{load-DV1DZuUJ.mjs → load-DmvJrtxS.mjs} +2 -2
- package/dist/{load-DV1DZuUJ.mjs.map → load-DmvJrtxS.mjs.map} +1 -1
- package/dist/{loader-CGugY7Zl.mjs → loader-DLBqRiGP.mjs} +95 -53
- package/dist/loader-DLBqRiGP.mjs.map +1 -0
- package/dist/{manifest-schema-Da7kj23y.mjs → manifest-schema-BXbUAHod.mjs} +1 -1
- package/dist/{manifest-schema-Da7kj23y.mjs.map → manifest-schema-BXbUAHod.mjs.map} +1 -1
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +3 -2
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +6 -5
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-OhYL-7Io.mjs → media-BWWWb8kg.mjs} +92 -3
- package/dist/media-BWWWb8kg.mjs.map +1 -0
- package/dist/{media-BP7S-nHT.mjs → media-CzhAn2--.mjs} +2 -2
- package/dist/{media-BP7S-nHT.mjs.map → media-CzhAn2--.mjs.map} +1 -1
- package/dist/{media-allowlist-D-peH1H5.mjs → media-allowlist-BD6HhgXA.mjs} +14 -3
- package/dist/media-allowlist-BD6HhgXA.mjs.map +1 -0
- package/dist/{media-upload-DtrwU2B0.mjs → media-upload-9yas9zGH.mjs} +10 -8
- package/dist/{media-upload-DtrwU2B0.mjs.map → media-upload-9yas9zGH.mjs.map} +1 -1
- package/dist/{media-url-DYs_YLOx.mjs → media-url-BvoX88FA.mjs} +1 -1
- package/dist/{media-url-DYs_YLOx.mjs.map → media-url-BvoX88FA.mjs.map} +1 -1
- package/dist/{media-usage-BlxfTkN0.mjs → media-usage-De3qvwjc.mjs} +137 -60
- package/dist/media-usage-De3qvwjc.mjs.map +1 -0
- package/dist/media-usage-work-B9Bksh_b.mjs +152 -0
- package/dist/media-usage-work-B9Bksh_b.mjs.map +1 -0
- package/dist/media-usage-work-DrCbqBcl.mjs +424 -0
- package/dist/media-usage-work-DrCbqBcl.mjs.map +1 -0
- package/dist/media-usage-write-fence-aHEgN1zB.mjs +42 -0
- package/dist/media-usage-write-fence-aHEgN1zB.mjs.map +1 -0
- package/dist/{menus-Y54RDPIN.mjs → menus-CC-yn1F9.mjs} +351 -95
- package/dist/menus-CC-yn1F9.mjs.map +1 -0
- package/dist/{menus-BcQWxeXu.mjs → menus-fxvEDYE6.mjs} +3 -3
- package/dist/{menus-BcQWxeXu.mjs.map → menus-fxvEDYE6.mjs.map} +1 -1
- package/dist/{mode-BWyTBe3I.mjs → mode-Bpe-tNNy.mjs} +1 -1
- package/dist/{mode-BWyTBe3I.mjs.map → mode-Bpe-tNNy.mjs.map} +1 -1
- package/dist/{normalize-C-SHXmra.mjs → normalize-Bc-s_r-a.mjs} +1 -1
- package/dist/{normalize-C-SHXmra.mjs.map → normalize-Bc-s_r-a.mjs.map} +1 -1
- package/dist/{oauth-authorization-ClvktmrL.mjs → oauth-authorization-BXO1MKej.mjs} +4 -4
- package/dist/{oauth-authorization-ClvktmrL.mjs.map → oauth-authorization-BXO1MKej.mjs.map} +1 -1
- package/dist/{oauth-clients-8ao-U66l.mjs → oauth-clients-C_DNqtRu.mjs} +1 -1
- package/dist/{oauth-clients-8ao-U66l.mjs.map → oauth-clients-C_DNqtRu.mjs.map} +1 -1
- package/dist/{oauth-state-store-B1ofdTiQ.mjs → oauth-state-store-DwAxMtk4.mjs} +1 -1
- package/dist/{oauth-state-store-B1ofdTiQ.mjs.map → oauth-state-store-DwAxMtk4.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-CscEuIiR.mjs → oauth-user-lookup-BxfZizdk.mjs} +1 -1
- package/dist/{oauth-user-lookup-CscEuIiR.mjs.map → oauth-user-lookup-BxfZizdk.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-CA4eVX6P.d.mts → options-DRe1pIBL.d.mts} +4 -3
- package/dist/options-DRe1pIBL.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-CJKNuewM.mjs → parse-DFbuc-Fh.mjs} +2 -2
- package/dist/{parse-CJKNuewM.mjs.map → parse-DFbuc-Fh.mjs.map} +1 -1
- package/dist/{passkey-config-D-zrzMJI.mjs → passkey-config-_2GOwwK8.mjs} +1 -1
- package/dist/{passkey-config-D-zrzMJI.mjs.map → passkey-config-_2GOwwK8.mjs.map} +1 -1
- package/dist/{placeholder-DaeNS-VG.d.mts → placeholder-CzW7Lshs.d.mts} +1 -1
- package/dist/{placeholder-DaeNS-VG.d.mts.map → placeholder-CzW7Lshs.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +8 -1
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-utils.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +7 -4
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{portable-text-B_kqBmXB.mjs → portable-text-DhKbDAGr.mjs} +1 -1
- package/dist/{portable-text-B_kqBmXB.mjs.map → portable-text-DhKbDAGr.mjs.map} +1 -1
- package/dist/{preview-BU6PaLpM.mjs → preview-PW-nOnq4.mjs} +2 -2
- package/dist/{preview-BU6PaLpM.mjs.map → preview-PW-nOnq4.mjs.map} +1 -1
- package/dist/{public-url-Ox9oOlgp.mjs → public-url-CWoFhQT8.mjs} +1 -1
- package/dist/{public-url-Ox9oOlgp.mjs.map → public-url-CWoFhQT8.mjs.map} +1 -1
- package/dist/{query-C5w7PsRQ.mjs → query-BgjfiLUQ.mjs} +31 -49
- package/dist/query-BgjfiLUQ.mjs.map +1 -0
- package/dist/{query-rC9HKv1N.mjs → query-vgZNwIhh.mjs} +3 -3
- package/dist/{query-rC9HKv1N.mjs.map → query-vgZNwIhh.mjs.map} +1 -1
- package/dist/{rate-limit-kug6q99V.mjs → rate-limit-L5anykgo.mjs} +2 -2
- package/dist/{rate-limit-kug6q99V.mjs.map → rate-limit-L5anykgo.mjs.map} +1 -1
- package/dist/{redirect-DIJxXKOG.mjs → redirect-COsS6SWJ.mjs} +2 -2
- package/dist/{redirect-DIJxXKOG.mjs.map → redirect-COsS6SWJ.mjs.map} +1 -1
- package/dist/{redirect-Egf2R9yP.mjs → redirect-KBNE3UEs.mjs} +1 -1
- package/dist/{redirect-Egf2R9yP.mjs.map → redirect-KBNE3UEs.mjs.map} +1 -1
- package/dist/{redirects-Bzm812bY.mjs → redirects-CufRQt0Q.mjs} +4 -4
- package/dist/{redirects-Bzm812bY.mjs.map → redirects-CufRQt0Q.mjs.map} +1 -1
- package/dist/{redirects-G8wAhWAf.mjs → redirects-cV9g7V-0.mjs} +133 -14
- package/dist/redirects-cV9g7V-0.mjs.map +1 -0
- package/dist/registry-C581V4TP.mjs +1275 -0
- package/dist/registry-C581V4TP.mjs.map +1 -0
- package/dist/{relation-Cbe3Sd3m.mjs → relation-DtmAQH7s.mjs} +3 -3
- package/dist/{relation-Cbe3Sd3m.mjs.map → relation-DtmAQH7s.mjs.map} +1 -1
- package/dist/{relations-Bw_E1TXo.mjs → relations-BBApI4e2.mjs} +3 -3
- package/dist/{relations-Bw_E1TXo.mjs.map → relations-BBApI4e2.mjs.map} +1 -1
- package/dist/{relations-qHwpUe66.mjs → relations-DICSyfsh.mjs} +6 -6
- package/dist/{relations-qHwpUe66.mjs.map → relations-DICSyfsh.mjs.map} +1 -1
- package/dist/{relations-G2ta7GIl.d.mts → relations-DItI3MN9.d.mts} +369 -35
- package/dist/relations-DItI3MN9.d.mts.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/{request-meta-Df-jFbAd.mjs → request-meta-DgZJh3zG.mjs} +2 -2
- package/dist/{request-meta-Df-jFbAd.mjs.map → request-meta-DgZJh3zG.mjs.map} +1 -1
- package/dist/{resolve-DZzG4HqM.mjs → resolve-DOhVEvty.mjs} +2 -2
- package/dist/{resolve-DZzG4HqM.mjs.map → resolve-DOhVEvty.mjs.map} +1 -1
- package/dist/{runner-BFTrkYhu.mjs → runner-BiDvq5dv.mjs} +1157 -254
- package/dist/runner-BiDvq5dv.mjs.map +1 -0
- package/dist/{runner-BaADli8l.d.mts → runner-CgQbELYC.d.mts} +2 -2
- package/dist/{runner-BaADli8l.d.mts.map → runner-CgQbELYC.d.mts.map} +1 -1
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +4 -3
- package/dist/runtime.mjs.map +1 -1
- package/dist/{schema-CiQXr6_F.mjs → schema-BFyTg38T.mjs} +3 -3
- package/dist/{schema-CiQXr6_F.mjs.map → schema-BFyTg38T.mjs.map} +1 -1
- package/dist/schema-CeQSNwB3.mjs +390 -0
- package/dist/schema-CeQSNwB3.mjs.map +1 -0
- package/dist/{scopes-CNJVT5i5.mjs → scopes-BVeuhGBE.mjs} +3 -3
- package/dist/{scopes-CNJVT5i5.mjs.map → scopes-BVeuhGBE.mjs.map} +1 -1
- package/dist/{search-FZhx5dDU.mjs → search-BpuPKZb0.mjs} +25 -15
- package/dist/search-BpuPKZb0.mjs.map +1 -0
- package/dist/{secrets-DLd8RXee.mjs → secrets-dtYs2hDo.mjs} +3 -3
- package/dist/{secrets-DLd8RXee.mjs.map → secrets-dtYs2hDo.mjs.map} +1 -1
- package/dist/{sections-BrIrMUCn.mjs → sections-COctk6hf.mjs} +3 -3
- package/dist/{sections-BrIrMUCn.mjs.map → sections-COctk6hf.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +24 -22
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +16 -15
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-CobNfOvb.mjs → seo-AFpVvTqr.mjs} +5 -3
- package/dist/seo-AFpVvTqr.mjs.map +1 -0
- package/dist/{seo-DTHRntNC.mjs → seo-CvDxfvFb.mjs} +2 -2
- package/dist/{seo-DTHRntNC.mjs.map → seo-CvDxfvFb.mjs.map} +1 -1
- package/dist/{service-B-pYGPgR.mjs → service-xMiMSTsR.mjs} +3 -3
- package/dist/{service-B-pYGPgR.mjs.map → service-xMiMSTsR.mjs.map} +1 -1
- package/dist/{session-user-BvM9-zNl.mjs → session-user-BzVemLkw.mjs} +1 -1
- package/dist/{session-user-BvM9-zNl.mjs.map → session-user-BzVemLkw.mjs.map} +1 -1
- package/dist/{settings-kJhGiQ4z.mjs → settings-B372MV0p.mjs} +4 -4
- package/dist/{settings-kJhGiQ4z.mjs.map → settings-B372MV0p.mjs.map} +1 -1
- package/dist/{settings-DPHau-WH.mjs → settings-BE9aqn_9.mjs} +3 -3
- package/dist/{settings-DPHau-WH.mjs.map → settings-BE9aqn_9.mjs.map} +1 -1
- package/dist/{setup-complete-u50Qm8rY.mjs → setup-complete-DF7TAfD5.mjs} +1 -1
- package/dist/{setup-complete-u50Qm8rY.mjs.map → setup-complete-DF7TAfD5.mjs.map} +1 -1
- package/dist/{setup-nonce-DCjiiOD2.mjs → setup-nonce-Do-U_cg9.mjs} +1 -1
- package/dist/{setup-nonce-DCjiiOD2.mjs.map → setup-nonce-Do-U_cg9.mjs.map} +1 -1
- package/dist/{single-flight-cache-DW3w11Pu.mjs → single-flight-cache-B0eLKS6K.mjs} +2 -2
- package/dist/{single-flight-cache-DW3w11Pu.mjs.map → single-flight-cache-B0eLKS6K.mjs.map} +1 -1
- package/dist/{site-url-I-lJ5kma.mjs → site-url-Bowsi9T-.mjs} +2 -2
- package/dist/{site-url-I-lJ5kma.mjs.map → site-url-Bowsi9T-.mjs.map} +1 -1
- package/dist/slugify-B994zkXC.mjs +17 -0
- package/dist/slugify-B994zkXC.mjs.map +1 -0
- package/dist/{snapshot-I_fjLDaD.mjs → snapshot-B5h6aPMh.mjs} +1 -1
- package/dist/{snapshot-I_fjLDaD.mjs.map → snapshot-B5h6aPMh.mjs.map} +1 -1
- package/dist/{ssrf-CTa6v21i.mjs → ssrf-Cpvg_n3A.mjs} +1 -1
- package/dist/{ssrf-CTa6v21i.mjs.map → ssrf-Cpvg_n3A.mjs.map} +1 -1
- package/dist/{state-CQvoefYP.mjs → state-DYwPue40.mjs} +1 -1
- package/dist/{state-CQvoefYP.mjs.map → state-DYwPue40.mjs.map} +1 -1
- package/dist/{status-CIsmlC1E.mjs → status-CWVYpbD8.mjs} +1 -1
- package/dist/{status-CIsmlC1E.mjs.map → status-CWVYpbD8.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-CLN1N92E.mjs → taxonomies-B0o9ExNV.mjs} +75 -64
- package/dist/taxonomies-B0o9ExNV.mjs.map +1 -0
- package/dist/{taxonomies-CKuaZER5.mjs → taxonomies-Dk3MAklL.mjs} +280 -56
- package/dist/taxonomies-Dk3MAklL.mjs.map +1 -0
- package/dist/{taxonomy-pOrB2kZe.mjs → taxonomy-CPeM8d2o.mjs} +131 -78
- package/dist/taxonomy-CPeM8d2o.mjs.map +1 -0
- package/dist/{tokens-DagaJGK8.mjs → tokens-C39klX8R.mjs} +2 -2
- package/dist/{tokens-DagaJGK8.mjs.map → tokens-C39klX8R.mjs.map} +1 -1
- package/dist/{transport-DVsa5YYo.mjs → transport--CfOflrp.mjs} +1 -1
- package/dist/{transport-DVsa5YYo.mjs.map → transport--CfOflrp.mjs.map} +1 -1
- package/dist/{transport-CAwTaTp_.d.mts → transport-B_rfeU-a.d.mts} +1 -1
- package/dist/{transport-CAwTaTp_.d.mts.map → transport-B_rfeU-a.d.mts.map} +1 -1
- package/dist/{trusted-proxy-D20_7fyX.mjs → trusted-proxy-CEVekpby.mjs} +1 -1
- package/dist/{trusted-proxy-D20_7fyX.mjs.map → trusted-proxy-CEVekpby.mjs.map} +1 -1
- package/dist/{types-NBI3rF-_.mjs → types-75KIqzL9.mjs} +18 -2
- package/dist/types-75KIqzL9.mjs.map +1 -0
- package/dist/{types-CbUcuxxc.d.mts → types-BPuloofb.d.mts} +1 -1
- package/dist/{types-CbUcuxxc.d.mts.map → types-BPuloofb.d.mts.map} +1 -1
- package/dist/{types-BjxTKxrZ.mjs → types-BW1syrlw.mjs} +1 -1
- package/dist/{types-BjxTKxrZ.mjs.map → types-BW1syrlw.mjs.map} +1 -1
- package/dist/{types-BnFP1M3J.d.mts → types-C3_AbkDP.d.mts} +32 -10
- package/dist/types-C3_AbkDP.d.mts.map +1 -0
- package/dist/{types-Dc4ntQjQ.d.mts → types-CAGdePf3.d.mts} +124 -1
- package/dist/types-CAGdePf3.d.mts.map +1 -0
- package/dist/{types-DLG4IFEQ.d.mts → types-CFUfyt1s.d.mts} +1 -1
- package/dist/{types-DLG4IFEQ.d.mts.map → types-CFUfyt1s.d.mts.map} +1 -1
- package/dist/{types-LoagAGzH.d.mts → types-CPx2lIGo.d.mts} +1 -1
- package/dist/{types-LoagAGzH.d.mts.map → types-CPx2lIGo.d.mts.map} +1 -1
- package/dist/{types-Cd8iuS1J.mjs → types-CQPWhPxE.mjs} +9 -12
- package/dist/types-CQPWhPxE.mjs.map +1 -0
- package/dist/{types-Cz8hNch2.d.mts → types-Cs-TFLNf.d.mts} +25 -5
- package/dist/types-Cs-TFLNf.d.mts.map +1 -0
- package/dist/types-CtzytVXn.mjs.map +1 -1
- package/dist/{types-BGWPMiBO.d.mts → types-D4_1Ga4L.d.mts} +44 -5
- package/dist/types-D4_1Ga4L.d.mts.map +1 -0
- package/dist/{types-C8oz_ayJ.d.mts → types-DefV3OiO.d.mts} +1 -1
- package/dist/{types-C8oz_ayJ.d.mts.map → types-DefV3OiO.d.mts.map} +1 -1
- package/dist/{types-BK6U01Ro.d.mts → types-X0MThr7x.d.mts} +1 -1
- package/dist/{types-BK6U01Ro.d.mts.map → types-X0MThr7x.d.mts.map} +1 -1
- package/dist/{upload-attempts-D8QAFLUJ.mjs → upload-attempts-hlne3iA1.mjs} +1 -1
- package/dist/{upload-attempts-D8QAFLUJ.mjs.map → upload-attempts-hlne3iA1.mjs.map} +1 -1
- package/dist/url-pattern-BHS0V5Ng.mjs +33 -0
- package/dist/url-pattern-BHS0V5Ng.mjs.map +1 -0
- package/dist/{user-DBrq4UVq.mjs → user-sHgJ62SP.mjs} +3 -3
- package/dist/{user-DBrq4UVq.mjs.map → user-sHgJ62SP.mjs.map} +1 -1
- package/dist/{utils-hLzi_2Fn.mjs → utils-D4vD_Y98.mjs} +3 -3
- package/dist/{utils-hLzi_2Fn.mjs.map → utils-D4vD_Y98.mjs.map} +1 -1
- package/dist/{validate-mKo3RxBM.mjs → validate-BkqIG_Uj.mjs} +24 -5
- package/dist/validate-BkqIG_Uj.mjs.map +1 -0
- package/dist/{validate-C3oSmA7F.d.mts → validate-DeGtBN84.d.mts} +15 -7
- package/dist/validate-DeGtBN84.d.mts.map +1 -0
- package/dist/{validation-BgpucsvF.mjs → validation-CiJb_X5o.mjs} +11 -10
- package/dist/{validation-BgpucsvF.mjs.map → validation-CiJb_X5o.mjs.map} +1 -1
- package/dist/version-x0NjTScG.mjs +7 -0
- package/dist/{version-C4PnpmoV.mjs.map → version-x0NjTScG.mjs.map} +1 -1
- package/dist/{widgets-CJJtkiKh.mjs → widgets-Cwzvww0W.mjs} +3 -3
- package/dist/{widgets-CJJtkiKh.mjs.map → widgets-Cwzvww0W.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-Bkpp_2tK.d.mts → wxr-taxonomies-CmC0ZsDr.d.mts} +1 -1
- package/dist/{wxr-taxonomies-Bkpp_2tK.d.mts.map → wxr-taxonomies-CmC0ZsDr.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-9PPSy8X6.mjs → wxr-taxonomies-QZjWxjyk.mjs} +13 -32
- package/dist/{wxr-taxonomies-9PPSy8X6.mjs.map → wxr-taxonomies-QZjWxjyk.mjs.map} +1 -1
- package/dist/{zod-generator-CG64Hnbh.mjs → zod-generator-D11MhxG4.mjs} +52 -5
- package/dist/zod-generator-D11MhxG4.mjs.map +1 -0
- package/package.json +16 -8
- package/src/api/errors.ts +12 -0
- package/src/api/handlers/content.ts +127 -29
- package/src/api/handlers/dashboard.ts +12 -2
- package/src/api/handlers/index.ts +16 -0
- package/src/api/handlers/manifest.ts +2 -0
- package/src/api/handlers/media-allowlist.ts +13 -2
- package/src/api/handlers/media-usage-work.ts +188 -0
- package/src/api/handlers/media-usage.ts +5 -3
- package/src/api/handlers/schema.ts +9 -3
- package/src/api/handlers/seo.ts +5 -2
- package/src/api/handlers/taxonomies.ts +345 -82
- package/src/api/media-usage-write-fence.ts +64 -0
- package/src/api/openapi/document.ts +199 -0
- package/src/api/schemas/common.ts +3 -1
- package/src/api/schemas/content.ts +122 -1
- package/src/api/schemas/media-usage.ts +133 -0
- package/src/api/schemas/schema.ts +78 -3
- package/src/api/schemas/taxonomies.ts +40 -8
- package/src/api/types.ts +1 -0
- package/src/astro/integration/index.ts +55 -42
- package/src/astro/integration/routes.ts +34 -4
- package/src/astro/integration/runtime.ts +15 -0
- package/src/astro/integration/virtual-modules.ts +25 -1
- package/src/astro/integration/vite-config.ts +16 -1
- package/src/astro/middleware/media-usage-write-fence.ts +30 -0
- package/src/astro/middleware/redirect.ts +12 -2
- package/src/astro/middleware.ts +75 -8
- package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/work/index.ts +26 -0
- package/src/astro/routes/api/admin/media-usage/work/retry.ts +26 -0
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +67 -31
- package/src/astro/routes/api/import/wordpress/execute.ts +3 -10
- package/src/astro/routes/api/mcp.ts +1 -0
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +7 -1
- package/src/astro/routes/api/schema/collections/[slug]/index.ts +1 -7
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +1 -0
- package/src/astro/routes/api/taxonomies/[name]/translations.ts +48 -0
- package/src/astro/routes/api/taxonomies/[name].ts +102 -0
- package/src/astro/types.ts +25 -4
- package/src/cleanup.ts +6 -12
- package/src/cli/commands/doctor.ts +193 -6
- package/src/cli/commands/export-seed.ts +4 -1
- package/src/client/index.ts +119 -0
- package/src/components/Block.astro +12 -0
- package/src/components/InlinePortableTextEditor.tsx +89 -1
- package/src/content/converters/mark-safety.ts +120 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +25 -16
- package/src/content/converters/prosemirror-to-portable-text.ts +12 -2
- package/src/content-list-query.ts +29 -0
- package/src/database/migrations/060_collection_admin_config.ts +16 -0
- package/src/database/migrations/061_media_usage_cleanup.ts +77 -0
- package/src/database/migrations/062_media_usage_cleanup_fence.ts +295 -0
- package/src/database/migrations/063_media_usage_incremental_work.ts +397 -0
- package/src/database/migrations/064_fts_plain_text.ts +253 -0
- package/src/database/migrations/065_media_usage_collection_deletion.ts +85 -0
- package/src/database/migrations/066_media_usage_reconciliation.ts +115 -0
- package/src/database/migrations/067_indexed_content_fields.ts +39 -0
- package/src/database/migrations/068_content_taxonomy_entry_groups.ts +61 -0
- package/src/database/migrations/069_collection_title_date_fields.ts +45 -0
- package/src/database/migrations/070_collection_routable.ts +18 -0
- package/src/database/migrations/runner.ts +22 -0
- package/src/database/repositories/content.ts +861 -96
- package/src/database/repositories/media-usage-work.ts +848 -0
- package/src/database/repositories/media-usage.ts +1502 -138
- package/src/database/repositories/revision.ts +17 -6
- package/src/database/repositories/taxonomy.ts +234 -103
- package/src/database/repositories/types.ts +51 -2
- package/src/database/types.ts +134 -16
- package/src/db/adapters.ts +28 -0
- package/src/db/index.ts +3 -0
- package/src/emdash-runtime.ts +227 -20
- package/src/fields/file.ts +7 -4
- package/src/fields/image.ts +8 -1
- package/src/fields/types.ts +18 -5
- package/src/i18n/config.ts +32 -0
- package/src/i18n/repair-locale-casing.ts +0 -14
- package/src/i18n/taxonomy-locale-diagnostic.ts +47 -0
- package/src/import/wxr-taxonomies.ts +7 -47
- package/src/index.ts +25 -2
- package/src/loader.ts +119 -65
- package/src/mcp/server.ts +242 -34
- package/src/media/usage/activation.ts +626 -0
- package/src/media/usage/capture-triggers.ts +543 -0
- package/src/media/usage/cleanup.ts +305 -0
- package/src/media/usage/collection-deletion-processor.ts +356 -0
- package/src/media/usage/collection-deletion.ts +836 -0
- package/src/media/usage/content-fields.ts +40 -3
- package/src/media/usage/content-refresh.ts +356 -47
- package/src/media/usage/content-repair.ts +180 -61
- package/src/media/usage/content-snapshots.ts +85 -105
- package/src/media/usage/projection-fingerprint.ts +129 -0
- package/src/media/usage/reconciliation-processor.ts +372 -0
- package/src/media/usage/reconciliation.ts +1117 -0
- package/src/media/usage/source-key.ts +4 -0
- package/src/media/usage/types.ts +2 -0
- package/src/media/usage/work-processor.ts +248 -0
- package/src/menus/index.ts +246 -141
- package/src/plugin-types.ts +8 -0
- package/src/plugins/adapt-sandbox-entry.ts +24 -5
- package/src/plugins/context.ts +24 -7
- package/src/plugins/index.ts +9 -0
- package/src/plugins/routes.ts +43 -1
- package/src/plugins/sandbox/index.ts +10 -1
- package/src/plugins/sandbox/types.ts +78 -1
- package/src/plugins/scheduler/node.ts +13 -1
- package/src/plugins/scheduler/types.ts +2 -0
- package/src/plugins/types.ts +39 -2
- package/src/query.ts +29 -37
- package/src/scheduler-health.ts +46 -0
- package/src/schema/registry.ts +777 -255
- package/src/schema/types.ts +50 -8
- package/src/schema/url-pattern.ts +33 -0
- package/src/schema/zod-generator.ts +77 -5
- package/src/search/fts-manager.ts +117 -76
- package/src/search/query.ts +32 -11
- package/src/search/types.ts +2 -0
- package/src/seed/apply.ts +68 -15
- package/src/seed/types.ts +11 -3
- package/src/seed/validate.ts +52 -2
- package/src/taxonomies/index.ts +77 -75
- package/src/taxonomies/term-counts.ts +21 -8
- package/src/utils/slugify.ts +1 -29
- package/src/virtual-modules.d.ts +16 -0
- package/dist/adapters-BMyNSSZi.d.mts.map +0 -1
- package/dist/api-D2hunekQ.mjs.map +0 -1
- package/dist/apply-kwNEJW2l.mjs.map +0 -1
- package/dist/config-DyF3OKg_.mjs.map +0 -1
- package/dist/content-CJ94NEx5.mjs.map +0 -1
- package/dist/content-refresh-Xw7aKmou.mjs +0 -1629
- package/dist/content-refresh-Xw7aKmou.mjs.map +0 -1
- package/dist/context-C_1nrqnW.mjs.map +0 -1
- package/dist/dashboard-DINnNVVU.mjs.map +0 -1
- package/dist/errors-BucQ8VYz.mjs.map +0 -1
- package/dist/fts-manager-BITakW_R.mjs.map +0 -1
- package/dist/index-M37iz29I.d.mts.map +0 -1
- package/dist/index-MGw47uWq.d.mts.map +0 -1
- package/dist/loader-CGugY7Zl.mjs.map +0 -1
- package/dist/media-OhYL-7Io.mjs.map +0 -1
- package/dist/media-allowlist-D-peH1H5.mjs.map +0 -1
- package/dist/media-usage-BlxfTkN0.mjs.map +0 -1
- package/dist/menus-Y54RDPIN.mjs.map +0 -1
- package/dist/options-CA4eVX6P.d.mts.map +0 -1
- package/dist/query-C5w7PsRQ.mjs.map +0 -1
- package/dist/redirects-G8wAhWAf.mjs.map +0 -1
- package/dist/registry-Dbodb4Uo.mjs +0 -840
- package/dist/registry-Dbodb4Uo.mjs.map +0 -1
- package/dist/relations-G2ta7GIl.d.mts.map +0 -1
- package/dist/runner-BFTrkYhu.mjs.map +0 -1
- package/dist/search-FZhx5dDU.mjs.map +0 -1
- package/dist/seo-CobNfOvb.mjs.map +0 -1
- package/dist/slugify-C_tqlU4G.mjs +0 -30
- package/dist/slugify-C_tqlU4G.mjs.map +0 -1
- package/dist/taxonomies-CKuaZER5.mjs.map +0 -1
- package/dist/taxonomies-CLN1N92E.mjs.map +0 -1
- package/dist/taxonomy-pOrB2kZe.mjs.map +0 -1
- package/dist/types-BGWPMiBO.d.mts.map +0 -1
- package/dist/types-BnFP1M3J.d.mts.map +0 -1
- package/dist/types-Cd8iuS1J.mjs.map +0 -1
- package/dist/types-Cz8hNch2.d.mts.map +0 -1
- package/dist/types-Dc4ntQjQ.d.mts.map +0 -1
- package/dist/types-NBI3rF-_.mjs.map +0 -1
- package/dist/validate-C3oSmA7F.d.mts.map +0 -1
- package/dist/validate-mKo3RxBM.mjs.map +0 -1
- package/dist/version-C4PnpmoV.mjs +0 -7
- package/dist/zod-generator-CG64Hnbh.mjs.map +0 -1
- /package/dist/{api-tokens-Dai9dND0.mjs → api-tokens-CyTsLszZ.mjs} +0 -0
- /package/dist/{ssrf-Cj568Dgs.mjs → ssrf-DpXgKsna.mjs} +0 -0
- /package/dist/{types-DKuWPYV5.mjs → types-CP1CflWf.mjs} +0 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -1,59 +1,57 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as runMigrations, o as __exportAll, r as getMigrationStatus } from "../runner-
|
|
2
|
+
import { a as runMigrations, o as __exportAll, r as getMigrationStatus } from "../runner-BiDvq5dv.mjs";
|
|
3
3
|
import { t as EmDashDatabaseError } from "../errors-9P_FDrJ_.mjs";
|
|
4
4
|
import { t as validateIdentifier } from "../validate-BpwoDOgt.mjs";
|
|
5
5
|
import { u as listTablesLike } from "../dialect-helpers-BSbfaO3F.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { i as isI18nEnabled, r as getI18nConfig } from "../config-C3EBstHi.mjs";
|
|
7
7
|
import "../after-CBU2vkoO.mjs";
|
|
8
8
|
import "../object-cache-71tPfV4A.mjs";
|
|
9
|
-
import { t as ContentRepository } from "../content-
|
|
10
|
-
import { n as isMissingTableError } from "../db-errors-
|
|
11
|
-
import { n as slugify } from "../slugify-
|
|
12
|
-
import { a as encodeBase64url } from "../base64-
|
|
13
|
-
import "../types-
|
|
14
|
-
import { t as MediaRepository } from "../media-
|
|
15
|
-
import { t as TaxonomyRepository } from "../taxonomy-
|
|
9
|
+
import { t as ContentRepository } from "../content-BNfwh7xX.mjs";
|
|
10
|
+
import { n as isMissingTableError } from "../db-errors-Cl-sKYTm.mjs";
|
|
11
|
+
import { n as slugify } from "../slugify-B994zkXC.mjs";
|
|
12
|
+
import { a as encodeBase64url } from "../base64-CvLhUKQv.mjs";
|
|
13
|
+
import "../types-CQPWhPxE.mjs";
|
|
14
|
+
import { t as MediaRepository } from "../media-CzhAn2--.mjs";
|
|
15
|
+
import { t as TaxonomyRepository } from "../taxonomy-CPeM8d2o.mjs";
|
|
16
16
|
import { t as OptionsRepository } from "../options-CBXIHUoT.mjs";
|
|
17
|
-
import "../redirect-
|
|
17
|
+
import "../redirect-COsS6SWJ.mjs";
|
|
18
18
|
import "../request-cache-BSUptuJR.mjs";
|
|
19
|
-
import "../byline-registry-
|
|
20
|
-
import "../field-defs-cache-
|
|
21
|
-
import { t as BylineRepository } from "../byline-
|
|
22
|
-
import "../
|
|
19
|
+
import "../byline-registry-DDun8sxh.mjs";
|
|
20
|
+
import "../field-defs-cache-hg6QkjV9.mjs";
|
|
21
|
+
import { t as BylineRepository } from "../byline-pEcoDps8.mjs";
|
|
22
|
+
import "../dist-D_6CKR8z.mjs";
|
|
23
|
+
import "../fts-manager-CZ-5dVwJ.mjs";
|
|
23
24
|
import { kyselyLogOption } from "../database/instrumentation.mjs";
|
|
24
|
-
import "../loader-
|
|
25
|
-
import "../
|
|
26
|
-
import "../
|
|
27
|
-
import { n as SchemaRegistry } from "../registry-
|
|
28
|
-
import "../settings-
|
|
29
|
-
import { i as pluginManifestSchema } from "../manifest-schema-
|
|
30
|
-
import { i as isDeprecatedCapability,
|
|
31
|
-
import "../ssrf-
|
|
32
|
-
import "../ssrf-
|
|
33
|
-
import { t as validateSeed } from "../validate-
|
|
34
|
-
import { t as applySeed } from "../apply-
|
|
35
|
-
import { n as fingerprintKey, r as generateEncryptionKey, t as EmDashSecretsError } from "../secrets-
|
|
25
|
+
import "../loader-DLBqRiGP.mjs";
|
|
26
|
+
import "../content-refresh-DNERP4-f.mjs";
|
|
27
|
+
import "../collection-deletion-C8BugSGz.mjs";
|
|
28
|
+
import { n as SchemaRegistry } from "../registry-C581V4TP.mjs";
|
|
29
|
+
import "../settings-B372MV0p.mjs";
|
|
30
|
+
import { i as pluginManifestSchema } from "../manifest-schema-BXbUAHod.mjs";
|
|
31
|
+
import { i as isDeprecatedCapability, t as CAPABILITY_RENAMES } from "../types-CP1CflWf.mjs";
|
|
32
|
+
import "../ssrf-Cpvg_n3A.mjs";
|
|
33
|
+
import "../ssrf-DpXgKsna.mjs";
|
|
34
|
+
import { t as validateSeed } from "../validate-BkqIG_Uj.mjs";
|
|
35
|
+
import { t as applySeed } from "../apply-D5zfeD09.mjs";
|
|
36
|
+
import { n as fingerprintKey, r as generateEncryptionKey, t as EmDashSecretsError } from "../secrets-dtYs2hDo.mjs";
|
|
36
37
|
import { LocalStorage } from "../storage/local.mjs";
|
|
37
|
-
import { t as convertDataForRead } from "../portable-text-
|
|
38
|
+
import { t as convertDataForRead } from "../portable-text-DhKbDAGr.mjs";
|
|
38
39
|
import { createHeaderAwareFetch, customHeadersInterceptor, getCachedAccessToken, isAccessRedirect, resolveCustomHeaders, runCloudflaredLogin } from "../client/cf-access.mjs";
|
|
39
40
|
import { EmDashClient } from "../client/index.mjs";
|
|
41
|
+
import { r as fileExists$4, t as bundleCommand } from "../bundle-CBEXrBnb.mjs";
|
|
40
42
|
import { Kysely, SqliteDialect, sql } from "kysely";
|
|
41
|
-
import { imageSize } from "image-size";
|
|
42
|
-
import { z } from "zod";
|
|
43
43
|
import { createGzipDecoder, unpackTar } from "modern-tar";
|
|
44
|
-
import {
|
|
45
|
-
import { basename, dirname,
|
|
46
|
-
import { pathToFileURL } from "node:url";
|
|
44
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
45
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
47
46
|
import BetterSqlite3 from "better-sqlite3";
|
|
48
|
-
import { access,
|
|
47
|
+
import { access, mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
49
48
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
50
49
|
import consola, { consola as consola$1 } from "consola";
|
|
51
50
|
import pc from "picocolors";
|
|
52
51
|
import { spawn } from "node:child_process";
|
|
53
52
|
import { homedir } from "node:os";
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import { packTar } from "modern-tar/fs";
|
|
53
|
+
import { parse, printParseErrorCode } from "jsonc-parser";
|
|
54
|
+
import { parse as parse$1 } from "smol-toml";
|
|
57
55
|
|
|
58
56
|
//#region src/cli/commands/auth.ts
|
|
59
57
|
/**
|
|
@@ -919,7 +917,7 @@ async function readPackageJson$2(cwd) {
|
|
|
919
917
|
return null;
|
|
920
918
|
}
|
|
921
919
|
}
|
|
922
|
-
async function fileExists$
|
|
920
|
+
async function fileExists$3(path) {
|
|
923
921
|
try {
|
|
924
922
|
await access(path);
|
|
925
923
|
return true;
|
|
@@ -971,7 +969,7 @@ const devCommand = defineCommand({
|
|
|
971
969
|
process.exit(1);
|
|
972
970
|
}
|
|
973
971
|
const dbPath = resolve(cwd, args.database);
|
|
974
|
-
if (!await fileExists$
|
|
972
|
+
if (!await fileExists$3(dbPath)) consola.start("Database not found, initializing...");
|
|
975
973
|
const db = createDatabase({ url: `file:${dbPath}` });
|
|
976
974
|
try {
|
|
977
975
|
consola.start("Checking database migrations...");
|
|
@@ -1010,8 +1008,8 @@ const devCommand = defineCommand({
|
|
|
1010
1008
|
"--port",
|
|
1011
1009
|
args.port
|
|
1012
1010
|
];
|
|
1013
|
-
const pnpmLockExists = await fileExists$
|
|
1014
|
-
const yarnLockExists = await fileExists$
|
|
1011
|
+
const pnpmLockExists = await fileExists$3(resolve(cwd, "pnpm-lock.yaml"));
|
|
1012
|
+
const yarnLockExists = await fileExists$3(resolve(cwd, "yarn.lock"));
|
|
1015
1013
|
let cmd;
|
|
1016
1014
|
let cmdArgs;
|
|
1017
1015
|
if (pnpmLockExists) {
|
|
@@ -1053,9 +1051,28 @@ const devCommand = defineCommand({
|
|
|
1053
1051
|
/**
|
|
1054
1052
|
* emdash doctor
|
|
1055
1053
|
*
|
|
1056
|
-
* Diagnose database health
|
|
1054
|
+
* Diagnose database health (connection, migrations, schema integrity) and
|
|
1055
|
+
* Cloudflare Worker scheduler wiring (Cron Trigger + scheduled() handler).
|
|
1057
1056
|
*/
|
|
1058
|
-
|
|
1057
|
+
const WRANGLER_CONFIG_FILES = [
|
|
1058
|
+
"wrangler.jsonc",
|
|
1059
|
+
"wrangler.json",
|
|
1060
|
+
"wrangler.toml"
|
|
1061
|
+
];
|
|
1062
|
+
const CLOUDFLARE_WORKER_MODULE = "@emdash-cms/cloudflare/worker";
|
|
1063
|
+
const WORKER_FIX = `export { default, PluginBridge } from "${CLOUDFLARE_WORKER_MODULE}";`;
|
|
1064
|
+
const MAIN_FIX_JSONC = `"main": "./src/worker.ts"`;
|
|
1065
|
+
const MAIN_FIX_TOML = `main = "./src/worker.ts"`;
|
|
1066
|
+
const TRIGGER_FIX_JSONC = `"triggers": { "crons": ["* * * * *"] }`;
|
|
1067
|
+
const TRIGGER_FIX_TOML = `[triggers]\ncrons = ["* * * * *"]`;
|
|
1068
|
+
const SCHEDULED_HANDLER_PATTERN = /\bscheduled\s*:\s*createScheduledHandler\s*\(/m;
|
|
1069
|
+
function triggerFix(configPath) {
|
|
1070
|
+
return configPath.endsWith(".toml") ? TRIGGER_FIX_TOML : TRIGGER_FIX_JSONC;
|
|
1071
|
+
}
|
|
1072
|
+
function mainFix(configPath) {
|
|
1073
|
+
return configPath.endsWith(".toml") ? MAIN_FIX_TOML : MAIN_FIX_JSONC;
|
|
1074
|
+
}
|
|
1075
|
+
async function fileExists$2(path) {
|
|
1059
1076
|
try {
|
|
1060
1077
|
await access(path);
|
|
1061
1078
|
return true;
|
|
@@ -1063,12 +1080,115 @@ async function fileExists$3(path) {
|
|
|
1063
1080
|
return false;
|
|
1064
1081
|
}
|
|
1065
1082
|
}
|
|
1083
|
+
function isRecord(value) {
|
|
1084
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1085
|
+
}
|
|
1086
|
+
function sourcePosition(source, offset) {
|
|
1087
|
+
const prefix = source.slice(0, offset);
|
|
1088
|
+
return {
|
|
1089
|
+
line: prefix.split("\n").length,
|
|
1090
|
+
column: offset - prefix.lastIndexOf("\n")
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
async function findWranglerConfig(cwd) {
|
|
1094
|
+
for (const filename of WRANGLER_CONFIG_FILES) {
|
|
1095
|
+
const path = resolve(cwd, filename);
|
|
1096
|
+
if (await fileExists$2(path)) return path;
|
|
1097
|
+
}
|
|
1098
|
+
return null;
|
|
1099
|
+
}
|
|
1100
|
+
function workerExportsScheduledMaintenance(source) {
|
|
1101
|
+
const modulePattern = CLOUDFLARE_WORKER_MODULE.replaceAll("/", "\\/");
|
|
1102
|
+
const reExportsWorker = new RegExp(`export\\s*\\{[^}]*\\bdefault\\b[^}]*\\}\\s*from\\s*["']${modulePattern}["']`, "m");
|
|
1103
|
+
const importsFactory = new RegExp(`import\\s+[^;]*\\{[^}]*\\bcreateScheduledHandler\\b[^}]*\\}\\s*from\\s*["']${modulePattern}["']`, "m");
|
|
1104
|
+
return reExportsWorker.test(source) || importsFactory.test(source) && SCHEDULED_HANDLER_PATTERN.test(source);
|
|
1105
|
+
}
|
|
1106
|
+
async function checkSchedulerWiringAtPath(cwd, configPath) {
|
|
1107
|
+
const configSource = await readFile(configPath, "utf8");
|
|
1108
|
+
let parsed;
|
|
1109
|
+
if (configPath.endsWith(".toml")) try {
|
|
1110
|
+
parsed = parse$1(configSource);
|
|
1111
|
+
} catch (error) {
|
|
1112
|
+
return [{
|
|
1113
|
+
name: "scheduler config",
|
|
1114
|
+
status: "fail",
|
|
1115
|
+
message: `could not parse ${configPath}: ${error instanceof Error ? error.message : "invalid TOML"} — fix the Wrangler configuration syntax`
|
|
1116
|
+
}];
|
|
1117
|
+
}
|
|
1118
|
+
else {
|
|
1119
|
+
const parseErrors = [];
|
|
1120
|
+
parsed = parse(configSource, parseErrors, {
|
|
1121
|
+
allowTrailingComma: true,
|
|
1122
|
+
disallowComments: false
|
|
1123
|
+
});
|
|
1124
|
+
if (parseErrors.length > 0) {
|
|
1125
|
+
const error = parseErrors[0];
|
|
1126
|
+
const { line, column } = sourcePosition(configSource, error.offset);
|
|
1127
|
+
return [{
|
|
1128
|
+
name: "scheduler config",
|
|
1129
|
+
status: "fail",
|
|
1130
|
+
message: `could not parse ${configPath}: ${printParseErrorCode(error.error)} at line ${line}, column ${column} — fix the Wrangler configuration syntax`
|
|
1131
|
+
}];
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if (!isRecord(parsed)) return [{
|
|
1135
|
+
name: "scheduler config",
|
|
1136
|
+
status: "fail",
|
|
1137
|
+
message: `could not parse ${configPath}: expected an object — fix the Wrangler configuration syntax`
|
|
1138
|
+
}];
|
|
1139
|
+
const triggers = isRecord(parsed.triggers) ? parsed.triggers : null;
|
|
1140
|
+
const hasCronTrigger = Array.isArray(triggers?.crons) && triggers.crons.some((cron) => typeof cron === "string" && cron.trim().length > 0);
|
|
1141
|
+
const main = typeof parsed.main === "string" && parsed.main.trim() ? parsed.main : null;
|
|
1142
|
+
if (!main) return [{
|
|
1143
|
+
name: "scheduler handler",
|
|
1144
|
+
status: "fail",
|
|
1145
|
+
message: `Wrangler configuration has no Worker entry to inspect — add ${mainFix(configPath)}, then export: ${WORKER_FIX}`
|
|
1146
|
+
}];
|
|
1147
|
+
const workerPath = resolve(cwd, main);
|
|
1148
|
+
let hasScheduledHandler = false;
|
|
1149
|
+
try {
|
|
1150
|
+
hasScheduledHandler = workerExportsScheduledMaintenance(await readFile(workerPath, "utf8"));
|
|
1151
|
+
} catch (error) {
|
|
1152
|
+
if ((isRecord(error) && typeof error.code === "string" ? error.code : null) !== "ENOENT") return [{
|
|
1153
|
+
name: "scheduler handler",
|
|
1154
|
+
status: "fail",
|
|
1155
|
+
message: `could not read Worker entry ${workerPath}: ${error instanceof Error ? error.message : "unknown I/O error"} — check the file path and permissions`
|
|
1156
|
+
}];
|
|
1157
|
+
return [{
|
|
1158
|
+
name: "scheduler handler",
|
|
1159
|
+
status: "fail",
|
|
1160
|
+
message: `Worker entry not found at ${workerPath} — create it with: ${WORKER_FIX}`
|
|
1161
|
+
}];
|
|
1162
|
+
}
|
|
1163
|
+
if (hasCronTrigger && !hasScheduledHandler) return [{
|
|
1164
|
+
name: "scheduler handler",
|
|
1165
|
+
status: "fail",
|
|
1166
|
+
message: `Cron Trigger is configured, but ${main} does not export EmDash scheduled() maintenance — replace its Worker export with: ${WORKER_FIX}`
|
|
1167
|
+
}];
|
|
1168
|
+
if (hasScheduledHandler && !hasCronTrigger) return [{
|
|
1169
|
+
name: "scheduler trigger",
|
|
1170
|
+
status: "fail",
|
|
1171
|
+
message: `EmDash scheduled() handler is exported, but no Cron Trigger is configured — add this to ${configPath}: ${triggerFix(configPath)}`
|
|
1172
|
+
}];
|
|
1173
|
+
if (!hasCronTrigger && !hasScheduledHandler) return [];
|
|
1174
|
+
return [{
|
|
1175
|
+
name: "scheduler wiring",
|
|
1176
|
+
status: "pass",
|
|
1177
|
+
message: `Cron Trigger and scheduled() handler found (${main})`
|
|
1178
|
+
}];
|
|
1179
|
+
}
|
|
1180
|
+
async function checkDoctor(cwd, dbPath) {
|
|
1181
|
+
const results = await checkDatabase(dbPath);
|
|
1182
|
+
const configPath = await findWranglerConfig(cwd);
|
|
1183
|
+
if (configPath) results.push(...await checkSchedulerWiringAtPath(cwd, configPath));
|
|
1184
|
+
return results;
|
|
1185
|
+
}
|
|
1066
1186
|
function printResult(result) {
|
|
1067
1187
|
(result.status === "pass" ? consola.success : result.status === "warn" ? consola.warn : consola.error)(`${result.name}: ${result.message}`);
|
|
1068
1188
|
}
|
|
1069
1189
|
async function checkDatabase(dbPath) {
|
|
1070
1190
|
const results = [];
|
|
1071
|
-
if (!await fileExists$
|
|
1191
|
+
if (!await fileExists$2(dbPath)) {
|
|
1072
1192
|
results.push({
|
|
1073
1193
|
name: "database",
|
|
1074
1194
|
status: "fail",
|
|
@@ -1149,7 +1269,7 @@ async function checkDatabase(dbPath) {
|
|
|
1149
1269
|
const doctorCommand = defineCommand({
|
|
1150
1270
|
meta: {
|
|
1151
1271
|
name: "doctor",
|
|
1152
|
-
description: "Check database health and diagnose issues"
|
|
1272
|
+
description: "Check database health, scheduler wiring, and diagnose issues"
|
|
1153
1273
|
},
|
|
1154
1274
|
args: {
|
|
1155
1275
|
database: {
|
|
@@ -1170,14 +1290,16 @@ const doctorCommand = defineCommand({
|
|
|
1170
1290
|
}
|
|
1171
1291
|
},
|
|
1172
1292
|
async run({ args }) {
|
|
1173
|
-
const
|
|
1293
|
+
const cwd = resolve(args.cwd);
|
|
1294
|
+
const results = await checkDoctor(cwd, resolve(cwd, args.database));
|
|
1295
|
+
const fails = results.filter((result) => result.status === "fail");
|
|
1174
1296
|
if (args.json) {
|
|
1175
1297
|
process.stdout.write(JSON.stringify(results, null, 2) + "\n");
|
|
1298
|
+
if (fails.length > 0) process.exitCode = 1;
|
|
1176
1299
|
return;
|
|
1177
1300
|
}
|
|
1178
1301
|
consola.start("EmDash Doctor\n");
|
|
1179
1302
|
for (const result of results) printResult(result);
|
|
1180
|
-
const fails = results.filter((r) => r.status === "fail");
|
|
1181
1303
|
const warns = results.filter((r) => r.status === "warn");
|
|
1182
1304
|
consola.log("");
|
|
1183
1305
|
if (fails.length === 0 && warns.length === 0) consola.success("All checks passed");
|
|
@@ -1392,8 +1514,10 @@ async function exportCollections(db) {
|
|
|
1392
1514
|
labelSingular: collection.labelSingular || void 0,
|
|
1393
1515
|
description: collection.description || void 0,
|
|
1394
1516
|
icon: collection.icon || void 0,
|
|
1517
|
+
admin: collection.admin,
|
|
1395
1518
|
supports: collection.supports.length > 0 ? collection.supports : void 0,
|
|
1396
1519
|
urlPattern: collection.urlPattern || void 0,
|
|
1520
|
+
routable: collection.routable === false ? false : void 0,
|
|
1397
1521
|
hidden: collection.hidden || void 0,
|
|
1398
1522
|
sortOrder: collection.sortOrder,
|
|
1399
1523
|
fields: fields.map((field) => ({
|
|
@@ -1403,6 +1527,7 @@ async function exportCollections(db) {
|
|
|
1403
1527
|
required: field.required || void 0,
|
|
1404
1528
|
unique: field.unique || void 0,
|
|
1405
1529
|
searchable: field.searchable || void 0,
|
|
1530
|
+
indexed: field.indexed || void 0,
|
|
1406
1531
|
defaultValue: field.defaultValue,
|
|
1407
1532
|
validation: field.validation ? { ...field.validation } : void 0,
|
|
1408
1533
|
widget: field.widget || void 0,
|
|
@@ -1633,7 +1758,7 @@ async function exportContent(db, collections, includeCollections, bylineGroupToS
|
|
|
1633
1758
|
const processedData = processDataForExport(item.data, collection.fields, mediaMap);
|
|
1634
1759
|
const entry = {
|
|
1635
1760
|
id: seedId,
|
|
1636
|
-
slug: item.slug
|
|
1761
|
+
slug: item.slug?.trim() ? item.slug : collection.routable === false ? void 0 : item.id,
|
|
1637
1762
|
status: item.status === "published" || item.status === "draft" ? item.status : void 0,
|
|
1638
1763
|
data: processedData
|
|
1639
1764
|
};
|
|
@@ -1735,7 +1860,7 @@ async function getTaxonomyAssignments(taxonomyRepo, collection, entryId) {
|
|
|
1735
1860
|
*
|
|
1736
1861
|
* Initialize database from template config in package.json
|
|
1737
1862
|
*/
|
|
1738
|
-
async function fileExists$
|
|
1863
|
+
async function fileExists$1(path) {
|
|
1739
1864
|
try {
|
|
1740
1865
|
await access(path);
|
|
1741
1866
|
return true;
|
|
@@ -1826,7 +1951,7 @@ const initCommand = defineCommand({
|
|
|
1826
1951
|
if (alreadyInitialized && args.force) consola.warn("Re-initializing (--force)...");
|
|
1827
1952
|
if (config?.schema) {
|
|
1828
1953
|
const schemaPath = resolve(cwd, config.schema);
|
|
1829
|
-
if (await fileExists$
|
|
1954
|
+
if (await fileExists$1(schemaPath)) {
|
|
1830
1955
|
consola.start(`Running schema: ${config.schema}`);
|
|
1831
1956
|
try {
|
|
1832
1957
|
await runSqlFile(db, schemaPath);
|
|
@@ -2474,653 +2599,6 @@ const menuCommand = defineCommand({
|
|
|
2474
2599
|
}
|
|
2475
2600
|
});
|
|
2476
2601
|
|
|
2477
|
-
//#endregion
|
|
2478
|
-
//#region src/cli/commands/bundle-utils.ts
|
|
2479
|
-
/**
|
|
2480
|
-
* Bundle utility functions
|
|
2481
|
-
*
|
|
2482
|
-
* Shared logic extracted from the bundle command so it can be tested
|
|
2483
|
-
* without the CLI harness and tsdown dependency.
|
|
2484
|
-
*/
|
|
2485
|
-
const MAX_BUNDLE_SIZE = 256 * 1024;
|
|
2486
|
-
const MAX_FILE_SIZE = 128 * 1024;
|
|
2487
|
-
const MAX_FILE_COUNT = 20;
|
|
2488
|
-
const MAX_SCREENSHOTS = 5;
|
|
2489
|
-
const MAX_SCREENSHOT_WIDTH = 1920;
|
|
2490
|
-
const MAX_SCREENSHOT_HEIGHT = 1080;
|
|
2491
|
-
const ICON_SIZE = 256;
|
|
2492
|
-
const MCP_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
2493
|
-
/**
|
|
2494
|
-
* Matches Node.js built-in imports in bundled output:
|
|
2495
|
-
* - require("node:xxx") / require("xxx")
|
|
2496
|
-
* - import("node:xxx") / import("xxx")
|
|
2497
|
-
* - import X from "node:xxx" / import { X } from "node:xxx"
|
|
2498
|
-
* - import * as X from "node:xxx"
|
|
2499
|
-
* - export { X } from "node:xxx"
|
|
2500
|
-
* Captures the base module name (e.g. "fs" from "node:fs/promises").
|
|
2501
|
-
*/
|
|
2502
|
-
const NODE_BUILTIN_IMPORT_RE = /(?:import|export|require)\s*(?:\(|[^(]*?\bfrom\s+)["'](?:node:)?([a-z_]+)(?:\/[^"']*)?\s*["']\)?/g;
|
|
2503
|
-
const LEADING_DOT_SLASH_RE = /^\.\//;
|
|
2504
|
-
const DIST_PREFIX_RE = /^dist\//;
|
|
2505
|
-
const MJS_EXT_RE = /\.m?js$/;
|
|
2506
|
-
const TS_TO_TSX_RE = /\.ts$/;
|
|
2507
|
-
/** Node.js built-in modules that shouldn't appear in sandbox code */
|
|
2508
|
-
const NODE_BUILTINS = new Set([
|
|
2509
|
-
"assert",
|
|
2510
|
-
"buffer",
|
|
2511
|
-
"child_process",
|
|
2512
|
-
"cluster",
|
|
2513
|
-
"crypto",
|
|
2514
|
-
"dgram",
|
|
2515
|
-
"dns",
|
|
2516
|
-
"domain",
|
|
2517
|
-
"events",
|
|
2518
|
-
"fs",
|
|
2519
|
-
"http",
|
|
2520
|
-
"http2",
|
|
2521
|
-
"https",
|
|
2522
|
-
"inspector",
|
|
2523
|
-
"module",
|
|
2524
|
-
"net",
|
|
2525
|
-
"os",
|
|
2526
|
-
"path",
|
|
2527
|
-
"perf_hooks",
|
|
2528
|
-
"process",
|
|
2529
|
-
"punycode",
|
|
2530
|
-
"querystring",
|
|
2531
|
-
"readline",
|
|
2532
|
-
"repl",
|
|
2533
|
-
"stream",
|
|
2534
|
-
"string_decoder",
|
|
2535
|
-
"sys",
|
|
2536
|
-
"timers",
|
|
2537
|
-
"tls",
|
|
2538
|
-
"trace_events",
|
|
2539
|
-
"tty",
|
|
2540
|
-
"url",
|
|
2541
|
-
"util",
|
|
2542
|
-
"v8",
|
|
2543
|
-
"vm",
|
|
2544
|
-
"wasi",
|
|
2545
|
-
"worker_threads",
|
|
2546
|
-
"zlib"
|
|
2547
|
-
]);
|
|
2548
|
-
async function fileExists$1(path) {
|
|
2549
|
-
try {
|
|
2550
|
-
await access(path);
|
|
2551
|
-
return true;
|
|
2552
|
-
} catch {
|
|
2553
|
-
return false;
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
/** Convert an absolute build artifact path into a portable ESM import specifier. */
|
|
2557
|
-
function toFileImportSpecifier(path) {
|
|
2558
|
-
return pathToFileURL(path).href;
|
|
2559
|
-
}
|
|
2560
|
-
/**
|
|
2561
|
-
* Read image dimensions from a buffer.
|
|
2562
|
-
* Returns [width, height] or null if the format is unrecognized.
|
|
2563
|
-
*/
|
|
2564
|
-
function readImageDimensions(buf) {
|
|
2565
|
-
try {
|
|
2566
|
-
const result = imageSize(buf);
|
|
2567
|
-
if (result.width != null && result.height != null) return [result.width, result.height];
|
|
2568
|
-
return null;
|
|
2569
|
-
} catch {
|
|
2570
|
-
return null;
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
/**
|
|
2574
|
-
* Extract manifest metadata from a ResolvedPlugin.
|
|
2575
|
-
* Strips functions (hooks, route handlers) and keeps only serializable metadata.
|
|
2576
|
-
*/
|
|
2577
|
-
function extractManifest(plugin) {
|
|
2578
|
-
const hooks = [];
|
|
2579
|
-
for (const [name, resolved] of Object.entries(plugin.hooks)) {
|
|
2580
|
-
if (!resolved) continue;
|
|
2581
|
-
if (resolved.exclusive || resolved.priority !== 100 || resolved.timeout !== 5e3) {
|
|
2582
|
-
const entry = { name };
|
|
2583
|
-
if (resolved.exclusive) entry.exclusive = true;
|
|
2584
|
-
if (resolved.priority !== 100) entry.priority = resolved.priority;
|
|
2585
|
-
if (resolved.timeout !== 5e3) entry.timeout = resolved.timeout;
|
|
2586
|
-
hooks.push(entry);
|
|
2587
|
-
} else hooks.push(name);
|
|
2588
|
-
}
|
|
2589
|
-
const routes = Object.entries(plugin.routes).map(([name, route]) => {
|
|
2590
|
-
if (route.public === void 0 && route.permission === void 0 && route.cacheControl === void 0) return name;
|
|
2591
|
-
const entry = { name };
|
|
2592
|
-
if (route.public !== void 0) entry.public = route.public;
|
|
2593
|
-
if (route.permission !== void 0) entry.permission = route.permission;
|
|
2594
|
-
if (route.cacheControl !== void 0) entry.cacheControl = route.cacheControl;
|
|
2595
|
-
return entry;
|
|
2596
|
-
});
|
|
2597
|
-
const tools = Object.entries(plugin.mcp?.tools ?? {}).map(([name, tool]) => {
|
|
2598
|
-
if (!MCP_TOOL_NAME_PATTERN.test(name)) throw new Error(`Invalid MCP tool name "${name}"`);
|
|
2599
|
-
const route = plugin.routes[tool.route];
|
|
2600
|
-
if (!route?.permission || route.public) throw new Error(`MCP tool "${name}" must reference a private route with a permission`);
|
|
2601
|
-
return {
|
|
2602
|
-
name,
|
|
2603
|
-
description: tool.description,
|
|
2604
|
-
route: tool.route,
|
|
2605
|
-
permission: route.permission,
|
|
2606
|
-
destructive: tool.destructive ?? false,
|
|
2607
|
-
inputSchema: z.toJSONSchema(tool.input, { target: "draft-7" }),
|
|
2608
|
-
...tool.output ? { outputSchema: z.toJSONSchema(tool.output, { target: "draft-7" }) } : {}
|
|
2609
|
-
};
|
|
2610
|
-
});
|
|
2611
|
-
return {
|
|
2612
|
-
id: plugin.id,
|
|
2613
|
-
version: plugin.version,
|
|
2614
|
-
declaredAccess: capabilitiesToDeclaredAccess(plugin.capabilities, plugin.allowedHosts),
|
|
2615
|
-
capabilities: plugin.capabilities,
|
|
2616
|
-
allowedHosts: plugin.allowedHosts,
|
|
2617
|
-
storage: plugin.storage,
|
|
2618
|
-
hooks,
|
|
2619
|
-
routes,
|
|
2620
|
-
...tools.length > 0 ? { mcp: { tools } } : {},
|
|
2621
|
-
admin: {
|
|
2622
|
-
settingsSchema: plugin.admin.settingsSchema,
|
|
2623
|
-
pages: plugin.admin.pages,
|
|
2624
|
-
widgets: plugin.admin.widgets
|
|
2625
|
-
}
|
|
2626
|
-
};
|
|
2627
|
-
}
|
|
2628
|
-
/**
|
|
2629
|
-
* Scan bundled code for Node.js built-in imports.
|
|
2630
|
-
* Matches require("node:xxx"), require("xxx"), import("node:xxx") — the patterns
|
|
2631
|
-
* that appear in bundled ESM/CJS output (not source-level named imports).
|
|
2632
|
-
* Returns deduplicated array of built-in module names found.
|
|
2633
|
-
*/
|
|
2634
|
-
function findNodeBuiltinImports(code) {
|
|
2635
|
-
const found = [];
|
|
2636
|
-
NODE_BUILTIN_IMPORT_RE.lastIndex = 0;
|
|
2637
|
-
let match;
|
|
2638
|
-
while ((match = NODE_BUILTIN_IMPORT_RE.exec(code)) !== null) {
|
|
2639
|
-
const mod = match[1];
|
|
2640
|
-
if (NODE_BUILTINS.has(mod)) found.push(mod);
|
|
2641
|
-
}
|
|
2642
|
-
return [...new Set(found)];
|
|
2643
|
-
}
|
|
2644
|
-
/**
|
|
2645
|
-
* Find a build output file by base name, checking common extensions.
|
|
2646
|
-
* tsdown may output .mjs, .js, or .cjs depending on format and config.
|
|
2647
|
-
*/
|
|
2648
|
-
async function findBuildOutput(dir, baseName) {
|
|
2649
|
-
for (const ext of [
|
|
2650
|
-
".mjs",
|
|
2651
|
-
".js",
|
|
2652
|
-
".cjs"
|
|
2653
|
-
]) {
|
|
2654
|
-
const candidate = join(dir, `${baseName}${ext}`);
|
|
2655
|
-
if (await fileExists$1(candidate)) return candidate;
|
|
2656
|
-
}
|
|
2657
|
-
}
|
|
2658
|
-
/**
|
|
2659
|
-
* Resolve a dist/built path back to its source .ts/.tsx equivalent.
|
|
2660
|
-
* E.g., "./dist/index.mjs" → "src/index.ts"
|
|
2661
|
-
*/
|
|
2662
|
-
async function resolveSourceEntry(pluginDir, distPath) {
|
|
2663
|
-
const cleaned = distPath.replace(LEADING_DOT_SLASH_RE, "");
|
|
2664
|
-
const srcPath = cleaned.replace(DIST_PREFIX_RE, "src/").replace(MJS_EXT_RE, ".ts");
|
|
2665
|
-
const srcFull = resolve(pluginDir, srcPath);
|
|
2666
|
-
if (await fileExists$1(srcFull)) return srcFull;
|
|
2667
|
-
const tsxFull = resolve(pluginDir, srcPath.replace(TS_TO_TSX_RE, ".tsx"));
|
|
2668
|
-
if (await fileExists$1(tsxFull)) return tsxFull;
|
|
2669
|
-
const direct = resolve(pluginDir, cleaned);
|
|
2670
|
-
if (await fileExists$1(direct)) return direct;
|
|
2671
|
-
}
|
|
2672
|
-
const TS_SOURCE_EXPORT_RE = /\.(?:ts|tsx|mts|cts|jsx)$/;
|
|
2673
|
-
/**
|
|
2674
|
-
* Find package.json exports that point to source files instead of built output.
|
|
2675
|
-
* Returns an array of `{ exportPath, resolvedPath }` for each offending export.
|
|
2676
|
-
*/
|
|
2677
|
-
function findSourceExports(exports) {
|
|
2678
|
-
const issues = [];
|
|
2679
|
-
for (const [exportPath, exportValue] of Object.entries(exports)) {
|
|
2680
|
-
const resolved = typeof exportValue === "string" ? exportValue : exportValue && typeof exportValue === "object" && "import" in exportValue ? exportValue.import : null;
|
|
2681
|
-
if (resolved && TS_SOURCE_EXPORT_RE.test(resolved)) issues.push({
|
|
2682
|
-
exportPath,
|
|
2683
|
-
resolvedPath: resolved
|
|
2684
|
-
});
|
|
2685
|
-
}
|
|
2686
|
-
return issues;
|
|
2687
|
-
}
|
|
2688
|
-
/**
|
|
2689
|
-
* Recursively walk a staging directory and return a flat list of all files
|
|
2690
|
-
* with sizes. Names are relative to `dir` so they match what would appear
|
|
2691
|
-
* as the tarball entry name.
|
|
2692
|
-
*/
|
|
2693
|
-
async function collectBundleEntries(dir) {
|
|
2694
|
-
const entries = [];
|
|
2695
|
-
await walkBundle(dir, "", entries);
|
|
2696
|
-
return entries;
|
|
2697
|
-
}
|
|
2698
|
-
async function walkBundle(dir, prefix, into) {
|
|
2699
|
-
const items = await readdir(dir, { withFileTypes: true });
|
|
2700
|
-
for (const item of items) {
|
|
2701
|
-
const fullPath = join(dir, item.name);
|
|
2702
|
-
const relPath = prefix ? `${prefix}/${item.name}` : item.name;
|
|
2703
|
-
if (item.isFile()) {
|
|
2704
|
-
const s = await stat(fullPath);
|
|
2705
|
-
into.push({
|
|
2706
|
-
name: relPath,
|
|
2707
|
-
bytes: s.size
|
|
2708
|
-
});
|
|
2709
|
-
} else if (item.isDirectory()) await walkBundle(fullPath, relPath, into);
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
/**
|
|
2713
|
-
* Sum the byte sizes of all entries.
|
|
2714
|
-
*/
|
|
2715
|
-
function totalBundleBytes(entries) {
|
|
2716
|
-
let total = 0;
|
|
2717
|
-
for (const e of entries) total += e.bytes;
|
|
2718
|
-
return total;
|
|
2719
|
-
}
|
|
2720
|
-
/**
|
|
2721
|
-
* Check a bundle against the three size caps from RFC 0001:
|
|
2722
|
-
* - total decompressed ≤ MAX_BUNDLE_SIZE
|
|
2723
|
-
* - per-file decompressed ≤ MAX_FILE_SIZE
|
|
2724
|
-
* - file count ≤ MAX_FILE_COUNT
|
|
2725
|
-
*
|
|
2726
|
-
* Returns a list of violation messages (empty if the bundle is within all
|
|
2727
|
-
* caps). Messages are deterministic per input — the total/count violations
|
|
2728
|
-
* come first, then oversized files in alphabetical order — so the same
|
|
2729
|
-
* bundle always produces the same error text.
|
|
2730
|
-
*/
|
|
2731
|
-
function validateBundleSize(entries) {
|
|
2732
|
-
const violations = [];
|
|
2733
|
-
const total = totalBundleBytes(entries);
|
|
2734
|
-
if (total > MAX_BUNDLE_SIZE) violations.push(`Bundle size ${formatBytes(total)} exceeds maximum of ${formatBytes(MAX_BUNDLE_SIZE)}.`);
|
|
2735
|
-
if (entries.length > MAX_FILE_COUNT) violations.push(`Bundle contains ${entries.length} files, exceeds maximum of ${MAX_FILE_COUNT}.`);
|
|
2736
|
-
const oversized = entries.filter((e) => e.bytes > MAX_FILE_SIZE).toSorted((a, b) => a.name.localeCompare(b.name));
|
|
2737
|
-
for (const e of oversized) violations.push(`File ${e.name} is ${formatBytes(e.bytes)}, exceeds per-file maximum of ${formatBytes(MAX_FILE_SIZE)}.`);
|
|
2738
|
-
return violations;
|
|
2739
|
-
}
|
|
2740
|
-
/**
|
|
2741
|
-
* Render a byte count as a human-friendly string (e.g. "256.0 KB").
|
|
2742
|
-
*/
|
|
2743
|
-
function formatBytes(n) {
|
|
2744
|
-
if (n < 1024) return `${n} B`;
|
|
2745
|
-
if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
|
2746
|
-
return `${(n / 1024 / 1024).toFixed(2)} MB`;
|
|
2747
|
-
}
|
|
2748
|
-
/**
|
|
2749
|
-
* Create a gzipped tarball from a directory.
|
|
2750
|
-
*/
|
|
2751
|
-
async function createTarball(sourceDir, outputPath) {
|
|
2752
|
-
const { createGzip } = await import("node:zlib");
|
|
2753
|
-
await pipeline(packTar(sourceDir), createGzip({ level: 9 }), createWriteStream(outputPath));
|
|
2754
|
-
}
|
|
2755
|
-
|
|
2756
|
-
//#endregion
|
|
2757
|
-
//#region src/cli/commands/bundle.ts
|
|
2758
|
-
/**
|
|
2759
|
-
* emdash plugin bundle
|
|
2760
|
-
*
|
|
2761
|
-
* Produces a publishable plugin tarball from a plugin source directory.
|
|
2762
|
-
*
|
|
2763
|
-
* Steps:
|
|
2764
|
-
* 1. Resolve plugin entrypoint (finds definePlugin() export)
|
|
2765
|
-
* 2. Bundle backend code with tsdown → backend.js (single ES module, tree-shaken)
|
|
2766
|
-
* 3. Bundle admin code if present → admin.js
|
|
2767
|
-
* 4. Extract manifest from definePlugin() → manifest.json
|
|
2768
|
-
* 5. Collect assets (README.md, icon.png, screenshots/)
|
|
2769
|
-
* 6. Validate bundle (manifest schema, size limits, no Node.js builtins)
|
|
2770
|
-
* 7. Create tarball ({id}-{version}.tar.gz)
|
|
2771
|
-
*/
|
|
2772
|
-
var bundle_exports = /* @__PURE__ */ __exportAll({ bundleCommand: () => bundleCommand });
|
|
2773
|
-
const TS_EXT_RE = /\.(tsx?|[mc]?js)$/;
|
|
2774
|
-
const SLASH_RE = /\//g;
|
|
2775
|
-
const LEADING_AT_RE = /^@/;
|
|
2776
|
-
const emdash_SCOPE_RE = /^@emdash-cms\//;
|
|
2777
|
-
const bundleCommand = defineCommand({
|
|
2778
|
-
meta: {
|
|
2779
|
-
name: "bundle",
|
|
2780
|
-
description: "Bundle a plugin for marketplace distribution"
|
|
2781
|
-
},
|
|
2782
|
-
args: {
|
|
2783
|
-
dir: {
|
|
2784
|
-
type: "string",
|
|
2785
|
-
description: "Plugin directory (default: current directory)",
|
|
2786
|
-
default: process.cwd()
|
|
2787
|
-
},
|
|
2788
|
-
outDir: {
|
|
2789
|
-
type: "string",
|
|
2790
|
-
alias: "o",
|
|
2791
|
-
description: "Output directory for the tarball (default: ./dist)",
|
|
2792
|
-
default: "dist"
|
|
2793
|
-
},
|
|
2794
|
-
validateOnly: {
|
|
2795
|
-
type: "boolean",
|
|
2796
|
-
description: "Run validation only, skip tarball creation",
|
|
2797
|
-
default: false
|
|
2798
|
-
}
|
|
2799
|
-
},
|
|
2800
|
-
async run({ args }) {
|
|
2801
|
-
const pluginDir = resolve(args.dir);
|
|
2802
|
-
const outDir = resolve(pluginDir, args.outDir);
|
|
2803
|
-
const validateOnly = args.validateOnly;
|
|
2804
|
-
consola.start(validateOnly ? "Validating plugin..." : "Bundling plugin...");
|
|
2805
|
-
const pkgPath = join(pluginDir, "package.json");
|
|
2806
|
-
if (!await fileExists$1(pkgPath)) {
|
|
2807
|
-
consola.error("No package.json found in", pluginDir);
|
|
2808
|
-
process.exit(1);
|
|
2809
|
-
}
|
|
2810
|
-
const pkg = JSON.parse(await readFile(pkgPath, "utf-8"));
|
|
2811
|
-
let backendEntry;
|
|
2812
|
-
let adminEntry;
|
|
2813
|
-
if (pkg.exports) {
|
|
2814
|
-
const sandboxExport = pkg.exports["./sandbox"];
|
|
2815
|
-
if (typeof sandboxExport === "string") backendEntry = await resolveSourceEntry(pluginDir, sandboxExport);
|
|
2816
|
-
else if (sandboxExport && typeof sandboxExport === "object" && "import" in sandboxExport) backendEntry = await resolveSourceEntry(pluginDir, sandboxExport.import);
|
|
2817
|
-
const adminExport = pkg.exports["./admin"];
|
|
2818
|
-
if (typeof adminExport === "string") adminEntry = await resolveSourceEntry(pluginDir, adminExport);
|
|
2819
|
-
else if (adminExport && typeof adminExport === "object" && "import" in adminExport) adminEntry = await resolveSourceEntry(pluginDir, adminExport.import);
|
|
2820
|
-
}
|
|
2821
|
-
if (!backendEntry) {
|
|
2822
|
-
const defaultSandbox = join(pluginDir, "src/sandbox-entry.ts");
|
|
2823
|
-
if (await fileExists$1(defaultSandbox)) backendEntry = defaultSandbox;
|
|
2824
|
-
}
|
|
2825
|
-
let mainEntry;
|
|
2826
|
-
if (pkg.exports?.["."] !== void 0) {
|
|
2827
|
-
const mainExport = pkg.exports["."];
|
|
2828
|
-
if (typeof mainExport === "string") mainEntry = await resolveSourceEntry(pluginDir, mainExport);
|
|
2829
|
-
else if (mainExport && typeof mainExport === "object" && "import" in mainExport) mainEntry = await resolveSourceEntry(pluginDir, mainExport.import);
|
|
2830
|
-
}
|
|
2831
|
-
if (!mainEntry && pkg.main) mainEntry = await resolveSourceEntry(pluginDir, pkg.main);
|
|
2832
|
-
if (!mainEntry) {
|
|
2833
|
-
const defaultMain = join(pluginDir, "src/index.ts");
|
|
2834
|
-
if (await fileExists$1(defaultMain)) mainEntry = defaultMain;
|
|
2835
|
-
}
|
|
2836
|
-
if (!mainEntry) {
|
|
2837
|
-
consola.error("Cannot find plugin entrypoint. Expected src/index.ts or main/exports in package.json");
|
|
2838
|
-
process.exit(1);
|
|
2839
|
-
}
|
|
2840
|
-
consola.info(`Main entry: ${mainEntry}`);
|
|
2841
|
-
if (backendEntry) consola.info(`Backend entry: ${backendEntry}`);
|
|
2842
|
-
if (adminEntry) consola.info(`Admin entry: ${adminEntry}`);
|
|
2843
|
-
consola.start("Extracting plugin manifest...");
|
|
2844
|
-
const { build } = await import("tsdown");
|
|
2845
|
-
const tmpDir = join(pluginDir, ".emdash-bundle-tmp");
|
|
2846
|
-
try {
|
|
2847
|
-
await rm(tmpDir, {
|
|
2848
|
-
recursive: true,
|
|
2849
|
-
force: true
|
|
2850
|
-
});
|
|
2851
|
-
await mkdir(tmpDir, { recursive: true });
|
|
2852
|
-
const mainOutDir = join(tmpDir, "main");
|
|
2853
|
-
await build({
|
|
2854
|
-
config: false,
|
|
2855
|
-
entry: [mainEntry],
|
|
2856
|
-
format: "esm",
|
|
2857
|
-
outDir: mainOutDir,
|
|
2858
|
-
dts: false,
|
|
2859
|
-
platform: "node",
|
|
2860
|
-
external: ["emdash", emdash_SCOPE_RE]
|
|
2861
|
-
});
|
|
2862
|
-
const pluginNodeModules = join(pluginDir, "node_modules");
|
|
2863
|
-
const tmpNodeModules = join(mainOutDir, "node_modules");
|
|
2864
|
-
if (await fileExists$1(pluginNodeModules)) await symlink(pluginNodeModules, tmpNodeModules, "junction");
|
|
2865
|
-
const mainOutputPath = await findBuildOutput(mainOutDir, basename(mainEntry).replace(TS_EXT_RE, ""));
|
|
2866
|
-
if (!mainOutputPath) {
|
|
2867
|
-
consola.error("Failed to build main entry — no output found in", mainOutDir);
|
|
2868
|
-
process.exit(1);
|
|
2869
|
-
}
|
|
2870
|
-
const pluginModule = await import(toFileImportSpecifier(mainOutputPath));
|
|
2871
|
-
let resolvedPlugin;
|
|
2872
|
-
if (typeof pluginModule.createPlugin === "function") resolvedPlugin = pluginModule.createPlugin();
|
|
2873
|
-
else if (typeof pluginModule.default === "function") resolvedPlugin = pluginModule.default();
|
|
2874
|
-
else if (typeof pluginModule.default === "object" && pluginModule.default !== null) {
|
|
2875
|
-
const defaultExport = pluginModule.default;
|
|
2876
|
-
if ("id" in defaultExport && "version" in defaultExport) resolvedPlugin = defaultExport;
|
|
2877
|
-
}
|
|
2878
|
-
if (!resolvedPlugin) for (const [key, value] of Object.entries(pluginModule)) {
|
|
2879
|
-
if (key === "default" || typeof value !== "function") continue;
|
|
2880
|
-
try {
|
|
2881
|
-
const result = value();
|
|
2882
|
-
if (result && typeof result === "object" && "id" in result && "version" in result) {
|
|
2883
|
-
resolvedPlugin = {
|
|
2884
|
-
id: result.id,
|
|
2885
|
-
version: result.version,
|
|
2886
|
-
capabilities: result.capabilities ?? [],
|
|
2887
|
-
allowedHosts: result.allowedHosts ?? [],
|
|
2888
|
-
storage: result.storage ?? {},
|
|
2889
|
-
hooks: {},
|
|
2890
|
-
routes: {},
|
|
2891
|
-
admin: {
|
|
2892
|
-
pages: result.adminPages,
|
|
2893
|
-
widgets: result.adminWidgets
|
|
2894
|
-
}
|
|
2895
|
-
};
|
|
2896
|
-
if (backendEntry) {
|
|
2897
|
-
const backendProbeDir = join(tmpDir, "backend-probe");
|
|
2898
|
-
const probeShimDir = join(tmpDir, "probe-shims");
|
|
2899
|
-
await mkdir(probeShimDir, { recursive: true });
|
|
2900
|
-
await writeFile(join(probeShimDir, "emdash.mjs"), "export const definePlugin = (d) => d;\n");
|
|
2901
|
-
await build({
|
|
2902
|
-
config: false,
|
|
2903
|
-
entry: [backendEntry],
|
|
2904
|
-
format: "esm",
|
|
2905
|
-
outDir: backendProbeDir,
|
|
2906
|
-
dts: false,
|
|
2907
|
-
platform: "neutral",
|
|
2908
|
-
external: [],
|
|
2909
|
-
alias: { emdash: join(probeShimDir, "emdash.mjs") },
|
|
2910
|
-
treeshake: true
|
|
2911
|
-
});
|
|
2912
|
-
const backendProbePath = await findBuildOutput(backendProbeDir, basename(backendEntry).replace(TS_EXT_RE, ""));
|
|
2913
|
-
if (backendProbePath) {
|
|
2914
|
-
const standardDef = (await import(toFileImportSpecifier(backendProbePath))).default ?? {};
|
|
2915
|
-
const hooks = standardDef.hooks;
|
|
2916
|
-
const routes = standardDef.routes;
|
|
2917
|
-
if (hooks) for (const hookName of Object.keys(hooks)) {
|
|
2918
|
-
const hookEntry = hooks[hookName];
|
|
2919
|
-
const isConfig = typeof hookEntry === "object" && hookEntry !== null && "handler" in hookEntry;
|
|
2920
|
-
const config = isConfig ? hookEntry : {};
|
|
2921
|
-
resolvedPlugin.hooks[hookName] = {
|
|
2922
|
-
handler: isConfig ? hookEntry.handler : hookEntry,
|
|
2923
|
-
priority: config.priority ?? 100,
|
|
2924
|
-
timeout: config.timeout ?? 5e3,
|
|
2925
|
-
dependencies: config.dependencies ?? [],
|
|
2926
|
-
errorPolicy: config.errorPolicy ?? "abort",
|
|
2927
|
-
exclusive: config.exclusive ?? false,
|
|
2928
|
-
pluginId: result.id
|
|
2929
|
-
};
|
|
2930
|
-
}
|
|
2931
|
-
if (routes) for (const [name, route] of Object.entries(routes)) {
|
|
2932
|
-
const routeObj = route;
|
|
2933
|
-
resolvedPlugin.routes[name] = {
|
|
2934
|
-
handler: routeObj.handler,
|
|
2935
|
-
public: routeObj.public,
|
|
2936
|
-
cacheControl: routeObj.cacheControl
|
|
2937
|
-
};
|
|
2938
|
-
}
|
|
2939
|
-
}
|
|
2940
|
-
}
|
|
2941
|
-
break;
|
|
2942
|
-
}
|
|
2943
|
-
} catch {}
|
|
2944
|
-
}
|
|
2945
|
-
if (!resolvedPlugin?.id || !resolvedPlugin?.version) {
|
|
2946
|
-
consola.error("Could not extract plugin definition. Expected one of:\n - createPlugin() export (native format)\n - Descriptor factory function returning { id, version, ... } (standard format)");
|
|
2947
|
-
process.exit(1);
|
|
2948
|
-
}
|
|
2949
|
-
const manifest = extractManifest(resolvedPlugin);
|
|
2950
|
-
if (resolvedPlugin.admin?.entry) {
|
|
2951
|
-
consola.error("Plugin declares adminEntry — React admin components require native/trusted mode. Use Block Kit for sandboxed admin pages, or remove adminEntry.");
|
|
2952
|
-
process.exit(1);
|
|
2953
|
-
}
|
|
2954
|
-
if (resolvedPlugin.admin?.portableTextBlocks && resolvedPlugin.admin.portableTextBlocks.length > 0) {
|
|
2955
|
-
consola.error("Plugin declares portableTextBlocks — these require native/trusted mode and cannot be bundled for the marketplace.");
|
|
2956
|
-
process.exit(1);
|
|
2957
|
-
}
|
|
2958
|
-
consola.success(`Plugin: ${manifest.id}@${manifest.version}`);
|
|
2959
|
-
consola.info(` Capabilities: ${manifest.capabilities.length > 0 ? manifest.capabilities.join(", ") : "(none)"}`);
|
|
2960
|
-
consola.info(` Hooks: ${manifest.hooks.length > 0 ? manifest.hooks.map((h) => typeof h === "string" ? h : h.name).join(", ") : "(none)"}`);
|
|
2961
|
-
consola.info(` Routes: ${manifest.routes.length > 0 ? manifest.routes.map((r) => typeof r === "string" ? r : r.name).join(", ") : "(none)"}`);
|
|
2962
|
-
const bundleDir = join(tmpDir, "bundle");
|
|
2963
|
-
await mkdir(bundleDir, { recursive: true });
|
|
2964
|
-
if (backendEntry) {
|
|
2965
|
-
consola.start("Bundling backend...");
|
|
2966
|
-
const shimDir = join(tmpDir, "shims");
|
|
2967
|
-
await mkdir(shimDir, { recursive: true });
|
|
2968
|
-
await writeFile(join(shimDir, "emdash.mjs"), "export const definePlugin = (d) => d;\n");
|
|
2969
|
-
await build({
|
|
2970
|
-
config: false,
|
|
2971
|
-
entry: [backendEntry],
|
|
2972
|
-
format: "esm",
|
|
2973
|
-
outDir: join(tmpDir, "backend"),
|
|
2974
|
-
dts: false,
|
|
2975
|
-
platform: "neutral",
|
|
2976
|
-
external: [],
|
|
2977
|
-
alias: { emdash: join(shimDir, "emdash.mjs") },
|
|
2978
|
-
minify: true,
|
|
2979
|
-
treeshake: true
|
|
2980
|
-
});
|
|
2981
|
-
const backendBaseName = basename(backendEntry).replace(TS_EXT_RE, "");
|
|
2982
|
-
const backendOutputPath = await findBuildOutput(join(tmpDir, "backend"), backendBaseName);
|
|
2983
|
-
if (backendOutputPath) {
|
|
2984
|
-
await copyFile(backendOutputPath, join(bundleDir, "backend.js"));
|
|
2985
|
-
consola.success("Built backend.js");
|
|
2986
|
-
} else {
|
|
2987
|
-
consola.error("Backend build produced no output");
|
|
2988
|
-
process.exit(1);
|
|
2989
|
-
}
|
|
2990
|
-
} else {
|
|
2991
|
-
consola.warn("No sandbox entry found — bundle will have no backend.js");
|
|
2992
|
-
consola.warn(" Add a \"sandbox-entry.ts\" in src/ or a \"./sandbox\" export in package.json");
|
|
2993
|
-
}
|
|
2994
|
-
if (adminEntry) {
|
|
2995
|
-
consola.start("Bundling admin...");
|
|
2996
|
-
await build({
|
|
2997
|
-
config: false,
|
|
2998
|
-
entry: [adminEntry],
|
|
2999
|
-
format: "esm",
|
|
3000
|
-
outDir: join(tmpDir, "admin"),
|
|
3001
|
-
dts: false,
|
|
3002
|
-
platform: "neutral",
|
|
3003
|
-
external: [],
|
|
3004
|
-
minify: true,
|
|
3005
|
-
treeshake: true
|
|
3006
|
-
});
|
|
3007
|
-
const adminBaseName = basename(adminEntry).replace(TS_EXT_RE, "");
|
|
3008
|
-
const adminOutputPath = await findBuildOutput(join(tmpDir, "admin"), adminBaseName);
|
|
3009
|
-
if (adminOutputPath) {
|
|
3010
|
-
await copyFile(adminOutputPath, join(bundleDir, "admin.js"));
|
|
3011
|
-
consola.success("Built admin.js");
|
|
3012
|
-
}
|
|
3013
|
-
}
|
|
3014
|
-
await writeFile(join(bundleDir, "manifest.json"), JSON.stringify(manifest, null, 2));
|
|
3015
|
-
consola.start("Collecting assets...");
|
|
3016
|
-
const readmePath = join(pluginDir, "README.md");
|
|
3017
|
-
if (await fileExists$1(readmePath)) {
|
|
3018
|
-
await copyFile(readmePath, join(bundleDir, "README.md"));
|
|
3019
|
-
consola.success("Included README.md");
|
|
3020
|
-
}
|
|
3021
|
-
const iconPath = join(pluginDir, "icon.png");
|
|
3022
|
-
if (await fileExists$1(iconPath)) {
|
|
3023
|
-
const dims = readImageDimensions(await readFile(iconPath));
|
|
3024
|
-
if (!dims) consola.warn("icon.png is not a valid PNG — skipping");
|
|
3025
|
-
else if (dims[0] !== ICON_SIZE || dims[1] !== ICON_SIZE) {
|
|
3026
|
-
consola.warn(`icon.png is ${dims[0]}x${dims[1]}, expected ${ICON_SIZE}x${ICON_SIZE} — including anyway`);
|
|
3027
|
-
await copyFile(iconPath, join(bundleDir, "icon.png"));
|
|
3028
|
-
} else {
|
|
3029
|
-
await copyFile(iconPath, join(bundleDir, "icon.png"));
|
|
3030
|
-
consola.success("Included icon.png");
|
|
3031
|
-
}
|
|
3032
|
-
}
|
|
3033
|
-
const screenshotsDir = join(pluginDir, "screenshots");
|
|
3034
|
-
if (await fileExists$1(screenshotsDir)) {
|
|
3035
|
-
const screenshotFiles = (await readdir(screenshotsDir)).filter((f) => {
|
|
3036
|
-
const ext = extname(f).toLowerCase();
|
|
3037
|
-
return ext === ".png" || ext === ".jpg" || ext === ".jpeg";
|
|
3038
|
-
}).toSorted().slice(0, MAX_SCREENSHOTS);
|
|
3039
|
-
if (screenshotFiles.length > 0) {
|
|
3040
|
-
await mkdir(join(bundleDir, "screenshots"), { recursive: true });
|
|
3041
|
-
for (const file of screenshotFiles) {
|
|
3042
|
-
const filePath = join(screenshotsDir, file);
|
|
3043
|
-
const dims = readImageDimensions(await readFile(filePath));
|
|
3044
|
-
if (!dims) {
|
|
3045
|
-
consola.warn(`screenshots/${file} — cannot read dimensions, skipping`);
|
|
3046
|
-
continue;
|
|
3047
|
-
}
|
|
3048
|
-
if (dims[0] > MAX_SCREENSHOT_WIDTH || dims[1] > MAX_SCREENSHOT_HEIGHT) consola.warn(`screenshots/${file} is ${dims[0]}x${dims[1]}, max ${MAX_SCREENSHOT_WIDTH}x${MAX_SCREENSHOT_HEIGHT} — including anyway`);
|
|
3049
|
-
await copyFile(filePath, join(bundleDir, "screenshots", file));
|
|
3050
|
-
}
|
|
3051
|
-
consola.success(`Included ${screenshotFiles.length} screenshot(s)`);
|
|
3052
|
-
}
|
|
3053
|
-
}
|
|
3054
|
-
consola.start("Validating bundle...");
|
|
3055
|
-
let hasErrors = false;
|
|
3056
|
-
if (pkg.exports) for (const issue of findSourceExports(pkg.exports)) {
|
|
3057
|
-
consola.error(`Export "${issue.exportPath}" points to source (${issue.resolvedPath}). Package exports must point to built files (e.g. dist/*.mjs). Add a build step and update the exports map.`);
|
|
3058
|
-
hasErrors = true;
|
|
3059
|
-
}
|
|
3060
|
-
const backendPath = join(bundleDir, "backend.js");
|
|
3061
|
-
if (await fileExists$1(backendPath)) {
|
|
3062
|
-
const builtins = findNodeBuiltinImports(await readFile(backendPath, "utf-8"));
|
|
3063
|
-
if (builtins.length > 0) {
|
|
3064
|
-
consola.error(`backend.js imports Node.js built-in modules: ${builtins.join(", ")}`);
|
|
3065
|
-
consola.error("Sandboxed plugins cannot use Node.js APIs");
|
|
3066
|
-
hasErrors = true;
|
|
3067
|
-
}
|
|
3068
|
-
}
|
|
3069
|
-
const declaresUnrestricted = manifest.capabilities.includes("network:request:unrestricted") || manifest.capabilities.includes("network:fetch:any");
|
|
3070
|
-
const declaresHostRestricted = manifest.capabilities.includes("network:request") || manifest.capabilities.includes("network:fetch");
|
|
3071
|
-
if (declaresUnrestricted) consola.warn("Plugin declares unrestricted network access (network:request:unrestricted) — it can make requests to any host");
|
|
3072
|
-
else if (declaresHostRestricted && manifest.allowedHosts.length === 0) consola.warn("Plugin declares network:request capability but no allowedHosts — all requests will be blocked");
|
|
3073
|
-
const deprecatedCaps = manifest.capabilities.filter(isDeprecatedCapability);
|
|
3074
|
-
if (deprecatedCaps.length > 0) {
|
|
3075
|
-
consola.warn("Plugin uses deprecated capability names. Rename them before publishing:");
|
|
3076
|
-
for (const cap of deprecatedCaps) {
|
|
3077
|
-
const replacement = CAPABILITY_RENAMES[cap];
|
|
3078
|
-
consola.warn(` ${cap} → ${replacement}`);
|
|
3079
|
-
}
|
|
3080
|
-
}
|
|
3081
|
-
if (resolvedPlugin.admin?.portableTextBlocks && resolvedPlugin.admin.portableTextBlocks.length > 0) consola.warn("Plugin declares portableTextBlocks — these require trusted mode and will be ignored in sandboxed plugins");
|
|
3082
|
-
if (resolvedPlugin.admin?.entry) consola.warn("Plugin declares admin.entry — custom React components require trusted mode. Use Block Kit for sandboxed admin pages");
|
|
3083
|
-
if (resolvedPlugin.hooks["page:fragments"]) consola.warn("Plugin declares page:fragments hook — this is trusted-only and will not work in sandboxed mode");
|
|
3084
|
-
const hasAdminPages = (manifest.admin?.pages?.length ?? 0) > 0;
|
|
3085
|
-
const hasAdminWidgets = (manifest.admin?.widgets?.length ?? 0) > 0;
|
|
3086
|
-
if (hasAdminPages || hasAdminWidgets) {
|
|
3087
|
-
if (!manifest.routes.map((r) => typeof r === "string" ? r : r.name).includes("admin")) {
|
|
3088
|
-
consola.error(`Plugin declares ${hasAdminPages ? "adminPages" : ""}${hasAdminPages && hasAdminWidgets ? " and " : ""}${hasAdminWidgets ? "adminWidgets" : ""} but the sandbox entry has no "admin" route. Add an admin route handler to serve Block Kit pages.`);
|
|
3089
|
-
hasErrors = true;
|
|
3090
|
-
}
|
|
3091
|
-
}
|
|
3092
|
-
const bundleEntries = await collectBundleEntries(bundleDir);
|
|
3093
|
-
const sizeViolations = validateBundleSize(bundleEntries);
|
|
3094
|
-
if (sizeViolations.length > 0) {
|
|
3095
|
-
for (const v of sizeViolations) consola.error(v);
|
|
3096
|
-
hasErrors = true;
|
|
3097
|
-
} else consola.info(`Bundle size: ${formatBytes(totalBundleBytes(bundleEntries))} across ${bundleEntries.length} file${bundleEntries.length === 1 ? "" : "s"}`);
|
|
3098
|
-
if (hasErrors) {
|
|
3099
|
-
consola.error("Bundle validation failed");
|
|
3100
|
-
process.exit(1);
|
|
3101
|
-
}
|
|
3102
|
-
consola.success("Validation passed");
|
|
3103
|
-
if (validateOnly) return;
|
|
3104
|
-
await mkdir(outDir, { recursive: true });
|
|
3105
|
-
const tarballName = `${manifest.id.replace(SLASH_RE, "-").replace(LEADING_AT_RE, "")}-${manifest.version}.tar.gz`;
|
|
3106
|
-
const tarballPath = join(outDir, tarballName);
|
|
3107
|
-
consola.start("Creating tarball...");
|
|
3108
|
-
await createTarball(bundleDir, tarballPath);
|
|
3109
|
-
const tarballSizeKB = ((await stat(tarballPath)).size / 1024).toFixed(1);
|
|
3110
|
-
const tarballBuf = await readFile(tarballPath);
|
|
3111
|
-
const checksum = createHash("sha256").update(tarballBuf).digest("hex");
|
|
3112
|
-
consola.success(`Created ${tarballName} (${tarballSizeKB}KB)`);
|
|
3113
|
-
consola.info(` SHA-256: ${checksum}`);
|
|
3114
|
-
consola.info(` Path: ${tarballPath}`);
|
|
3115
|
-
} finally {
|
|
3116
|
-
if (tmpDir.endsWith(".emdash-bundle-tmp")) await rm(tmpDir, {
|
|
3117
|
-
recursive: true,
|
|
3118
|
-
force: true
|
|
3119
|
-
});
|
|
3120
|
-
}
|
|
3121
|
-
}
|
|
3122
|
-
});
|
|
3123
|
-
|
|
3124
2602
|
//#endregion
|
|
3125
2603
|
//#region src/cli/commands/plugin-init.ts
|
|
3126
2604
|
/**
|
|
@@ -3181,7 +2659,7 @@ const pluginInitCommand = defineCommand({
|
|
|
3181
2659
|
process.exit(1);
|
|
3182
2660
|
}
|
|
3183
2661
|
const srcDir = join(targetDir, "src");
|
|
3184
|
-
if (await fileExists$
|
|
2662
|
+
if (await fileExists$4(join(targetDir, "package.json"))) {
|
|
3185
2663
|
consola.error(`package.json already exists in ${targetDir}`);
|
|
3186
2664
|
process.exit(1);
|
|
3187
2665
|
}
|
|
@@ -3663,7 +3141,7 @@ const publishCommand = defineCommand({
|
|
|
3663
3141
|
const pluginDir = resolve(args.dir);
|
|
3664
3142
|
try {
|
|
3665
3143
|
const { runCommand } = await import("citty");
|
|
3666
|
-
const { bundleCommand } = await
|
|
3144
|
+
const { bundleCommand } = await import("../bundle-CBEXrBnb.mjs").then((n) => n.n);
|
|
3667
3145
|
await runCommand(bundleCommand, { rawArgs: ["--dir", pluginDir] });
|
|
3668
3146
|
} catch {
|
|
3669
3147
|
consola.error("Build failed");
|