emdash 1.0.1 → 1.1.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/action-token-AgOs1UWD.mjs +26 -0
- package/dist/action-token-AgOs1UWD.mjs.map +1 -0
- package/dist/activation-xomsCMJg.mjs +387 -0
- package/dist/activation-xomsCMJg.mjs.map +1 -0
- package/dist/adapters-DM1oyHIN.d.mts +173 -0
- package/dist/adapters-DM1oyHIN.d.mts.map +1 -0
- package/dist/allowed-origins-CFtudhyw.mjs +116 -0
- package/dist/allowed-origins-CFtudhyw.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +4 -4
- package/dist/api/route-utils.mjs +48 -47
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +10 -10
- package/dist/api-CltsXhiX.mjs +4980 -0
- package/dist/api-CltsXhiX.mjs.map +1 -0
- package/dist/api-tokens-P3mAaQgr.mjs +166 -0
- package/dist/api-tokens-P3mAaQgr.mjs.map +1 -0
- package/dist/apply-Q7uvzBWW.mjs +1680 -0
- package/dist/apply-Q7uvzBWW.mjs.map +1 -0
- package/dist/approvals-DycwI6lZ.mjs +460 -0
- package/dist/approvals-DycwI6lZ.mjs.map +1 -0
- package/dist/artifact-fetch-CWxyELVI.mjs +659 -0
- package/dist/artifact-fetch-CWxyELVI.mjs.map +1 -0
- package/dist/artifacts-UzWbysb8.mjs +307 -0
- package/dist/artifacts-UzWbysb8.mjs.map +1 -0
- package/dist/astro/index.d.mts +14 -14
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +38 -12
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +12 -12
- package/dist/astro/middleware/auth.mjs +12 -11
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +6 -6
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +9 -22
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +33 -21
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +12 -12
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +203 -120
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +15 -15
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +15 -15
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +7 -7
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +8 -8
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +7 -7
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +17 -17
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +17 -17
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +17 -17
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +22 -22
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +22 -23
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +23 -23
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +19 -19
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/bulk.mjs +18 -18
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/index.mjs +18 -18
- package/dist/astro/routes/api/admin/core-update.mjs +8 -8
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +7 -7
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +6 -6
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +21 -21
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +22 -22
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +22 -22
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +23 -23
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +29 -29
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +22 -22
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +22 -22
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +7 -7
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +7 -7
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +9 -9
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +9 -9
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +72 -71
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +8 -8
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +70 -69
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +71 -70
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +81 -80
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +71 -70
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +8 -8
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +70 -69
- 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 +80 -79
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +70 -69
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +71 -70
- 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 +82 -81
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +10 -10
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +73 -72
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +8 -8
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +71 -70
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +70 -69
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +70 -69
- 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 +8 -8
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +70 -69
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs +5 -5
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +39 -39
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +39 -39
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs +43 -43
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +43 -43
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +43 -43
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +43 -43
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +41 -41
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs +43 -43
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +15 -15
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +7 -7
- package/dist/astro/routes/api/admin/users/index.mjs +15 -15
- package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/accept.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/complete.mjs +20 -20
- package/dist/astro/routes/api/auth/invite/index.mjs +17 -17
- package/dist/astro/routes/api/auth/invite/register-options.mjs +18 -18
- package/dist/astro/routes/api/auth/logout.mjs +6 -6
- package/dist/astro/routes/api/auth/magic-link/send.mjs +19 -19
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +16 -16
- package/dist/astro/routes/api/auth/me.mjs +16 -16
- package/dist/astro/routes/api/auth/mode.mjs +6 -6
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +36 -13
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +20 -5
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +15 -15
- package/dist/astro/routes/api/auth/passkey/index.mjs +5 -5
- package/dist/astro/routes/api/auth/passkey/options.mjs +20 -20
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +18 -18
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +19 -19
- package/dist/astro/routes/api/auth/passkey/verify.mjs +20 -20
- package/dist/astro/routes/api/auth/signup/complete.mjs +20 -20
- package/dist/astro/routes/api/auth/signup/request.mjs +18 -18
- package/dist/astro/routes/api/auth/signup/verify.mjs +5 -5
- package/dist/astro/routes/api/calendar.d.mts +8 -0
- package/dist/astro/routes/api/calendar.d.mts.map +1 -0
- package/dist/astro/routes/api/calendar.mjs +204 -0
- package/dist/astro/routes/api/calendar.mjs.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -14
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +20 -20
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +31 -31
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +34 -34
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +34 -34
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +24 -24
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/authors.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/index.mjs +16 -16
- package/dist/astro/routes/api/content/_collection_/trash.mjs +16 -16
- package/dist/astro/routes/api/dashboard.mjs +11 -11
- package/dist/astro/routes/api/dev/emails.mjs +6 -6
- package/dist/astro/routes/api/health.mjs +7 -7
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +24 -24
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +6 -6
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress/execute.mjs +23 -23
- package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -12
- package/dist/astro/routes/api/import/wordpress/media.mjs +20 -20
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +18 -18
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +27 -27
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -24
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +32 -32
- package/dist/astro/routes/api/manifest.mjs +7 -7
- package/dist/astro/routes/api/mcp.mjs +94 -94
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +19 -19
- package/dist/astro/routes/api/media/_id_/replace.mjs +17 -17
- package/dist/astro/routes/api/media/_id_/upload.mjs +10 -10
- package/dist/astro/routes/api/media/_id_/usage.mjs +31 -31
- package/dist/astro/routes/api/media/_id_.mjs +29 -29
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +7 -7
- package/dist/astro/routes/api/media/file/_...key_.mjs +10 -10
- package/dist/astro/routes/api/media/folders/_id_.mjs +17 -17
- package/dist/astro/routes/api/media/folders/index.mjs +17 -17
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +6 -6
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +6 -6
- package/dist/astro/routes/api/media/providers/index.mjs +6 -6
- package/dist/astro/routes/api/media/upload-url.mjs +23 -23
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +37 -36
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +18 -18
- package/dist/astro/routes/api/menus/_name_/items.mjs +18 -18
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +18 -18
- package/dist/astro/routes/api/menus/_name_/translations.mjs +18 -18
- package/dist/astro/routes/api/menus/_name_.mjs +18 -18
- package/dist/astro/routes/api/menus/index.mjs +18 -18
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/code.mjs +12 -12
- package/dist/astro/routes/api/oauth/device/token.mjs +11 -11
- package/dist/astro/routes/api/oauth/register.mjs +8 -8
- package/dist/astro/routes/api/oauth/token/refresh.mjs +9 -9
- package/dist/astro/routes/api/oauth/token/revoke.mjs +9 -9
- package/dist/astro/routes/api/oauth/token.mjs +9 -9
- package/dist/astro/routes/api/openapi.json.mjs +21 -21
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +12 -12
- package/dist/astro/routes/api/redirects/404s/index.mjs +20 -19
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +20 -19
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +20 -19
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +20 -19
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +34 -34
- package/dist/astro/routes/api/relations/index.mjs +34 -34
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +6 -6
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +17 -17
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +70 -69
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +70 -69
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/index.mjs +70 -69
- package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +70 -69
- 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 +70 -69
- 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 +70 -69
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +70 -69
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +70 -69
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +70 -69
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +16 -16
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +70 -69
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +70 -69
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +19 -19
- package/dist/astro/routes/api/search/index.mjs +18 -18
- package/dist/astro/routes/api/search/rebuild.mjs +19 -19
- package/dist/astro/routes/api/search/stats.mjs +9 -9
- package/dist/astro/routes/api/search/suggest.mjs +18 -18
- package/dist/astro/routes/api/sections/_slug_.mjs +18 -18
- package/dist/astro/routes/api/sections/index.mjs +18 -18
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/export.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/index.mjs +9 -9
- package/dist/astro/routes/api/settings/email.mjs +7 -7
- package/dist/astro/routes/api/settings.mjs +22 -22
- package/dist/astro/routes/api/setup/admin-verify.mjs +21 -21
- package/dist/astro/routes/api/setup/admin.mjs +19 -19
- package/dist/astro/routes/api/setup/dev-bypass.mjs +42 -42
- package/dist/astro/routes/api/setup/dev-reset.mjs +5 -5
- package/dist/astro/routes/api/setup/index.mjs +54 -49
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +7 -7
- package/dist/astro/routes/api/snapshot.mjs +10 -10
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +22 -22
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +22 -22
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +22 -22
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +22 -22
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +21 -21
- package/dist/astro/routes/api/taxonomies/_name_.mjs +22 -22
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +35 -35
- package/dist/astro/routes/api/taxonomies/index.mjs +22 -22
- package/dist/astro/routes/api/themes/preview.mjs +8 -8
- package/dist/astro/routes/api/typegen.mjs +7 -7
- package/dist/astro/routes/api/visual-editing/action-token.mjs +8 -8
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +20 -20
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +5 -5
- 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 +17 -17
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +19 -19
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +19 -19
- package/dist/astro/routes/api/widget-areas/_name_.mjs +9 -9
- package/dist/astro/routes/api/widget-areas/index.mjs +19 -19
- package/dist/astro/routes/api/widget-components.mjs +6 -6
- package/dist/astro/routes/robots.txt.mjs +7 -7
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +8 -8
- package/dist/astro/types.d.mts +17 -17
- package/dist/audit-CCH3MA4Y.mjs +127 -0
- package/dist/audit-CCH3MA4Y.mjs.map +1 -0
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/auth/providers/microsoft.d.mts +27 -0
- package/dist/auth/providers/microsoft.d.mts.map +1 -0
- package/dist/auth/providers/microsoft.mjs +20 -0
- package/dist/auth/providers/microsoft.mjs.map +1 -0
- package/dist/authoritative-records-dSvXCfzb.mjs +5172 -0
- package/dist/authoritative-records-dSvXCfzb.mjs.map +1 -0
- package/dist/authorize-DeWfk--K.mjs +49 -0
- package/dist/authorize-DeWfk--K.mjs.map +1 -0
- package/dist/backup-CFnbdTSJ.mjs +246 -0
- package/dist/backup-CFnbdTSJ.mjs.map +1 -0
- package/dist/base64-BQBZwXCx.mjs +63 -0
- package/dist/base64-BQBZwXCx.mjs.map +1 -0
- package/dist/block-types-C0YFSfR7.mjs +132 -0
- package/dist/block-types-C0YFSfR7.mjs.map +1 -0
- package/dist/block-values-H4E0XwE8.mjs +175 -0
- package/dist/block-values-H4E0XwE8.mjs.map +1 -0
- package/dist/byline-BhVslYLz.mjs +909 -0
- package/dist/byline-BhVslYLz.mjs.map +1 -0
- package/dist/byline-fields-DHJs0Mja.mjs +280 -0
- package/dist/byline-fields-DHJs0Mja.mjs.map +1 -0
- package/dist/byline-fields-xdxE9kxZ.mjs +123 -0
- package/dist/byline-fields-xdxE9kxZ.mjs.map +1 -0
- package/dist/bylines-B_nN9liM.mjs +234 -0
- package/dist/bylines-B_nN9liM.mjs.map +1 -0
- package/dist/bylines-C71YACkL.mjs +150 -0
- package/dist/bylines-C71YACkL.mjs.map +1 -0
- package/dist/cache-aTYCL9nK.mjs +133 -0
- package/dist/cache-aTYCL9nK.mjs.map +1 -0
- package/dist/canonical-Y1dpjCnp.mjs +174 -0
- package/dist/canonical-Y1dpjCnp.mjs.map +1 -0
- package/dist/capture-triggers-C9JKoIdT.mjs +362 -0
- package/dist/capture-triggers-C9JKoIdT.mjs.map +1 -0
- package/dist/challenge-store-CxZxPqaw.mjs +51 -0
- package/dist/challenge-store-CxZxPqaw.mjs.map +1 -0
- package/dist/checksum-DtH6m5uk.mjs +162 -0
- package/dist/checksum-DtH6m5uk.mjs.map +1 -0
- package/dist/chrome-tags-BIKBMZYO.mjs +24 -0
- package/dist/chrome-tags-BIKBMZYO.mjs.map +1 -0
- package/dist/chunks-zlGB5IQP.mjs +25 -0
- package/dist/chunks-zlGB5IQP.mjs.map +1 -0
- package/dist/cli/index.mjs +47 -47
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +121 -121
- package/dist/client/index.mjs +2 -2
- package/dist/collection-slugs-cache-B2Gs9Jwx.mjs +85 -0
- package/dist/collection-slugs-cache-B2Gs9Jwx.mjs.map +1 -0
- package/dist/comment-Bu08Wvr3.mjs +313 -0
- package/dist/comment-Bu08Wvr3.mjs.map +1 -0
- package/dist/comment-reaction-B8SfT-yM.mjs +85 -0
- package/dist/comment-reaction-B8SfT-yM.mjs.map +1 -0
- package/dist/comments-BRtp992B.mjs +99 -0
- package/dist/comments-BRtp992B.mjs.map +1 -0
- package/dist/comments-DVUYqdyC.mjs +195 -0
- package/dist/comments-DVUYqdyC.mjs.map +1 -0
- package/dist/components-CQY-Sgm-.mjs +108 -0
- package/dist/components-CQY-Sgm-.mjs.map +1 -0
- package/dist/config-B-uePMLj.d.mts +39 -0
- package/dist/config-B-uePMLj.d.mts.map +1 -0
- package/dist/config-B6BDSsz2.d.mts +6712 -0
- package/dist/config-B6BDSsz2.d.mts.map +1 -0
- package/dist/config-BsJHiQxC.mjs +228 -0
- package/dist/config-BsJHiQxC.mjs.map +1 -0
- package/dist/connection-B9pIasFd.mjs +36 -0
- package/dist/connection-B9pIasFd.mjs.map +1 -0
- package/dist/content-Dji9vEiW.mjs +2063 -0
- package/dist/content-Dji9vEiW.mjs.map +1 -0
- package/dist/content-list-query-DiNwyKtd.d.mts +26 -0
- package/dist/content-list-query-DiNwyKtd.d.mts.map +1 -0
- package/dist/content-repair-B7wnbzhN.mjs +442 -0
- package/dist/content-repair-B7wnbzhN.mjs.map +1 -0
- package/dist/context-Ctcxc8Ia.mjs +2026 -0
- package/dist/context-Ctcxc8Ia.mjs.map +1 -0
- package/dist/credits-Bu7dlobo.mjs +110 -0
- package/dist/credits-Bu7dlobo.mjs.map +1 -0
- package/dist/cron-xe5XKqA-.mjs +306 -0
- package/dist/cron-xe5XKqA-.mjs.map +1 -0
- package/dist/dashboard-B5hVHOtf.mjs +151 -0
- package/dist/dashboard-B5hVHOtf.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +5 -5
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +4 -4
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +4 -4
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/default-DaoYyFRS.mjs +81 -0
- package/dist/default-DaoYyFRS.mjs.map +1 -0
- package/dist/deferred-tasks-BYcDx2o_.d.mts +9 -0
- package/dist/deferred-tasks-BYcDx2o_.d.mts.map +1 -0
- package/dist/dev-typegen-Dtl8AfS6.mjs +29 -0
- package/dist/dev-typegen-Dtl8AfS6.mjs.map +1 -0
- package/dist/device-flow-Ma5P5d2e.mjs +521 -0
- package/dist/device-flow-Ma5P5d2e.mjs.map +1 -0
- package/dist/digest-xIpR3o64.mjs +194 -0
- package/dist/digest-xIpR3o64.mjs.map +1 -0
- package/dist/direct-executor-DMWwCey3.mjs +104 -0
- package/dist/direct-executor-DMWwCey3.mjs.map +1 -0
- package/dist/email-console-DmqVF5J_.mjs +50 -0
- package/dist/email-console-DmqVF5J_.mjs.map +1 -0
- package/dist/email-locale-Cc5YSXfJ.mjs +25 -0
- package/dist/email-locale-Cc5YSXfJ.mjs.map +1 -0
- package/dist/emdash-runtime-BlybX9Ui.mjs +4249 -0
- package/dist/emdash-runtime-BlybX9Ui.mjs.map +1 -0
- package/dist/enrich-Duu4sV3a.mjs +194 -0
- package/dist/enrich-Duu4sV3a.mjs.map +1 -0
- package/dist/entry-lock-De1L8qUQ.mjs +163 -0
- package/dist/entry-lock-De1L8qUQ.mjs.map +1 -0
- package/dist/entry-lock-esmMbgI9.d.mts +4551 -0
- package/dist/entry-lock-esmMbgI9.d.mts.map +1 -0
- package/dist/entry-lock-sxz2PGAT.mjs +1197 -0
- package/dist/entry-lock-sxz2PGAT.mjs.map +1 -0
- package/dist/env-types-BkjCtN13.mjs +38 -0
- package/dist/env-types-BkjCtN13.mjs.map +1 -0
- package/dist/error-B0rgPgsQ.mjs +90 -0
- package/dist/error-B0rgPgsQ.mjs.map +1 -0
- package/dist/errors-CuHQRiBW.mjs +120 -0
- package/dist/errors-CuHQRiBW.mjs.map +1 -0
- package/dist/errors-DTE6C3K_.mjs +470 -0
- package/dist/errors-DTE6C3K_.mjs.map +1 -0
- package/dist/escape-nJW7dR0s.mjs +9 -0
- package/dist/escape-nJW7dR0s.mjs.map +1 -0
- package/dist/fence-CGw57S4v.mjs +162 -0
- package/dist/fence-CGw57S4v.mjs.map +1 -0
- package/dist/field-defs-cache-Bw8w499w.mjs +77 -0
- package/dist/field-defs-cache-Bw8w499w.mjs.map +1 -0
- package/dist/field-map-hn-D-SyH.mjs +83 -0
- package/dist/field-map-hn-D-SyH.mjs.map +1 -0
- package/dist/fts-manager-DacCYIe4.mjs +443 -0
- package/dist/fts-manager-DacCYIe4.mjs.map +1 -0
- package/dist/gc-BBplHrv6.mjs +75 -0
- package/dist/gc-BBplHrv6.mjs.map +1 -0
- package/dist/hash-C4DFoJ7Z.mjs +37 -0
- package/dist/hash-C4DFoJ7Z.mjs.map +1 -0
- package/dist/hook-result-DSRRxu_-.d.mts +31 -0
- package/dist/hook-result-DSRRxu_-.d.mts.map +1 -0
- package/dist/hreflang-CKPunvU0.mjs +105 -0
- package/dist/hreflang-CKPunvU0.mjs.map +1 -0
- package/dist/hreflang-egumj6WF.d.mts +50 -0
- package/dist/hreflang-egumj6WF.d.mts.map +1 -0
- package/dist/http-route-dispatch-DjNFZcJ2.mjs +339 -0
- package/dist/http-route-dispatch-DjNFZcJ2.mjs.map +1 -0
- package/dist/identity-Dfrx2_Bc.mjs +35 -0
- package/dist/identity-Dfrx2_Bc.mjs.map +1 -0
- package/dist/import-ROBvhbNc.mjs +2021 -0
- package/dist/import-ROBvhbNc.mjs.map +1 -0
- package/dist/index-B4sIdCAT.d.mts +623 -0
- package/dist/index-B4sIdCAT.d.mts.map +1 -0
- package/dist/index.d.mts +24 -24
- package/dist/index.mjs +98 -97
- package/dist/init-lock-BGmew3r1.mjs +56 -0
- package/dist/init-lock-BGmew3r1.mjs.map +1 -0
- package/dist/install-finalization-CPM7Gged.mjs +58 -0
- package/dist/install-finalization-CPM7Gged.mjs.map +1 -0
- package/dist/keys-DxqxcAD4.mjs +61 -0
- package/dist/keys-DxqxcAD4.mjs.map +1 -0
- package/dist/kinds-BQl5gN6e.mjs +974 -0
- package/dist/kinds-BQl5gN6e.mjs.map +1 -0
- package/dist/lifecycle-DGQI7itS.mjs +25 -0
- package/dist/lifecycle-DGQI7itS.mjs.map +1 -0
- package/dist/load-DMxRl4VK.mjs +28 -0
- package/dist/load-DMxRl4VK.mjs.map +1 -0
- package/dist/loader-1DMiOq5s.mjs +1303 -0
- package/dist/loader-1DMiOq5s.mjs.map +1 -0
- package/dist/loops-Dn1i16FP.mjs +205 -0
- package/dist/loops-Dn1i16FP.mjs.map +1 -0
- package/dist/manifest-builder-CTw4FmZk.mjs +189 -0
- package/dist/manifest-builder-CTw4FmZk.mjs.map +1 -0
- package/dist/manifest-schema-gy37bD_D.mjs +496 -0
- package/dist/manifest-schema-gy37bD_D.mjs.map +1 -0
- package/dist/marketplace-tHWSsCUo.mjs +257 -0
- package/dist/marketplace-tHWSsCUo.mjs.map +1 -0
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +1 -1
- package/dist/media/local-runtime.d.mts +14 -14
- package/dist/media/local-runtime.mjs +7 -7
- package/dist/media-Bw-Q65ve.mjs +294 -0
- package/dist/media-Bw-Q65ve.mjs.map +1 -0
- package/dist/media-BzUDu7nl.mjs +373 -0
- package/dist/media-BzUDu7nl.mjs.map +1 -0
- package/dist/media-aahnKHze.mjs +408 -0
- package/dist/media-aahnKHze.mjs.map +1 -0
- package/dist/media-allowlist-RMrjo8TU.mjs +45 -0
- package/dist/media-allowlist-RMrjo8TU.mjs.map +1 -0
- package/dist/media-folders-kabR1oJf.mjs +210 -0
- package/dist/media-folders-kabR1oJf.mjs.map +1 -0
- package/dist/media-url-DloW2xrP.mjs +43 -0
- package/dist/media-url-DloW2xrP.mjs.map +1 -0
- package/dist/media-usage-CHHpV7ee.mjs +282 -0
- package/dist/media-usage-CHHpV7ee.mjs.map +1 -0
- package/dist/media-usage-activation-BinYqC_r.mjs +78 -0
- package/dist/media-usage-activation-BinYqC_r.mjs.map +1 -0
- package/dist/media-usage-work-C734aq6s.mjs +1015 -0
- package/dist/media-usage-work-C734aq6s.mjs.map +1 -0
- package/dist/media-usage-work-lxvV0-UO.mjs +151 -0
- package/dist/media-usage-work-lxvV0-UO.mjs.map +1 -0
- package/dist/menus-6RHNq4ZK.mjs +753 -0
- package/dist/menus-6RHNq4ZK.mjs.map +1 -0
- package/dist/menus-AuCTaO9W.mjs +3704 -0
- package/dist/menus-AuCTaO9W.mjs.map +1 -0
- package/dist/menus-BQKqf0Up.mjs +92 -0
- package/dist/menus-BQKqf0Up.mjs.map +1 -0
- package/dist/migrations/index.d.mts +1 -1
- package/dist/migrations/index.mjs +3 -3
- package/dist/mime-B5M9R53H.mjs +81 -0
- package/dist/mime-B5M9R53H.mjs.map +1 -0
- package/dist/mode-nh0ppSX5.mjs +23 -0
- package/dist/mode-nh0ppSX5.mjs.map +1 -0
- package/dist/node-sqlite-compat-CDOEcc97.mjs +63 -0
- package/dist/node-sqlite-compat-CDOEcc97.mjs.map +1 -0
- package/dist/oauth-authorization-BtYQ80uU.mjs +274 -0
- package/dist/oauth-authorization-BtYQ80uU.mjs.map +1 -0
- package/dist/oauth-clients-C1S4NQHh.mjs +266 -0
- package/dist/oauth-clients-C1S4NQHh.mjs.map +1 -0
- package/dist/oauth-state-store-CpGi2FZH.mjs +50 -0
- package/dist/oauth-state-store-CpGi2FZH.mjs.map +1 -0
- package/dist/oauth-user-lookup-BNp1aFAr.mjs +26 -0
- package/dist/oauth-user-lookup-BNp1aFAr.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/options-B41aLm1I.d.mts +81 -0
- package/dist/options-B41aLm1I.d.mts.map +1 -0
- package/dist/ownership-DoeAIuTg.mjs +12 -0
- package/dist/ownership-DoeAIuTg.mjs.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.mjs +6 -6
- package/dist/parse-CmFDTGzp.mjs +81 -0
- package/dist/parse-CmFDTGzp.mjs.map +1 -0
- package/dist/parse-QVS0t5oR.d.mts +172 -0
- package/dist/parse-QVS0t5oR.d.mts.map +1 -0
- package/dist/passkey-config-C-MxsV22.mjs +46 -0
- package/dist/passkey-config-C-MxsV22.mjs.map +1 -0
- package/dist/paths-kr8hAMMI.mjs +77 -0
- package/dist/paths-kr8hAMMI.mjs.map +1 -0
- package/dist/placeholder-Dn7MMdWr.d.mts +306 -0
- package/dist/placeholder-Dn7MMdWr.d.mts.map +1 -0
- package/dist/plan-CuQOeU9g.mjs +135 -0
- package/dist/plan-CuQOeU9g.mjs.map +1 -0
- package/dist/plugin-test-runtime.d.mts +14 -14
- package/dist/plugin-test-runtime.mjs +110 -109
- package/dist/plugin-types.d.mts +2 -2
- package/dist/plugin-utils.d.mts +12 -12
- package/dist/plugins/adapt-sandbox-entry.d.mts +12 -12
- package/dist/plugins/adapt-sandbox-entry.mjs +3 -3
- package/dist/plugins/host.d.mts +5 -5
- package/dist/plugins/host.mjs +44 -43
- package/dist/plugins-CGb-G98c.mjs +261 -0
- package/dist/plugins-CGb-G98c.mjs.map +1 -0
- package/dist/policy-C5wrDXYV.mjs +45 -0
- package/dist/policy-C5wrDXYV.mjs.map +1 -0
- package/dist/portable-text-BnRuiR1-.mjs +307 -0
- package/dist/portable-text-BnRuiR1-.mjs.map +1 -0
- package/dist/preview-xWNSR1Li.mjs +107 -0
- package/dist/preview-xWNSR1Li.mjs.map +1 -0
- package/dist/protocol-ClxN-m1e.d.mts +61 -0
- package/dist/protocol-ClxN-m1e.d.mts.map +1 -0
- package/dist/public-submission-CkmT2SKv.mjs +250 -0
- package/dist/public-submission-CkmT2SKv.mjs.map +1 -0
- package/dist/public-url-B5a0QAh6.mjs +101 -0
- package/dist/public-url-B5a0QAh6.mjs.map +1 -0
- package/dist/query-DHqFiqqH.mjs +41 -0
- package/dist/query-DHqFiqqH.mjs.map +1 -0
- package/dist/query-DT85BehD.mjs +1125 -0
- package/dist/query-DT85BehD.mjs.map +1 -0
- package/dist/rate-limit-iMvcu3eu.mjs +120 -0
- package/dist/rate-limit-iMvcu3eu.mjs.map +1 -0
- package/dist/receipt-Dpp1uaX9.mjs +43 -0
- package/dist/receipt-Dpp1uaX9.mjs.map +1 -0
- package/dist/redirect-BRoLiWQE.mjs +19 -0
- package/dist/redirect-BRoLiWQE.mjs.map +1 -0
- package/dist/redirect-xZNpBoGp.mjs +417 -0
- package/dist/redirect-xZNpBoGp.mjs.map +1 -0
- package/dist/redirects-D4EWeXAo.mjs +148 -0
- package/dist/redirects-D4EWeXAo.mjs.map +1 -0
- package/dist/redirects-DCKqwiWp.mjs +446 -0
- package/dist/redirects-DCKqwiWp.mjs.map +1 -0
- package/dist/registry/testing.mjs +3 -3
- package/dist/registry-DaXmUsD4.mjs +8369 -0
- package/dist/registry-DaXmUsD4.mjs.map +1 -0
- package/dist/relations-JvBP8nGP.mjs +776 -0
- package/dist/relations-JvBP8nGP.mjs.map +1 -0
- package/dist/request-context.d.mts +2 -2
- package/dist/request-context.mjs.map +1 -1
- package/dist/request-meta-B6blULFY.mjs +141 -0
- package/dist/request-meta-B6blULFY.mjs.map +1 -0
- package/dist/resolve-DAhHi5tn.mjs +100 -0
- package/dist/resolve-DAhHi5tn.mjs.map +1 -0
- package/dist/revision-BWEH2qQB.mjs +368 -0
- package/dist/revision-BWEH2qQB.mjs.map +1 -0
- package/dist/route-wire-DK600v4u.mjs +197 -0
- package/dist/route-wire-DK600v4u.mjs.map +1 -0
- package/dist/routes-BeZyaCzv.mjs +272 -0
- package/dist/routes-BeZyaCzv.mjs.map +1 -0
- package/dist/runner-CskI4Hmq.mjs +6372 -0
- package/dist/runner-CskI4Hmq.mjs.map +1 -0
- package/dist/runner-J3Cj6DGk.d.mts +68 -0
- package/dist/runner-J3Cj6DGk.d.mts.map +1 -0
- package/dist/runtime.d.mts +13 -13
- package/dist/runtime.mjs +3 -3
- package/dist/schema/project-env-types.mjs +37 -37
- package/dist/schema-CK0ihqMR.mjs +815 -0
- package/dist/schema-CK0ihqMR.mjs.map +1 -0
- package/dist/schema-VtaZSrC-.mjs +13 -0
- package/dist/schema-VtaZSrC-.mjs.map +1 -0
- package/dist/scopes-BRnGlL9t.mjs +34 -0
- package/dist/scopes-BRnGlL9t.mjs.map +1 -0
- package/dist/search-D6-XK1Sn.mjs +448 -0
- package/dist/search-D6-XK1Sn.mjs.map +1 -0
- package/dist/secrets-Cc_O3Kp-.mjs +369 -0
- package/dist/secrets-Cc_O3Kp-.mjs.map +1 -0
- package/dist/sections-CBDCf7qR.mjs +346 -0
- package/dist/sections-CBDCf7qR.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +35 -35
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +22 -22
- package/dist/seo-BdeEPDNW.mjs +133 -0
- package/dist/seo-BdeEPDNW.mjs.map +1 -0
- package/dist/seo-C61bnPuV.mjs +114 -0
- package/dist/seo-C61bnPuV.mjs.map +1 -0
- package/dist/service-BuRKLMxa.mjs +150 -0
- package/dist/service-BuRKLMxa.mjs.map +1 -0
- package/dist/session-user-CqkPtrPL.mjs +61 -0
- package/dist/session-user-CqkPtrPL.mjs.map +1 -0
- package/dist/settings-0u0lTthS.mjs +51 -0
- package/dist/settings-0u0lTthS.mjs.map +1 -0
- package/dist/settings-WHr45II1.mjs +61 -0
- package/dist/settings-WHr45II1.mjs.map +1 -0
- package/dist/settings-m5tIYnF0.mjs +443 -0
- package/dist/settings-m5tIYnF0.mjs.map +1 -0
- package/dist/setup-complete-B2_dhZZz.mjs +65 -0
- package/dist/setup-complete-B2_dhZZz.mjs.map +1 -0
- package/dist/setup-nonce-CJV9ftSK.mjs +25 -0
- package/dist/setup-nonce-CJV9ftSK.mjs.map +1 -0
- package/dist/single-flight-cache-D0EaGbN1.mjs +104 -0
- package/dist/single-flight-cache-D0EaGbN1.mjs.map +1 -0
- package/dist/site-settings-KJOqJW6W.mjs +50 -0
- package/dist/site-settings-KJOqJW6W.mjs.map +1 -0
- package/dist/site-url-Ceq_AUK0.mjs +16 -0
- package/dist/site-url-Ceq_AUK0.mjs.map +1 -0
- package/dist/snapshot-Dzsn3NZa.mjs +414 -0
- package/dist/snapshot-Dzsn3NZa.mjs.map +1 -0
- package/dist/ssrf-DsmvZB80.mjs +406 -0
- package/dist/ssrf-DsmvZB80.mjs.map +1 -0
- package/dist/stage-Csnh_yEd.mjs +662 -0
- package/dist/stage-Csnh_yEd.mjs.map +1 -0
- package/dist/staged-Q7pnEVvI.mjs +686 -0
- package/dist/staged-Q7pnEVvI.mjs.map +1 -0
- package/dist/state-kGdOMQRY.mjs +153 -0
- package/dist/state-kGdOMQRY.mjs.map +1 -0
- package/dist/status-D39Fpy8R.mjs +30 -0
- package/dist/status-D39Fpy8R.mjs.map +1 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +2 -2
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/storage-query-C7iy6eUb.d.mts +1615 -0
- package/dist/storage-query-C7iy6eUb.d.mts.map +1 -0
- package/dist/tar-BWiraSUY.mjs +449 -0
- package/dist/tar-BWiraSUY.mjs.map +1 -0
- package/dist/target-DOFs5oUC.mjs +27 -0
- package/dist/target-DOFs5oUC.mjs.map +1 -0
- package/dist/taxonomies-BS40Wxvi.mjs +939 -0
- package/dist/taxonomies-BS40Wxvi.mjs.map +1 -0
- package/dist/taxonomies-DAZU9VDd.mjs +697 -0
- package/dist/taxonomies-DAZU9VDd.mjs.map +1 -0
- package/dist/taxonomy-XzLE95Vx.mjs +525 -0
- package/dist/taxonomy-XzLE95Vx.mjs.map +1 -0
- package/dist/tokens-DSQan4p7.mjs +171 -0
- package/dist/tokens-DSQan4p7.mjs.map +1 -0
- package/dist/transfer-BcCVxDgf.mjs +166 -0
- package/dist/transfer-BcCVxDgf.mjs.map +1 -0
- package/dist/transfer-OMrancOt.mjs +8873 -0
- package/dist/transfer-OMrancOt.mjs.map +1 -0
- package/dist/transfer-download-Dc-ltjZY.mjs +33 -0
- package/dist/transfer-download-Dc-ltjZY.mjs.map +1 -0
- package/dist/transformations-Ddx7UtrY.mjs +196 -0
- package/dist/transformations-Ddx7UtrY.mjs.map +1 -0
- package/dist/transport-flR-Zmds.d.mts +42 -0
- package/dist/transport-flR-Zmds.d.mts.map +1 -0
- package/dist/transport-umzEbgYO.mjs +136 -0
- package/dist/transport-umzEbgYO.mjs.map +1 -0
- package/dist/trusted-proxy-BqfQFs6a.mjs +51 -0
- package/dist/trusted-proxy-BqfQFs6a.mjs.map +1 -0
- package/dist/turnstile-Do60baId.mjs +58 -0
- package/dist/turnstile-Do60baId.mjs.map +1 -0
- package/dist/types-BT1p3uyb.d.mts +1735 -0
- package/dist/types-BT1p3uyb.d.mts.map +1 -0
- package/dist/types-BYaPWs_F.d.mts +198 -0
- package/dist/types-BYaPWs_F.d.mts.map +1 -0
- package/dist/types-C-Xp0CcN.mjs +103 -0
- package/dist/types-C-Xp0CcN.mjs.map +1 -0
- package/dist/types-CLTQ9b_r.d.mts +374 -0
- package/dist/types-CLTQ9b_r.d.mts.map +1 -0
- package/dist/types-CPkQw2T2.d.mts +85 -0
- package/dist/types-CPkQw2T2.d.mts.map +1 -0
- package/dist/types-CQLvuXoZ.d.mts +198 -0
- package/dist/types-CQLvuXoZ.d.mts.map +1 -0
- package/dist/types-CV5xszpF.d.mts +363 -0
- package/dist/types-CV5xszpF.d.mts.map +1 -0
- package/dist/types-CdEMurNh.mjs +77 -0
- package/dist/types-CdEMurNh.mjs.map +1 -0
- package/dist/types-Cj0_yZkn.mjs +18 -0
- package/dist/types-Cj0_yZkn.mjs.map +1 -0
- package/dist/types-CxwtnuSS.mjs +37 -0
- package/dist/types-CxwtnuSS.mjs.map +1 -0
- package/dist/types-DGw8KMX_.mjs +16 -0
- package/dist/types-DGw8KMX_.mjs.map +1 -0
- package/dist/types-DOfVMPoo.d.mts +125 -0
- package/dist/types-DOfVMPoo.d.mts.map +1 -0
- package/dist/types-LtS0SM4F.d.mts +287 -0
- package/dist/types-LtS0SM4F.d.mts.map +1 -0
- package/dist/types-ifgOkcBa.d.mts +916 -0
- package/dist/types-ifgOkcBa.d.mts.map +1 -0
- package/dist/update-check-DOc2aBIU.mjs +161 -0
- package/dist/update-check-DOc2aBIU.mjs.map +1 -0
- package/dist/upload-attempts-nzdc3cay.mjs +32 -0
- package/dist/upload-attempts-nzdc3cay.mjs.map +1 -0
- package/dist/url-pattern-hVbqpXs6.mjs +41 -0
- package/dist/url-pattern-hVbqpXs6.mjs.map +1 -0
- package/dist/user-Dnp53zTq.mjs +171 -0
- package/dist/user-Dnp53zTq.mjs.map +1 -0
- package/dist/utils-CoV-PYhg.mjs +439 -0
- package/dist/utils-CoV-PYhg.mjs.map +1 -0
- package/dist/validate-CfQ9_YlD.d.mts +468 -0
- package/dist/validate-CfQ9_YlD.d.mts.map +1 -0
- package/dist/validate-DBX3DKtL.mjs +516 -0
- package/dist/validate-DBX3DKtL.mjs.map +1 -0
- package/dist/validation-BJMiDhB1.mjs +219 -0
- package/dist/validation-BJMiDhB1.mjs.map +1 -0
- package/dist/version-BaT8yKIT.mjs +7 -0
- package/dist/version-BaT8yKIT.mjs.map +1 -0
- package/dist/version-BwEGkqkx.mjs +9 -0
- package/dist/version-BwEGkqkx.mjs.map +1 -0
- package/dist/virtual-modules-B6vJW15k.mjs +516 -0
- package/dist/virtual-modules-B6vJW15k.mjs.map +1 -0
- package/dist/widgets-BkxBAgZ_.mjs +126 -0
- package/dist/widgets-BkxBAgZ_.mjs.map +1 -0
- package/dist/wxr-taxonomies-D7gAJyOF.mjs +453 -0
- package/dist/wxr-taxonomies-D7gAJyOF.mjs.map +1 -0
- package/dist/wxr-taxonomies-DM5J9AsT.d.mts +34 -0
- package/dist/wxr-taxonomies-DM5J9AsT.d.mts.map +1 -0
- package/dist/zod-generator-BQilAboC.mjs +424 -0
- package/dist/zod-generator-BQilAboC.mjs.map +1 -0
- package/package.json +11 -5
- package/src/api/errors.ts +3 -0
- package/src/api/handlers/bylines.ts +24 -3
- package/src/api/handlers/calendar.ts +246 -0
- package/src/api/handlers/content.ts +12 -5
- package/src/api/handlers/media-allowlist.ts +1 -0
- package/src/api/handlers/media-upload.ts +13 -10
- package/src/api/handlers/plugins.ts +21 -29
- package/src/api/handlers/redirects.ts +6 -6
- package/src/api/schemas/bylines.ts +3 -1
- package/src/api/schemas/content.ts +16 -0
- package/src/astro/integration/index.ts +18 -1
- package/src/astro/integration/routes.ts +5 -0
- package/src/astro/integration/vite-config.ts +11 -0
- package/src/astro/middleware/csp.ts +1 -0
- package/src/astro/middleware/redirect.ts +20 -9
- package/src/astro/middleware/request-context.ts +54 -27
- package/src/astro/middleware.ts +97 -12
- package/src/astro/prefetch.ts +10 -3
- package/src/astro/routes/api/admin/bylines/[id]/translations.ts +0 -5
- package/src/astro/routes/api/admin/bylines/index.ts +1 -1
- package/src/astro/routes/api/admin/plugins/[id]/index.ts +1 -0
- package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +56 -4
- package/src/astro/routes/api/auth/oauth/[provider].ts +37 -4
- package/src/astro/routes/api/calendar.ts +35 -0
- package/src/astro/routes/api/media/upload-url.ts +8 -4
- package/src/astro/routes/api/media.ts +9 -5
- package/src/astro/routes/api/setup/index.ts +14 -2
- package/src/auth/providers/microsoft-admin.tsx +31 -0
- package/src/auth/providers/microsoft.ts +47 -0
- package/src/comments/turnstile.ts +6 -1
- package/src/components/HtmlBlock.astro +17 -6
- package/src/components/HtmlBlockFrame.astro +63 -0
- package/src/components/Iframe.astro +141 -0
- package/src/components/InlinePortableTextEditor.tsx +8 -7
- package/src/components/WebMcpSearch.astro +80 -0
- package/src/components/index.ts +5 -2
- package/src/components/webmcp-search.ts +142 -0
- package/src/config/secrets.ts +27 -15
- package/src/content/converters/portable-text-identity.ts +1 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +36 -2
- package/src/content/converters/prosemirror-to-portable-text.ts +28 -2
- package/src/content/converters/types.ts +24 -0
- package/src/database/content-datetime.ts +11 -4
- package/src/database/migrations/090_redirect_enable_loop_guard.ts +70 -0
- package/src/database/migrations/091_redirect_artifacts.ts +141 -0
- package/src/database/migrations/runner.ts +4 -0
- package/src/database/repositories/content.ts +81 -26
- package/src/database/repositories/redirect.ts +6 -1
- package/src/database/request-scoped.ts +34 -0
- package/src/database/types.ts +23 -0
- package/src/db/adapters.ts +2 -0
- package/src/emdash-runtime.ts +28 -3
- package/src/import/menus.ts +3 -0
- package/src/index.ts +1 -0
- package/src/loader.ts +226 -55
- package/src/mcp/server.ts +12 -4
- package/src/media/mime.ts +21 -0
- package/src/menus/index.ts +30 -26
- package/src/plugins/hooks.ts +10 -0
- package/src/plugins/manager.ts +12 -2
- package/src/plugins/types.ts +16 -0
- package/src/query.ts +12 -29
- package/src/redirects/artifacts.ts +460 -0
- package/src/redirects/cache.ts +76 -41
- package/src/request-context.ts +1 -1
- package/src/seed/apply.ts +65 -57
- package/src/settings/index.ts +17 -12
- package/src/transfer/format/columns.ts +3 -0
- package/src/transfer/import/rebuild.ts +17 -2
- package/src/transfer/import/scaffold.ts +16 -9
- package/src/ui.ts +1 -0
- package/src/utils/sanitize.ts +14 -9
- package/src/virtual-modules.d.ts +3 -0
- package/dist/action-token-D2KE1Rqf.mjs +0 -26
- package/dist/action-token-D2KE1Rqf.mjs.map +0 -1
- package/dist/activation-DDuqAat2.mjs +0 -387
- package/dist/activation-DDuqAat2.mjs.map +0 -1
- package/dist/adapters-Ds-1Pmkm.d.mts +0 -171
- package/dist/adapters-Ds-1Pmkm.d.mts.map +0 -1
- package/dist/allowed-origins-D78QvbTO.mjs +0 -116
- package/dist/allowed-origins-D78QvbTO.mjs.map +0 -1
- package/dist/api-BBZlif0y.mjs +0 -4974
- package/dist/api-BBZlif0y.mjs.map +0 -1
- package/dist/api-tokens-BGbfWZVO.mjs +0 -166
- package/dist/api-tokens-BGbfWZVO.mjs.map +0 -1
- package/dist/apply-CDNV4JJ-.mjs +0 -1672
- package/dist/apply-CDNV4JJ-.mjs.map +0 -1
- package/dist/approvals-CVvJSEBF.mjs +0 -460
- package/dist/approvals-CVvJSEBF.mjs.map +0 -1
- package/dist/artifact-fetch-CGK0DQLj.mjs +0 -659
- package/dist/artifact-fetch-CGK0DQLj.mjs.map +0 -1
- package/dist/audit-BszbE_BP.mjs +0 -127
- package/dist/audit-BszbE_BP.mjs.map +0 -1
- package/dist/authoritative-records-ChM8dTeV.mjs +0 -5172
- package/dist/authoritative-records-ChM8dTeV.mjs.map +0 -1
- package/dist/authorize-CTGywswM.mjs +0 -49
- package/dist/authorize-CTGywswM.mjs.map +0 -1
- package/dist/backup-CDrPP8fI.mjs +0 -246
- package/dist/backup-CDrPP8fI.mjs.map +0 -1
- package/dist/base64-DvnNgP7e.mjs +0 -63
- package/dist/base64-DvnNgP7e.mjs.map +0 -1
- package/dist/block-types-nNEaPkvx.mjs +0 -132
- package/dist/block-types-nNEaPkvx.mjs.map +0 -1
- package/dist/block-values-Bho1nsZF.mjs +0 -175
- package/dist/block-values-Bho1nsZF.mjs.map +0 -1
- package/dist/byline-02tu_Uc-.mjs +0 -909
- package/dist/byline-02tu_Uc-.mjs.map +0 -1
- package/dist/byline-fields-BYbTptTU.mjs +0 -280
- package/dist/byline-fields-BYbTptTU.mjs.map +0 -1
- package/dist/byline-fields-BjQH-1z9.mjs +0 -123
- package/dist/byline-fields-BjQH-1z9.mjs.map +0 -1
- package/dist/bylines-VytjeHBI.mjs +0 -214
- package/dist/bylines-VytjeHBI.mjs.map +0 -1
- package/dist/bylines-gyWBWUUc.mjs +0 -150
- package/dist/bylines-gyWBWUUc.mjs.map +0 -1
- package/dist/cache-CPanL9IO.mjs +0 -114
- package/dist/cache-CPanL9IO.mjs.map +0 -1
- package/dist/canonical-CAecl1UQ.mjs +0 -174
- package/dist/canonical-CAecl1UQ.mjs.map +0 -1
- package/dist/capture-triggers-CdZfvHtF.mjs +0 -362
- package/dist/capture-triggers-CdZfvHtF.mjs.map +0 -1
- package/dist/challenge-store-VePApay4.mjs +0 -51
- package/dist/challenge-store-VePApay4.mjs.map +0 -1
- package/dist/checksum-BSIhEAYW.mjs +0 -162
- package/dist/checksum-BSIhEAYW.mjs.map +0 -1
- package/dist/chrome-tags-CKELm-bo.mjs +0 -24
- package/dist/chrome-tags-CKELm-bo.mjs.map +0 -1
- package/dist/chunks-DBmkKmBH.mjs +0 -25
- package/dist/chunks-DBmkKmBH.mjs.map +0 -1
- package/dist/collection-slugs-cache-BNRAPNiu.mjs +0 -85
- package/dist/collection-slugs-cache-BNRAPNiu.mjs.map +0 -1
- package/dist/comment-Cq1UYN8_.mjs +0 -313
- package/dist/comment-Cq1UYN8_.mjs.map +0 -1
- package/dist/comment-reaction-B5sZzSoA.mjs +0 -85
- package/dist/comment-reaction-B5sZzSoA.mjs.map +0 -1
- package/dist/comments-B3F-ETyh.mjs +0 -195
- package/dist/comments-B3F-ETyh.mjs.map +0 -1
- package/dist/comments-zrTgWBSg.mjs +0 -99
- package/dist/comments-zrTgWBSg.mjs.map +0 -1
- package/dist/components-Dbf4Eq16.mjs +0 -108
- package/dist/components-Dbf4Eq16.mjs.map +0 -1
- package/dist/config-BCM5sQP7.d.mts +0 -6688
- package/dist/config-BCM5sQP7.d.mts.map +0 -1
- package/dist/config-CXPcy2iY.mjs +0 -228
- package/dist/config-CXPcy2iY.mjs.map +0 -1
- package/dist/config-CZkZBuBK.d.mts +0 -39
- package/dist/config-CZkZBuBK.d.mts.map +0 -1
- package/dist/connection-C5GIciX9.mjs +0 -36
- package/dist/connection-C5GIciX9.mjs.map +0 -1
- package/dist/content-RzEXY3QX.mjs +0 -2020
- package/dist/content-RzEXY3QX.mjs.map +0 -1
- package/dist/content-list-query-B6P37Ug_.d.mts +0 -26
- package/dist/content-list-query-B6P37Ug_.d.mts.map +0 -1
- package/dist/content-repair-BDVsYXWK.mjs +0 -442
- package/dist/content-repair-BDVsYXWK.mjs.map +0 -1
- package/dist/context-BpTIzY5h.mjs +0 -2026
- package/dist/context-BpTIzY5h.mjs.map +0 -1
- package/dist/credits-JOE92Gr7.mjs +0 -110
- package/dist/credits-JOE92Gr7.mjs.map +0 -1
- package/dist/cron-ktyapbdB.mjs +0 -306
- package/dist/cron-ktyapbdB.mjs.map +0 -1
- package/dist/dashboard-BoV4pwPP.mjs +0 -151
- package/dist/dashboard-BoV4pwPP.mjs.map +0 -1
- package/dist/default-B7KnYwtQ.mjs +0 -81
- package/dist/default-B7KnYwtQ.mjs.map +0 -1
- package/dist/deferred-tasks-eaUIqXj8.d.mts +0 -9
- package/dist/deferred-tasks-eaUIqXj8.d.mts.map +0 -1
- package/dist/dev-typegen-8JlYYFno.mjs +0 -29
- package/dist/dev-typegen-8JlYYFno.mjs.map +0 -1
- package/dist/device-flow-BlV_z24g.mjs +0 -521
- package/dist/device-flow-BlV_z24g.mjs.map +0 -1
- package/dist/digest-DiYAoZpf.mjs +0 -194
- package/dist/digest-DiYAoZpf.mjs.map +0 -1
- package/dist/direct-executor-Db8xA3zg.mjs +0 -104
- package/dist/direct-executor-Db8xA3zg.mjs.map +0 -1
- package/dist/email-console-Dm78wSmg.mjs +0 -50
- package/dist/email-console-Dm78wSmg.mjs.map +0 -1
- package/dist/email-locale-B4X9LXe9.mjs +0 -25
- package/dist/email-locale-B4X9LXe9.mjs.map +0 -1
- package/dist/emdash-runtime-BakQ6io7.mjs +0 -4239
- package/dist/emdash-runtime-BakQ6io7.mjs.map +0 -1
- package/dist/enrich-BDdVNeDK.mjs +0 -194
- package/dist/enrich-BDdVNeDK.mjs.map +0 -1
- package/dist/entry-lock-DY8B-xcr.d.mts +0 -4544
- package/dist/entry-lock-DY8B-xcr.d.mts.map +0 -1
- package/dist/entry-lock-DrUAdTzf.mjs +0 -163
- package/dist/entry-lock-DrUAdTzf.mjs.map +0 -1
- package/dist/entry-lock-yIkBduqJ.mjs +0 -1180
- package/dist/entry-lock-yIkBduqJ.mjs.map +0 -1
- package/dist/env-types-DkHYR2pl.mjs +0 -38
- package/dist/env-types-DkHYR2pl.mjs.map +0 -1
- package/dist/error-DIYXAVk4.mjs +0 -90
- package/dist/error-DIYXAVk4.mjs.map +0 -1
- package/dist/errors-CNvATh_7.mjs +0 -469
- package/dist/errors-CNvATh_7.mjs.map +0 -1
- package/dist/errors-CjXd1LgH.mjs +0 -120
- package/dist/errors-CjXd1LgH.mjs.map +0 -1
- package/dist/escape-B1GM0yJU.mjs +0 -9
- package/dist/escape-B1GM0yJU.mjs.map +0 -1
- package/dist/fence-8MaKKWhp.mjs +0 -162
- package/dist/fence-8MaKKWhp.mjs.map +0 -1
- package/dist/field-defs-cache-DEkFYCDE.mjs +0 -77
- package/dist/field-defs-cache-DEkFYCDE.mjs.map +0 -1
- package/dist/field-map-D7ioN0r0.mjs +0 -83
- package/dist/field-map-D7ioN0r0.mjs.map +0 -1
- package/dist/fts-manager-DU03MxWu.mjs +0 -443
- package/dist/fts-manager-DU03MxWu.mjs.map +0 -1
- package/dist/gc-DMiE7ezk.mjs +0 -75
- package/dist/gc-DMiE7ezk.mjs.map +0 -1
- package/dist/hash-CY4QdeMJ.mjs +0 -37
- package/dist/hash-CY4QdeMJ.mjs.map +0 -1
- package/dist/hook-result-Cb67D3P3.d.mts +0 -31
- package/dist/hook-result-Cb67D3P3.d.mts.map +0 -1
- package/dist/hreflang-Bterc3b7.mjs +0 -105
- package/dist/hreflang-Bterc3b7.mjs.map +0 -1
- package/dist/hreflang-uIBOE5yg.d.mts +0 -50
- package/dist/hreflang-uIBOE5yg.d.mts.map +0 -1
- package/dist/http-route-dispatch-DubjTibD.mjs +0 -339
- package/dist/http-route-dispatch-DubjTibD.mjs.map +0 -1
- package/dist/identity-DJ-5AcdG.mjs +0 -35
- package/dist/identity-DJ-5AcdG.mjs.map +0 -1
- package/dist/import-DEfuIgRz.mjs +0 -2020
- package/dist/import-DEfuIgRz.mjs.map +0 -1
- package/dist/index-xCy3j0f6.d.mts +0 -623
- package/dist/index-xCy3j0f6.d.mts.map +0 -1
- package/dist/init-lock-4eRRB4Le.mjs +0 -56
- package/dist/init-lock-4eRRB4Le.mjs.map +0 -1
- package/dist/install-finalization-DeGRbaVa.mjs +0 -58
- package/dist/install-finalization-DeGRbaVa.mjs.map +0 -1
- package/dist/keys-DWwMxdZh.mjs +0 -61
- package/dist/keys-DWwMxdZh.mjs.map +0 -1
- package/dist/kinds-D1A-00-F.mjs +0 -974
- package/dist/kinds-D1A-00-F.mjs.map +0 -1
- package/dist/lifecycle-BWtBGNEn.mjs +0 -25
- package/dist/lifecycle-BWtBGNEn.mjs.map +0 -1
- package/dist/load-BR1NEa_3.mjs +0 -28
- package/dist/load-BR1NEa_3.mjs.map +0 -1
- package/dist/loader-D4edocWH.mjs +0 -1197
- package/dist/loader-D4edocWH.mjs.map +0 -1
- package/dist/loops-DLaHFrvI.mjs +0 -205
- package/dist/loops-DLaHFrvI.mjs.map +0 -1
- package/dist/manifest-builder-8jsSLR7s.mjs +0 -189
- package/dist/manifest-builder-8jsSLR7s.mjs.map +0 -1
- package/dist/manifest-schema-DcZjRNEv.mjs +0 -496
- package/dist/manifest-schema-DcZjRNEv.mjs.map +0 -1
- package/dist/marketplace-CNxjq10S.mjs +0 -257
- package/dist/marketplace-CNxjq10S.mjs.map +0 -1
- package/dist/media-3v7mqAVX.mjs +0 -294
- package/dist/media-3v7mqAVX.mjs.map +0 -1
- package/dist/media-Bs6qmlVl.mjs +0 -408
- package/dist/media-Bs6qmlVl.mjs.map +0 -1
- package/dist/media-CputjGE1.mjs +0 -373
- package/dist/media-CputjGE1.mjs.map +0 -1
- package/dist/media-allowlist-isqF1gAh.mjs +0 -44
- package/dist/media-allowlist-isqF1gAh.mjs.map +0 -1
- package/dist/media-folders-D2VdVBf6.mjs +0 -210
- package/dist/media-folders-D2VdVBf6.mjs.map +0 -1
- package/dist/media-url-DbkMY3y6.mjs +0 -43
- package/dist/media-url-DbkMY3y6.mjs.map +0 -1
- package/dist/media-usage-activation-BaT4AlNI.mjs +0 -78
- package/dist/media-usage-activation-BaT4AlNI.mjs.map +0 -1
- package/dist/media-usage-v43L0kR_.mjs +0 -282
- package/dist/media-usage-v43L0kR_.mjs.map +0 -1
- package/dist/media-usage-work-CY8gIeU-.mjs +0 -151
- package/dist/media-usage-work-CY8gIeU-.mjs.map +0 -1
- package/dist/media-usage-work-VO108Q9E.mjs +0 -1015
- package/dist/media-usage-work-VO108Q9E.mjs.map +0 -1
- package/dist/menus-BYyeRemR.mjs +0 -3647
- package/dist/menus-BYyeRemR.mjs.map +0 -1
- package/dist/menus-mC_XTxD7.mjs +0 -92
- package/dist/menus-mC_XTxD7.mjs.map +0 -1
- package/dist/menus-trvc6_fW.mjs +0 -753
- package/dist/menus-trvc6_fW.mjs.map +0 -1
- package/dist/mime-IZf-LHIS.mjs +0 -36
- package/dist/mime-IZf-LHIS.mjs.map +0 -1
- package/dist/mode-B9-gMXL9.mjs +0 -23
- package/dist/mode-B9-gMXL9.mjs.map +0 -1
- package/dist/node-sqlite-compat-DztcWs4y.mjs +0 -63
- package/dist/node-sqlite-compat-DztcWs4y.mjs.map +0 -1
- package/dist/oauth-authorization-BIHy9SGU.mjs +0 -274
- package/dist/oauth-authorization-BIHy9SGU.mjs.map +0 -1
- package/dist/oauth-clients-BZWZvKXa.mjs +0 -266
- package/dist/oauth-clients-BZWZvKXa.mjs.map +0 -1
- package/dist/oauth-state-store-CxXTjXdI.mjs +0 -50
- package/dist/oauth-state-store-CxXTjXdI.mjs.map +0 -1
- package/dist/oauth-user-lookup-GWojfxRl.mjs +0 -26
- package/dist/oauth-user-lookup-GWojfxRl.mjs.map +0 -1
- package/dist/options-DRF6dlXY.d.mts +0 -81
- package/dist/options-DRF6dlXY.d.mts.map +0 -1
- package/dist/ownership-Bd77AmJz.mjs +0 -12
- package/dist/ownership-Bd77AmJz.mjs.map +0 -1
- package/dist/parse-5Y0W39xR.mjs +0 -81
- package/dist/parse-5Y0W39xR.mjs.map +0 -1
- package/dist/parse-BPblgoa-.d.mts +0 -172
- package/dist/parse-BPblgoa-.d.mts.map +0 -1
- package/dist/passkey-config-PiQ5cBnt.mjs +0 -46
- package/dist/passkey-config-PiQ5cBnt.mjs.map +0 -1
- package/dist/paths-DkS74lBM.mjs +0 -77
- package/dist/paths-DkS74lBM.mjs.map +0 -1
- package/dist/placeholder-Bez2282x.d.mts +0 -306
- package/dist/placeholder-Bez2282x.d.mts.map +0 -1
- package/dist/plan-Lw7iGnGD.mjs +0 -135
- package/dist/plan-Lw7iGnGD.mjs.map +0 -1
- package/dist/plugins-D7xSh1Lu.mjs +0 -277
- package/dist/plugins-D7xSh1Lu.mjs.map +0 -1
- package/dist/policy-DMRiMdLn.mjs +0 -45
- package/dist/policy-DMRiMdLn.mjs.map +0 -1
- package/dist/portable-text-kcyN3F-a.mjs +0 -307
- package/dist/portable-text-kcyN3F-a.mjs.map +0 -1
- package/dist/preview--2VDLaND.mjs +0 -107
- package/dist/preview--2VDLaND.mjs.map +0 -1
- package/dist/protocol-FvwLA8P-.d.mts +0 -61
- package/dist/protocol-FvwLA8P-.d.mts.map +0 -1
- package/dist/public-submission-BRyK76U8.mjs +0 -250
- package/dist/public-submission-BRyK76U8.mjs.map +0 -1
- package/dist/public-url-7j0cpCFc.mjs +0 -101
- package/dist/public-url-7j0cpCFc.mjs.map +0 -1
- package/dist/query-BRNTde3V.mjs +0 -41
- package/dist/query-BRNTde3V.mjs.map +0 -1
- package/dist/query-DyYYWOKk.mjs +0 -1161
- package/dist/query-DyYYWOKk.mjs.map +0 -1
- package/dist/rate-limit-D0BcE76H.mjs +0 -120
- package/dist/rate-limit-D0BcE76H.mjs.map +0 -1
- package/dist/receipt-C4icyHlC.mjs +0 -43
- package/dist/receipt-C4icyHlC.mjs.map +0 -1
- package/dist/redirect-9DbtxSNG.mjs +0 -19
- package/dist/redirect-9DbtxSNG.mjs.map +0 -1
- package/dist/redirect-BvFKh8Sz.mjs +0 -416
- package/dist/redirect-BvFKh8Sz.mjs.map +0 -1
- package/dist/redirects-1nhdEaTq.mjs +0 -148
- package/dist/redirects-1nhdEaTq.mjs.map +0 -1
- package/dist/redirects-D1yMnSR9.mjs +0 -446
- package/dist/redirects-D1yMnSR9.mjs.map +0 -1
- package/dist/registry-CzPJNu3H.mjs +0 -8366
- package/dist/registry-CzPJNu3H.mjs.map +0 -1
- package/dist/relations-C8JpSkU6.mjs +0 -776
- package/dist/relations-C8JpSkU6.mjs.map +0 -1
- package/dist/request-meta-Bs60XW1m.mjs +0 -141
- package/dist/request-meta-Bs60XW1m.mjs.map +0 -1
- package/dist/resolve-BHWgMU_X.mjs +0 -100
- package/dist/resolve-BHWgMU_X.mjs.map +0 -1
- package/dist/revision-CGkQA0e5.mjs +0 -366
- package/dist/revision-CGkQA0e5.mjs.map +0 -1
- package/dist/route-wire-ClUVQduA.mjs +0 -197
- package/dist/route-wire-ClUVQduA.mjs.map +0 -1
- package/dist/routes-D2GFl3B7.mjs +0 -272
- package/dist/routes-D2GFl3B7.mjs.map +0 -1
- package/dist/runner-CLpxmhl8.mjs +0 -6197
- package/dist/runner-CLpxmhl8.mjs.map +0 -1
- package/dist/runner-CWl76CH3.d.mts +0 -68
- package/dist/runner-CWl76CH3.d.mts.map +0 -1
- package/dist/schema-27XefSYG.mjs +0 -13
- package/dist/schema-27XefSYG.mjs.map +0 -1
- package/dist/schema-Btvj3BMh.mjs +0 -815
- package/dist/schema-Btvj3BMh.mjs.map +0 -1
- package/dist/scopes-DGCj6K4p.mjs +0 -34
- package/dist/scopes-DGCj6K4p.mjs.map +0 -1
- package/dist/search-pZRRmWjh.mjs +0 -448
- package/dist/search-pZRRmWjh.mjs.map +0 -1
- package/dist/secrets-CIi0nFiR.mjs +0 -341
- package/dist/secrets-CIi0nFiR.mjs.map +0 -1
- package/dist/sections-CIhqs3Ao.mjs +0 -346
- package/dist/sections-CIhqs3Ao.mjs.map +0 -1
- package/dist/seo-DifeiGdl.mjs +0 -114
- package/dist/seo-DifeiGdl.mjs.map +0 -1
- package/dist/seo-DpYxmGaL.mjs +0 -133
- package/dist/seo-DpYxmGaL.mjs.map +0 -1
- package/dist/service-COVdVpSK.mjs +0 -150
- package/dist/service-COVdVpSK.mjs.map +0 -1
- package/dist/session-user-C6IEjuty.mjs +0 -61
- package/dist/session-user-C6IEjuty.mjs.map +0 -1
- package/dist/settings-CwcrX-Ay.mjs +0 -61
- package/dist/settings-CwcrX-Ay.mjs.map +0 -1
- package/dist/settings-D_cJtT48.mjs +0 -439
- package/dist/settings-D_cJtT48.mjs.map +0 -1
- package/dist/settings-tnPQN3Z2.mjs +0 -51
- package/dist/settings-tnPQN3Z2.mjs.map +0 -1
- package/dist/setup-complete-BOrI10UY.mjs +0 -65
- package/dist/setup-complete-BOrI10UY.mjs.map +0 -1
- package/dist/setup-nonce-0XTBLTsX.mjs +0 -25
- package/dist/setup-nonce-0XTBLTsX.mjs.map +0 -1
- package/dist/single-flight-cache-B5O2qhO1.mjs +0 -104
- package/dist/single-flight-cache-B5O2qhO1.mjs.map +0 -1
- package/dist/site-settings-B7vGFRDT.mjs +0 -50
- package/dist/site-settings-B7vGFRDT.mjs.map +0 -1
- package/dist/site-url-wEYRMHBv.mjs +0 -16
- package/dist/site-url-wEYRMHBv.mjs.map +0 -1
- package/dist/snapshot-W36KbLmc.mjs +0 -414
- package/dist/snapshot-W36KbLmc.mjs.map +0 -1
- package/dist/ssrf-CRJ-xom5.mjs +0 -406
- package/dist/ssrf-CRJ-xom5.mjs.map +0 -1
- package/dist/stage-DA0NrTRZ.mjs +0 -662
- package/dist/stage-DA0NrTRZ.mjs.map +0 -1
- package/dist/staged-Bw5eHbKS.mjs +0 -686
- package/dist/staged-Bw5eHbKS.mjs.map +0 -1
- package/dist/state-BTlprvUF.mjs +0 -153
- package/dist/state-BTlprvUF.mjs.map +0 -1
- package/dist/status-C6IrSLMT.mjs +0 -30
- package/dist/status-C6IrSLMT.mjs.map +0 -1
- package/dist/storage-query-CdVF2bng.d.mts +0 -1614
- package/dist/storage-query-CdVF2bng.d.mts.map +0 -1
- package/dist/tar-BGOZARjy.mjs +0 -449
- package/dist/tar-BGOZARjy.mjs.map +0 -1
- package/dist/target-YhYH_0uc.mjs +0 -27
- package/dist/target-YhYH_0uc.mjs.map +0 -1
- package/dist/taxonomies-DK_XBrmT.mjs +0 -697
- package/dist/taxonomies-DK_XBrmT.mjs.map +0 -1
- package/dist/taxonomies-S1M3rUC0.mjs +0 -939
- package/dist/taxonomies-S1M3rUC0.mjs.map +0 -1
- package/dist/taxonomy-BesdHIwi.mjs +0 -525
- package/dist/taxonomy-BesdHIwi.mjs.map +0 -1
- package/dist/tokens-B_ffPF1q.mjs +0 -171
- package/dist/tokens-B_ffPF1q.mjs.map +0 -1
- package/dist/transfer-9fVSxyrV.mjs +0 -166
- package/dist/transfer-9fVSxyrV.mjs.map +0 -1
- package/dist/transfer-B7LUTaYD.mjs +0 -8855
- package/dist/transfer-B7LUTaYD.mjs.map +0 -1
- package/dist/transfer-download-BdNq4VWN.mjs +0 -33
- package/dist/transfer-download-BdNq4VWN.mjs.map +0 -1
- package/dist/transformations-BtQdvyly.mjs +0 -196
- package/dist/transformations-BtQdvyly.mjs.map +0 -1
- package/dist/transport-CriYXY1c.mjs +0 -136
- package/dist/transport-CriYXY1c.mjs.map +0 -1
- package/dist/transport-SnhS6xku.d.mts +0 -42
- package/dist/transport-SnhS6xku.d.mts.map +0 -1
- package/dist/trusted-proxy-C0eHXPd-.mjs +0 -51
- package/dist/trusted-proxy-C0eHXPd-.mjs.map +0 -1
- package/dist/turnstile-BNPrWd1e.mjs +0 -53
- package/dist/turnstile-BNPrWd1e.mjs.map +0 -1
- package/dist/types-B8sF_kE5.d.mts +0 -287
- package/dist/types-B8sF_kE5.d.mts.map +0 -1
- package/dist/types-BYVIYOlD.d.mts +0 -1720
- package/dist/types-BYVIYOlD.d.mts.map +0 -1
- package/dist/types-Bs4bi95j.d.mts +0 -374
- package/dist/types-Bs4bi95j.d.mts.map +0 -1
- package/dist/types-CGuODCZi.d.mts +0 -198
- package/dist/types-CGuODCZi.d.mts.map +0 -1
- package/dist/types-CVsmpTcU.mjs +0 -18
- package/dist/types-CVsmpTcU.mjs.map +0 -1
- package/dist/types-ClFEExxn.mjs +0 -37
- package/dist/types-ClFEExxn.mjs.map +0 -1
- package/dist/types-D994zUWB.d.mts +0 -85
- package/dist/types-D994zUWB.d.mts.map +0 -1
- package/dist/types-DAj1ByJQ.d.mts +0 -125
- package/dist/types-DAj1ByJQ.d.mts.map +0 -1
- package/dist/types-Dlv6esp4.mjs +0 -77
- package/dist/types-Dlv6esp4.mjs.map +0 -1
- package/dist/types-Dr1LVwL7.d.mts +0 -363
- package/dist/types-Dr1LVwL7.d.mts.map +0 -1
- package/dist/types-MN9bOQ1g.d.mts +0 -198
- package/dist/types-MN9bOQ1g.d.mts.map +0 -1
- package/dist/types-d2Szb1oz.mjs +0 -16
- package/dist/types-d2Szb1oz.mjs.map +0 -1
- package/dist/types-ibtP7GEA.d.mts +0 -896
- package/dist/types-ibtP7GEA.d.mts.map +0 -1
- package/dist/types-j6MBDjlZ.mjs +0 -103
- package/dist/types-j6MBDjlZ.mjs.map +0 -1
- package/dist/update-check-D8No-E5s.mjs +0 -161
- package/dist/update-check-D8No-E5s.mjs.map +0 -1
- package/dist/upload-attempts-BodUoFBu.mjs +0 -32
- package/dist/upload-attempts-BodUoFBu.mjs.map +0 -1
- package/dist/url-pattern-DGAG6ZP2.mjs +0 -41
- package/dist/url-pattern-DGAG6ZP2.mjs.map +0 -1
- package/dist/user-BOvuF1sQ.mjs +0 -171
- package/dist/user-BOvuF1sQ.mjs.map +0 -1
- package/dist/utils-Dr01wRKt.mjs +0 -439
- package/dist/utils-Dr01wRKt.mjs.map +0 -1
- package/dist/validate-BttYU7NK.mjs +0 -516
- package/dist/validate-BttYU7NK.mjs.map +0 -1
- package/dist/validate-Df09inbC.d.mts +0 -468
- package/dist/validate-Df09inbC.d.mts.map +0 -1
- package/dist/validation-DH2WRwWO.mjs +0 -219
- package/dist/validation-DH2WRwWO.mjs.map +0 -1
- package/dist/version-BbygH8CT.mjs +0 -7
- package/dist/version-BbygH8CT.mjs.map +0 -1
- package/dist/version-CseoDDOd.mjs +0 -9
- package/dist/version-CseoDDOd.mjs.map +0 -1
- package/dist/virtual-modules-82GlnQyG.mjs +0 -516
- package/dist/virtual-modules-82GlnQyG.mjs.map +0 -1
- package/dist/widgets-DMAgGcQt.mjs +0 -126
- package/dist/widgets-DMAgGcQt.mjs.map +0 -1
- package/dist/wxr-taxonomies-Bi5kFSxQ.mjs +0 -453
- package/dist/wxr-taxonomies-Bi5kFSxQ.mjs.map +0 -1
- package/dist/wxr-taxonomies-y_FpYlDn.d.mts +0 -34
- package/dist/wxr-taxonomies-y_FpYlDn.d.mts.map +0 -1
- package/dist/zod-generator-DnfG5sGQ.mjs +0 -424
- package/dist/zod-generator-DnfG5sGQ.mjs.map +0 -1
- /package/dist/{api-tokens-B4COohsb.mjs → api-tokens-BLz2MtQs.mjs} +0 -0
- /package/dist/{ssrf-sC4_5rxm.mjs → ssrf-tA45vIPX.mjs} +0 -0
|
@@ -1,939 +0,0 @@
|
|
|
1
|
-
import { u as __exportAll } from "./runner-CLpxmhl8.mjs";
|
|
2
|
-
import { o as resolveConfiguredLocale, r as getI18nConfig } from "./config-CvmjJcVw.mjs";
|
|
3
|
-
import { t as withTransaction } from "./transaction-BVYIo_yu.mjs";
|
|
4
|
-
import { t as TaxonomyRepository } from "./taxonomy-BesdHIwi.mjs";
|
|
5
|
-
import { f as findTaxonomyStructure, h as selectTaxonomyDefs, m as saveTaxonomyStructure, p as parseTaxonomyCollections } from "./loader-D4edocWH.mjs";
|
|
6
|
-
import { d as invalidateTermCache, p as fetchVisibleTermCounts, u as invalidateTaxonomyDefsCache } from "./taxonomies-DK_XBrmT.mjs";
|
|
7
|
-
import { sql } from "kysely";
|
|
8
|
-
import { ulid } from "ulidx";
|
|
9
|
-
|
|
10
|
-
//#region src/api/handlers/taxonomies.ts
|
|
11
|
-
/**
|
|
12
|
-
* Taxonomy and term CRUD handlers.
|
|
13
|
-
*
|
|
14
|
-
* i18n: terms and defs are per-locale. `(name, slug, locale)` is unique for
|
|
15
|
-
* terms; `(name, locale)` for defs. Translations of the same term/def share a
|
|
16
|
-
* `translation_group`. The content_taxonomies pivot stores translation_groups
|
|
17
|
-
* so assignments span every locale of a post.
|
|
18
|
-
*
|
|
19
|
-
* A def's `label` and `labelSingular` belong to its locale; `hierarchical` and
|
|
20
|
-
* `collections` belong to the taxonomy and read and write the same through
|
|
21
|
-
* every locale.
|
|
22
|
-
*/
|
|
23
|
-
var taxonomies_exports = /* @__PURE__ */ __exportAll({
|
|
24
|
-
handleTaxonomyCreate: () => handleTaxonomyCreate,
|
|
25
|
-
handleTaxonomyDefTranslations: () => handleTaxonomyDefTranslations,
|
|
26
|
-
handleTaxonomyDelete: () => handleTaxonomyDelete,
|
|
27
|
-
handleTaxonomyGet: () => handleTaxonomyGet,
|
|
28
|
-
handleTaxonomyList: () => handleTaxonomyList,
|
|
29
|
-
handleTaxonomyUpdate: () => handleTaxonomyUpdate,
|
|
30
|
-
handleTermCreate: () => handleTermCreate,
|
|
31
|
-
handleTermDelete: () => handleTermDelete,
|
|
32
|
-
handleTermGet: () => handleTermGet,
|
|
33
|
-
handleTermList: () => handleTermList,
|
|
34
|
-
handleTermReorder: () => handleTermReorder,
|
|
35
|
-
handleTermTranslations: () => handleTermTranslations,
|
|
36
|
-
handleTermUpdate: () => handleTermUpdate
|
|
37
|
-
});
|
|
38
|
-
const NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
39
|
-
const MAX_GENERATED_TERM_SLUG_ATTEMPTS = 16;
|
|
40
|
-
function isTermSlugUniqueViolation(error) {
|
|
41
|
-
const message = error instanceof Error ? error.message.toLowerCase() : "";
|
|
42
|
-
return (message.includes("unique constraint failed") || message.includes("duplicate key")) && message.includes("slug");
|
|
43
|
-
}
|
|
44
|
-
function isTermTranslationLocaleUniqueViolation(error) {
|
|
45
|
-
const message = error instanceof Error ? error.message.toLowerCase() : "";
|
|
46
|
-
return (message.includes("unique constraint failed") || message.includes("duplicate key")) && (message.includes("translation_group") || message.includes("idx_taxonomies_translation_group_locale_unique"));
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Build tree structure from flat terms
|
|
50
|
-
*/
|
|
51
|
-
function buildTree(flatTerms, resolveByGroup = false) {
|
|
52
|
-
const byLocaleGroup = /* @__PURE__ */ new Map();
|
|
53
|
-
const roots = [];
|
|
54
|
-
for (const term of flatTerms) {
|
|
55
|
-
const key = resolveByGroup ? term.translationGroup ?? term.id : `${term.locale}::${term.translationGroup ?? term.id}`;
|
|
56
|
-
byLocaleGroup.set(key, term);
|
|
57
|
-
}
|
|
58
|
-
for (const term of flatTerms) {
|
|
59
|
-
const parent = term.parentId ? byLocaleGroup.get(resolveByGroup ? term.parentId : `${term.locale}::${term.parentId}`) : void 0;
|
|
60
|
-
if (parent) parent.children.push(term);
|
|
61
|
-
else roots.push(term);
|
|
62
|
-
}
|
|
63
|
-
return roots;
|
|
64
|
-
}
|
|
65
|
-
function taxonomyDefNotFound(name, locale) {
|
|
66
|
-
return {
|
|
67
|
-
success: false,
|
|
68
|
-
error: {
|
|
69
|
-
code: "NOT_FOUND",
|
|
70
|
-
message: `Taxonomy '${name}' not found${locale !== void 0 ? ` in locale '${locale}'` : ""}`
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/** Look up the exact definition addressed by a mutation. */
|
|
75
|
-
async function requireTaxonomyDef(db, name, locale) {
|
|
76
|
-
let query = selectTaxonomyDefs(db).where("d.name", "=", name);
|
|
77
|
-
if (locale !== void 0) query = query.where("d.locale", "=", locale);
|
|
78
|
-
const def = await query.orderBy("d.locale", "asc").orderBy("d.id", "asc").executeTakeFirst();
|
|
79
|
-
return def ? {
|
|
80
|
-
success: true,
|
|
81
|
-
def
|
|
82
|
-
} : taxonomyDefNotFound(name, locale);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Prefer the requested locale, then the configured default. Incomplete
|
|
86
|
-
* translation groups fall back deterministically so their terms remain usable.
|
|
87
|
-
*/
|
|
88
|
-
async function requireTaxonomyDefWithFallback(db, name, locale) {
|
|
89
|
-
const defs = await selectTaxonomyDefs(db).where("d.name", "=", name).orderBy("d.locale", "asc").orderBy("d.id", "asc").execute();
|
|
90
|
-
const defaultLocale = getI18nConfig()?.defaultLocale;
|
|
91
|
-
const def = (locale ? defs.find((candidate) => candidate.locale === locale) : void 0) ?? (defaultLocale ? defs.find((candidate) => candidate.locale === defaultLocale) : void 0) ?? defs[0];
|
|
92
|
-
return def ? {
|
|
93
|
-
success: true,
|
|
94
|
-
def
|
|
95
|
-
} : taxonomyDefNotFound(name, locale);
|
|
96
|
-
}
|
|
97
|
-
function validateHierarchicalParent(def, taxonomyName, parentId) {
|
|
98
|
-
if (parentId === void 0 || parentId === null || def.hierarchical === 1) return null;
|
|
99
|
-
return {
|
|
100
|
-
code: "VALIDATION_ERROR",
|
|
101
|
-
message: `Taxonomy '${taxonomyName}' is not hierarchical and cannot have parent terms`
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
/** The subset of `slugs` that still has a row in `_emdash_collections`. */
|
|
105
|
-
async function findExistingCollections(db, slugs) {
|
|
106
|
-
if (slugs.length === 0) return /* @__PURE__ */ new Set();
|
|
107
|
-
const rows = await db.selectFrom("_emdash_collections").select("slug").where("slug", "in", [...slugs]).execute();
|
|
108
|
-
return new Set(rows.map((r) => r.slug));
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Reject a `collections` list naming collections that don't exist. Shared by
|
|
112
|
-
* create and update so both fail the same way instead of storing a reference
|
|
113
|
-
* that reads back filtered out.
|
|
114
|
-
*/
|
|
115
|
-
async function validateCollections(db, collections) {
|
|
116
|
-
const existing = await findExistingCollections(db, collections);
|
|
117
|
-
const invalid = collections.filter((slug) => !existing.has(slug));
|
|
118
|
-
if (invalid.length === 0) return null;
|
|
119
|
-
return {
|
|
120
|
-
code: "VALIDATION_ERROR",
|
|
121
|
-
message: `Unknown collection(s): ${invalid.join(", ")}`
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Shape one definition row for a response, dropping collection references whose
|
|
126
|
-
* collection is gone. Storage is untouched — re-creating the collection
|
|
127
|
-
* re-links automatically, same as `handleTaxonomyList`.
|
|
128
|
-
*/
|
|
129
|
-
async function toTaxonomyResponse(db, row) {
|
|
130
|
-
const def = rowToDef(row);
|
|
131
|
-
const realCollections = await findExistingCollections(db, def.collections);
|
|
132
|
-
return { taxonomy: {
|
|
133
|
-
...def,
|
|
134
|
-
collections: def.collections.filter((slug) => realCollections.has(slug))
|
|
135
|
-
} };
|
|
136
|
-
}
|
|
137
|
-
function rowToDef(row) {
|
|
138
|
-
return {
|
|
139
|
-
id: row.id,
|
|
140
|
-
name: row.name,
|
|
141
|
-
label: row.label,
|
|
142
|
-
labelSingular: row.label_singular ?? void 0,
|
|
143
|
-
hierarchical: row.hierarchical === 1,
|
|
144
|
-
collections: parseTaxonomyCollections(row.collections),
|
|
145
|
-
locale: row.locale,
|
|
146
|
-
translationGroup: row.translation_group
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* List all taxonomy definitions
|
|
151
|
-
*/
|
|
152
|
-
async function handleTaxonomyList(db, options = {}) {
|
|
153
|
-
try {
|
|
154
|
-
const locale = options.locale ? resolveConfiguredLocale(options.locale) : void 0;
|
|
155
|
-
let query = selectTaxonomyDefs(db);
|
|
156
|
-
if (locale !== void 0) query = query.where("d.locale", "=", locale);
|
|
157
|
-
const [rows, collectionRows] = await Promise.all([query.execute(), db.selectFrom("_emdash_collections").select("slug").execute()]);
|
|
158
|
-
const realCollections = new Set(collectionRows.map((r) => r.slug));
|
|
159
|
-
return {
|
|
160
|
-
success: true,
|
|
161
|
-
data: { taxonomies: rows.map((row) => {
|
|
162
|
-
const def = rowToDef(row);
|
|
163
|
-
return {
|
|
164
|
-
...def,
|
|
165
|
-
collections: def.collections.filter((slug) => realCollections.has(slug))
|
|
166
|
-
};
|
|
167
|
-
}) }
|
|
168
|
-
};
|
|
169
|
-
} catch {
|
|
170
|
-
return {
|
|
171
|
-
success: false,
|
|
172
|
-
error: {
|
|
173
|
-
code: "TAXONOMY_LIST_ERROR",
|
|
174
|
-
message: "Failed to list taxonomies"
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Get a single taxonomy definition by name.
|
|
181
|
-
*
|
|
182
|
-
* Definitions are per-locale, so `locale` picks which one. Without it the
|
|
183
|
-
* configured default locale wins, then the lowest locale code.
|
|
184
|
-
*/
|
|
185
|
-
async function handleTaxonomyGet(db, name, options = {}) {
|
|
186
|
-
try {
|
|
187
|
-
const lookup = await requireTaxonomyDefWithFallback(db, name, options.locale ? resolveConfiguredLocale(options.locale) : void 0);
|
|
188
|
-
if (!lookup.success) return lookup;
|
|
189
|
-
return {
|
|
190
|
-
success: true,
|
|
191
|
-
data: await toTaxonomyResponse(db, lookup.def)
|
|
192
|
-
};
|
|
193
|
-
} catch {
|
|
194
|
-
return {
|
|
195
|
-
success: false,
|
|
196
|
-
error: {
|
|
197
|
-
code: "TAXONOMY_GET_ERROR",
|
|
198
|
-
message: "Failed to get taxonomy"
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Create a taxonomy definition in one locale.
|
|
205
|
-
*
|
|
206
|
-
* When the taxonomy already exists in another locale, the new definition joins
|
|
207
|
-
* it whether or not `translationOf` is given, and takes its `hierarchical` and
|
|
208
|
-
* `collections`. A differing value sent with it is rejected rather than applied
|
|
209
|
-
* to every locale; changing the structure is an update.
|
|
210
|
-
*/
|
|
211
|
-
async function handleTaxonomyCreate(db, input) {
|
|
212
|
-
try {
|
|
213
|
-
const locale = resolveConfiguredLocale(input.locale ?? getI18nConfig()?.defaultLocale ?? "en");
|
|
214
|
-
if (!NAME_PATTERN.test(input.name)) return {
|
|
215
|
-
success: false,
|
|
216
|
-
error: {
|
|
217
|
-
code: "VALIDATION_ERROR",
|
|
218
|
-
message: "Taxonomy name must start with a letter and contain only lowercase letters, numbers, and underscores"
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
if (input.translationOf) {
|
|
222
|
-
const source = await db.selectFrom("_emdash_taxonomy_defs").select("name").where("id", "=", input.translationOf).executeTakeFirst();
|
|
223
|
-
if (!source) return {
|
|
224
|
-
success: false,
|
|
225
|
-
error: {
|
|
226
|
-
code: "NOT_FOUND",
|
|
227
|
-
message: "Source taxonomy for translation not found"
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
if (source.name !== input.name) return {
|
|
231
|
-
success: false,
|
|
232
|
-
error: {
|
|
233
|
-
code: "VALIDATION_ERROR",
|
|
234
|
-
message: `A translation of taxonomy '${source.name}' must use the same name`
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
if (input.collections !== void 0) {
|
|
239
|
-
const collectionError = await validateCollections(db, input.collections);
|
|
240
|
-
if (collectionError) return {
|
|
241
|
-
success: false,
|
|
242
|
-
error: collectionError
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
if (await db.selectFrom("_emdash_taxonomy_defs").select("id").where("name", "=", input.name).where("locale", "=", locale).executeTakeFirst()) return {
|
|
246
|
-
success: false,
|
|
247
|
-
error: {
|
|
248
|
-
code: "CONFLICT",
|
|
249
|
-
message: `Taxonomy '${input.name}' already exists in locale '${locale}'`
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
const id = ulid();
|
|
253
|
-
const existingStructure = await findTaxonomyStructure(db, input.name);
|
|
254
|
-
if (existingStructure && !await matchesStructure(db, existingStructure, input)) return {
|
|
255
|
-
success: false,
|
|
256
|
-
error: {
|
|
257
|
-
code: "VALIDATION_ERROR",
|
|
258
|
-
message: `Taxonomy '${input.name}' already exists in another locale with a different hierarchical or collections value; change them with an update`
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
const structure = existingStructure ?? {
|
|
262
|
-
hierarchical: input.hierarchical ?? false,
|
|
263
|
-
collections: [...new Set(input.collections ?? [])]
|
|
264
|
-
};
|
|
265
|
-
const groupId = existingStructure?.id ?? id;
|
|
266
|
-
await withTransaction(db, async (trx) => {
|
|
267
|
-
await trx.insertInto("_emdash_taxonomy_defs").values({
|
|
268
|
-
id,
|
|
269
|
-
name: input.name,
|
|
270
|
-
label: input.label,
|
|
271
|
-
label_singular: input.labelSingular ?? null,
|
|
272
|
-
hierarchical: structure.hierarchical ? 1 : 0,
|
|
273
|
-
collections: JSON.stringify(structure.collections),
|
|
274
|
-
locale,
|
|
275
|
-
translation_group: groupId
|
|
276
|
-
}).execute();
|
|
277
|
-
await saveTaxonomyStructure(trx, input.name, groupId, structure, {});
|
|
278
|
-
});
|
|
279
|
-
invalidateTaxonomyDefsCache();
|
|
280
|
-
return {
|
|
281
|
-
success: true,
|
|
282
|
-
data: { taxonomy: rowToDef(await selectTaxonomyDefs(db).where("d.id", "=", id).executeTakeFirstOrThrow()) }
|
|
283
|
-
};
|
|
284
|
-
} catch (error) {
|
|
285
|
-
if (error instanceof Error && error.message.includes("UNIQUE constraint failed")) return {
|
|
286
|
-
success: false,
|
|
287
|
-
error: {
|
|
288
|
-
code: "CONFLICT",
|
|
289
|
-
message: `Taxonomy '${input.name}' already exists`
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
return {
|
|
293
|
-
success: false,
|
|
294
|
-
error: {
|
|
295
|
-
code: "TAXONOMY_CREATE_ERROR",
|
|
296
|
-
message: "Failed to create taxonomy"
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Whether the `hierarchical` and `collections` a request sends, if any, equal
|
|
303
|
-
* `structure` as a read returns it, without collections that no longer exist.
|
|
304
|
-
*/
|
|
305
|
-
async function matchesStructure(db, structure, input) {
|
|
306
|
-
if (input.hierarchical !== void 0 && input.hierarchical !== structure.hierarchical) return false;
|
|
307
|
-
if (input.collections === void 0) return true;
|
|
308
|
-
const existing = await findExistingCollections(db, structure.collections);
|
|
309
|
-
const visible = structure.collections.filter((collection) => existing.has(collection));
|
|
310
|
-
const sent = new Set(input.collections);
|
|
311
|
-
return sent.size === visible.length && visible.every((collection) => sent.has(collection));
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Update a taxonomy definition.
|
|
315
|
-
*
|
|
316
|
-
* `label` and `labelSingular` write the one row `(name, locale)` resolves to.
|
|
317
|
-
* `hierarchical` and `collections` write the taxonomy, so every locale changes.
|
|
318
|
-
* `name` and `locale` are immutable (renaming would strand the terms, which are
|
|
319
|
-
* keyed on `name`).
|
|
320
|
-
*/
|
|
321
|
-
async function handleTaxonomyUpdate(db, name, input) {
|
|
322
|
-
try {
|
|
323
|
-
const lookup = await requireTaxonomyDef(db, name, input.locale ? resolveConfiguredLocale(input.locale) : void 0);
|
|
324
|
-
if (!lookup.success) return lookup;
|
|
325
|
-
const collections = input.collections ? [...new Set(input.collections)] : void 0;
|
|
326
|
-
if (collections !== void 0) {
|
|
327
|
-
const collectionError = await validateCollections(db, collections);
|
|
328
|
-
if (collectionError) return {
|
|
329
|
-
success: false,
|
|
330
|
-
error: collectionError
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
const updates = {};
|
|
334
|
-
if (input.label !== void 0) updates.label = input.label;
|
|
335
|
-
if (input.labelSingular !== void 0) updates.label_singular = input.labelSingular;
|
|
336
|
-
const structureChanged = input.hierarchical !== void 0 || collections !== void 0;
|
|
337
|
-
if (Object.keys(updates).length > 0 || structureChanged) {
|
|
338
|
-
const def = lookup.def;
|
|
339
|
-
await withTransaction(db, async (trx) => {
|
|
340
|
-
if (Object.keys(updates).length > 0) await trx.updateTable("_emdash_taxonomy_defs").set(updates).where("id", "=", def.id).execute();
|
|
341
|
-
if (structureChanged) await saveTaxonomyStructure(trx, name, def.translation_group ?? def.id, {
|
|
342
|
-
hierarchical: input.hierarchical ?? def.hierarchical === 1,
|
|
343
|
-
collections: collections ?? parseTaxonomyCollections(def.collections)
|
|
344
|
-
}, {
|
|
345
|
-
hierarchical: input.hierarchical,
|
|
346
|
-
collections
|
|
347
|
-
});
|
|
348
|
-
});
|
|
349
|
-
invalidateTaxonomyDefsCache();
|
|
350
|
-
}
|
|
351
|
-
return {
|
|
352
|
-
success: true,
|
|
353
|
-
data: await toTaxonomyResponse(db, await selectTaxonomyDefs(db).where("d.id", "=", lookup.def.id).executeTakeFirstOrThrow())
|
|
354
|
-
};
|
|
355
|
-
} catch {
|
|
356
|
-
return {
|
|
357
|
-
success: false,
|
|
358
|
-
error: {
|
|
359
|
-
code: "TAXONOMY_UPDATE_ERROR",
|
|
360
|
-
message: "Failed to update taxonomy"
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Delete a taxonomy: every locale's definition, every term under that name in
|
|
367
|
-
* every locale, and the term assignments those terms hold.
|
|
368
|
-
*
|
|
369
|
-
* There is no locale scope and no non-empty guard. Terms are keyed on `name`
|
|
370
|
-
* rather than on a definition row, so leaving one locale's definition behind
|
|
371
|
-
* would leave the taxonomy half-deleted — a definition with no terms, or terms
|
|
372
|
-
* no definition describes.
|
|
373
|
-
*/
|
|
374
|
-
async function handleTaxonomyDelete(db, name) {
|
|
375
|
-
try {
|
|
376
|
-
const lookup = await requireTaxonomyDef(db, name);
|
|
377
|
-
if (!lookup.success) return lookup;
|
|
378
|
-
await withTransaction(db, async (trx) => {
|
|
379
|
-
await trx.deleteFrom("content_taxonomies").where("taxonomy_id", "in", (eb) => eb.selectFrom("taxonomies").select(sql`coalesce(translation_group, id)`.as("group")).where("name", "=", name)).execute();
|
|
380
|
-
await trx.deleteFrom("taxonomies").where("name", "=", name).execute();
|
|
381
|
-
await trx.deleteFrom("_emdash_taxonomy_defs").where("name", "=", name).execute();
|
|
382
|
-
await trx.deleteFrom("_emdash_taxonomy_def_groups").where("name", "=", name).execute();
|
|
383
|
-
});
|
|
384
|
-
invalidateTaxonomyDefsCache();
|
|
385
|
-
return {
|
|
386
|
-
success: true,
|
|
387
|
-
data: { deleted: true }
|
|
388
|
-
};
|
|
389
|
-
} catch (error) {
|
|
390
|
-
console.error("[taxonomies] delete failed:", error);
|
|
391
|
-
return {
|
|
392
|
-
success: false,
|
|
393
|
-
error: {
|
|
394
|
-
code: "TAXONOMY_DELETE_ERROR",
|
|
395
|
-
message: "Failed to delete taxonomy"
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* List every locale translation of a taxonomy def (by id or translation_group).
|
|
402
|
-
*/
|
|
403
|
-
async function handleTaxonomyDefTranslations(db, idOrGroup) {
|
|
404
|
-
try {
|
|
405
|
-
const anchor = await db.selectFrom("_emdash_taxonomy_defs").selectAll().where((eb) => eb.or([eb("id", "=", idOrGroup), eb("translation_group", "=", idOrGroup)])).executeTakeFirst();
|
|
406
|
-
if (!anchor) return {
|
|
407
|
-
success: false,
|
|
408
|
-
error: {
|
|
409
|
-
code: "NOT_FOUND",
|
|
410
|
-
message: "Taxonomy not found"
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
const group = anchor.translation_group ?? anchor.id;
|
|
414
|
-
return {
|
|
415
|
-
success: true,
|
|
416
|
-
data: {
|
|
417
|
-
translationGroup: group,
|
|
418
|
-
translations: (await db.selectFrom("_emdash_taxonomy_defs").selectAll().where("translation_group", "=", group).orderBy("locale", "asc").execute()).map((r) => ({
|
|
419
|
-
id: r.id,
|
|
420
|
-
name: r.name,
|
|
421
|
-
label: r.label,
|
|
422
|
-
locale: r.locale
|
|
423
|
-
}))
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
} catch {
|
|
427
|
-
return {
|
|
428
|
-
success: false,
|
|
429
|
-
error: {
|
|
430
|
-
code: "TAXONOMY_TRANSLATIONS_ERROR",
|
|
431
|
-
message: "Failed to list taxonomy translations"
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
/**
|
|
437
|
-
* List all terms for a taxonomy (returns tree for hierarchical taxonomies)
|
|
438
|
-
*/
|
|
439
|
-
async function handleTermList(db, taxonomyName, options = {}) {
|
|
440
|
-
try {
|
|
441
|
-
if (options.resolveFallback && !options.locale) return {
|
|
442
|
-
success: false,
|
|
443
|
-
error: {
|
|
444
|
-
code: "VALIDATION_ERROR",
|
|
445
|
-
message: "A locale is required when resolving taxonomy fallbacks"
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
const locale = options.locale ? resolveConfiguredLocale(options.locale) : void 0;
|
|
449
|
-
const lookup = await requireTaxonomyDefWithFallback(db, taxonomyName, locale);
|
|
450
|
-
if (!lookup.success) return lookup;
|
|
451
|
-
const repo = new TaxonomyRepository(db);
|
|
452
|
-
const terms = options.resolveFallback && locale ? await repo.findByNameResolved(taxonomyName, locale, getI18nConfig()?.defaultLocale ?? "en") : await repo.findByName(taxonomyName, { locale });
|
|
453
|
-
const countsByGroup = options.includeCounts ?? true ? await fetchVisibleTermCounts(db, taxonomyName, parseTaxonomyCollections(lookup.def.collections), locale) : void 0;
|
|
454
|
-
const termData = terms.map((term) => ({
|
|
455
|
-
id: term.id,
|
|
456
|
-
name: term.name,
|
|
457
|
-
slug: term.slug,
|
|
458
|
-
label: term.label,
|
|
459
|
-
parentId: term.parentId,
|
|
460
|
-
description: typeof term.data?.description === "string" ? term.data.description : void 0,
|
|
461
|
-
children: [],
|
|
462
|
-
...countsByGroup && { count: countsByGroup.get(term.translationGroup ?? term.id) ?? 0 },
|
|
463
|
-
locale: term.locale,
|
|
464
|
-
translationGroup: term.translationGroup
|
|
465
|
-
}));
|
|
466
|
-
return {
|
|
467
|
-
success: true,
|
|
468
|
-
data: { terms: lookup.def.hierarchical === 1 ? buildTree(termData, options.resolveFallback && !!locale) : termData }
|
|
469
|
-
};
|
|
470
|
-
} catch (error) {
|
|
471
|
-
console.error("[taxonomies] term list failed:", error);
|
|
472
|
-
return {
|
|
473
|
-
success: false,
|
|
474
|
-
error: {
|
|
475
|
-
code: "TERM_LIST_ERROR",
|
|
476
|
-
message: "Failed to list terms"
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
/**
|
|
482
|
-
* Set the manual order of one sibling group.
|
|
483
|
-
*
|
|
484
|
-
* `ids` names the terms to move, in the desired order; each is a row id or a
|
|
485
|
-
* translation_group and resolves to the latter, because a position belongs to a
|
|
486
|
-
* term rather than to one of its locales. Reordering never reparents — moving a
|
|
487
|
-
* term under a different parent is a term update.
|
|
488
|
-
*
|
|
489
|
-
* The group is `(taxonomy, parentId)` and has no locale: `parentId` is the
|
|
490
|
-
* parent's translation_group (a row id is accepted and resolved), and `null`
|
|
491
|
-
* selects the top level — which for a flat taxonomy is every term.
|
|
492
|
-
*
|
|
493
|
-
* `ids` may be a *subset* of the group, and the listed terms are permuted
|
|
494
|
-
* within the positions they already occupy. A locale only renders the terms
|
|
495
|
-
* translated into it, so a caller often cannot name every member; a member left
|
|
496
|
-
* out keeps its place, which is also what makes a stale list harmless.
|
|
497
|
-
*/
|
|
498
|
-
async function handleTermReorder(db, taxonomyName, input) {
|
|
499
|
-
try {
|
|
500
|
-
const lookup = await requireTaxonomyDef(db, taxonomyName);
|
|
501
|
-
if (!lookup.success) return lookup;
|
|
502
|
-
const repo = new TaxonomyRepository(db);
|
|
503
|
-
let parentId = input.parentId ?? null;
|
|
504
|
-
if (parentId !== null) {
|
|
505
|
-
const parent = await repo.findById(parentId);
|
|
506
|
-
if (parent) parentId = parent.translationGroup ?? parent.id;
|
|
507
|
-
}
|
|
508
|
-
const members = await repo.findByName(taxonomyName, { parentId });
|
|
509
|
-
const siblings = [];
|
|
510
|
-
const seen = /* @__PURE__ */ new Set();
|
|
511
|
-
const resolve = /* @__PURE__ */ new Map();
|
|
512
|
-
for (const term of members) {
|
|
513
|
-
const group = term.translationGroup ?? term.id;
|
|
514
|
-
if (!seen.has(group)) {
|
|
515
|
-
seen.add(group);
|
|
516
|
-
siblings.push({
|
|
517
|
-
group,
|
|
518
|
-
position: term.sortOrder
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
resolve.set(group, group);
|
|
522
|
-
resolve.set(term.id, group);
|
|
523
|
-
}
|
|
524
|
-
const groups = [];
|
|
525
|
-
for (const id of input.ids) {
|
|
526
|
-
const group = resolve.get(id);
|
|
527
|
-
if (!group) return {
|
|
528
|
-
success: false,
|
|
529
|
-
error: {
|
|
530
|
-
code: "REORDER_MISMATCH",
|
|
531
|
-
message: `Term "${id}" is not in the sibling group being reordered`
|
|
532
|
-
}
|
|
533
|
-
};
|
|
534
|
-
if (groups.includes(group)) return {
|
|
535
|
-
success: false,
|
|
536
|
-
error: {
|
|
537
|
-
code: "REORDER_MISMATCH",
|
|
538
|
-
message: `Term "${id}" is listed more than once`
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
groups.push(group);
|
|
542
|
-
}
|
|
543
|
-
await repo.reorder(groups, siblings);
|
|
544
|
-
invalidateTermCache();
|
|
545
|
-
return {
|
|
546
|
-
success: true,
|
|
547
|
-
data: { reordered: true }
|
|
548
|
-
};
|
|
549
|
-
} catch (error) {
|
|
550
|
-
console.error("[taxonomies] term reorder failed:", error);
|
|
551
|
-
return {
|
|
552
|
-
success: false,
|
|
553
|
-
error: {
|
|
554
|
-
code: "TERM_REORDER_ERROR",
|
|
555
|
-
message: "Failed to reorder terms"
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* Validate a parent term reference for create/update.
|
|
562
|
-
*
|
|
563
|
-
* Returns `null` on success or a structured error message that callers
|
|
564
|
-
* wrap in their own ApiResult.
|
|
565
|
-
*
|
|
566
|
-
* - `parentId === undefined` -> no-op (no parent change requested).
|
|
567
|
-
* - `parentId === null` -> caller intends to detach; no-op here.
|
|
568
|
-
* - parent must exist (FK exists -> term row not soft-deleted).
|
|
569
|
-
* - parent must live in the same taxonomy.
|
|
570
|
-
* - reject a parent in the term's own translation_group (self-parent),
|
|
571
|
-
* including the create path: a translation inherits its source's group, so
|
|
572
|
-
* `selfGroup` carries that prospective group when `termId` is absent.
|
|
573
|
-
* - walk up the parent chain to detect cycles, on create against `selfGroup`,
|
|
574
|
-
* since a translation under another parent moves the existing term.
|
|
575
|
-
*/
|
|
576
|
-
async function validateParentTerm(repo, taxonomyName, termId, parentId, selfGroup) {
|
|
577
|
-
if (parentId === void 0 || parentId === null) return null;
|
|
578
|
-
const parent = await repo.findById(parentId);
|
|
579
|
-
if (!parent) return {
|
|
580
|
-
code: "VALIDATION_ERROR",
|
|
581
|
-
message: `Parent term '${parentId}' not found`
|
|
582
|
-
};
|
|
583
|
-
if (parent.name !== taxonomyName) return {
|
|
584
|
-
code: "VALIDATION_ERROR",
|
|
585
|
-
message: `Parent term '${parentId}' belongs to taxonomy '${parent.name}', not '${taxonomyName}'`
|
|
586
|
-
};
|
|
587
|
-
const parentGroup = parent.translationGroup ?? parent.id;
|
|
588
|
-
let termGroup = selfGroup ?? null;
|
|
589
|
-
if (termId !== void 0) {
|
|
590
|
-
const term = await repo.findById(termId);
|
|
591
|
-
termGroup = term ? term.translationGroup ?? term.id : termId;
|
|
592
|
-
}
|
|
593
|
-
if (termGroup !== null && parentGroup === termGroup) return {
|
|
594
|
-
code: "VALIDATION_ERROR",
|
|
595
|
-
message: "A term cannot be its own parent"
|
|
596
|
-
};
|
|
597
|
-
const MAX_DEPTH = 100;
|
|
598
|
-
let cursor = parent.parentId;
|
|
599
|
-
let steps = 0;
|
|
600
|
-
while (cursor !== null && steps < MAX_DEPTH) {
|
|
601
|
-
if (termGroup !== null && cursor === termGroup) return {
|
|
602
|
-
code: "VALIDATION_ERROR",
|
|
603
|
-
message: "Cycle detected: cannot make a descendant the parent"
|
|
604
|
-
};
|
|
605
|
-
const next = await repo.findById(cursor);
|
|
606
|
-
if (!next) break;
|
|
607
|
-
cursor = next.parentId;
|
|
608
|
-
steps++;
|
|
609
|
-
}
|
|
610
|
-
if (cursor !== null && steps >= MAX_DEPTH) return {
|
|
611
|
-
code: "VALIDATION_ERROR",
|
|
612
|
-
message: "Parent chain exceeds maximum depth"
|
|
613
|
-
};
|
|
614
|
-
return null;
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* Create a new term in a taxonomy
|
|
618
|
-
*/
|
|
619
|
-
async function handleTermCreate(db, taxonomyName, input) {
|
|
620
|
-
let attemptedSlug = input.slug;
|
|
621
|
-
let effectiveLocale = input.locale ?? getI18nConfig()?.defaultLocale ?? "en";
|
|
622
|
-
try {
|
|
623
|
-
const locale = resolveConfiguredLocale(input.locale ?? getI18nConfig()?.defaultLocale ?? "en");
|
|
624
|
-
effectiveLocale = locale;
|
|
625
|
-
const lookup = await requireTaxonomyDefWithFallback(db, taxonomyName, locale);
|
|
626
|
-
if (!lookup.success) return lookup;
|
|
627
|
-
const repo = new TaxonomyRepository(db);
|
|
628
|
-
const parentId = input.parentId === "" || input.parentId === void 0 ? void 0 : input.parentId;
|
|
629
|
-
const hierarchyError = validateHierarchicalParent(lookup.def, taxonomyName, parentId);
|
|
630
|
-
if (hierarchyError) return {
|
|
631
|
-
success: false,
|
|
632
|
-
error: hierarchyError
|
|
633
|
-
};
|
|
634
|
-
if (input.slug === void 0 ? null : await repo.findBySlug(taxonomyName, input.slug, locale)) return {
|
|
635
|
-
success: false,
|
|
636
|
-
error: {
|
|
637
|
-
code: "CONFLICT",
|
|
638
|
-
message: `Term '${input.slug}' already exists in '${taxonomyName}' (${locale})`
|
|
639
|
-
}
|
|
640
|
-
};
|
|
641
|
-
let selfGroup = null;
|
|
642
|
-
if (input.translationOf) {
|
|
643
|
-
const source = await repo.findById(input.translationOf);
|
|
644
|
-
if (!source) return {
|
|
645
|
-
success: false,
|
|
646
|
-
error: {
|
|
647
|
-
code: "VALIDATION_ERROR",
|
|
648
|
-
message: `Translation source '${input.translationOf}' not found`
|
|
649
|
-
}
|
|
650
|
-
};
|
|
651
|
-
if (source.name !== taxonomyName) return {
|
|
652
|
-
success: false,
|
|
653
|
-
error: {
|
|
654
|
-
code: "VALIDATION_ERROR",
|
|
655
|
-
message: `Translation source '${input.translationOf}' belongs to taxonomy '${source.name}', not '${taxonomyName}'`
|
|
656
|
-
}
|
|
657
|
-
};
|
|
658
|
-
selfGroup = source.translationGroup ?? source.id;
|
|
659
|
-
if ((await repo.findTranslations(selfGroup)).some((translation) => translation.locale === locale)) return {
|
|
660
|
-
success: false,
|
|
661
|
-
error: {
|
|
662
|
-
code: "CONFLICT",
|
|
663
|
-
message: `Term translation already exists for locale '${locale}'`
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
const parentError = await validateParentTerm(repo, taxonomyName, void 0, parentId, selfGroup);
|
|
668
|
-
if (parentError) return {
|
|
669
|
-
success: false,
|
|
670
|
-
error: parentError
|
|
671
|
-
};
|
|
672
|
-
const create = (slug) => repo.create({
|
|
673
|
-
name: taxonomyName,
|
|
674
|
-
slug,
|
|
675
|
-
label: input.label,
|
|
676
|
-
parentId: parentId ?? void 0,
|
|
677
|
-
data: input.description ? { description: input.description } : void 0,
|
|
678
|
-
locale,
|
|
679
|
-
translationOf: input.translationOf
|
|
680
|
-
});
|
|
681
|
-
let term;
|
|
682
|
-
let lastSlugConflict;
|
|
683
|
-
if (input.slug !== void 0) term = await create(input.slug);
|
|
684
|
-
else for (let attempt = 0; attempt < MAX_GENERATED_TERM_SLUG_ATTEMPTS; attempt++) {
|
|
685
|
-
attemptedSlug = await repo.generateUniqueSlug(taxonomyName, input.label, locale);
|
|
686
|
-
try {
|
|
687
|
-
term = await create(attemptedSlug);
|
|
688
|
-
break;
|
|
689
|
-
} catch (error) {
|
|
690
|
-
if (!isTermSlugUniqueViolation(error)) throw error;
|
|
691
|
-
lastSlugConflict = error;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
if (!term) throw lastSlugConflict ?? /* @__PURE__ */ new Error("Failed to create taxonomy term");
|
|
695
|
-
invalidateTermCache();
|
|
696
|
-
return {
|
|
697
|
-
success: true,
|
|
698
|
-
data: { term: {
|
|
699
|
-
id: term.id,
|
|
700
|
-
name: term.name,
|
|
701
|
-
slug: term.slug,
|
|
702
|
-
label: term.label,
|
|
703
|
-
parentId: term.parentId,
|
|
704
|
-
description: typeof term.data?.description === "string" ? term.data.description : void 0,
|
|
705
|
-
locale: term.locale,
|
|
706
|
-
translationGroup: term.translationGroup
|
|
707
|
-
} }
|
|
708
|
-
};
|
|
709
|
-
} catch (error) {
|
|
710
|
-
if (isTermTranslationLocaleUniqueViolation(error)) return {
|
|
711
|
-
success: false,
|
|
712
|
-
error: {
|
|
713
|
-
code: "CONFLICT",
|
|
714
|
-
message: `Term translation already exists for locale '${effectiveLocale}'`
|
|
715
|
-
}
|
|
716
|
-
};
|
|
717
|
-
if (isTermSlugUniqueViolation(error)) return {
|
|
718
|
-
success: false,
|
|
719
|
-
error: {
|
|
720
|
-
code: "CONFLICT",
|
|
721
|
-
message: `Term with slug '${attemptedSlug ?? "(generated)"}' already exists in taxonomy '${taxonomyName}'`
|
|
722
|
-
}
|
|
723
|
-
};
|
|
724
|
-
return {
|
|
725
|
-
success: false,
|
|
726
|
-
error: {
|
|
727
|
-
code: "TERM_CREATE_ERROR",
|
|
728
|
-
message: "Failed to create term"
|
|
729
|
-
}
|
|
730
|
-
};
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Get a single term by slug
|
|
735
|
-
*/
|
|
736
|
-
async function handleTermGet(db, taxonomyName, termSlug, options = {}) {
|
|
737
|
-
try {
|
|
738
|
-
const repo = new TaxonomyRepository(db);
|
|
739
|
-
const locale = options.locale ? resolveConfiguredLocale(options.locale) : void 0;
|
|
740
|
-
const term = await repo.findBySlug(taxonomyName, termSlug, locale);
|
|
741
|
-
if (!term) return {
|
|
742
|
-
success: false,
|
|
743
|
-
error: {
|
|
744
|
-
code: "NOT_FOUND",
|
|
745
|
-
message: `Term '${termSlug}' not found in taxonomy '${taxonomyName}'`
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
const lookup = await requireTaxonomyDefWithFallback(db, taxonomyName, locale);
|
|
749
|
-
const count = (await fetchVisibleTermCounts(db, taxonomyName, lookup.success ? parseTaxonomyCollections(lookup.def.collections) : [], locale ?? term.locale)).get(term.translationGroup ?? term.id) ?? 0;
|
|
750
|
-
const children = await repo.findChildren(term.id, term.locale);
|
|
751
|
-
return {
|
|
752
|
-
success: true,
|
|
753
|
-
data: { term: {
|
|
754
|
-
id: term.id,
|
|
755
|
-
name: term.name,
|
|
756
|
-
slug: term.slug,
|
|
757
|
-
label: term.label,
|
|
758
|
-
parentId: term.parentId,
|
|
759
|
-
description: typeof term.data?.description === "string" ? term.data.description : void 0,
|
|
760
|
-
count,
|
|
761
|
-
children: children.map((c) => ({
|
|
762
|
-
id: c.id,
|
|
763
|
-
slug: c.slug,
|
|
764
|
-
label: c.label
|
|
765
|
-
})),
|
|
766
|
-
locale: term.locale,
|
|
767
|
-
translationGroup: term.translationGroup
|
|
768
|
-
} }
|
|
769
|
-
};
|
|
770
|
-
} catch {
|
|
771
|
-
return {
|
|
772
|
-
success: false,
|
|
773
|
-
error: {
|
|
774
|
-
code: "TERM_GET_ERROR",
|
|
775
|
-
message: "Failed to get term"
|
|
776
|
-
}
|
|
777
|
-
};
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
/** List every translation of a term (by id or translation_group). */
|
|
781
|
-
async function handleTermTranslations(db, idOrGroup) {
|
|
782
|
-
try {
|
|
783
|
-
const anchor = await db.selectFrom("taxonomies").selectAll().where((eb) => eb.or([eb("id", "=", idOrGroup), eb("translation_group", "=", idOrGroup)])).executeTakeFirst();
|
|
784
|
-
if (!anchor) return {
|
|
785
|
-
success: false,
|
|
786
|
-
error: {
|
|
787
|
-
code: "NOT_FOUND",
|
|
788
|
-
message: "Term not found"
|
|
789
|
-
}
|
|
790
|
-
};
|
|
791
|
-
const group = anchor.translation_group ?? anchor.id;
|
|
792
|
-
return {
|
|
793
|
-
success: true,
|
|
794
|
-
data: {
|
|
795
|
-
translationGroup: group,
|
|
796
|
-
translations: (await db.selectFrom("taxonomies").selectAll().where("translation_group", "=", group).orderBy("locale", "asc").execute()).map((r) => ({
|
|
797
|
-
id: r.id,
|
|
798
|
-
slug: r.slug,
|
|
799
|
-
label: r.label,
|
|
800
|
-
locale: r.locale
|
|
801
|
-
}))
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
} catch {
|
|
805
|
-
return {
|
|
806
|
-
success: false,
|
|
807
|
-
error: {
|
|
808
|
-
code: "TERM_TRANSLATIONS_ERROR",
|
|
809
|
-
message: "Failed to list term translations"
|
|
810
|
-
}
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* Update a term
|
|
816
|
-
*/
|
|
817
|
-
async function handleTermUpdate(db, taxonomyName, termSlug, input, options = {}) {
|
|
818
|
-
try {
|
|
819
|
-
const repo = new TaxonomyRepository(db);
|
|
820
|
-
const locale = options.locale ? resolveConfiguredLocale(options.locale) : void 0;
|
|
821
|
-
const term = await repo.findBySlug(taxonomyName, termSlug, locale);
|
|
822
|
-
if (!term) return {
|
|
823
|
-
success: false,
|
|
824
|
-
error: {
|
|
825
|
-
code: "NOT_FOUND",
|
|
826
|
-
message: `Term '${termSlug}' not found in taxonomy '${taxonomyName}'`
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
const newSlug = input.slug === "" || input.slug === void 0 ? void 0 : input.slug;
|
|
830
|
-
const newParentId = input.parentId === "" || input.parentId === void 0 ? void 0 : input.parentId;
|
|
831
|
-
if (newParentId !== void 0 && newParentId !== null) {
|
|
832
|
-
const lookup = await requireTaxonomyDefWithFallback(db, taxonomyName, term.locale);
|
|
833
|
-
if (!lookup.success) return lookup;
|
|
834
|
-
const hierarchyError = validateHierarchicalParent(lookup.def, taxonomyName, newParentId);
|
|
835
|
-
if (hierarchyError) return {
|
|
836
|
-
success: false,
|
|
837
|
-
error: hierarchyError
|
|
838
|
-
};
|
|
839
|
-
}
|
|
840
|
-
if (newSlug !== void 0 && newSlug !== termSlug) {
|
|
841
|
-
const existing = await repo.findBySlug(taxonomyName, newSlug, locale);
|
|
842
|
-
if (existing && existing.id !== term.id) return {
|
|
843
|
-
success: false,
|
|
844
|
-
error: {
|
|
845
|
-
code: "CONFLICT",
|
|
846
|
-
message: `Term with slug '${newSlug}' already exists in taxonomy '${taxonomyName}'`
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
const parentError = await validateParentTerm(repo, taxonomyName, term.id, newParentId);
|
|
851
|
-
if (parentError) return {
|
|
852
|
-
success: false,
|
|
853
|
-
error: parentError
|
|
854
|
-
};
|
|
855
|
-
const updated = await repo.update(term.id, {
|
|
856
|
-
slug: newSlug,
|
|
857
|
-
label: input.label,
|
|
858
|
-
parentId: newParentId,
|
|
859
|
-
data: input.description !== void 0 ? { description: input.description } : void 0
|
|
860
|
-
});
|
|
861
|
-
invalidateTermCache();
|
|
862
|
-
if (!updated) return {
|
|
863
|
-
success: false,
|
|
864
|
-
error: {
|
|
865
|
-
code: "TERM_UPDATE_ERROR",
|
|
866
|
-
message: "Failed to update term"
|
|
867
|
-
}
|
|
868
|
-
};
|
|
869
|
-
return {
|
|
870
|
-
success: true,
|
|
871
|
-
data: { term: {
|
|
872
|
-
id: updated.id,
|
|
873
|
-
name: updated.name,
|
|
874
|
-
slug: updated.slug,
|
|
875
|
-
label: updated.label,
|
|
876
|
-
parentId: updated.parentId,
|
|
877
|
-
description: typeof updated.data?.description === "string" ? updated.data.description : void 0,
|
|
878
|
-
locale: updated.locale,
|
|
879
|
-
translationGroup: updated.translationGroup
|
|
880
|
-
} }
|
|
881
|
-
};
|
|
882
|
-
} catch {
|
|
883
|
-
return {
|
|
884
|
-
success: false,
|
|
885
|
-
error: {
|
|
886
|
-
code: "TERM_UPDATE_ERROR",
|
|
887
|
-
message: "Failed to update term"
|
|
888
|
-
}
|
|
889
|
-
};
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
/**
|
|
893
|
-
* Delete a term
|
|
894
|
-
*/
|
|
895
|
-
async function handleTermDelete(db, taxonomyName, termSlug, options = {}) {
|
|
896
|
-
try {
|
|
897
|
-
const repo = new TaxonomyRepository(db);
|
|
898
|
-
const locale = options.locale ? resolveConfiguredLocale(options.locale) : void 0;
|
|
899
|
-
const term = await repo.findBySlug(taxonomyName, termSlug, locale);
|
|
900
|
-
if (!term) return {
|
|
901
|
-
success: false,
|
|
902
|
-
error: {
|
|
903
|
-
code: "NOT_FOUND",
|
|
904
|
-
message: `Term '${termSlug}' not found in taxonomy '${taxonomyName}'`
|
|
905
|
-
}
|
|
906
|
-
};
|
|
907
|
-
if ((await repo.findChildren(term.id)).length > 0) return {
|
|
908
|
-
success: false,
|
|
909
|
-
error: {
|
|
910
|
-
code: "VALIDATION_ERROR",
|
|
911
|
-
message: "Cannot delete term with children. Delete children first."
|
|
912
|
-
}
|
|
913
|
-
};
|
|
914
|
-
if (!await repo.delete(term.id)) return {
|
|
915
|
-
success: false,
|
|
916
|
-
error: {
|
|
917
|
-
code: "TERM_DELETE_ERROR",
|
|
918
|
-
message: "Failed to delete term"
|
|
919
|
-
}
|
|
920
|
-
};
|
|
921
|
-
invalidateTermCache();
|
|
922
|
-
return {
|
|
923
|
-
success: true,
|
|
924
|
-
data: { deleted: true }
|
|
925
|
-
};
|
|
926
|
-
} catch {
|
|
927
|
-
return {
|
|
928
|
-
success: false,
|
|
929
|
-
error: {
|
|
930
|
-
code: "TERM_DELETE_ERROR",
|
|
931
|
-
message: "Failed to delete term"
|
|
932
|
-
}
|
|
933
|
-
};
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
//#endregion
|
|
938
|
-
export { handleTaxonomyList as a, handleTermDelete as c, handleTermReorder as d, handleTermTranslations as f, handleTaxonomyGet as i, handleTermGet as l, taxonomies_exports as m, handleTaxonomyDefTranslations as n, handleTaxonomyUpdate as o, handleTermUpdate as p, handleTaxonomyDelete as r, handleTermCreate as s, handleTaxonomyCreate as t, handleTermList as u };
|
|
939
|
-
//# sourceMappingURL=taxonomies-S1M3rUC0.mjs.map
|