emdash 0.34.0 → 0.36.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/activation-K0kGBWuJ.mjs +382 -0
- package/dist/activation-K0kGBWuJ.mjs.map +1 -0
- package/dist/{adapters-34EN2eXO.d.mts → adapters-CzL3H752.d.mts} +10 -3
- package/dist/adapters-CzL3H752.d.mts.map +1 -0
- package/dist/{allowed-origins-DW7sYyqg.mjs → allowed-origins-maylGaHv.mjs} +2 -2
- package/dist/{allowed-origins-DW7sYyqg.mjs.map → allowed-origins-maylGaHv.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +22 -20
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/api-B0w3uBiG.mjs +2269 -0
- package/dist/api-B0w3uBiG.mjs.map +1 -0
- package/dist/{api-tokens-CFXu8F_2.mjs → api-tokens-9YrrCoE6.mjs} +2 -2
- package/dist/{api-tokens-CFXu8F_2.mjs.map → api-tokens-9YrrCoE6.mjs.map} +1 -1
- package/dist/{apply-D5zfeD09.mjs → apply-B_VMpJ2P.mjs} +34 -35
- package/dist/{apply-D5zfeD09.mjs.map → apply-B_VMpJ2P.mjs.map} +1 -1
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +92 -25
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +10 -7
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +2 -2
- package/dist/astro/middleware/redirect.mjs +4 -4
- package/dist/astro/middleware/request-context.mjs +3 -3
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +11 -12
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +255 -1323
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -9
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +15 -15
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +15 -15
- package/dist/astro/routes/api/admin/bylines/index.mjs +15 -15
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +4 -4
- package/dist/astro/routes/api/admin/comments/index.mjs +9 -9
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +46 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +14 -13
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +14 -13
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +44 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +16 -11
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +14 -13
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +14 -13
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +172 -133
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +52 -46
- 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 +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +7 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +11 -11
- package/dist/astro/routes/api/auth/invite/index.mjs +8 -8
- package/dist/astro/routes/api/auth/invite/register-options.mjs +10 -10
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +10 -10
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/me.mjs +19 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +2 -2
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -11
- package/dist/astro/routes/api/auth/signup/complete.mjs +11 -11
- package/dist/astro/routes/api/auth/signup/request.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +13 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +16 -14
- 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 +16 -14
- 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 +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
- package/dist/astro/routes/api/dashboard.mjs +7 -7
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +16 -16
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +2 -2
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +12 -12
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +12 -10
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +16 -16
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +26 -26
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +42 -42
- package/dist/astro/routes/api/media/_id_/confirm.mjs +11 -11
- package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
- package/dist/astro/routes/api/media/_id_/usage.mjs +18 -13
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +21 -13
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/folders/_id_.d.mts +10 -0
- package/dist/astro/routes/api/media/folders/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs +52 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/media/folders/index.d.mts +9 -0
- package/dist/astro/routes/api/media/folders/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/index.mjs +41 -0
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +9 -9
- package/dist/astro/routes/api/media.d.mts.map +1 -1
- package/dist/astro/routes/api/media.mjs +28 -19
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/items.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/translations.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_.mjs +8 -8
- package/dist/astro/routes/api/menus/index.mjs +8 -8
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
- package/dist/astro/routes/api/oauth/device/code.mjs +8 -8
- package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
- package/dist/astro/routes/api/oauth/register.mjs +2 -2
- package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
- package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
- package/dist/astro/routes/api/oauth/token.mjs +5 -5
- package/dist/astro/routes/api/openapi.json.mjs +153 -6
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +10 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +11 -11
- package/dist/astro/routes/api/redirects/index.mjs +11 -11
- package/dist/astro/routes/api/relations/_id_/index.mjs +16 -14
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +11 -9
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +16 -14
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +52 -46
- 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 +52 -46
- 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 +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +10 -8
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +10 -10
- package/dist/astro/routes/api/search/index.mjs +9 -9
- package/dist/astro/routes/api/search/rebuild.mjs +10 -10
- package/dist/astro/routes/api/search/stats.mjs +5 -5
- package/dist/astro/routes/api/search/suggest.mjs +9 -9
- package/dist/astro/routes/api/sections/_slug_.mjs +9 -9
- package/dist/astro/routes/api/sections/index.mjs +9 -9
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +5 -5
- package/dist/astro/routes/api/settings/backups/export.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/index.mjs +7 -7
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +13 -13
- package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
- package/dist/astro/routes/api/setup/admin.mjs +11 -11
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +35 -31
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +31 -35
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +7 -7
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/index.mjs +13 -13
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +7 -7
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +10 -10
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +10 -10
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +10 -10
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +6 -6
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +7 -7
- package/dist/astro/types.d.mts +19 -14
- 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-1iFJzPaZ.mjs → authorize-ByYs-Uxs.mjs} +2 -2
- package/dist/{authorize-1iFJzPaZ.mjs.map → authorize-ByYs-Uxs.mjs.map} +1 -1
- package/dist/{backup-LHjIAVNP.mjs → backup-ChyHfIoX.mjs} +5 -5
- package/dist/{backup-LHjIAVNP.mjs.map → backup-ChyHfIoX.mjs.map} +1 -1
- package/dist/{bundle-CBEXrBnb.mjs → bundle-DZFhFurR.mjs} +7 -7
- package/dist/{bundle-CBEXrBnb.mjs.map → bundle-DZFhFurR.mjs.map} +1 -1
- package/dist/{byline-pEcoDps8.mjs → byline-Cpnwrje1.mjs} +6 -6
- package/dist/{byline-pEcoDps8.mjs.map → byline-Cpnwrje1.mjs.map} +1 -1
- package/dist/{byline-fields-C5S8wygO.mjs → byline-fields-CAyA_Umd.mjs} +2 -2
- package/dist/{byline-fields-C5S8wygO.mjs.map → byline-fields-CAyA_Umd.mjs.map} +1 -1
- package/dist/{byline-registry-DDun8sxh.mjs → byline-registry-Bpu9-MVs.mjs} +2 -2
- package/dist/{byline-registry-DDun8sxh.mjs.map → byline-registry-Bpu9-MVs.mjs.map} +1 -1
- package/dist/{bylines-BWemdX2k.mjs → bylines-BSo9B9RX.mjs} +7 -7
- package/dist/{bylines-BWemdX2k.mjs.map → bylines-BSo9B9RX.mjs.map} +1 -1
- package/dist/{bylines-DJfSfXCL.mjs → bylines-CHjvehVX.mjs} +3 -3
- package/dist/{bylines-DJfSfXCL.mjs.map → bylines-CHjvehVX.mjs.map} +1 -1
- package/dist/{cache-CBJaDy_E.mjs → cache-5VirJ2Cn.mjs} +4 -4
- package/dist/{cache-CBJaDy_E.mjs.map → cache-5VirJ2Cn.mjs.map} +1 -1
- package/dist/capture-triggers-CNW1q3HK.mjs +362 -0
- package/dist/capture-triggers-CNW1q3HK.mjs.map +1 -0
- package/dist/{challenge-store-CZyFVaad.mjs → challenge-store-D5pSY2S1.mjs} +1 -1
- package/dist/{challenge-store-CZyFVaad.mjs.map → challenge-store-D5pSY2S1.mjs.map} +1 -1
- package/dist/{chunks-DfPax1I0.mjs → chunks-bNiX6_DR.mjs} +2 -2
- package/dist/{chunks-DfPax1I0.mjs.map → chunks-bNiX6_DR.mjs.map} +1 -1
- package/dist/cli/index.mjs +568 -84
- 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 +54 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/{collection-deletion-C8BugSGz.mjs → collection-deletion-m_oi2c0N.mjs} +13 -356
- package/dist/collection-deletion-m_oi2c0N.mjs.map +1 -0
- package/dist/{comment-Dxlep6cE.mjs → comment-DhvLEdhQ.mjs} +1 -1
- package/dist/{comment-Dxlep6cE.mjs.map → comment-DhvLEdhQ.mjs.map} +1 -1
- package/dist/{comment-reaction-D6qfHKBc.mjs → comment-reaction-CRuItEjt.mjs} +2 -2
- package/dist/{comment-reaction-D6qfHKBc.mjs.map → comment-reaction-CRuItEjt.mjs.map} +1 -1
- package/dist/{comments-CTOuhTSX.mjs → comments-CLj4bi8I.mjs} +2 -2
- package/dist/{comments-CTOuhTSX.mjs.map → comments-CLj4bi8I.mjs.map} +1 -1
- package/dist/{components-CQy3lh9x.mjs → components-v4U4DT2y.mjs} +1 -1
- package/dist/{components-CQy3lh9x.mjs.map → components-v4U4DT2y.mjs.map} +1 -1
- package/dist/config-DrfghTPe.d.mts +34 -0
- package/dist/config-DrfghTPe.d.mts.map +1 -0
- package/dist/{content-BNfwh7xX.mjs → content-CP-SeXNa.mjs} +5 -4
- package/dist/content-CP-SeXNa.mjs.map +1 -0
- package/dist/{content-list-query-DhQ84eVV.d.mts → content-list-query-BhejKVqb.d.mts} +1 -1
- package/dist/{content-list-query-DhQ84eVV.d.mts.map → content-list-query-BhejKVqb.d.mts.map} +1 -1
- package/dist/{content-refresh-DNERP4-f.mjs → content-refresh-DLOfIhYc.mjs} +1094 -93
- package/dist/content-refresh-DLOfIhYc.mjs.map +1 -0
- package/dist/{media-usage-De3qvwjc.mjs → content-repair-BCxzy0r4.mjs} +5 -196
- package/dist/content-repair-BCxzy0r4.mjs.map +1 -0
- package/dist/{context-DRgOvSnW.mjs → context-BR5hRWiK.mjs} +13 -13
- package/dist/{context-DRgOvSnW.mjs.map → context-BR5hRWiK.mjs.map} +1 -1
- package/dist/{cron-Y9aLtgrA.mjs → cron-CWfWrWKG.mjs} +1 -1
- package/dist/{cron-Y9aLtgrA.mjs.map → cron-CWfWrWKG.mjs.map} +1 -1
- package/dist/{dashboard-CB8J89rJ.mjs → dashboard-CkIV2rnQ.mjs} +5 -5
- package/dist/{dashboard-CB8J89rJ.mjs.map → dashboard-CkIV2rnQ.mjs.map} +1 -1
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +32 -9
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +11 -0
- package/dist/db/libsql-migrations.d.mts.map +1 -0
- package/dist/db/libsql-migrations.mjs +57 -0
- package/dist/db/libsql-migrations.mjs.map +1 -0
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +10 -0
- package/dist/db/postgres-migrations.d.mts.map +1 -0
- package/dist/db/postgres-migrations.mjs +47 -0
- package/dist/db/postgres-migrations.mjs.map +1 -0
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +10 -0
- package/dist/db/sqlite-migrations.d.mts.map +1 -0
- package/dist/db/sqlite-migrations.mjs +28 -0
- package/dist/db/sqlite-migrations.mjs.map +1 -0
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +3 -3
- package/dist/db/sqlite.mjs.map +1 -1
- package/dist/{default-DdDl3fxv.mjs → default-YMEfcQUx.mjs} +1 -1
- package/dist/{default-DdDl3fxv.mjs.map → default-YMEfcQUx.mjs.map} +1 -1
- package/dist/{deferred-tasks-BMsa9F64.d.mts → deferred-tasks-DfqxH5Xf.d.mts} +1 -1
- package/dist/{deferred-tasks-BMsa9F64.d.mts.map → deferred-tasks-DfqxH5Xf.d.mts.map} +1 -1
- package/dist/{device-flow-CaioYGK3.mjs → device-flow-CojjSBwb.mjs} +5 -5
- package/dist/{device-flow-CaioYGK3.mjs.map → device-flow-CojjSBwb.mjs.map} +1 -1
- package/dist/direct-executor-BWeWiRYB.mjs +85 -0
- package/dist/direct-executor-BWeWiRYB.mjs.map +1 -0
- package/dist/{dist-D_6CKR8z.mjs → dist-89xCrGqi.mjs} +1 -1
- package/dist/{dist-D_6CKR8z.mjs.map → dist-89xCrGqi.mjs.map} +1 -1
- package/dist/{email-console-BHNjIwiB.mjs → email-console-CEJgR_LB.mjs} +1 -1
- package/dist/{email-console-BHNjIwiB.mjs.map → email-console-CEJgR_LB.mjs.map} +1 -1
- package/dist/{enrich-_ySMEvEE.mjs → enrich-BX0IDp4z.mjs} +3 -3
- package/dist/{enrich-_ySMEvEE.mjs.map → enrich-BX0IDp4z.mjs.map} +1 -1
- package/dist/{error-DupyJZE2.mjs → error-D9w94fjV.mjs} +2 -2
- package/dist/{error-DupyJZE2.mjs.map → error-D9w94fjV.mjs.map} +1 -1
- package/dist/{errors-CLUPm7aD.mjs → errors-n2j49uNf.mjs} +22 -2
- package/dist/errors-n2j49uNf.mjs.map +1 -0
- package/dist/{escape-C_aLKP3H.mjs → escape-DN4Qmjsl.mjs} +1 -1
- package/dist/{escape-C_aLKP3H.mjs.map → escape-DN4Qmjsl.mjs.map} +1 -1
- package/dist/{field-defs-cache-hg6QkjV9.mjs → field-defs-cache-Bh4q6oar.mjs} +5 -5
- package/dist/{field-defs-cache-hg6QkjV9.mjs.map → field-defs-cache-Bh4q6oar.mjs.map} +1 -1
- package/dist/focal-point-BeWFo6Xx.mjs +23 -0
- package/dist/focal-point-BeWFo6Xx.mjs.map +1 -0
- package/dist/{fts-manager-CZ-5dVwJ.mjs → fts-manager-BhOdW0bi.mjs} +3 -3
- package/dist/{fts-manager-CZ-5dVwJ.mjs.map → fts-manager-BhOdW0bi.mjs.map} +1 -1
- package/dist/{hash-Cg0TXJPV.mjs → hash-CTcngWvj.mjs} +1 -1
- package/dist/{hash-Cg0TXJPV.mjs.map → hash-CTcngWvj.mjs.map} +1 -1
- package/dist/{hreflang-D3Uehfv2.d.mts → hreflang-7pTHsLZJ.d.mts} +2 -2
- package/dist/{hreflang-D3Uehfv2.d.mts.map → hreflang-7pTHsLZJ.d.mts.map} +1 -1
- package/dist/{hreflang-DNswoYsi.mjs → hreflang-Huc6O5wa.mjs} +7 -7
- package/dist/{hreflang-DNswoYsi.mjs.map → hreflang-Huc6O5wa.mjs.map} +1 -1
- package/dist/identity-DXmb4aVp.mjs +35 -0
- package/dist/identity-DXmb4aVp.mjs.map +1 -0
- package/dist/{import-B41u8Rot.mjs → import-C4_O3KXU.mjs} +5 -5
- package/dist/{import-B41u8Rot.mjs.map → import-C4_O3KXU.mjs.map} +1 -1
- package/dist/{index-Cof4-Fab.d.mts → index-6bRee8zb.d.mts} +3 -3
- package/dist/{index-Cof4-Fab.d.mts.map → index-6bRee8zb.d.mts.map} +1 -1
- package/dist/{index-C3Y-rsyN.d.mts → index-DWbJrsAg.d.mts} +138 -83
- package/dist/index-DWbJrsAg.d.mts.map +1 -0
- package/dist/index.d.mts +21 -20
- package/dist/index.mjs +78 -72
- package/dist/{init-lock-6b309ZrF.mjs → init-lock-DJkX6Hto.mjs} +1 -1
- package/dist/{init-lock-6b309ZrF.mjs.map → init-lock-DJkX6Hto.mjs.map} +1 -1
- package/dist/{load-DmvJrtxS.mjs → load-Bo7fZAbg.mjs} +2 -2
- package/dist/{load-DmvJrtxS.mjs.map → load-Bo7fZAbg.mjs.map} +1 -1
- package/dist/{loader-DLBqRiGP.mjs → loader-ZsjE4paL.mjs} +2 -2
- package/dist/{loader-DLBqRiGP.mjs.map → loader-ZsjE4paL.mjs.map} +1 -1
- package/dist/manifest-builder-QXuqvVMP.mjs +189 -0
- package/dist/manifest-builder-QXuqvVMP.mjs.map +1 -0
- package/dist/{manifest-schema-BXbUAHod.mjs → manifest-schema-CUYPfCEH.mjs} +1 -1
- package/dist/{manifest-schema-BXbUAHod.mjs.map → manifest-schema-CUYPfCEH.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 +13 -3
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +14 -12
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +11 -5
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-BWWWb8kg.mjs → media-BjwNuLEu.mjs} +100 -6
- package/dist/media-BjwNuLEu.mjs.map +1 -0
- package/dist/{media-CzhAn2--.mjs → media-D6SeAfBl.mjs} +41 -12
- package/dist/media-D6SeAfBl.mjs.map +1 -0
- package/dist/{media-allowlist-BD6HhgXA.mjs → media-allowlist-D35v7bmL.mjs} +3 -2
- package/dist/media-allowlist-D35v7bmL.mjs.map +1 -0
- package/dist/media-folders-D-0CmRZj.mjs +210 -0
- package/dist/media-folders-D-0CmRZj.mjs.map +1 -0
- package/dist/{media-upload-9yas9zGH.mjs → media-upload-C7bLXGcI.mjs} +9 -9
- package/dist/{media-upload-9yas9zGH.mjs.map → media-upload-C7bLXGcI.mjs.map} +1 -1
- package/dist/{media-url-BvoX88FA.mjs → media-url-DH7giMx_.mjs} +1 -1
- package/dist/{media-url-BvoX88FA.mjs.map → media-url-DH7giMx_.mjs.map} +1 -1
- package/dist/media-usage-BTRJvS6V.mjs +1833 -0
- package/dist/media-usage-BTRJvS6V.mjs.map +1 -0
- package/dist/media-usage-activation-Dx0kPV6b.mjs +78 -0
- package/dist/media-usage-activation-Dx0kPV6b.mjs.map +1 -0
- package/dist/{media-usage-work-DrCbqBcl.mjs → media-usage-work-C-fhM30c.mjs} +221 -59
- package/dist/media-usage-work-C-fhM30c.mjs.map +1 -0
- package/dist/{media-usage-work-B9Bksh_b.mjs → media-usage-work-DWb2XPMI.mjs} +4 -4
- package/dist/{media-usage-work-B9Bksh_b.mjs.map → media-usage-work-DWb2XPMI.mjs.map} +1 -1
- package/dist/{media-usage-write-fence-aHEgN1zB.mjs → media-usage-write-fence-BwoJVRDC.mjs} +2 -2
- package/dist/{media-usage-write-fence-aHEgN1zB.mjs.map → media-usage-write-fence-BwoJVRDC.mjs.map} +1 -1
- package/dist/{menus-fxvEDYE6.mjs → menus-CD7EFLwz.mjs} +3 -3
- package/dist/{menus-fxvEDYE6.mjs.map → menus-CD7EFLwz.mjs.map} +1 -1
- package/dist/{menus-CC-yn1F9.mjs → menus-CNg0QlDt.mjs} +42 -26
- package/dist/menus-CNg0QlDt.mjs.map +1 -0
- package/dist/migrations/index.d.mts +22 -0
- package/dist/migrations/index.d.mts.map +1 -0
- package/dist/migrations/index.mjs +7 -0
- package/dist/{mime-DfIVjNkr.mjs → mime-CUIG6x84.mjs} +1 -1
- package/dist/mime-CUIG6x84.mjs.map +1 -0
- package/dist/{mode-Bpe-tNNy.mjs → mode-DaUM_MB2.mjs} +1 -1
- package/dist/{mode-Bpe-tNNy.mjs.map → mode-DaUM_MB2.mjs.map} +1 -1
- package/dist/node-sqlite-compat-Udb4Y-rs.mjs +46 -0
- package/dist/node-sqlite-compat-Udb4Y-rs.mjs.map +1 -0
- package/dist/{normalize-Bc-s_r-a.mjs → normalize-CSxdKBVa.mjs} +22 -1
- package/dist/normalize-CSxdKBVa.mjs.map +1 -0
- package/dist/{oauth-authorization-BXO1MKej.mjs → oauth-authorization-Dpsb-fMJ.mjs} +5 -5
- package/dist/{oauth-authorization-BXO1MKej.mjs.map → oauth-authorization-Dpsb-fMJ.mjs.map} +1 -1
- package/dist/{oauth-clients-C_DNqtRu.mjs → oauth-clients-Bxnoe_67.mjs} +1 -1
- package/dist/{oauth-clients-C_DNqtRu.mjs.map → oauth-clients-Bxnoe_67.mjs.map} +1 -1
- package/dist/{oauth-state-store-DwAxMtk4.mjs → oauth-state-store-0C4s0K6w.mjs} +1 -1
- package/dist/{oauth-state-store-DwAxMtk4.mjs.map → oauth-state-store-0C4s0K6w.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-BxfZizdk.mjs → oauth-user-lookup-wlGYSeqX.mjs} +1 -1
- package/dist/{oauth-user-lookup-BxfZizdk.mjs.map → oauth-user-lookup-wlGYSeqX.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-CBXIHUoT.mjs → options-BHPeIbBd.mjs} +1 -1
- package/dist/{options-CBXIHUoT.mjs.map → options-BHPeIbBd.mjs.map} +1 -1
- package/dist/{options-DRe1pIBL.d.mts → options-BhZIeFY1.d.mts} +3 -3
- package/dist/{options-DRe1pIBL.d.mts.map → options-BhZIeFY1.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-DFbuc-Fh.mjs → parse-BRJg1kz8.mjs} +2 -2
- package/dist/{parse-DFbuc-Fh.mjs.map → parse-BRJg1kz8.mjs.map} +1 -1
- package/dist/{passkey-config-_2GOwwK8.mjs → passkey-config-B3P0nHRR.mjs} +1 -1
- package/dist/{passkey-config-_2GOwwK8.mjs.map → passkey-config-B3P0nHRR.mjs.map} +1 -1
- package/dist/{patterns-CiyXeDgr.mjs → patterns-D9iDO3j8.mjs} +1 -1
- package/dist/{patterns-CiyXeDgr.mjs.map → patterns-D9iDO3j8.mjs.map} +1 -1
- package/dist/{placeholder-CzW7Lshs.d.mts → placeholder-BR4ZhVJl.d.mts} +7 -1
- package/dist/placeholder-BR4ZhVJl.d.mts.map +1 -0
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/policy-BVRganJQ.mjs +45 -0
- package/dist/policy-BVRganJQ.mjs.map +1 -0
- package/dist/{portable-text-DhKbDAGr.mjs → portable-text-C8Tvp4_g.mjs} +1 -1
- package/dist/{portable-text-DhKbDAGr.mjs.map → portable-text-C8Tvp4_g.mjs.map} +1 -1
- package/dist/{preview-PW-nOnq4.mjs → preview-dn2dUyM0.mjs} +2 -2
- package/dist/{preview-PW-nOnq4.mjs.map → preview-dn2dUyM0.mjs.map} +1 -1
- package/dist/protocol-CuBEsqgE.d.mts +52 -0
- package/dist/protocol-CuBEsqgE.d.mts.map +1 -0
- package/dist/{public-url-CWoFhQT8.mjs → public-url-DRz_AinV.mjs} +1 -1
- package/dist/{public-url-CWoFhQT8.mjs.map → public-url-DRz_AinV.mjs.map} +1 -1
- package/dist/{query-BgjfiLUQ.mjs → query-D18vTdha.mjs} +14 -14
- package/dist/{query-BgjfiLUQ.mjs.map → query-D18vTdha.mjs.map} +1 -1
- package/dist/{query-vgZNwIhh.mjs → query-tZDEdtCN.mjs} +4 -4
- package/dist/{query-vgZNwIhh.mjs.map → query-tZDEdtCN.mjs.map} +1 -1
- package/dist/{rate-limit-L5anykgo.mjs → rate-limit-on7KPo-v.mjs} +2 -2
- package/dist/{rate-limit-L5anykgo.mjs.map → rate-limit-on7KPo-v.mjs.map} +1 -1
- package/dist/{redirect-COsS6SWJ.mjs → redirect-CZkbozu9.mjs} +2 -2
- package/dist/{redirect-COsS6SWJ.mjs.map → redirect-CZkbozu9.mjs.map} +1 -1
- package/dist/{redirect-KBNE3UEs.mjs → redirect-DrbEmU9a.mjs} +1 -1
- package/dist/{redirect-KBNE3UEs.mjs.map → redirect-DrbEmU9a.mjs.map} +1 -1
- package/dist/{redirects-CufRQt0Q.mjs → redirects-BahWiu8Z.mjs} +5 -5
- package/dist/{redirects-CufRQt0Q.mjs.map → redirects-BahWiu8Z.mjs.map} +1 -1
- package/dist/{redirects-cV9g7V-0.mjs → redirects-CRIM55KH.mjs} +6 -6
- package/dist/{redirects-cV9g7V-0.mjs.map → redirects-CRIM55KH.mjs.map} +1 -1
- package/dist/{api-DdAsirBe.mjs → registry-BiO5WwPq.mjs} +483 -2462
- package/dist/registry-BiO5WwPq.mjs.map +1 -0
- package/dist/{registry-C581V4TP.mjs → registry-Cx-jEJOS.mjs} +9 -123
- package/dist/registry-Cx-jEJOS.mjs.map +1 -0
- package/dist/{relation-DtmAQH7s.mjs → relation-A6wLF_DS.mjs} +2 -2
- package/dist/{relation-DtmAQH7s.mjs.map → relation-A6wLF_DS.mjs.map} +1 -1
- package/dist/{relations-BBApI4e2.mjs → relations-BTPM2saV.mjs} +2 -2
- package/dist/{relations-BBApI4e2.mjs.map → relations-BTPM2saV.mjs.map} +1 -1
- package/dist/{relations-DItI3MN9.d.mts → relations-C7B46bcU.d.mts} +189 -30
- package/dist/relations-C7B46bcU.d.mts.map +1 -0
- package/dist/{relations-DICSyfsh.mjs → relations-Cj5hZ6Zg.mjs} +4 -4
- package/dist/{relations-DICSyfsh.mjs.map → relations-Cj5hZ6Zg.mjs.map} +1 -1
- package/dist/{request-cache-BSUptuJR.mjs → request-cache-DH9zdCOD.mjs} +1 -1
- package/dist/{request-cache-BSUptuJR.mjs.map → request-cache-DH9zdCOD.mjs.map} +1 -1
- package/dist/request-context.d.mts +1 -1
- package/dist/{request-meta-DgZJh3zG.mjs → request-meta-DRp5ENd_.mjs} +2 -2
- package/dist/{request-meta-DgZJh3zG.mjs.map → request-meta-DRp5ENd_.mjs.map} +1 -1
- package/dist/{resolve-DOhVEvty.mjs → resolve-DxUpTMmE.mjs} +1 -1
- package/dist/{resolve-DOhVEvty.mjs.map → resolve-DxUpTMmE.mjs.map} +1 -1
- package/dist/{runner-BiDvq5dv.mjs → runner-77GOZCnH.mjs} +443 -289
- package/dist/runner-77GOZCnH.mjs.map +1 -0
- package/dist/{runner-CgQbELYC.d.mts → runner-zgqA_CqP.d.mts} +16 -3
- package/dist/runner-zgqA_CqP.d.mts.map +1 -0
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-BFyTg38T.mjs → schema-BY-oVntF.mjs} +3 -3
- package/dist/{schema-BFyTg38T.mjs.map → schema-BY-oVntF.mjs.map} +1 -1
- package/dist/{schema-CeQSNwB3.mjs → schema-Cw9kVK0I.mjs} +35 -5
- package/dist/{schema-CeQSNwB3.mjs.map → schema-Cw9kVK0I.mjs.map} +1 -1
- package/dist/{scopes-BVeuhGBE.mjs → scopes-vMR1uIbt.mjs} +3 -3
- package/dist/{scopes-BVeuhGBE.mjs.map → scopes-vMR1uIbt.mjs.map} +1 -1
- package/dist/{search-BpuPKZb0.mjs → search-CfT3KxO5.mjs} +4 -4
- package/dist/{search-BpuPKZb0.mjs.map → search-CfT3KxO5.mjs.map} +1 -1
- package/dist/{secrets-dtYs2hDo.mjs → secrets-BH2Qow1-.mjs} +3 -3
- package/dist/{secrets-dtYs2hDo.mjs.map → secrets-BH2Qow1-.mjs.map} +1 -1
- package/dist/{sections-COctk6hf.mjs → sections-DTfjyf1z.mjs} +2 -2
- package/dist/{sections-COctk6hf.mjs.map → sections-DTfjyf1z.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 -14
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-AFpVvTqr.mjs → seo-BSiTIXzd.mjs} +1 -1
- package/dist/{seo-AFpVvTqr.mjs.map → seo-BSiTIXzd.mjs.map} +1 -1
- package/dist/{seo-CvDxfvFb.mjs → seo-Cm-dtvgk.mjs} +2 -2
- package/dist/{seo-CvDxfvFb.mjs.map → seo-Cm-dtvgk.mjs.map} +1 -1
- package/dist/{service-xMiMSTsR.mjs → service-DYsDHEKe.mjs} +3 -3
- package/dist/{service-xMiMSTsR.mjs.map → service-DYsDHEKe.mjs.map} +1 -1
- package/dist/{session-user-BzVemLkw.mjs → session-user-CNAfvsdw.mjs} +1 -1
- package/dist/{session-user-BzVemLkw.mjs.map → session-user-CNAfvsdw.mjs.map} +1 -1
- package/dist/{settings-B372MV0p.mjs → settings-BgN-0DT-.mjs} +6 -6
- package/dist/{settings-B372MV0p.mjs.map → settings-BgN-0DT-.mjs.map} +1 -1
- package/dist/{settings-BE9aqn_9.mjs → settings-DjtkUo__.mjs} +3 -3
- package/dist/{settings-BE9aqn_9.mjs.map → settings-DjtkUo__.mjs.map} +1 -1
- package/dist/{setup-complete-DF7TAfD5.mjs → setup-complete-CcpXaPU7.mjs} +2 -2
- package/dist/{setup-complete-DF7TAfD5.mjs.map → setup-complete-CcpXaPU7.mjs.map} +1 -1
- package/dist/{setup-nonce-Do-U_cg9.mjs → setup-nonce-Reyw30jg.mjs} +1 -1
- package/dist/{setup-nonce-Do-U_cg9.mjs.map → setup-nonce-Reyw30jg.mjs.map} +1 -1
- package/dist/{single-flight-cache-B0eLKS6K.mjs → single-flight-cache-BPuGPdcN.mjs} +2 -2
- package/dist/{single-flight-cache-B0eLKS6K.mjs.map → single-flight-cache-BPuGPdcN.mjs.map} +1 -1
- package/dist/{site-url-Bowsi9T-.mjs → site-url-Cs_V9n3V.mjs} +3 -3
- package/dist/{site-url-Bowsi9T-.mjs.map → site-url-Cs_V9n3V.mjs.map} +1 -1
- package/dist/{snapshot-B5h6aPMh.mjs → snapshot-DSB8P7Lm.mjs} +1 -1
- package/dist/{snapshot-B5h6aPMh.mjs.map → snapshot-DSB8P7Lm.mjs.map} +1 -1
- package/dist/{ssrf-Cpvg_n3A.mjs → ssrf-DqebVE34.mjs} +21 -5
- package/dist/{ssrf-Cpvg_n3A.mjs.map → ssrf-DqebVE34.mjs.map} +1 -1
- package/dist/{state-DYwPue40.mjs → state-BJfU9Uzw.mjs} +12 -4
- package/dist/state-BJfU9Uzw.mjs.map +1 -0
- package/dist/{status-CWVYpbD8.mjs → status-DDu8HIQl.mjs} +1 -1
- package/dist/{status-CWVYpbD8.mjs.map → status-DDu8HIQl.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +3 -3
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/target-D0o26Azo.mjs +27 -0
- package/dist/target-D0o26Azo.mjs.map +1 -0
- package/dist/{taxonomies-Dk3MAklL.mjs → taxonomies-CPGxo-bn.mjs} +5 -5
- package/dist/{taxonomies-Dk3MAklL.mjs.map → taxonomies-CPGxo-bn.mjs.map} +1 -1
- package/dist/{taxonomies-B0o9ExNV.mjs → taxonomies-kmyudNGP.mjs} +7 -7
- package/dist/{taxonomies-B0o9ExNV.mjs.map → taxonomies-kmyudNGP.mjs.map} +1 -1
- package/dist/{taxonomy-CPeM8d2o.mjs → taxonomy-8X09dLN5.mjs} +4 -4
- package/dist/{taxonomy-CPeM8d2o.mjs.map → taxonomy-8X09dLN5.mjs.map} +1 -1
- package/dist/{tokens-C39klX8R.mjs → tokens-gTS-IVUp.mjs} +1 -1
- package/dist/{tokens-C39klX8R.mjs.map → tokens-gTS-IVUp.mjs.map} +1 -1
- package/dist/{transaction-NQj4VJ7Z.mjs → transaction-0KOpOyMu.mjs} +2 -1
- package/dist/{transaction-NQj4VJ7Z.mjs.map → transaction-0KOpOyMu.mjs.map} +1 -1
- package/dist/{transport-B_rfeU-a.d.mts → transport-_6R1ub7t.d.mts} +1 -1
- package/dist/{transport-B_rfeU-a.d.mts.map → transport-_6R1ub7t.d.mts.map} +1 -1
- package/dist/{transport--CfOflrp.mjs → transport-fX59xaJz.mjs} +4 -3
- package/dist/{transport--CfOflrp.mjs.map → transport-fX59xaJz.mjs.map} +1 -1
- package/dist/{trusted-proxy-CEVekpby.mjs → trusted-proxy-fe6nEgR4.mjs} +1 -1
- package/dist/{trusted-proxy-CEVekpby.mjs.map → trusted-proxy-fe6nEgR4.mjs.map} +1 -1
- package/dist/types-75KIqzL9.mjs.map +1 -1
- package/dist/{types-BW1syrlw.mjs → types-BXUmsINL.mjs} +1 -1
- package/dist/{types-BW1syrlw.mjs.map → types-BXUmsINL.mjs.map} +1 -1
- package/dist/{types-CPx2lIGo.d.mts → types-Blb-MRC3.d.mts} +1 -1
- package/dist/{types-CPx2lIGo.d.mts.map → types-Blb-MRC3.d.mts.map} +1 -1
- package/dist/{types-C3_AbkDP.d.mts → types-Br-ERaxh.d.mts} +2 -1
- package/dist/types-Br-ERaxh.d.mts.map +1 -0
- package/dist/{types-BPuloofb.d.mts → types-BzBd3PeX.d.mts} +1 -1
- package/dist/{types-BPuloofb.d.mts.map → types-BzBd3PeX.d.mts.map} +1 -1
- package/dist/{types-DefV3OiO.d.mts → types-CLqvnd05.d.mts} +1 -1
- package/dist/{types-DefV3OiO.d.mts.map → types-CLqvnd05.d.mts.map} +1 -1
- package/dist/{types-X0MThr7x.d.mts → types-D5VVLr7J.d.mts} +1 -1
- package/dist/{types-X0MThr7x.d.mts.map → types-D5VVLr7J.d.mts.map} +1 -1
- package/dist/{types-CAGdePf3.d.mts → types-DHxzBjbD.d.mts} +10 -1
- package/dist/types-DHxzBjbD.d.mts.map +1 -0
- package/dist/{types-D4_1Ga4L.d.mts → types-DJQxln7q.d.mts} +3 -3
- package/dist/{types-D4_1Ga4L.d.mts.map → types-DJQxln7q.d.mts.map} +1 -1
- package/dist/{types-CtzytVXn.mjs → types-DM3vioBY.mjs} +1 -1
- package/dist/{types-CtzytVXn.mjs.map → types-DM3vioBY.mjs.map} +1 -1
- package/dist/{types-CFUfyt1s.d.mts → types-D_DWe7k9.d.mts} +1 -1
- package/dist/{types-CFUfyt1s.d.mts.map → types-D_DWe7k9.d.mts.map} +1 -1
- package/dist/{types-Cs-TFLNf.d.mts → types-Vg6f5i3s.d.mts} +3 -3
- package/dist/{types-Cs-TFLNf.d.mts.map → types-Vg6f5i3s.d.mts.map} +1 -1
- package/dist/{upload-attempts-hlne3iA1.mjs → upload-attempts-CNyGSepg.mjs} +1 -1
- package/dist/{upload-attempts-hlne3iA1.mjs.map → upload-attempts-CNyGSepg.mjs.map} +1 -1
- package/dist/{url-pattern-BHS0V5Ng.mjs → url-pattern-K-KdXcSe.mjs} +1 -1
- package/dist/{url-pattern-BHS0V5Ng.mjs.map → url-pattern-K-KdXcSe.mjs.map} +1 -1
- package/dist/{user-sHgJ62SP.mjs → user-CtYY0tp2.mjs} +2 -2
- package/dist/{user-sHgJ62SP.mjs.map → user-CtYY0tp2.mjs.map} +1 -1
- package/dist/{utils-D4vD_Y98.mjs → utils-HztC73hq.mjs} +1 -1
- package/dist/{utils-D4vD_Y98.mjs.map → utils-HztC73hq.mjs.map} +1 -1
- package/dist/{validate-BkqIG_Uj.mjs → validate-Dd-IUjnZ.mjs} +2 -2
- package/dist/{validate-BkqIG_Uj.mjs.map → validate-Dd-IUjnZ.mjs.map} +1 -1
- package/dist/{validate-DeGtBN84.d.mts → validate-DlqdOZXB.d.mts} +5 -5
- package/dist/{validate-DeGtBN84.d.mts.map → validate-DlqdOZXB.d.mts.map} +1 -1
- package/dist/{validation-CiJb_X5o.mjs → validation-D83n7Npi.mjs} +10 -8
- package/dist/{validation-CiJb_X5o.mjs.map → validation-D83n7Npi.mjs.map} +1 -1
- package/dist/version-ri-sCyAp.mjs +7 -0
- package/dist/{version-x0NjTScG.mjs.map → version-ri-sCyAp.mjs.map} +1 -1
- package/dist/{widgets-Cwzvww0W.mjs → widgets-CpmZd9Q-.mjs} +4 -4
- package/dist/{widgets-Cwzvww0W.mjs.map → widgets-CpmZd9Q-.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-CmC0ZsDr.d.mts → wxr-taxonomies-BFd0y72_.d.mts} +1 -1
- package/dist/{wxr-taxonomies-CmC0ZsDr.d.mts.map → wxr-taxonomies-BFd0y72_.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-QZjWxjyk.mjs → wxr-taxonomies-Df4vxWcU.mjs} +4 -4
- package/dist/{wxr-taxonomies-QZjWxjyk.mjs.map → wxr-taxonomies-Df4vxWcU.mjs.map} +1 -1
- package/dist/{zod-generator-D11MhxG4.mjs → zod-generator-DylzusHh.mjs} +24 -18
- package/dist/zod-generator-DylzusHh.mjs.map +1 -0
- package/package.json +32 -8
- package/src/api/errors.ts +20 -0
- package/src/api/handlers/index.ts +17 -0
- package/src/api/handlers/media-allowlist.ts +1 -0
- package/src/api/handlers/media-folders.ts +130 -0
- package/src/api/handlers/media-usage-activation.ts +102 -0
- package/src/api/handlers/media-usage.ts +108 -0
- package/src/api/handlers/media.ts +62 -2
- package/src/api/handlers/registry.ts +134 -316
- package/src/api/openapi/document.ts +192 -2
- package/src/api/schemas/media-usage.ts +77 -0
- package/src/api/schemas/media.ts +69 -0
- package/src/astro/integration/index.ts +46 -14
- package/src/astro/integration/routes.ts +18 -0
- package/src/astro/integration/runtime.ts +3 -0
- package/src/astro/integration/vite-config.ts +2 -7
- package/src/astro/middleware/auth.ts +4 -0
- package/src/astro/middleware/scoped-db.ts +21 -0
- package/src/astro/middleware.ts +67 -17
- package/src/astro/routes/api/admin/media-usage/activation.ts +42 -0
- package/src/astro/routes/api/admin/media-usage/progress.ts +37 -0
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +246 -96
- package/src/astro/routes/api/auth/dev-bypass.ts +0 -4
- package/src/astro/routes/api/auth/me.ts +14 -2
- package/src/astro/routes/api/media/[id].ts +3 -0
- package/src/astro/routes/api/media/folders/[id].ts +55 -0
- package/src/astro/routes/api/media/folders/index.ts +37 -0
- package/src/astro/routes/api/media.ts +12 -2
- package/src/astro/routes/api/setup/dev-bypass.ts +14 -7
- package/src/astro/routes/api/setup/index.ts +5 -13
- package/src/astro/types.ts +11 -1
- package/src/cli/commands/migrate.ts +593 -0
- package/src/cli/index.ts +2 -23
- package/src/client/index.ts +140 -2
- package/src/client/transport.ts +6 -2
- package/src/components/EmDashImage.astro +154 -50
- package/src/components/Gallery.astro +7 -0
- package/src/components/InlinePortableTextEditor.tsx +130 -1
- package/src/components/LiveSearch.astro +23 -0
- package/src/components/inline-code-block.tsx +180 -49
- package/src/content/converters/gallery.ts +2 -0
- package/src/content/converters/types.ts +2 -0
- package/src/database/connection.ts +2 -31
- package/src/database/index.ts +9 -3
- package/src/database/json-recordset.ts +16 -0
- package/src/database/migrations/019_i18n.ts +1 -1
- package/src/database/migrations/071_restore_content_bylines_table.ts +43 -0
- package/src/database/migrations/072_media_folders.ts +72 -0
- package/src/database/migrations/073_media_focal_point.ts +57 -0
- package/src/database/migrations/policy.ts +70 -0
- package/src/database/migrations/runner.ts +57 -5
- package/src/database/repositories/content.ts +5 -4
- package/src/database/repositories/media-folders.ts +115 -0
- package/src/database/repositories/media-usage-work.ts +395 -111
- package/src/database/repositories/media-usage.ts +1038 -10
- package/src/database/repositories/media.ts +97 -29
- package/src/database/transaction.ts +1 -0
- package/src/database/types.ts +13 -0
- package/src/db/adapters.ts +52 -4
- package/src/db/index.ts +3 -1
- package/src/db/libsql-migrations.ts +72 -0
- package/src/db/node-sqlite-compat.ts +78 -0
- package/src/db/postgres-migrations.ts +59 -0
- package/src/db/sqlite-migrations.ts +37 -0
- package/src/db/sqlite.ts +3 -3
- package/src/emdash-runtime.ts +154 -120
- package/src/fields/image.ts +7 -1
- package/src/fields/types.ts +6 -2
- package/src/i18n/normalize.ts +31 -0
- package/src/index.ts +12 -1
- package/src/media/focal-point.ts +37 -0
- package/src/media/local-runtime.ts +8 -0
- package/src/media/mime.ts +1 -0
- package/src/media/normalize.ts +10 -0
- package/src/media/types.ts +10 -0
- package/src/media/usage/activation.ts +162 -35
- package/src/media/usage/capture-triggers.ts +19 -3
- package/src/media/usage/collection-deletion-processor.ts +7 -3
- package/src/media/usage/collection-deletion.ts +10 -0
- package/src/media/usage/content-refresh.ts +258 -39
- package/src/media/usage/content-snapshots.ts +128 -31
- package/src/media/usage/extractor.ts +32 -13
- package/src/media/usage/maintenance-engine.ts +166 -0
- package/src/media/usage/reconciliation-processor.ts +106 -29
- package/src/media/usage/reconciliation.ts +90 -7
- package/src/media/usage/work-processor.ts +342 -101
- package/src/migrations/config-loader.ts +205 -0
- package/src/migrations/direct-executor.ts +141 -0
- package/src/migrations/identity.ts +46 -0
- package/src/migrations/index.ts +19 -0
- package/src/migrations/integration-metadata.ts +67 -0
- package/src/migrations/manifest-builder.ts +55 -0
- package/src/migrations/manifest-writer.ts +63 -0
- package/src/migrations/manifest.ts +197 -0
- package/src/migrations/protocol.ts +59 -0
- package/src/migrations/target.ts +35 -0
- package/src/plugins/index.ts +1 -0
- package/src/plugins/save-rejection.ts +20 -0
- package/src/plugins/scheduler/node.ts +1 -13
- package/src/plugins/scheduler/types.ts +0 -2
- package/src/plugins/state.ts +13 -3
- package/src/registry/artifact-fetch.ts +530 -0
- package/src/registry/config.ts +24 -6
- package/src/registry/types.ts +12 -15
- package/src/schema/types.ts +1 -0
- package/src/schema/zod-generator.ts +12 -4
- package/src/security/ssrf.ts +21 -2
- package/src/seed/apply.ts +4 -4
- package/src/ui.ts +2 -0
- package/src/virtual-modules.d.ts +8 -0
- package/dist/adapters-34EN2eXO.d.mts.map +0 -1
- package/dist/api-DdAsirBe.mjs.map +0 -1
- package/dist/collection-deletion-C8BugSGz.mjs.map +0 -1
- package/dist/content-BNfwh7xX.mjs.map +0 -1
- package/dist/content-refresh-DNERP4-f.mjs.map +0 -1
- package/dist/errors-CLUPm7aD.mjs.map +0 -1
- package/dist/index-C3Y-rsyN.d.mts.map +0 -1
- package/dist/media-BWWWb8kg.mjs.map +0 -1
- package/dist/media-CzhAn2--.mjs.map +0 -1
- package/dist/media-allowlist-BD6HhgXA.mjs.map +0 -1
- package/dist/media-usage-De3qvwjc.mjs.map +0 -1
- package/dist/media-usage-work-DrCbqBcl.mjs.map +0 -1
- package/dist/menus-CC-yn1F9.mjs.map +0 -1
- package/dist/mime-DfIVjNkr.mjs.map +0 -1
- package/dist/normalize-Bc-s_r-a.mjs.map +0 -1
- package/dist/placeholder-CzW7Lshs.d.mts.map +0 -1
- package/dist/registry-C581V4TP.mjs.map +0 -1
- package/dist/relations-DItI3MN9.d.mts.map +0 -1
- package/dist/runner-BiDvq5dv.mjs.map +0 -1
- package/dist/runner-CgQbELYC.d.mts.map +0 -1
- package/dist/state-DYwPue40.mjs.map +0 -1
- package/dist/types-C3_AbkDP.d.mts.map +0 -1
- package/dist/types-CAGdePf3.d.mts.map +0 -1
- package/dist/version-x0NjTScG.mjs +0 -7
- package/dist/zod-generator-D11MhxG4.mjs.map +0 -1
- /package/dist/{api-tokens-CyTsLszZ.mjs → api-tokens-B5NHLNUN.mjs} +0 -0
- /package/dist/{ssrf-DpXgKsna.mjs → ssrf-BPKzkm6O.mjs} +0 -0
- /package/dist/{types-CP1CflWf.mjs → types-D6OcIp2P.mjs} +0 -0
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
sql,
|
|
3
|
+
type ExpressionBuilder,
|
|
4
|
+
type Kysely,
|
|
5
|
+
type SelectQueryBuilder,
|
|
6
|
+
type SqlBool,
|
|
7
|
+
} from "kysely";
|
|
2
8
|
import { ulid } from "ulidx";
|
|
3
9
|
|
|
10
|
+
import { normalizeFocalPoint, type FocalPointUpdate } from "../../media/focal-point.js";
|
|
4
11
|
import type { Database, MediaRow } from "../types.js";
|
|
5
12
|
import type { FindManyResult } from "./types.js";
|
|
6
13
|
import { encodeCursor, decodeCursor } from "./types.js";
|
|
@@ -48,6 +55,8 @@ export interface MediaItem {
|
|
|
48
55
|
size: number | null;
|
|
49
56
|
width: number | null;
|
|
50
57
|
height: number | null;
|
|
58
|
+
focalX: number | null;
|
|
59
|
+
focalY: number | null;
|
|
51
60
|
alt: string | null;
|
|
52
61
|
caption: string | null;
|
|
53
62
|
storageKey: string;
|
|
@@ -57,6 +66,7 @@ export interface MediaItem {
|
|
|
57
66
|
dominantColor: string | null;
|
|
58
67
|
createdAt: string;
|
|
59
68
|
authorId: string | null;
|
|
69
|
+
folderId?: string | null;
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
export interface CreateMediaInput {
|
|
@@ -83,6 +93,25 @@ export interface FindManyMediaOptions {
|
|
|
83
93
|
status?: MediaStatus | "all"; // Filter by status, defaults to "ready"
|
|
84
94
|
/** Case-insensitive substring matched against the filename (covers filename and extension). */
|
|
85
95
|
q?: string;
|
|
96
|
+
/** Omit for all media, pass null for the Main library, or pass a folder ID. */
|
|
97
|
+
folderId?: string | null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface UpdateMediaInput extends FocalPointUpdate {
|
|
101
|
+
alt?: string;
|
|
102
|
+
caption?: string;
|
|
103
|
+
width?: number;
|
|
104
|
+
height?: number;
|
|
105
|
+
folderId?: string | null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface FindMediaPageOptions extends Omit<FindManyMediaOptions, "cursor"> {
|
|
109
|
+
page: number;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface MediaPageResult {
|
|
113
|
+
items: MediaItem[];
|
|
114
|
+
totalCount: number;
|
|
86
115
|
}
|
|
87
116
|
|
|
88
117
|
const UPLOAD_ATTEMPT_CLEANUP_AGE_MS = 60 * 60 * 1000;
|
|
@@ -108,6 +137,8 @@ export class MediaRepository {
|
|
|
108
137
|
size: input.size ?? null,
|
|
109
138
|
width: input.width ?? null,
|
|
110
139
|
height: input.height ?? null,
|
|
140
|
+
focal_x: null,
|
|
141
|
+
focal_y: null,
|
|
111
142
|
alt: input.alt ?? null,
|
|
112
143
|
caption: input.caption ?? null,
|
|
113
144
|
storage_key: input.storageKey,
|
|
@@ -117,6 +148,7 @@ export class MediaRepository {
|
|
|
117
148
|
status: input.status ?? "ready",
|
|
118
149
|
created_at: now,
|
|
119
150
|
author_id: input.authorId ?? null,
|
|
151
|
+
folder_id: null,
|
|
120
152
|
};
|
|
121
153
|
|
|
122
154
|
await this.db.insertInto("media").values(row).execute();
|
|
@@ -367,8 +399,7 @@ export class MediaRepository {
|
|
|
367
399
|
async findMany(options: FindManyMediaOptions = {}): Promise<FindManyResult<MediaItem>> {
|
|
368
400
|
const limit = Math.min(options.limit || 50, 100);
|
|
369
401
|
|
|
370
|
-
let query = this.db
|
|
371
|
-
.selectFrom("media")
|
|
402
|
+
let query = this.applyListFilters(this.db.selectFrom("media"), options)
|
|
372
403
|
.selectAll()
|
|
373
404
|
.orderBy("created_at", "desc")
|
|
374
405
|
.orderBy("id", "desc")
|
|
@@ -387,28 +418,6 @@ export class MediaRepository {
|
|
|
387
418
|
);
|
|
388
419
|
}
|
|
389
420
|
|
|
390
|
-
const mimeFilters = normalizeMimeFilter(options.mimeType);
|
|
391
|
-
if (mimeFilters.length > 0) {
|
|
392
|
-
query = query.where((eb) => mimeMatchExpr(eb, mimeFilters));
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// Case-insensitive filename substring search (also matches extensions).
|
|
396
|
-
// LIKE wildcards in the term are escaped so they're treated literally.
|
|
397
|
-
const term = options.q?.trim();
|
|
398
|
-
if (term) {
|
|
399
|
-
const pattern = `%${escapeLike(term)}%`;
|
|
400
|
-
query = query.where(
|
|
401
|
-
sql<string>`lower(filename)`,
|
|
402
|
-
"like",
|
|
403
|
-
sql<string>`lower(${pattern}) escape '\\'`,
|
|
404
|
-
);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
// Default to only showing ready items
|
|
408
|
-
if (options.status !== "all") {
|
|
409
|
-
query = query.where("status", "=", options.status ?? "ready");
|
|
410
|
-
}
|
|
411
|
-
|
|
412
421
|
const rows = await query.execute();
|
|
413
422
|
|
|
414
423
|
const hasMore = rows.length > limit;
|
|
@@ -423,13 +432,31 @@ export class MediaRepository {
|
|
|
423
432
|
return { items, nextCursor };
|
|
424
433
|
}
|
|
425
434
|
|
|
435
|
+
async findPage(options: FindMediaPageOptions): Promise<MediaPageResult> {
|
|
436
|
+
const limit = Math.min(options.limit || 50, 100);
|
|
437
|
+
const offset = (options.page - 1) * limit;
|
|
438
|
+
const filtered = this.applyListFilters(this.db.selectFrom("media"), options);
|
|
439
|
+
const rows = await filtered
|
|
440
|
+
.selectAll()
|
|
441
|
+
.orderBy("created_at", "desc")
|
|
442
|
+
.orderBy("id", "desc")
|
|
443
|
+
.limit(limit)
|
|
444
|
+
.offset(offset)
|
|
445
|
+
.execute();
|
|
446
|
+
const count = await filtered
|
|
447
|
+
.select((eb) => eb.fn.count<number>("id").as("count"))
|
|
448
|
+
.executeTakeFirst();
|
|
449
|
+
|
|
450
|
+
return {
|
|
451
|
+
items: rows.map((row) => this.rowToItem(row)),
|
|
452
|
+
totalCount: Number(count?.count ?? 0),
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
|
|
426
456
|
/**
|
|
427
457
|
* Update media metadata
|
|
428
458
|
*/
|
|
429
|
-
async update(
|
|
430
|
-
id: string,
|
|
431
|
-
input: Partial<Pick<CreateMediaInput, "alt" | "caption" | "width" | "height">>,
|
|
432
|
-
): Promise<MediaItem | null> {
|
|
459
|
+
async update(id: string, input: UpdateMediaInput): Promise<MediaItem | null> {
|
|
433
460
|
const existing = await this.findById(id);
|
|
434
461
|
if (!existing) {
|
|
435
462
|
return null;
|
|
@@ -440,6 +467,11 @@ export class MediaRepository {
|
|
|
440
467
|
if (input.caption !== undefined) updates.caption = input.caption;
|
|
441
468
|
if (input.width !== undefined) updates.width = input.width;
|
|
442
469
|
if (input.height !== undefined) updates.height = input.height;
|
|
470
|
+
if (input.folderId !== undefined) updates.folder_id = input.folderId;
|
|
471
|
+
if (input.focalX !== undefined && input.focalY !== undefined) {
|
|
472
|
+
updates.focal_x = input.focalX;
|
|
473
|
+
updates.focal_y = input.focalY;
|
|
474
|
+
}
|
|
443
475
|
|
|
444
476
|
if (Object.keys(updates).length > 0) {
|
|
445
477
|
await this.db.updateTable("media").set(updates).where("id", "=", id).execute();
|
|
@@ -480,6 +512,38 @@ export class MediaRepository {
|
|
|
480
512
|
return Number(result?.count || 0);
|
|
481
513
|
}
|
|
482
514
|
|
|
515
|
+
private applyListFilters<O>(
|
|
516
|
+
query: SelectQueryBuilder<Database, "media", O>,
|
|
517
|
+
options: Omit<FindManyMediaOptions, "cursor" | "limit">,
|
|
518
|
+
): SelectQueryBuilder<Database, "media", O> {
|
|
519
|
+
const mimeFilters = normalizeMimeFilter(options.mimeType);
|
|
520
|
+
if (mimeFilters.length > 0) {
|
|
521
|
+
query = query.where((eb) => mimeMatchExpr(eb, mimeFilters));
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const term = options.q?.trim();
|
|
525
|
+
if (term) {
|
|
526
|
+
const pattern = `%${escapeLike(term)}%`;
|
|
527
|
+
query = query.where(
|
|
528
|
+
sql<string>`lower(filename)`,
|
|
529
|
+
"like",
|
|
530
|
+
sql<string>`lower(${pattern}) escape '\\'`,
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
if (options.status !== "all") {
|
|
535
|
+
query = query.where("status", "=", options.status ?? "ready");
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
if (options.folderId === null) {
|
|
539
|
+
query = query.where("folder_id", "is", null);
|
|
540
|
+
} else if (options.folderId !== undefined) {
|
|
541
|
+
query = query.where("folder_id", "=", options.folderId);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
return query;
|
|
545
|
+
}
|
|
546
|
+
|
|
483
547
|
/**
|
|
484
548
|
* Delete pending uploads older than the given age.
|
|
485
549
|
* Pending uploads that were never confirmed indicate abandoned upload flows.
|
|
@@ -504,6 +568,7 @@ export class MediaRepository {
|
|
|
504
568
|
* Convert database row to MediaItem
|
|
505
569
|
*/
|
|
506
570
|
private rowToItem(row: MediaRow): MediaItem {
|
|
571
|
+
const focalPoint = normalizeFocalPoint(row.focal_x, row.focal_y);
|
|
507
572
|
return {
|
|
508
573
|
id: row.id,
|
|
509
574
|
filename: row.filename,
|
|
@@ -511,6 +576,8 @@ export class MediaRepository {
|
|
|
511
576
|
size: row.size,
|
|
512
577
|
width: row.width,
|
|
513
578
|
height: row.height,
|
|
579
|
+
focalX: focalPoint?.focalX ?? null,
|
|
580
|
+
focalY: focalPoint?.focalY ?? null,
|
|
514
581
|
alt: row.alt,
|
|
515
582
|
caption: row.caption,
|
|
516
583
|
storageKey: row.storage_key,
|
|
@@ -521,6 +588,7 @@ export class MediaRepository {
|
|
|
521
588
|
status: row.status as MediaStatus,
|
|
522
589
|
createdAt: row.created_at,
|
|
523
590
|
authorId: row.author_id,
|
|
591
|
+
folderId: row.folder_id,
|
|
524
592
|
};
|
|
525
593
|
}
|
|
526
594
|
}
|
|
@@ -29,6 +29,7 @@ export async function withTransaction<DB, T>(
|
|
|
29
29
|
db: Kysely<DB>,
|
|
30
30
|
fn: (trx: Kysely<DB> | Transaction<DB>) => Promise<T>,
|
|
31
31
|
): Promise<T> {
|
|
32
|
+
if (db.isTransaction) return fn(db);
|
|
32
33
|
// Fast path: we already know transactions work
|
|
33
34
|
if (transactionsSupported === true) {
|
|
34
35
|
return db.transaction().execute(fn);
|
package/src/database/types.ts
CHANGED
|
@@ -67,6 +67,8 @@ export interface MediaTable {
|
|
|
67
67
|
size: number | null;
|
|
68
68
|
width: number | null;
|
|
69
69
|
height: number | null;
|
|
70
|
+
focal_x: number | null;
|
|
71
|
+
focal_y: number | null;
|
|
70
72
|
alt: string | null;
|
|
71
73
|
caption: string | null;
|
|
72
74
|
storage_key: string;
|
|
@@ -76,6 +78,13 @@ export interface MediaTable {
|
|
|
76
78
|
dominant_color: string | null;
|
|
77
79
|
created_at: Generated<string>;
|
|
78
80
|
author_id: string | null;
|
|
81
|
+
folder_id: Generated<string | null>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface MediaFolderTable {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
name_key: string;
|
|
79
88
|
}
|
|
80
89
|
|
|
81
90
|
export interface MediaUploadAttemptTable {
|
|
@@ -627,6 +636,7 @@ export interface Database {
|
|
|
627
636
|
content_taxonomies: ContentTaxonomyTable;
|
|
628
637
|
_emdash_taxonomy_defs: TaxonomyDefTable;
|
|
629
638
|
media: MediaTable;
|
|
639
|
+
media_folders: MediaFolderTable;
|
|
630
640
|
_emdash_media_upload_attempts: MediaUploadAttemptTable;
|
|
631
641
|
_emdash_media_usage_sources: MediaUsageSourceTable;
|
|
632
642
|
_emdash_media_usage: MediaUsageTable;
|
|
@@ -685,6 +695,8 @@ export type MediaRow = {
|
|
|
685
695
|
size: number | null;
|
|
686
696
|
width: number | null;
|
|
687
697
|
height: number | null;
|
|
698
|
+
focal_x: number | null;
|
|
699
|
+
focal_y: number | null;
|
|
688
700
|
alt: string | null;
|
|
689
701
|
caption: string | null;
|
|
690
702
|
storage_key: string;
|
|
@@ -694,6 +706,7 @@ export type MediaRow = {
|
|
|
694
706
|
dominant_color: string | null;
|
|
695
707
|
created_at: string;
|
|
696
708
|
author_id: string | null;
|
|
709
|
+
folder_id: string | null;
|
|
697
710
|
};
|
|
698
711
|
|
|
699
712
|
export interface RedirectTable {
|
package/src/db/adapters.ts
CHANGED
|
@@ -52,6 +52,20 @@ export type ExecuteCollectionDeletionGuard = (
|
|
|
52
52
|
input: CollectionDeletionGuardInput,
|
|
53
53
|
) => Promise<CollectionDeletionGuardResult>;
|
|
54
54
|
|
|
55
|
+
const ENVIRONMENT_VARIABLE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
56
|
+
|
|
57
|
+
function migrationEnvironmentVariable(
|
|
58
|
+
value: string | undefined,
|
|
59
|
+
fallback: string,
|
|
60
|
+
optionName: string,
|
|
61
|
+
): string {
|
|
62
|
+
const name = value ?? fallback;
|
|
63
|
+
if (!ENVIRONMENT_VARIABLE_PATTERN.test(name)) {
|
|
64
|
+
throw new Error(`${optionName} must be a valid environment variable name.`);
|
|
65
|
+
}
|
|
66
|
+
return name;
|
|
67
|
+
}
|
|
68
|
+
|
|
55
69
|
/**
|
|
56
70
|
* Database descriptor - serializable config for virtual modules
|
|
57
71
|
*/
|
|
@@ -59,6 +73,11 @@ export interface DatabaseDescriptor {
|
|
|
59
73
|
entrypoint: string;
|
|
60
74
|
config: unknown;
|
|
61
75
|
type: DatabaseDialectType;
|
|
76
|
+
/** Deployment migration capability with configuration safe for a build artifact. */
|
|
77
|
+
migrations?: {
|
|
78
|
+
entrypoint: string;
|
|
79
|
+
manifestConfig: unknown;
|
|
80
|
+
};
|
|
62
81
|
/**
|
|
63
82
|
* When true, the adapter's runtime entrypoint MUST export a named
|
|
64
83
|
* `createRequestScopedDb` function matching the signature declared in
|
|
@@ -111,12 +130,13 @@ export interface LibsqlConfig {
|
|
|
111
130
|
* Auth token for remote libSQL
|
|
112
131
|
*/
|
|
113
132
|
authToken?: string;
|
|
133
|
+
migrationAuthTokenEnv?: string;
|
|
114
134
|
}
|
|
115
135
|
|
|
116
136
|
/**
|
|
117
|
-
* SQLite database adapter (
|
|
137
|
+
* SQLite database adapter (node:sqlite)
|
|
118
138
|
*
|
|
119
|
-
* For local development and Node.js deployments.
|
|
139
|
+
* For local development and Node.js deployments. Requires Node.js 22.16 or later.
|
|
120
140
|
*
|
|
121
141
|
* @example
|
|
122
142
|
* ```ts
|
|
@@ -128,6 +148,10 @@ export function sqlite(config: SqliteConfig): DatabaseDescriptor {
|
|
|
128
148
|
entrypoint: "emdash/db/sqlite",
|
|
129
149
|
config,
|
|
130
150
|
type: "sqlite",
|
|
151
|
+
migrations: {
|
|
152
|
+
entrypoint: "emdash/db/sqlite-migrations",
|
|
153
|
+
manifestConfig: { url: config.url },
|
|
154
|
+
},
|
|
131
155
|
};
|
|
132
156
|
}
|
|
133
157
|
|
|
@@ -145,10 +169,22 @@ export function sqlite(config: SqliteConfig): DatabaseDescriptor {
|
|
|
145
169
|
* ```
|
|
146
170
|
*/
|
|
147
171
|
export function libsql(config: LibsqlConfig): DatabaseDescriptor {
|
|
172
|
+
const { migrationAuthTokenEnv, ...runtimeConfig } = config;
|
|
148
173
|
return {
|
|
149
174
|
entrypoint: "emdash/db/libsql",
|
|
150
|
-
config,
|
|
175
|
+
config: runtimeConfig,
|
|
151
176
|
type: "sqlite",
|
|
177
|
+
migrations: {
|
|
178
|
+
entrypoint: "emdash/db/libsql-migrations",
|
|
179
|
+
manifestConfig: {
|
|
180
|
+
url: config.url,
|
|
181
|
+
authTokenEnv: migrationEnvironmentVariable(
|
|
182
|
+
migrationAuthTokenEnv,
|
|
183
|
+
"TURSO_AUTH_TOKEN",
|
|
184
|
+
"migrationAuthTokenEnv",
|
|
185
|
+
),
|
|
186
|
+
},
|
|
187
|
+
},
|
|
152
188
|
};
|
|
153
189
|
}
|
|
154
190
|
|
|
@@ -164,6 +200,7 @@ export interface PostgresConfig {
|
|
|
164
200
|
password?: string;
|
|
165
201
|
ssl?: boolean;
|
|
166
202
|
pool?: { min?: number; max?: number };
|
|
203
|
+
migrationConnectionStringEnv?: string;
|
|
167
204
|
}
|
|
168
205
|
|
|
169
206
|
/**
|
|
@@ -177,9 +214,20 @@ export interface PostgresConfig {
|
|
|
177
214
|
* ```
|
|
178
215
|
*/
|
|
179
216
|
export function postgres(config: PostgresConfig): DatabaseDescriptor {
|
|
217
|
+
const { migrationConnectionStringEnv, ...runtimeConfig } = config;
|
|
180
218
|
return {
|
|
181
219
|
entrypoint: "emdash/db/postgres",
|
|
182
|
-
config,
|
|
220
|
+
config: runtimeConfig,
|
|
183
221
|
type: "postgres",
|
|
222
|
+
migrations: {
|
|
223
|
+
entrypoint: "emdash/db/postgres-migrations",
|
|
224
|
+
manifestConfig: {
|
|
225
|
+
connectionStringEnv: migrationEnvironmentVariable(
|
|
226
|
+
migrationConnectionStringEnv,
|
|
227
|
+
"DATABASE_URL",
|
|
228
|
+
"migrationConnectionStringEnv",
|
|
229
|
+
),
|
|
230
|
+
},
|
|
231
|
+
},
|
|
184
232
|
};
|
|
185
233
|
}
|
package/src/db/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ export type {
|
|
|
35
35
|
export {
|
|
36
36
|
runMigrations,
|
|
37
37
|
getMigrationStatus,
|
|
38
|
+
getExactMigrationStatus,
|
|
38
39
|
rollbackMigration,
|
|
40
|
+
MIGRATION_NAMES,
|
|
39
41
|
} from "../database/migrations/runner.js";
|
|
40
|
-
export type { MigrationStatus } from "../database/migrations/runner.js";
|
|
42
|
+
export type { MigrationStatus, ExactMigrationStatus } from "../database/migrations/runner.js";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
|
|
4
|
+
import { createDirectMigrationExecutor } from "../migrations/direct-executor.js";
|
|
5
|
+
import type { MigrationExecutor, MigrationExecutorFactoryContext } from "../migrations/protocol.js";
|
|
6
|
+
import { createMigrationTarget, requireMigrationEnvironment } from "../migrations/target.js";
|
|
7
|
+
import { createDialect } from "./libsql.js";
|
|
8
|
+
|
|
9
|
+
export interface LibsqlMigrationManifestConfig {
|
|
10
|
+
url: string;
|
|
11
|
+
authTokenEnv: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ResolvedLibsqlUrl {
|
|
15
|
+
connectionUrl: string;
|
|
16
|
+
label: string;
|
|
17
|
+
identity: string[];
|
|
18
|
+
requiresAuthToken: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function resolveLibsqlUrl(url: unknown, projectRoot: string): ResolvedLibsqlUrl {
|
|
22
|
+
if (typeof url !== "string" || url.length === 0) {
|
|
23
|
+
throw new Error("libSQL migration URL is missing.");
|
|
24
|
+
}
|
|
25
|
+
if (url.startsWith("file:")) {
|
|
26
|
+
const configuredPath = url.slice(5);
|
|
27
|
+
if (configuredPath.length === 0) throw new Error("libSQL migration URL is invalid.");
|
|
28
|
+
const fileUrl = pathToFileURL(resolve(projectRoot, configuredPath));
|
|
29
|
+
return {
|
|
30
|
+
connectionUrl: fileUrl.href,
|
|
31
|
+
label: fileUrl.href,
|
|
32
|
+
identity: [fileUrl.protocol, fileUrl.pathname],
|
|
33
|
+
requiresAuthToken: false,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let parsed: URL;
|
|
38
|
+
try {
|
|
39
|
+
parsed = new URL(url);
|
|
40
|
+
} catch {
|
|
41
|
+
throw new Error("libSQL migration URL is invalid.");
|
|
42
|
+
}
|
|
43
|
+
if (parsed.username || parsed.password) {
|
|
44
|
+
throw new Error("libSQL migration URL must not contain credentials.");
|
|
45
|
+
}
|
|
46
|
+
const label = `${parsed.protocol}//${parsed.host}${parsed.pathname}`;
|
|
47
|
+
return {
|
|
48
|
+
connectionUrl: url,
|
|
49
|
+
label,
|
|
50
|
+
identity: [parsed.protocol, parsed.host, parsed.pathname],
|
|
51
|
+
requiresAuthToken: true,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export async function createMigrationExecutor(
|
|
56
|
+
manifestConfig: LibsqlMigrationManifestConfig,
|
|
57
|
+
context: MigrationExecutorFactoryContext,
|
|
58
|
+
): Promise<MigrationExecutor> {
|
|
59
|
+
const resolvedUrl = resolveLibsqlUrl(manifestConfig.url, context.projectRoot);
|
|
60
|
+
const authToken = resolvedUrl.requiresAuthToken
|
|
61
|
+
? requireMigrationEnvironment(manifestConfig.authTokenEnv, context.env)
|
|
62
|
+
: undefined;
|
|
63
|
+
const target = await createMigrationTarget("libsql", resolvedUrl.label, resolvedUrl.identity);
|
|
64
|
+
return createDirectMigrationExecutor({
|
|
65
|
+
target,
|
|
66
|
+
createDialect: () =>
|
|
67
|
+
createDialect({
|
|
68
|
+
url: resolvedUrl.connectionUrl,
|
|
69
|
+
authToken,
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { DatabaseSync } from "node:sqlite";
|
|
2
|
+
|
|
3
|
+
export interface NodeSqliteCompatDatabase {
|
|
4
|
+
close(): void;
|
|
5
|
+
prepare(sql: string): NodeSqliteCompatStatement;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface NodeSqliteCompatStatement {
|
|
9
|
+
readonly reader: boolean;
|
|
10
|
+
all(parameters: ReadonlyArray<unknown>): unknown[];
|
|
11
|
+
run(parameters: ReadonlyArray<unknown>): {
|
|
12
|
+
changes: number | bigint;
|
|
13
|
+
lastInsertRowid: number | bigint;
|
|
14
|
+
};
|
|
15
|
+
iterate(parameters: ReadonlyArray<unknown>): IterableIterator<unknown>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface NodeSqliteOpenOptions {
|
|
19
|
+
journalMode?: "wal";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type SqliteBinding = null | number | bigint | string | Uint8Array;
|
|
23
|
+
|
|
24
|
+
export function openNodeSqliteDatabase(
|
|
25
|
+
path: string,
|
|
26
|
+
options: NodeSqliteOpenOptions = {},
|
|
27
|
+
): NodeSqliteCompatDatabase {
|
|
28
|
+
const database = new DatabaseSync(path);
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
database.exec("PRAGMA busy_timeout = 5000");
|
|
32
|
+
database.exec("PRAGMA foreign_keys = ON");
|
|
33
|
+
// Negative cache_size values are kibibytes.
|
|
34
|
+
database.exec("PRAGMA cache_size = -16000");
|
|
35
|
+
if (options.journalMode === "wal") {
|
|
36
|
+
database.exec("PRAGMA journal_mode = WAL");
|
|
37
|
+
}
|
|
38
|
+
const journalMode = database.prepare("PRAGMA journal_mode").get()?.["journal_mode"];
|
|
39
|
+
if (journalMode === "wal") {
|
|
40
|
+
database.exec("PRAGMA synchronous = NORMAL");
|
|
41
|
+
}
|
|
42
|
+
} catch (error) {
|
|
43
|
+
try {
|
|
44
|
+
database.close();
|
|
45
|
+
} catch {
|
|
46
|
+
throw new Error("SQLite setup failed and the connection could not be closed", {
|
|
47
|
+
cause: error,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
close: () => database.close(),
|
|
55
|
+
prepare(sql) {
|
|
56
|
+
const statement = database.prepare(sql);
|
|
57
|
+
return {
|
|
58
|
+
reader: statement.columns().length > 0,
|
|
59
|
+
all: (parameters) => statement.all(...toBindings(parameters)),
|
|
60
|
+
run: (parameters) => statement.run(...toBindings(parameters)),
|
|
61
|
+
iterate: (parameters) => statement.iterate(...toBindings(parameters)),
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function toBindings(parameters: ReadonlyArray<unknown>): SqliteBinding[] {
|
|
68
|
+
return parameters.map((value) => {
|
|
69
|
+
if (value === null || typeof value === "string" || typeof value === "number") {
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
if (typeof value === "bigint") return value;
|
|
73
|
+
if (typeof value === "boolean") return value ? 1 : 0;
|
|
74
|
+
if (value === undefined) return null;
|
|
75
|
+
if (value instanceof Uint8Array) return value;
|
|
76
|
+
throw new TypeError(`Cannot bind ${Object.prototype.toString.call(value)} to SQLite`);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createDirectMigrationExecutor } from "../migrations/direct-executor.js";
|
|
2
|
+
import type { MigrationExecutor, MigrationExecutorFactoryContext } from "../migrations/protocol.js";
|
|
3
|
+
import { createMigrationTarget, requireMigrationEnvironment } from "../migrations/target.js";
|
|
4
|
+
import { createDialect } from "./postgres.js";
|
|
5
|
+
|
|
6
|
+
export interface PostgresMigrationManifestConfig {
|
|
7
|
+
connectionStringEnv: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface PostgresTargetIdentity {
|
|
11
|
+
host: string;
|
|
12
|
+
port: string;
|
|
13
|
+
database: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function parseTargetIdentity(connectionString: string): PostgresTargetIdentity {
|
|
17
|
+
let parsed: URL;
|
|
18
|
+
try {
|
|
19
|
+
parsed = new URL(connectionString);
|
|
20
|
+
} catch {
|
|
21
|
+
throw new Error("PostgreSQL migration connection string is invalid.");
|
|
22
|
+
}
|
|
23
|
+
if (parsed.protocol !== "postgres:" && parsed.protocol !== "postgresql:") {
|
|
24
|
+
throw new Error("PostgreSQL migration connection string is invalid.");
|
|
25
|
+
}
|
|
26
|
+
const database = parsed.pathname.slice(1);
|
|
27
|
+
if (!parsed.hostname || !database) {
|
|
28
|
+
throw new Error("PostgreSQL migration connection string must identify a host and database.");
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
host: parsed.hostname,
|
|
32
|
+
port: parsed.port || "5432",
|
|
33
|
+
database,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function createMigrationExecutor(
|
|
38
|
+
manifestConfig: PostgresMigrationManifestConfig,
|
|
39
|
+
context: MigrationExecutorFactoryContext,
|
|
40
|
+
): Promise<MigrationExecutor> {
|
|
41
|
+
const connectionStringEnv =
|
|
42
|
+
context.overrides?.databaseUrlEnv ?? manifestConfig.connectionStringEnv;
|
|
43
|
+
const connectionString = requireMigrationEnvironment(connectionStringEnv, context.env);
|
|
44
|
+
const identity = parseTargetIdentity(connectionString);
|
|
45
|
+
const label = `${identity.host}:${identity.port}/${identity.database}`;
|
|
46
|
+
const target = await createMigrationTarget("postgres", label, [
|
|
47
|
+
identity.host,
|
|
48
|
+
identity.port,
|
|
49
|
+
identity.database,
|
|
50
|
+
]);
|
|
51
|
+
return createDirectMigrationExecutor({
|
|
52
|
+
target,
|
|
53
|
+
createDialect: () =>
|
|
54
|
+
createDialect({
|
|
55
|
+
connectionString,
|
|
56
|
+
pool: { min: 0, max: 1 },
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { isAbsolute, resolve } from "node:path";
|
|
2
|
+
|
|
3
|
+
import { createDirectMigrationExecutor } from "../migrations/direct-executor.js";
|
|
4
|
+
import type { MigrationExecutor, MigrationExecutorFactoryContext } from "../migrations/protocol.js";
|
|
5
|
+
import { createMigrationTarget } from "../migrations/target.js";
|
|
6
|
+
import { createDialect } from "./sqlite.js";
|
|
7
|
+
|
|
8
|
+
export interface SqliteMigrationManifestConfig {
|
|
9
|
+
url: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function resolveDatabasePath(
|
|
13
|
+
manifestConfig: SqliteMigrationManifestConfig,
|
|
14
|
+
context: MigrationExecutorFactoryContext,
|
|
15
|
+
): string {
|
|
16
|
+
const configuredUrl = context.overrides?.database ?? manifestConfig.url;
|
|
17
|
+
if (typeof configuredUrl !== "string" || configuredUrl.length === 0) {
|
|
18
|
+
throw new Error("SQLite migration database path is missing.");
|
|
19
|
+
}
|
|
20
|
+
const path = configuredUrl.startsWith("file:") ? configuredUrl.slice(5) : configuredUrl;
|
|
21
|
+
if (path.length === 0) {
|
|
22
|
+
throw new Error("SQLite migration database path is missing.");
|
|
23
|
+
}
|
|
24
|
+
return isAbsolute(path) ? resolve(path) : resolve(context.projectRoot, path);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function createMigrationExecutor(
|
|
28
|
+
manifestConfig: SqliteMigrationManifestConfig,
|
|
29
|
+
context: MigrationExecutorFactoryContext,
|
|
30
|
+
): Promise<MigrationExecutor> {
|
|
31
|
+
const databasePath = resolveDatabasePath(manifestConfig, context);
|
|
32
|
+
const target = await createMigrationTarget("sqlite", databasePath, [databasePath]);
|
|
33
|
+
return createDirectMigrationExecutor({
|
|
34
|
+
target,
|
|
35
|
+
createDialect: () => createDialect({ url: databasePath }),
|
|
36
|
+
});
|
|
37
|
+
}
|
package/src/db/sqlite.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SQLite runtime adapter
|
|
3
3
|
*
|
|
4
|
-
* Creates a Kysely dialect for
|
|
4
|
+
* Creates a Kysely dialect for Node's built-in SQLite driver.
|
|
5
5
|
* Loaded at runtime via virtual module.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import BetterSqlite3 from "better-sqlite3";
|
|
9
8
|
import { type Dialect, SqliteDialect } from "kysely";
|
|
10
9
|
|
|
11
10
|
import type { SqliteConfig } from "./adapters.js";
|
|
11
|
+
import { openNodeSqliteDatabase } from "./node-sqlite-compat.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Create a SQLite dialect from config
|
|
@@ -18,7 +18,7 @@ export function createDialect(config: SqliteConfig): Dialect {
|
|
|
18
18
|
const url = config.url;
|
|
19
19
|
const filePath = url.startsWith("file:") ? url.slice(5) : url;
|
|
20
20
|
|
|
21
|
-
const database =
|
|
21
|
+
const database = openNodeSqliteDatabase(filePath);
|
|
22
22
|
|
|
23
23
|
return new SqliteDialect({ database });
|
|
24
24
|
}
|