emdash 0.40.0 → 0.41.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-CbKDcPJi.mjs +26 -0
- package/dist/action-token-CbKDcPJi.mjs.map +1 -0
- package/dist/activation-PtniBLt9.mjs +382 -0
- package/dist/activation-PtniBLt9.mjs.map +1 -0
- package/dist/adapters-C_Tf5x90.d.mts +171 -0
- package/dist/adapters-C_Tf5x90.d.mts.map +1 -0
- package/dist/allowed-origins-U1z4TdEZ.mjs +116 -0
- package/dist/allowed-origins-U1z4TdEZ.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +4 -4
- package/dist/api/route-utils.mjs +46 -45
- 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-CXwQkV_m.mjs +5122 -0
- package/dist/api-CXwQkV_m.mjs.map +1 -0
- package/dist/api-tokens-89WlohEN.mjs +166 -0
- package/dist/api-tokens-89WlohEN.mjs.map +1 -0
- package/dist/apply-Do3KNnUk.mjs +1659 -0
- package/dist/apply-Do3KNnUk.mjs.map +1 -0
- package/dist/approvals-CAX9Yw33.mjs +460 -0
- package/dist/approvals-CAX9Yw33.mjs.map +1 -0
- package/dist/artifact-fetch-B9W4CEST.mjs +659 -0
- package/dist/artifact-fetch-B9W4CEST.mjs.map +1 -0
- package/dist/astro/index.d.mts +14 -14
- package/dist/astro/index.mjs +26 -30
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +12 -12
- package/dist/astro/middleware/auth.mjs +10 -10
- package/dist/astro/middleware/media-usage-write-fence.mjs +5 -5
- package/dist/astro/middleware/redirect.mjs +7 -7
- package/dist/astro/middleware/request-context.mjs +3 -3
- 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 +110 -106
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +14 -14
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +14 -14
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +7 -7
- 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 +23 -23
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +23 -23
- package/dist/astro/routes/api/admin/bylines/index.mjs +23 -23
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +18 -18
- package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -7
- package/dist/astro/routes/api/admin/comments/bulk.mjs +17 -17
- package/dist/astro/routes/api/admin/comments/counts.mjs +7 -7
- package/dist/astro/routes/api/admin/comments/index.mjs +17 -17
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +20 -20
- 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 +25 -25
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +31 -31
- 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 +6 -6
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +8 -8
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +8 -8
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +72 -68
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +7 -7
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +71 -67
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +72 -68
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +82 -78
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +72 -68
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +71 -67
- 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 +81 -77
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +71 -67
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +72 -68
- 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 +83 -79
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +9 -9
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +74 -70
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +7 -7
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +72 -68
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +71 -67
- 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 +71 -67
- 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 +5 -5
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +71 -67
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs +4 -4
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +40 -40
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +40 -40
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +43 -43
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +43 -43
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +43 -43
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs +44 -44
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +44 -44
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +44 -44
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +44 -44
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +42 -42
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs +44 -44
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +15 -15
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +6 -6
- package/dist/astro/routes/api/admin/users/index.mjs +14 -14
- package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -6
- package/dist/astro/routes/api/auth/invite/accept.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/complete.mjs +18 -18
- package/dist/astro/routes/api/auth/invite/index.mjs +16 -16
- package/dist/astro/routes/api/auth/invite/register-options.mjs +17 -17
- package/dist/astro/routes/api/auth/logout.mjs +5 -5
- package/dist/astro/routes/api/auth/magic-link/send.mjs +18 -18
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +14 -14
- package/dist/astro/routes/api/auth/me.mjs +15 -15
- package/dist/astro/routes/api/auth/mode.mjs +5 -5
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +14 -14
- package/dist/astro/routes/api/auth/passkey/index.mjs +4 -4
- package/dist/astro/routes/api/auth/passkey/options.mjs +19 -19
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +17 -17
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +18 -18
- package/dist/astro/routes/api/auth/passkey/verify.mjs +18 -18
- package/dist/astro/routes/api/auth/signup/complete.mjs +18 -18
- package/dist/astro/routes/api/auth/signup/request.mjs +17 -17
- package/dist/astro/routes/api/auth/signup/verify.mjs +4 -4
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +12 -12
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +18 -18
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +11 -11
- 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.d.mts +1 -2
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +42 -53
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +34 -29
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +25 -24
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +17 -17
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +18 -18
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/index.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/trash.mjs +15 -15
- package/dist/astro/routes/api/dashboard.mjs +10 -9
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +5 -5
- package/dist/astro/routes/api/health.mjs +6 -6
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +23 -23
- 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 +16 -16
- package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -12
- package/dist/astro/routes/api/import/wordpress/media.mjs +19 -19
- 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 +28 -28
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +23 -23
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +34 -34
- package/dist/astro/routes/api/manifest.mjs +6 -6
- package/dist/astro/routes/api/mcp.mjs +98 -118
- 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 +16 -16
- package/dist/astro/routes/api/media/_id_/upload.mjs +9 -9
- package/dist/astro/routes/api/media/_id_/usage.mjs +33 -33
- package/dist/astro/routes/api/media/_id_.mjs +31 -31
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +6 -6
- package/dist/astro/routes/api/media/file/_...key_.mjs +9 -9
- package/dist/astro/routes/api/media/folders/_id_.mjs +16 -16
- package/dist/astro/routes/api/media/folders/index.mjs +16 -16
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +5 -5
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +5 -5
- package/dist/astro/routes/api/media/providers/index.mjs +5 -5
- package/dist/astro/routes/api/media/upload-url.mjs +18 -18
- package/dist/astro/routes/api/media.mjs +35 -35
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +17 -17
- package/dist/astro/routes/api/menus/_name_/items.mjs +17 -17
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +17 -17
- package/dist/astro/routes/api/menus/_name_/translations.mjs +17 -17
- package/dist/astro/routes/api/menus/_name_.mjs +17 -17
- package/dist/astro/routes/api/menus/index.mjs +17 -17
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.d.mts +2 -1
- package/dist/astro/routes/api/oauth/device/authorize.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/device/authorize.mjs +23 -9
- package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/code.mjs +11 -11
- package/dist/astro/routes/api/oauth/device/token.mjs +10 -10
- package/dist/astro/routes/api/oauth/register.mjs +5 -5
- package/dist/astro/routes/api/oauth/token/refresh.mjs +8 -8
- package/dist/astro/routes/api/oauth/token/revoke.mjs +8 -8
- package/dist/astro/routes/api/oauth/token.mjs +8 -8
- package/dist/astro/routes/api/openapi.json.mjs +20 -20
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +11 -11
- package/dist/astro/routes/api/redirects/404s/index.mjs +19 -19
- package/dist/astro/routes/api/redirects/404s/summary.mjs +19 -19
- package/dist/astro/routes/api/redirects/_id_.mjs +19 -19
- package/dist/astro/routes/api/redirects/index.mjs +19 -19
- package/dist/astro/routes/api/relations/_id_/index.mjs +34 -29
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +36 -31
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +5 -5
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -5
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +71 -67
- 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 +71 -67
- 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 +71 -67
- package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +73 -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 +71 -67
- 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 +71 -67
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +71 -67
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +71 -67
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +71 -67
- 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 +71 -67
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +71 -67
- 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 +7 -7
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/export.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/index.mjs +8 -8
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +21 -21
- package/dist/astro/routes/api/setup/admin-verify.mjs +19 -19
- package/dist/astro/routes/api/setup/admin.mjs +18 -18
- package/dist/astro/routes/api/setup/dev-bypass.mjs +45 -39
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +80 -49
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +6 -6
- package/dist/astro/routes/api/snapshot.mjs +9 -9
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +23 -23
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +23 -23
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +23 -23
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +23 -23
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +22 -22
- package/dist/astro/routes/api/taxonomies/_name_.mjs +23 -23
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +36 -35
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +23 -23
- package/dist/astro/routes/api/themes/preview.mjs +6 -6
- package/dist/astro/routes/api/typegen.mjs +8 -8
- package/dist/astro/routes/api/visual-editing/action-token.mjs +6 -6
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +19 -19
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +4 -4
- 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 +16 -16
- 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 +5 -5
- package/dist/astro/routes/robots.txt.mjs +6 -6
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +7 -7
- package/dist/astro/types.d.mts +28 -18
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/audit-CrgmE9LE.mjs +127 -0
- package/dist/audit-CrgmE9LE.mjs.map +1 -0
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/authoritative-records-C2YzIdbu.mjs +5172 -0
- package/dist/authoritative-records-C2YzIdbu.mjs.map +1 -0
- package/dist/authorize-WgdKF8QY.mjs +49 -0
- package/dist/authorize-WgdKF8QY.mjs.map +1 -0
- package/dist/backup-Ck8_lMO3.mjs +246 -0
- package/dist/backup-Ck8_lMO3.mjs.map +1 -0
- package/dist/block-types-BQ90asVI.mjs +132 -0
- package/dist/block-types-BQ90asVI.mjs.map +1 -0
- package/dist/block-values-ACFqgB1D.mjs +175 -0
- package/dist/block-values-ACFqgB1D.mjs.map +1 -0
- package/dist/bundle-Db1iNMv_.mjs +667 -0
- package/dist/bundle-Db1iNMv_.mjs.map +1 -0
- package/dist/byline-BayaYGoj.mjs +909 -0
- package/dist/byline-BayaYGoj.mjs.map +1 -0
- package/dist/byline-fields-B8HH-35f.mjs +254 -0
- package/dist/byline-fields-B8HH-35f.mjs.map +1 -0
- package/dist/byline-fields-hMPjf6Eu.mjs +123 -0
- package/dist/byline-fields-hMPjf6Eu.mjs.map +1 -0
- package/dist/byline-registry-B_EK_TQf.mjs +406 -0
- package/dist/byline-registry-B_EK_TQf.mjs.map +1 -0
- package/dist/bylines-DFAaFXWi.mjs +214 -0
- package/dist/bylines-DFAaFXWi.mjs.map +1 -0
- package/dist/bylines-DkIxUxmr.mjs +232 -0
- package/dist/bylines-DkIxUxmr.mjs.map +1 -0
- package/dist/cache-DkvhQ8XE.mjs +108 -0
- package/dist/cache-DkvhQ8XE.mjs.map +1 -0
- package/dist/canonical-CcSuuTlH.mjs +174 -0
- package/dist/canonical-CcSuuTlH.mjs.map +1 -0
- package/dist/capture-triggers-DJEoOTOq.mjs +362 -0
- package/dist/capture-triggers-DJEoOTOq.mjs.map +1 -0
- package/dist/challenge-store-CvBl81AQ.mjs +51 -0
- package/dist/challenge-store-CvBl81AQ.mjs.map +1 -0
- package/dist/checksum-CClweQzI.mjs +162 -0
- package/dist/checksum-CClweQzI.mjs.map +1 -0
- package/dist/chrome-tags-D5caJwwp.mjs +24 -0
- package/dist/chrome-tags-D5caJwwp.mjs.map +1 -0
- package/dist/chunks-DwBaj8aT.mjs +25 -0
- package/dist/chunks-DwBaj8aT.mjs.map +1 -0
- package/dist/cli/index.mjs +374 -761
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +18 -18
- package/dist/client/index.mjs +2 -2
- package/dist/collection-deletion-CLCdXsnV.mjs +436 -0
- package/dist/collection-deletion-CLCdXsnV.mjs.map +1 -0
- package/dist/collection-deletion-processor-hNw8x01F.mjs +217 -0
- package/dist/collection-deletion-processor-hNw8x01F.mjs.map +1 -0
- package/dist/collection-slugs-cache-CUuiduLq.mjs +85 -0
- package/dist/collection-slugs-cache-CUuiduLq.mjs.map +1 -0
- package/dist/comment-D2uvL63j.mjs +313 -0
- package/dist/comment-D2uvL63j.mjs.map +1 -0
- package/dist/comment-reaction-DevUuzg4.mjs +85 -0
- package/dist/comment-reaction-DevUuzg4.mjs.map +1 -0
- package/dist/comments-Cq0s7_hO.mjs +195 -0
- package/dist/comments-Cq0s7_hO.mjs.map +1 -0
- package/dist/comments-M4EDYAHw.mjs +99 -0
- package/dist/comments-M4EDYAHw.mjs.map +1 -0
- package/dist/components-CuIGwXMs.mjs +108 -0
- package/dist/components-CuIGwXMs.mjs.map +1 -0
- package/dist/config-52Ea5IWt.d.mts +39 -0
- package/dist/config-52Ea5IWt.d.mts.map +1 -0
- package/dist/config-CCz3xOLc.mjs +242 -0
- package/dist/config-CCz3xOLc.mjs.map +1 -0
- package/dist/config-D3d5Qudq.d.mts +6669 -0
- package/dist/config-D3d5Qudq.d.mts.map +1 -0
- package/dist/content-CbnufDsM.mjs +2018 -0
- package/dist/content-CbnufDsM.mjs.map +1 -0
- package/dist/content-list-query-D_7B1FE5.d.mts +26 -0
- package/dist/content-list-query-D_7B1FE5.d.mts.map +1 -0
- package/dist/content-policy-CYu6K1KB.mjs +46 -0
- package/dist/content-policy-CYu6K1KB.mjs.map +1 -0
- package/dist/content-repair-DlDUgFGp.mjs +442 -0
- package/dist/content-repair-DlDUgFGp.mjs.map +1 -0
- package/dist/context-CGQLA1-a.mjs +1922 -0
- package/dist/context-CGQLA1-a.mjs.map +1 -0
- package/dist/cron-c4D5C5Fx.mjs +284 -0
- package/dist/cron-c4D5C5Fx.mjs.map +1 -0
- package/dist/dashboard-CBq9kmOn.mjs +151 -0
- package/dist/dashboard-CBq9kmOn.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +4 -4
- 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-DPsys51U.mjs +81 -0
- package/dist/default-DPsys51U.mjs.map +1 -0
- package/dist/deferred-tasks-CZ7rzBdo.d.mts +9 -0
- package/dist/deferred-tasks-CZ7rzBdo.d.mts.map +1 -0
- package/dist/dev-typegen-HRxwLRcT.mjs +29 -0
- package/dist/dev-typegen-HRxwLRcT.mjs.map +1 -0
- package/dist/device-flow-OcSqE9uY.mjs +521 -0
- package/dist/device-flow-OcSqE9uY.mjs.map +1 -0
- package/dist/digest-DVZ--cE9.mjs +194 -0
- package/dist/digest-DVZ--cE9.mjs.map +1 -0
- package/dist/direct-executor-DyjAqkpT.mjs +104 -0
- package/dist/direct-executor-DyjAqkpT.mjs.map +1 -0
- package/dist/dist-FPR93_xf.mjs +810 -0
- package/dist/dist-FPR93_xf.mjs.map +1 -0
- package/dist/email-console-DyQIgEnz.mjs +50 -0
- package/dist/email-console-DyQIgEnz.mjs.map +1 -0
- package/dist/email-locale-BYb16rVd.mjs +25 -0
- package/dist/email-locale-BYb16rVd.mjs.map +1 -0
- package/dist/emdash-runtime-CrzxJFmF.mjs +4214 -0
- package/dist/emdash-runtime-CrzxJFmF.mjs.map +1 -0
- package/dist/enrich-DBtCncE2.mjs +194 -0
- package/dist/enrich-DBtCncE2.mjs.map +1 -0
- package/dist/entry-lock-BN5y4YbO.d.mts +4481 -0
- package/dist/entry-lock-BN5y4YbO.d.mts.map +1 -0
- package/dist/entry-lock-BaRBHCsH.mjs +1173 -0
- package/dist/entry-lock-BaRBHCsH.mjs.map +1 -0
- package/dist/entry-lock-C6NcnZPV.mjs +163 -0
- package/dist/entry-lock-C6NcnZPV.mjs.map +1 -0
- package/dist/entry-locks-BTyQLdbC.mjs +167 -0
- package/dist/entry-locks-BTyQLdbC.mjs.map +1 -0
- package/dist/error-BfsNNrIE.mjs +90 -0
- package/dist/error-BfsNNrIE.mjs.map +1 -0
- package/dist/errors-BN1QAnEY.mjs +460 -0
- package/dist/errors-BN1QAnEY.mjs.map +1 -0
- package/dist/errors-Bt3goF8I.mjs +120 -0
- package/dist/errors-Bt3goF8I.mjs.map +1 -0
- package/dist/escape-BveidMa2.mjs +9 -0
- package/dist/escape-BveidMa2.mjs.map +1 -0
- package/dist/fence-Bb_IbCxI.mjs +162 -0
- package/dist/fence-Bb_IbCxI.mjs.map +1 -0
- package/dist/field-defs-cache-CsZctvbu.mjs +77 -0
- package/dist/field-defs-cache-CsZctvbu.mjs.map +1 -0
- package/dist/field-map-6m9rF49t.mjs +83 -0
- package/dist/field-map-6m9rF49t.mjs.map +1 -0
- package/dist/focal-point-CZ3d1wK5.mjs +23 -0
- package/dist/focal-point-CZ3d1wK5.mjs.map +1 -0
- package/dist/fts-manager-CCaZTp8y.mjs +443 -0
- package/dist/fts-manager-CCaZTp8y.mjs.map +1 -0
- package/dist/gc-xowRjczI.mjs +75 -0
- package/dist/gc-xowRjczI.mjs.map +1 -0
- package/dist/hash-COVK27Pc.mjs +37 -0
- package/dist/hash-COVK27Pc.mjs.map +1 -0
- package/dist/hook-result-CYSk0XFe.d.mts +31 -0
- package/dist/hook-result-CYSk0XFe.d.mts.map +1 -0
- package/dist/hreflang-CChPV7jx.mjs +105 -0
- package/dist/hreflang-CChPV7jx.mjs.map +1 -0
- package/dist/hreflang-DRslq3QI.d.mts +50 -0
- package/dist/hreflang-DRslq3QI.d.mts.map +1 -0
- package/dist/http-route-dispatch-CAdp2onn.mjs +339 -0
- package/dist/http-route-dispatch-CAdp2onn.mjs.map +1 -0
- package/dist/identity-NVTOOQyq.mjs +35 -0
- package/dist/identity-NVTOOQyq.mjs.map +1 -0
- package/dist/import-wpSO2N0x.mjs +2020 -0
- package/dist/import-wpSO2N0x.mjs.map +1 -0
- package/dist/index-CDs2wq4X.d.mts +623 -0
- package/dist/index-CDs2wq4X.d.mts.map +1 -0
- package/dist/index.d.mts +24 -24
- package/dist/index.mjs +103 -101
- package/dist/install-finalization-D9R9R-W8.mjs +58 -0
- package/dist/install-finalization-D9R9R-W8.mjs.map +1 -0
- package/dist/keys-Bck6LBfF.mjs +61 -0
- package/dist/keys-Bck6LBfF.mjs.map +1 -0
- package/dist/kinds-CYmRESWj.mjs +974 -0
- package/dist/kinds-CYmRESWj.mjs.map +1 -0
- package/dist/lifecycle-C815ZQfV.mjs +25 -0
- package/dist/lifecycle-C815ZQfV.mjs.map +1 -0
- package/dist/load-D99axixL.mjs +28 -0
- package/dist/load-D99axixL.mjs.map +1 -0
- package/dist/loader-CrRPfkHS.mjs +1197 -0
- package/dist/loader-CrRPfkHS.mjs.map +1 -0
- package/dist/loops-DMKlygqX.mjs +203 -0
- package/dist/loops-DMKlygqX.mjs.map +1 -0
- package/dist/manifest-builder-BQzCHNgB.mjs +189 -0
- package/dist/manifest-builder-BQzCHNgB.mjs.map +1 -0
- package/dist/manifest-schema-Ci2gmd0u.mjs +492 -0
- package/dist/manifest-schema-Ci2gmd0u.mjs.map +1 -0
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +4 -4
- package/dist/media/local-runtime.d.mts +14 -14
- package/dist/media/local-runtime.mjs +6 -6
- package/dist/media-BUQePMxP.mjs +373 -0
- package/dist/media-BUQePMxP.mjs.map +1 -0
- package/dist/media-DH8ibNlY.mjs +294 -0
- package/dist/media-DH8ibNlY.mjs.map +1 -0
- package/dist/media-OEIQ3bVc.mjs +408 -0
- package/dist/media-OEIQ3bVc.mjs.map +1 -0
- package/dist/media-allowlist-pYtaBA95.mjs +44 -0
- package/dist/media-allowlist-pYtaBA95.mjs.map +1 -0
- package/dist/media-folders-Bf8_s4de.mjs +210 -0
- package/dist/media-folders-Bf8_s4de.mjs.map +1 -0
- package/dist/media-url-C6klEuNd.mjs +43 -0
- package/dist/media-url-C6klEuNd.mjs.map +1 -0
- package/dist/media-usage-D7Y64m6v.mjs +1629 -0
- package/dist/media-usage-D7Y64m6v.mjs.map +1 -0
- package/dist/media-usage-activation-DrqbmgLA.mjs +78 -0
- package/dist/media-usage-activation-DrqbmgLA.mjs.map +1 -0
- package/dist/media-usage-work-DommYhYA.mjs +152 -0
- package/dist/media-usage-work-DommYhYA.mjs.map +1 -0
- package/dist/media-usage-work-HU63hNDu.mjs +586 -0
- package/dist/media-usage-work-HU63hNDu.mjs.map +1 -0
- package/dist/menus-BQfusWEC.mjs +3608 -0
- package/dist/menus-BQfusWEC.mjs.map +1 -0
- package/dist/menus-BtwjQt5s.mjs +753 -0
- package/dist/menus-BtwjQt5s.mjs.map +1 -0
- package/dist/menus-p_M1V7J_.mjs +139 -0
- package/dist/menus-p_M1V7J_.mjs.map +1 -0
- package/dist/migrations/index.d.mts +1 -1
- package/dist/migrations/index.mjs +3 -3
- package/dist/mime-C94qBG-P.mjs +36 -0
- package/dist/mime-C94qBG-P.mjs.map +1 -0
- package/dist/mode-DpYW3w6U.mjs +23 -0
- package/dist/mode-DpYW3w6U.mjs.map +1 -0
- package/dist/node-sqlite-compat-pWFw0lcc.mjs +46 -0
- package/dist/node-sqlite-compat-pWFw0lcc.mjs.map +1 -0
- package/dist/normalize-DduyxBjf.mjs +191 -0
- package/dist/normalize-DduyxBjf.mjs.map +1 -0
- package/dist/oauth-authorization-DAXsH1H9.mjs +274 -0
- package/dist/oauth-authorization-DAXsH1H9.mjs.map +1 -0
- package/dist/oauth-clients-DENiDQri.mjs +266 -0
- package/dist/oauth-clients-DENiDQri.mjs.map +1 -0
- package/dist/oauth-state-store-y8mEYVq9.mjs +50 -0
- package/dist/oauth-state-store-y8mEYVq9.mjs.map +1 -0
- package/dist/oauth-user-lookup-CtTYAy-O.mjs +26 -0
- package/dist/oauth-user-lookup-CtTYAy-O.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/options-BYa1FgIM.d.mts +81 -0
- package/dist/options-BYa1FgIM.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.mjs +5 -5
- package/dist/parse-CORGGhHf.mjs +81 -0
- package/dist/parse-CORGGhHf.mjs.map +1 -0
- package/dist/parse-avNM1xWV.d.mts +168 -0
- package/dist/parse-avNM1xWV.d.mts.map +1 -0
- package/dist/passkey-config-Dih5YeIS.mjs +46 -0
- package/dist/passkey-config-Dih5YeIS.mjs.map +1 -0
- package/dist/paths-d51RFm8M.mjs +77 -0
- package/dist/paths-d51RFm8M.mjs.map +1 -0
- package/dist/patterns-CoqlXUvk.mjs +145 -0
- package/dist/patterns-CoqlXUvk.mjs.map +1 -0
- package/dist/placeholder-D2aksPMF.d.mts +306 -0
- package/dist/placeholder-D2aksPMF.d.mts.map +1 -0
- package/dist/plan-DqeZKuaR.mjs +135 -0
- package/dist/plan-DqeZKuaR.mjs.map +1 -0
- package/dist/plugin-test-runtime.d.mts +14 -14
- package/dist/plugin-test-runtime.mjs +110 -107
- 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 +42 -41
- package/dist/plugins-Bb7oqjQA.mjs +277 -0
- package/dist/plugins-Bb7oqjQA.mjs.map +1 -0
- package/dist/policy-BcEqut3n.mjs +45 -0
- package/dist/policy-BcEqut3n.mjs.map +1 -0
- package/dist/portable-text-DXE8ymtD.mjs +307 -0
- package/dist/portable-text-DXE8ymtD.mjs.map +1 -0
- package/dist/preview-DEDWbwA_.mjs +107 -0
- package/dist/preview-DEDWbwA_.mjs.map +1 -0
- package/dist/protocol-BJbTzvwl.d.mts +61 -0
- package/dist/protocol-BJbTzvwl.d.mts.map +1 -0
- package/dist/public-submission-D9c9S14m.mjs +250 -0
- package/dist/public-submission-D9c9S14m.mjs.map +1 -0
- package/dist/public-url-CIRe-2T6.mjs +101 -0
- package/dist/public-url-CIRe-2T6.mjs.map +1 -0
- package/dist/query-BzifXlPS.mjs +1156 -0
- package/dist/query-BzifXlPS.mjs.map +1 -0
- package/dist/query-OzMJ6vJP.mjs +41 -0
- package/dist/query-OzMJ6vJP.mjs.map +1 -0
- package/dist/rate-limit-Csp60Vik.mjs +120 -0
- package/dist/rate-limit-Csp60Vik.mjs.map +1 -0
- package/dist/receipt-B-aU4hpJ.mjs +43 -0
- package/dist/receipt-B-aU4hpJ.mjs.map +1 -0
- package/dist/redirect-CDSw1sU3.mjs +17 -0
- package/dist/redirect-CDSw1sU3.mjs.map +1 -0
- package/dist/redirect-D1ArbO85.mjs +411 -0
- package/dist/redirect-D1ArbO85.mjs.map +1 -0
- package/dist/redirects-BjTwDTsV.mjs +148 -0
- package/dist/redirects-BjTwDTsV.mjs.map +1 -0
- package/dist/redirects-Ck50kH3n.mjs +446 -0
- package/dist/redirects-Ck50kH3n.mjs.map +1 -0
- package/dist/registry/testing.mjs +3 -3
- package/dist/registry-CFcNCayZ.mjs +6754 -0
- package/dist/registry-CFcNCayZ.mjs.map +1 -0
- package/dist/relations-Cfaa1fDl.mjs +776 -0
- package/dist/relations-Cfaa1fDl.mjs.map +1 -0
- package/dist/request-cache-iHRlHx1d.mjs +104 -0
- package/dist/request-cache-iHRlHx1d.mjs.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/request-meta-D47mqyev.mjs +141 -0
- package/dist/request-meta-D47mqyev.mjs.map +1 -0
- package/dist/resolve-BPE8sMvx.mjs +99 -0
- package/dist/resolve-BPE8sMvx.mjs.map +1 -0
- package/dist/resolve-C0s1E_fH.mjs +199 -0
- package/dist/resolve-C0s1E_fH.mjs.map +1 -0
- package/dist/revision-j1p4-bOj.mjs +302 -0
- package/dist/revision-j1p4-bOj.mjs.map +1 -0
- package/dist/route-wire-C9PJV9aL.mjs +197 -0
- package/dist/route-wire-C9PJV9aL.mjs.map +1 -0
- package/dist/routes-lyYw0mMf.mjs +272 -0
- package/dist/routes-lyYw0mMf.mjs.map +1 -0
- package/dist/runner-B3eyB9Gb.mjs +6121 -0
- package/dist/runner-B3eyB9Gb.mjs.map +1 -0
- package/dist/runner-DoYH2Jcu.d.mts +68 -0
- package/dist/runner-DoYH2Jcu.d.mts.map +1 -0
- package/dist/runtime.d.mts +13 -13
- package/dist/runtime.mjs +3 -3
- package/dist/schema-BAayK46S.mjs +13 -0
- package/dist/schema-BAayK46S.mjs.map +1 -0
- package/dist/schema-Gqcl-8G4.mjs +815 -0
- package/dist/schema-Gqcl-8G4.mjs.map +1 -0
- package/dist/scopes-BqPOKoKf.mjs +34 -0
- package/dist/scopes-BqPOKoKf.mjs.map +1 -0
- package/dist/search-YJKPIEV6.mjs +448 -0
- package/dist/search-YJKPIEV6.mjs.map +1 -0
- package/dist/sections-BR_e-wK5.mjs +346 -0
- package/dist/sections-BR_e-wK5.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +37 -31
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +22 -21
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-Dsj8hy3j.mjs +114 -0
- package/dist/seo-Dsj8hy3j.mjs.map +1 -0
- package/dist/seo-XvH4LNNp.mjs +133 -0
- package/dist/seo-XvH4LNNp.mjs.map +1 -0
- package/dist/service-BsVG05gS.mjs +150 -0
- package/dist/service-BsVG05gS.mjs.map +1 -0
- package/dist/session-user-DgKbYrlj.mjs +51 -0
- package/dist/session-user-DgKbYrlj.mjs.map +1 -0
- package/dist/settings-CNPUntkh.mjs +51 -0
- package/dist/settings-CNPUntkh.mjs.map +1 -0
- package/dist/settings-D5EHi0Tk.mjs +439 -0
- package/dist/settings-D5EHi0Tk.mjs.map +1 -0
- package/dist/settings-DSfE7wOa.mjs +61 -0
- package/dist/settings-DSfE7wOa.mjs.map +1 -0
- package/dist/setup-complete-B8W8sJ9v.mjs +26 -0
- package/dist/setup-complete-B8W8sJ9v.mjs.map +1 -0
- package/dist/setup-nonce-DnSBP260.mjs +25 -0
- package/dist/setup-nonce-DnSBP260.mjs.map +1 -0
- package/dist/site-settings-NGzdrt7O.mjs +50 -0
- package/dist/site-settings-NGzdrt7O.mjs.map +1 -0
- package/dist/site-url-D6JB7tLW.mjs +16 -0
- package/dist/site-url-D6JB7tLW.mjs.map +1 -0
- package/dist/snapshot-CdcwwWAf.mjs +414 -0
- package/dist/snapshot-CdcwwWAf.mjs.map +1 -0
- package/dist/ssrf-Dv0_tRpo.mjs +406 -0
- package/dist/ssrf-Dv0_tRpo.mjs.map +1 -0
- package/dist/stage-CUjhED3P.mjs +662 -0
- package/dist/stage-CUjhED3P.mjs.map +1 -0
- package/dist/staged-C36IWXff.mjs +659 -0
- package/dist/staged-C36IWXff.mjs.map +1 -0
- package/dist/state-CKouMCSY.mjs +153 -0
- package/dist/state-CKouMCSY.mjs.map +1 -0
- package/dist/status-lzyj4Uu7.mjs +30 -0
- package/dist/status-lzyj4Uu7.mjs.map +1 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/storage-query-B-cWcTjJ.d.mts +1594 -0
- package/dist/storage-query-B-cWcTjJ.d.mts.map +1 -0
- package/dist/tar-DsTXX6ch.mjs +449 -0
- package/dist/tar-DsTXX6ch.mjs.map +1 -0
- package/dist/target-DLQCwp_Z.mjs +27 -0
- package/dist/target-DLQCwp_Z.mjs.map +1 -0
- package/dist/taxonomies-BlAjr4BL.mjs +697 -0
- package/dist/taxonomies-BlAjr4BL.mjs.map +1 -0
- package/dist/taxonomies-Byyo7LOZ.mjs +939 -0
- package/dist/taxonomies-Byyo7LOZ.mjs.map +1 -0
- package/dist/taxonomy-CKDwM61Y.mjs +525 -0
- package/dist/taxonomy-CKDwM61Y.mjs.map +1 -0
- package/dist/tokens-BojXlk49.mjs +171 -0
- package/dist/tokens-BojXlk49.mjs.map +1 -0
- package/dist/transaction-DLPQWik1.mjs +29 -0
- package/dist/transaction-DLPQWik1.mjs.map +1 -0
- package/dist/transfer-XSTh2BCr.mjs +8706 -0
- package/dist/transfer-XSTh2BCr.mjs.map +1 -0
- package/dist/transfer-download-DkoCDA9d.mjs +33 -0
- package/dist/transfer-download-DkoCDA9d.mjs.map +1 -0
- package/dist/transfer-iQ26J-RT.mjs +166 -0
- package/dist/transfer-iQ26J-RT.mjs.map +1 -0
- package/dist/transformations-C7RQabKQ.mjs +196 -0
- package/dist/transformations-C7RQabKQ.mjs.map +1 -0
- package/dist/transport-D3RulfD6.mjs +136 -0
- package/dist/transport-D3RulfD6.mjs.map +1 -0
- package/dist/transport-DhlZlf4D.d.mts +42 -0
- package/dist/transport-DhlZlf4D.d.mts.map +1 -0
- package/dist/trusted-proxy-B6ECOZJc.mjs +51 -0
- package/dist/trusted-proxy-B6ECOZJc.mjs.map +1 -0
- package/dist/turnstile-lqUiY7lP.mjs +53 -0
- package/dist/turnstile-lqUiY7lP.mjs.map +1 -0
- package/dist/types-4Dn9bZhu.mjs +77 -0
- package/dist/types-4Dn9bZhu.mjs.map +1 -0
- package/dist/types-5LSo7PPx.d.mts +85 -0
- package/dist/types-5LSo7PPx.d.mts.map +1 -0
- package/dist/types-BQ3hwYJT.d.mts +896 -0
- package/dist/types-BQ3hwYJT.d.mts.map +1 -0
- package/dist/types-BYEk7qo3.d.mts +198 -0
- package/dist/types-BYEk7qo3.d.mts.map +1 -0
- package/dist/types-CJKsWVFR.mjs +199 -0
- package/dist/types-CJKsWVFR.mjs.map +1 -0
- package/dist/types-Ca_w8mmY.d.mts +363 -0
- package/dist/types-Ca_w8mmY.d.mts.map +1 -0
- package/dist/types-CkE41ZAG.mjs +18 -0
- package/dist/types-CkE41ZAG.mjs.map +1 -0
- package/dist/types-D0aJW2uR.d.mts +1641 -0
- package/dist/types-D0aJW2uR.d.mts.map +1 -0
- package/dist/types-DbpN4Qto.d.mts +372 -0
- package/dist/types-DbpN4Qto.d.mts.map +1 -0
- package/dist/types-ILDI1sdY.mjs +16 -0
- package/dist/types-ILDI1sdY.mjs.map +1 -0
- package/dist/types-OC5c-edM.mjs +22 -0
- package/dist/types-OC5c-edM.mjs.map +1 -0
- package/dist/types-aOOxRSx6.mjs +103 -0
- package/dist/types-aOOxRSx6.mjs.map +1 -0
- package/dist/types-m1WbUffD.d.mts +198 -0
- package/dist/types-m1WbUffD.d.mts.map +1 -0
- package/dist/types-uxLoPBio.d.mts +124 -0
- package/dist/types-uxLoPBio.d.mts.map +1 -0
- package/dist/types-we5uR-tV.d.mts +287 -0
- package/dist/types-we5uR-tV.d.mts.map +1 -0
- package/dist/upload-attempts-DduMy6B0.mjs +32 -0
- package/dist/upload-attempts-DduMy6B0.mjs.map +1 -0
- package/dist/url-pattern-B3EwxAAk.mjs +33 -0
- package/dist/url-pattern-B3EwxAAk.mjs.map +1 -0
- package/dist/user-ElwQjTQT.mjs +171 -0
- package/dist/user-ElwQjTQT.mjs.map +1 -0
- package/dist/utils-BlAXmfOG.mjs +439 -0
- package/dist/utils-BlAXmfOG.mjs.map +1 -0
- package/dist/validate-CH0X5b2c.d.mts +468 -0
- package/dist/validate-CH0X5b2c.d.mts.map +1 -0
- package/dist/validate-CfgRpcjA.mjs +492 -0
- package/dist/validate-CfgRpcjA.mjs.map +1 -0
- package/dist/validation-DvYJtv4k.mjs +218 -0
- package/dist/validation-DvYJtv4k.mjs.map +1 -0
- package/dist/version-DgYjhTud.mjs +9 -0
- package/dist/version-DgYjhTud.mjs.map +1 -0
- package/dist/version-Dq71scUb.mjs +7 -0
- package/dist/version-Dq71scUb.mjs.map +1 -0
- package/dist/widgets-ChFIj0be.mjs +126 -0
- package/dist/widgets-ChFIj0be.mjs.map +1 -0
- package/dist/wxr-taxonomies-CBZMp2YX.mjs +372 -0
- package/dist/wxr-taxonomies-CBZMp2YX.mjs.map +1 -0
- package/dist/wxr-taxonomies-DlKDpWN1.d.mts +34 -0
- package/dist/wxr-taxonomies-DlKDpWN1.d.mts.map +1 -0
- package/dist/zod-generator-DmTKI-Ig.mjs +426 -0
- package/dist/zod-generator-DmTKI-Ig.mjs.map +1 -0
- package/package.json +7 -6
- package/src/api/handlers/content.ts +593 -16
- package/src/api/handlers/device-flow.ts +74 -21
- package/src/api/handlers/index.ts +1 -0
- package/src/api/handlers/manifest.ts +79 -5
- package/src/api/handlers/media-upload.ts +17 -71
- package/src/api/handlers/media.ts +97 -3
- package/src/api/handlers/relations.ts +638 -157
- package/src/api/handlers/revision.ts +30 -0
- package/src/api/handlers/schema.ts +403 -1
- package/src/api/handlers/snapshot.ts +257 -3
- package/src/api/handlers/staged-references.ts +142 -0
- package/src/api/handlers/validate-references.ts +146 -0
- package/src/api/schemas/content.ts +13 -0
- package/src/api/schemas/relations.ts +54 -44
- package/src/api/schemas/schema.ts +14 -0
- package/src/astro/integration/routes.ts +15 -19
- package/src/astro/integration/vite-config.ts +10 -4
- package/src/astro/middleware.ts +1 -0
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/children.ts +11 -54
- package/src/astro/routes/api/content/[collection]/[id].ts +3 -1
- package/src/astro/routes/api/oauth/device/authorize.ts +33 -4
- package/src/astro/routes/api/relations/index.ts +4 -4
- package/src/astro/routes/api/schema/collections/[slug]/fields/[fieldSlug].ts +6 -2
- package/src/astro/routes/api/setup/index.ts +66 -23
- package/src/astro/routes/api/snapshot.ts +2 -1
- package/src/astro/types.ts +10 -0
- package/src/cleanup.ts +10 -0
- package/src/cli/commands/export-seed.ts +510 -89
- package/src/components/Columns.astro +3 -1
- package/src/components/Cover.astro +3 -1
- package/src/components/WidgetArea.astro +3 -2
- package/src/database/migrations/086_relations_structural.ts +197 -0
- package/src/database/migrations/087_reference_field_relations.ts +407 -0
- package/src/database/migrations/runner.ts +4 -0
- package/src/database/reference-backfill.ts +141 -0
- package/src/database/repositories/content.ts +43 -8
- package/src/database/repositories/media.ts +40 -1
- package/src/database/repositories/redirect.ts +17 -34
- package/src/database/repositories/relation.ts +620 -208
- package/src/database/repositories/revision.ts +16 -0
- package/src/database/repositories/types.ts +38 -0
- package/src/database/transaction.ts +12 -1
- package/src/database/types.ts +14 -5
- package/src/emdash-runtime.ts +114 -11
- package/src/index.ts +11 -0
- package/src/loader.ts +169 -22
- package/src/mcp/server.ts +13 -48
- package/src/query.ts +455 -25
- package/src/references/field-map.ts +115 -0
- package/src/references/resolve.ts +160 -0
- package/src/references/staged.ts +117 -0
- package/src/references/types.ts +16 -0
- package/src/registry/artifact-fetch.ts +45 -271
- package/src/schema/registry.ts +99 -24
- package/src/schema/types.ts +58 -0
- package/src/schema/zod-generator.ts +67 -1
- package/src/seed/apply.ts +841 -103
- package/src/seed/types.ts +36 -2
- package/src/seed/validate.ts +78 -2
- package/src/transfer/analyze/unique-keys.ts +3 -12
- package/src/transfer/analyze/validate.ts +65 -39
- package/src/transfer/analyze/values.ts +12 -1
- package/src/transfer/export/readers.ts +12 -8
- package/src/transfer/format/columns.ts +26 -6
- package/src/transfer/format/kinds.ts +21 -5
- package/src/transfer/import/context.ts +8 -1
- package/src/transfer/ops/package-index.ts +1 -1
- package/dist/action-token-DYwe4Pk0.mjs +0 -26
- package/dist/action-token-DYwe4Pk0.mjs.map +0 -1
- package/dist/activation-LOkDM5WT.mjs +0 -382
- package/dist/activation-LOkDM5WT.mjs.map +0 -1
- package/dist/adapters-B64LbYcB.d.mts +0 -171
- package/dist/adapters-B64LbYcB.d.mts.map +0 -1
- package/dist/allowed-origins-CHB8oZNM.mjs +0 -116
- package/dist/allowed-origins-CHB8oZNM.mjs.map +0 -1
- package/dist/api-cFFZpyS0.mjs +0 -4718
- package/dist/api-cFFZpyS0.mjs.map +0 -1
- package/dist/api-tokens-s4i4aUp_.mjs +0 -166
- package/dist/api-tokens-s4i4aUp_.mjs.map +0 -1
- package/dist/apply-CoT603H3.mjs +0 -1163
- package/dist/apply-CoT603H3.mjs.map +0 -1
- package/dist/approvals-CqMfNxak.mjs +0 -460
- package/dist/approvals-CqMfNxak.mjs.map +0 -1
- package/dist/artifact-fetch-DZMOGZ3-.mjs +0 -818
- package/dist/artifact-fetch-DZMOGZ3-.mjs.map +0 -1
- package/dist/astro/routes/api/relations/_id_/translations.d.mts +0 -8
- package/dist/astro/routes/api/relations/_id_/translations.d.mts.map +0 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +0 -47
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +0 -1
- package/dist/audit-RfCugiSB.mjs +0 -127
- package/dist/audit-RfCugiSB.mjs.map +0 -1
- package/dist/authoritative-records-CoJvBXAD.mjs +0 -5172
- package/dist/authoritative-records-CoJvBXAD.mjs.map +0 -1
- package/dist/authorize-seCifOMJ.mjs +0 -49
- package/dist/authorize-seCifOMJ.mjs.map +0 -1
- package/dist/backup-CBu0LrXf.mjs +0 -246
- package/dist/backup-CBu0LrXf.mjs.map +0 -1
- package/dist/block-type-registry-DUI_3KxT.mjs +0 -6709
- package/dist/block-type-registry-DUI_3KxT.mjs.map +0 -1
- package/dist/block-types-BmZmLmAD.mjs +0 -132
- package/dist/block-types-BmZmLmAD.mjs.map +0 -1
- package/dist/block-values-C_VIPr5t.mjs +0 -175
- package/dist/block-values-C_VIPr5t.mjs.map +0 -1
- package/dist/byline-DYmkXqvo.mjs +0 -909
- package/dist/byline-DYmkXqvo.mjs.map +0 -1
- package/dist/byline-fields-D28AT-Fh.mjs +0 -123
- package/dist/byline-fields-D28AT-Fh.mjs.map +0 -1
- package/dist/byline-registry-gnKscbQX.mjs +0 -406
- package/dist/byline-registry-gnKscbQX.mjs.map +0 -1
- package/dist/bylines-BPwJqoYH.mjs +0 -232
- package/dist/bylines-BPwJqoYH.mjs.map +0 -1
- package/dist/bylines-ukLaYpVZ.mjs +0 -214
- package/dist/bylines-ukLaYpVZ.mjs.map +0 -1
- package/dist/cache-m7UEkRFV.mjs +0 -108
- package/dist/cache-m7UEkRFV.mjs.map +0 -1
- package/dist/canonical-YhEQezjg.mjs +0 -174
- package/dist/canonical-YhEQezjg.mjs.map +0 -1
- package/dist/capture-triggers-kJyl_yyM.mjs +0 -362
- package/dist/capture-triggers-kJyl_yyM.mjs.map +0 -1
- package/dist/challenge-store-ppU6Uv13.mjs +0 -51
- package/dist/challenge-store-ppU6Uv13.mjs.map +0 -1
- package/dist/checksum-B2IINIlN.mjs +0 -162
- package/dist/checksum-B2IINIlN.mjs.map +0 -1
- package/dist/chrome-tags-DApCQSIk.mjs +0 -24
- package/dist/chrome-tags-DApCQSIk.mjs.map +0 -1
- package/dist/chunks-Dms7Uxbt.mjs +0 -25
- package/dist/chunks-Dms7Uxbt.mjs.map +0 -1
- package/dist/collection-deletion-BIm28mo3.mjs +0 -436
- package/dist/collection-deletion-BIm28mo3.mjs.map +0 -1
- package/dist/collection-deletion-processor-Br6rxs3u.mjs +0 -217
- package/dist/collection-deletion-processor-Br6rxs3u.mjs.map +0 -1
- package/dist/collection-slugs-cache-CjGk__zp.mjs +0 -85
- package/dist/collection-slugs-cache-CjGk__zp.mjs.map +0 -1
- package/dist/comment-CrBl22OF.mjs +0 -313
- package/dist/comment-CrBl22OF.mjs.map +0 -1
- package/dist/comment-reaction-JEQ2Fpd8.mjs +0 -85
- package/dist/comment-reaction-JEQ2Fpd8.mjs.map +0 -1
- package/dist/comments-2ah9du9y.mjs +0 -195
- package/dist/comments-2ah9du9y.mjs.map +0 -1
- package/dist/comments-fHZ8ON9O.mjs +0 -99
- package/dist/comments-fHZ8ON9O.mjs.map +0 -1
- package/dist/components-CXbq7CSM.mjs +0 -108
- package/dist/components-CXbq7CSM.mjs.map +0 -1
- package/dist/config-5ii2haYu.d.mts +0 -6528
- package/dist/config-5ii2haYu.d.mts.map +0 -1
- package/dist/config-IhybvkIQ.mjs +0 -242
- package/dist/config-IhybvkIQ.mjs.map +0 -1
- package/dist/config-Py43JK9r.d.mts +0 -39
- package/dist/config-Py43JK9r.d.mts.map +0 -1
- package/dist/content-DFaIEDj9.mjs +0 -2281
- package/dist/content-DFaIEDj9.mjs.map +0 -1
- package/dist/content-list-query-Dra4Dalc.d.mts +0 -26
- package/dist/content-list-query-Dra4Dalc.d.mts.map +0 -1
- package/dist/content-policy-DFNw91-d.mjs +0 -46
- package/dist/content-policy-DFNw91-d.mjs.map +0 -1
- package/dist/content-repair-Q8IUrpLL.mjs +0 -442
- package/dist/content-repair-Q8IUrpLL.mjs.map +0 -1
- package/dist/context-BeGccdUX.mjs +0 -1921
- package/dist/context-BeGccdUX.mjs.map +0 -1
- package/dist/cron-7DCJwPXq.mjs +0 -284
- package/dist/cron-7DCJwPXq.mjs.map +0 -1
- package/dist/dashboard-DjrB-xxZ.mjs +0 -151
- package/dist/dashboard-DjrB-xxZ.mjs.map +0 -1
- package/dist/default-DQ6vsviu.mjs +0 -81
- package/dist/default-DQ6vsviu.mjs.map +0 -1
- package/dist/deferred-tasks-BPxXUB4x.d.mts +0 -9
- package/dist/deferred-tasks-BPxXUB4x.d.mts.map +0 -1
- package/dist/dev-typegen-CZaPLl3V.mjs +0 -29
- package/dist/dev-typegen-CZaPLl3V.mjs.map +0 -1
- package/dist/device-flow-CRd6DXmW.mjs +0 -466
- package/dist/device-flow-CRd6DXmW.mjs.map +0 -1
- package/dist/digest-BarSh-pN.mjs +0 -194
- package/dist/digest-BarSh-pN.mjs.map +0 -1
- package/dist/direct-executor-BmuFJJZV.mjs +0 -104
- package/dist/direct-executor-BmuFJJZV.mjs.map +0 -1
- package/dist/dist-BNwANFJR.mjs +0 -810
- package/dist/dist-BNwANFJR.mjs.map +0 -1
- package/dist/email-console-bJn3ctqA.mjs +0 -50
- package/dist/email-console-bJn3ctqA.mjs.map +0 -1
- package/dist/email-locale-CN6WAMx0.mjs +0 -25
- package/dist/email-locale-CN6WAMx0.mjs.map +0 -1
- package/dist/emdash-runtime-DAjghyEG.mjs +0 -4186
- package/dist/emdash-runtime-DAjghyEG.mjs.map +0 -1
- package/dist/enrich-Dl3kZ-lP.mjs +0 -194
- package/dist/enrich-Dl3kZ-lP.mjs.map +0 -1
- package/dist/entry-lock-BJYdBfXb.mjs +0 -1097
- package/dist/entry-lock-BJYdBfXb.mjs.map +0 -1
- package/dist/entry-lock-DHQOxN7R.mjs +0 -163
- package/dist/entry-lock-DHQOxN7R.mjs.map +0 -1
- package/dist/entry-lock-DVhCt49A.d.mts +0 -4368
- package/dist/entry-lock-DVhCt49A.d.mts.map +0 -1
- package/dist/entry-locks-D0foLdjQ.mjs +0 -167
- package/dist/entry-locks-D0foLdjQ.mjs.map +0 -1
- package/dist/error-CfvOHP0M.mjs +0 -90
- package/dist/error-CfvOHP0M.mjs.map +0 -1
- package/dist/errors-BF0_LFhW.mjs +0 -460
- package/dist/errors-BF0_LFhW.mjs.map +0 -1
- package/dist/errors-DgE1zJGG.mjs +0 -120
- package/dist/errors-DgE1zJGG.mjs.map +0 -1
- package/dist/escape-CuaZhZvL.mjs +0 -9
- package/dist/escape-CuaZhZvL.mjs.map +0 -1
- package/dist/fence-CMDXJYc_.mjs +0 -162
- package/dist/fence-CMDXJYc_.mjs.map +0 -1
- package/dist/field-defs-cache-HIgBbqZZ.mjs +0 -77
- package/dist/field-defs-cache-HIgBbqZZ.mjs.map +0 -1
- package/dist/focal-point-Gr34o-4o.mjs +0 -23
- package/dist/focal-point-Gr34o-4o.mjs.map +0 -1
- package/dist/fts-manager-S-K0laoS.mjs +0 -443
- package/dist/fts-manager-S-K0laoS.mjs.map +0 -1
- package/dist/gc-DjKY0Ay1.mjs +0 -75
- package/dist/gc-DjKY0Ay1.mjs.map +0 -1
- package/dist/hash-SDAW6zC-.mjs +0 -37
- package/dist/hash-SDAW6zC-.mjs.map +0 -1
- package/dist/hook-result-B5bXDgS2.d.mts +0 -31
- package/dist/hook-result-B5bXDgS2.d.mts.map +0 -1
- package/dist/hreflang-D5uNnsGJ.d.mts +0 -50
- package/dist/hreflang-D5uNnsGJ.d.mts.map +0 -1
- package/dist/hreflang-DMFBL2eb.mjs +0 -105
- package/dist/hreflang-DMFBL2eb.mjs.map +0 -1
- package/dist/http-route-dispatch-BitqzwMy.mjs +0 -339
- package/dist/http-route-dispatch-BitqzwMy.mjs.map +0 -1
- package/dist/identity-IyNWwXr6.mjs +0 -35
- package/dist/identity-IyNWwXr6.mjs.map +0 -1
- package/dist/import-C3JZplWq.mjs +0 -2020
- package/dist/import-C3JZplWq.mjs.map +0 -1
- package/dist/index-D-hdtLe8.d.mts +0 -623
- package/dist/index-D-hdtLe8.d.mts.map +0 -1
- package/dist/install-finalization-DfM1fj5x.mjs +0 -58
- package/dist/install-finalization-DfM1fj5x.mjs.map +0 -1
- package/dist/keys-yxLm5l35.mjs +0 -61
- package/dist/keys-yxLm5l35.mjs.map +0 -1
- package/dist/kinds-CRu_T5T5.mjs +0 -961
- package/dist/kinds-CRu_T5T5.mjs.map +0 -1
- package/dist/lifecycle-BzeGPeQ-.mjs +0 -25
- package/dist/lifecycle-BzeGPeQ-.mjs.map +0 -1
- package/dist/load-XgJiE6_3.mjs +0 -28
- package/dist/load-XgJiE6_3.mjs.map +0 -1
- package/dist/loader-BzqeR1ZN.mjs +0 -1086
- package/dist/loader-BzqeR1ZN.mjs.map +0 -1
- package/dist/loops-BQSzv5Zn.mjs +0 -203
- package/dist/loops-BQSzv5Zn.mjs.map +0 -1
- package/dist/manifest-builder-B8zR-73J.mjs +0 -189
- package/dist/manifest-builder-B8zR-73J.mjs.map +0 -1
- package/dist/manifest-schema-CY3zng_M.mjs +0 -492
- package/dist/manifest-schema-CY3zng_M.mjs.map +0 -1
- package/dist/media-Pu1L6xir.mjs +0 -408
- package/dist/media-Pu1L6xir.mjs.map +0 -1
- package/dist/media-Qp5S3eH3.mjs +0 -355
- package/dist/media-Qp5S3eH3.mjs.map +0 -1
- package/dist/media-allowlist-BSoa9Vvm.mjs +0 -44
- package/dist/media-allowlist-BSoa9Vvm.mjs.map +0 -1
- package/dist/media-folders-BE0oo2eX.mjs +0 -210
- package/dist/media-folders-BE0oo2eX.mjs.map +0 -1
- package/dist/media-h7tOiDLj.mjs +0 -221
- package/dist/media-h7tOiDLj.mjs.map +0 -1
- package/dist/media-url-jArBpzIG.mjs +0 -43
- package/dist/media-url-jArBpzIG.mjs.map +0 -1
- package/dist/media-usage-My-Vi-ex.mjs +0 -1629
- package/dist/media-usage-My-Vi-ex.mjs.map +0 -1
- package/dist/media-usage-activation-HKp7zk7W.mjs +0 -78
- package/dist/media-usage-activation-HKp7zk7W.mjs.map +0 -1
- package/dist/media-usage-work-C2OZLCAd.mjs +0 -586
- package/dist/media-usage-work-C2OZLCAd.mjs.map +0 -1
- package/dist/media-usage-work-DwUNbgvS.mjs +0 -152
- package/dist/media-usage-work-DwUNbgvS.mjs.map +0 -1
- package/dist/menus-BM7BPLOb.mjs +0 -139
- package/dist/menus-BM7BPLOb.mjs.map +0 -1
- package/dist/menus-ITeAbcIF.mjs +0 -753
- package/dist/menus-ITeAbcIF.mjs.map +0 -1
- package/dist/menus-TsSGmSR4.mjs +0 -3608
- package/dist/menus-TsSGmSR4.mjs.map +0 -1
- package/dist/mime-ChLqYwDk.mjs +0 -36
- package/dist/mime-ChLqYwDk.mjs.map +0 -1
- package/dist/mode-CCuKXUci.mjs +0 -23
- package/dist/mode-CCuKXUci.mjs.map +0 -1
- package/dist/node-sqlite-compat-CONMsl-x.mjs +0 -46
- package/dist/node-sqlite-compat-CONMsl-x.mjs.map +0 -1
- package/dist/normalize-CO2P8-iE.mjs +0 -191
- package/dist/normalize-CO2P8-iE.mjs.map +0 -1
- package/dist/oauth-authorization-DlMIL5_h.mjs +0 -274
- package/dist/oauth-authorization-DlMIL5_h.mjs.map +0 -1
- package/dist/oauth-clients-Djq9r_KP.mjs +0 -266
- package/dist/oauth-clients-Djq9r_KP.mjs.map +0 -1
- package/dist/oauth-state-store-BbjnZXNC.mjs +0 -50
- package/dist/oauth-state-store-BbjnZXNC.mjs.map +0 -1
- package/dist/oauth-user-lookup-vue9a64A.mjs +0 -26
- package/dist/oauth-user-lookup-vue9a64A.mjs.map +0 -1
- package/dist/options-SQCHQCPH.d.mts +0 -81
- package/dist/options-SQCHQCPH.d.mts.map +0 -1
- package/dist/parse-CVgO-Qai.d.mts +0 -168
- package/dist/parse-CVgO-Qai.d.mts.map +0 -1
- package/dist/parse-DY6OD1j_.mjs +0 -81
- package/dist/parse-DY6OD1j_.mjs.map +0 -1
- package/dist/passkey-config-X_H8128a.mjs +0 -46
- package/dist/passkey-config-X_H8128a.mjs.map +0 -1
- package/dist/paths-JxokKIbr.mjs +0 -77
- package/dist/paths-JxokKIbr.mjs.map +0 -1
- package/dist/patterns-BhAvqO0S.mjs +0 -145
- package/dist/patterns-BhAvqO0S.mjs.map +0 -1
- package/dist/placeholder-MSEd8gty.d.mts +0 -306
- package/dist/placeholder-MSEd8gty.d.mts.map +0 -1
- package/dist/plan-xjcWrAah.mjs +0 -135
- package/dist/plan-xjcWrAah.mjs.map +0 -1
- package/dist/plugins-DUXUt8B9.mjs +0 -277
- package/dist/plugins-DUXUt8B9.mjs.map +0 -1
- package/dist/policy-CUvwAARc.mjs +0 -45
- package/dist/policy-CUvwAARc.mjs.map +0 -1
- package/dist/portable-text-5O_ZGUjB.mjs +0 -307
- package/dist/portable-text-5O_ZGUjB.mjs.map +0 -1
- package/dist/preview-CIUcPYr6.mjs +0 -107
- package/dist/preview-CIUcPYr6.mjs.map +0 -1
- package/dist/protocol-B97DZaFr.d.mts +0 -61
- package/dist/protocol-B97DZaFr.d.mts.map +0 -1
- package/dist/public-submission-BFBUrqst.mjs +0 -250
- package/dist/public-submission-BFBUrqst.mjs.map +0 -1
- package/dist/public-url-Bn7U0D7-.mjs +0 -101
- package/dist/public-url-Bn7U0D7-.mjs.map +0 -1
- package/dist/query-B48peoRT.mjs +0 -890
- package/dist/query-B48peoRT.mjs.map +0 -1
- package/dist/query-C4IH0uhR.mjs +0 -41
- package/dist/query-C4IH0uhR.mjs.map +0 -1
- package/dist/rate-limit-BZ6nybgc.mjs +0 -120
- package/dist/rate-limit-BZ6nybgc.mjs.map +0 -1
- package/dist/receipt-B4wJj5Jq.mjs +0 -43
- package/dist/receipt-B4wJj5Jq.mjs.map +0 -1
- package/dist/redirect-Cd1E7VUt.mjs +0 -17
- package/dist/redirect-Cd1E7VUt.mjs.map +0 -1
- package/dist/redirect-iJf5fltD.mjs +0 -415
- package/dist/redirect-iJf5fltD.mjs.map +0 -1
- package/dist/redirects-CYu1u1aK.mjs +0 -446
- package/dist/redirects-CYu1u1aK.mjs.map +0 -1
- package/dist/redirects-Cv9apQKj.mjs +0 -148
- package/dist/redirects-Cv9apQKj.mjs.map +0 -1
- package/dist/relation-M4NUCb0b.mjs +0 -334
- package/dist/relation-M4NUCb0b.mjs.map +0 -1
- package/dist/relations-CCif47Oq.mjs +0 -403
- package/dist/relations-CCif47Oq.mjs.map +0 -1
- package/dist/relations-CK9CYUyr.mjs +0 -310
- package/dist/relations-CK9CYUyr.mjs.map +0 -1
- package/dist/request-cache-DzLYKm_x.mjs +0 -104
- package/dist/request-cache-DzLYKm_x.mjs.map +0 -1
- package/dist/request-meta-sZXt3sRo.mjs +0 -141
- package/dist/request-meta-sZXt3sRo.mjs.map +0 -1
- package/dist/resolve-2WbQsCvT.mjs +0 -199
- package/dist/resolve-2WbQsCvT.mjs.map +0 -1
- package/dist/route-wire--1hLuACz.mjs +0 -197
- package/dist/route-wire--1hLuACz.mjs.map +0 -1
- package/dist/routes-CUsM40Cc.mjs +0 -272
- package/dist/routes-CUsM40Cc.mjs.map +0 -1
- package/dist/runner-1y4J9fJB.mjs +0 -5742
- package/dist/runner-1y4J9fJB.mjs.map +0 -1
- package/dist/runner-D5_LzKXI.d.mts +0 -68
- package/dist/runner-D5_LzKXI.d.mts.map +0 -1
- package/dist/schema-BABiRdsH.mjs +0 -13
- package/dist/schema-BABiRdsH.mjs.map +0 -1
- package/dist/schema-Du3MzCG0.mjs +0 -446
- package/dist/schema-Du3MzCG0.mjs.map +0 -1
- package/dist/scopes-Dbk-ElhT.mjs +0 -34
- package/dist/scopes-Dbk-ElhT.mjs.map +0 -1
- package/dist/search-Bt1PL1jf.mjs +0 -448
- package/dist/search-Bt1PL1jf.mjs.map +0 -1
- package/dist/sections-Ddptx_o9.mjs +0 -346
- package/dist/sections-Ddptx_o9.mjs.map +0 -1
- package/dist/seo-CZT2oLtT.mjs +0 -114
- package/dist/seo-CZT2oLtT.mjs.map +0 -1
- package/dist/seo-D5w3-Azy.mjs +0 -133
- package/dist/seo-D5w3-Azy.mjs.map +0 -1
- package/dist/service-DuykXPyW.mjs +0 -150
- package/dist/service-DuykXPyW.mjs.map +0 -1
- package/dist/session-user-BhaVp8w0.mjs +0 -51
- package/dist/session-user-BhaVp8w0.mjs.map +0 -1
- package/dist/settings-2xNYr90o.mjs +0 -51
- package/dist/settings-2xNYr90o.mjs.map +0 -1
- package/dist/settings-CgjRWGW9.mjs +0 -439
- package/dist/settings-CgjRWGW9.mjs.map +0 -1
- package/dist/settings-DYidIB26.mjs +0 -61
- package/dist/settings-DYidIB26.mjs.map +0 -1
- package/dist/setup-complete-bOogcHWG.mjs +0 -26
- package/dist/setup-complete-bOogcHWG.mjs.map +0 -1
- package/dist/setup-nonce-0EGuKM4s.mjs +0 -25
- package/dist/setup-nonce-0EGuKM4s.mjs.map +0 -1
- package/dist/site-settings-DOgRUoFX.mjs +0 -50
- package/dist/site-settings-DOgRUoFX.mjs.map +0 -1
- package/dist/site-url-BU_bbxwj.mjs +0 -16
- package/dist/site-url-BU_bbxwj.mjs.map +0 -1
- package/dist/snapshot-CugwUqKQ.mjs +0 -237
- package/dist/snapshot-CugwUqKQ.mjs.map +0 -1
- package/dist/ssrf-CJUnJymJ.mjs +0 -406
- package/dist/ssrf-CJUnJymJ.mjs.map +0 -1
- package/dist/stage-DgrBz_du.mjs +0 -662
- package/dist/stage-DgrBz_du.mjs.map +0 -1
- package/dist/state-DDiPySSG.mjs +0 -153
- package/dist/state-DDiPySSG.mjs.map +0 -1
- package/dist/status-DZKIG4a9.mjs +0 -30
- package/dist/status-DZKIG4a9.mjs.map +0 -1
- package/dist/storage-query-Bdv7A62k.d.mts +0 -1576
- package/dist/storage-query-Bdv7A62k.d.mts.map +0 -1
- package/dist/tar-_1AgTYFu.mjs +0 -449
- package/dist/tar-_1AgTYFu.mjs.map +0 -1
- package/dist/target-_7pn2Gbg.mjs +0 -27
- package/dist/target-_7pn2Gbg.mjs.map +0 -1
- package/dist/taxonomies-C1IwNe8Q.mjs +0 -697
- package/dist/taxonomies-C1IwNe8Q.mjs.map +0 -1
- package/dist/taxonomies-C_XMoRcX.mjs +0 -939
- package/dist/taxonomies-C_XMoRcX.mjs.map +0 -1
- package/dist/taxonomy-C3Fu1YeH.mjs +0 -525
- package/dist/taxonomy-C3Fu1YeH.mjs.map +0 -1
- package/dist/tokens-u78jETkX.mjs +0 -171
- package/dist/tokens-u78jETkX.mjs.map +0 -1
- package/dist/transaction-BcJO4Tmc.mjs +0 -29
- package/dist/transaction-BcJO4Tmc.mjs.map +0 -1
- package/dist/transfer-BhUCrgDc.mjs +0 -8675
- package/dist/transfer-BhUCrgDc.mjs.map +0 -1
- package/dist/transfer-DIGvR9Af.mjs +0 -166
- package/dist/transfer-DIGvR9Af.mjs.map +0 -1
- package/dist/transfer-download-Pml7RMio.mjs +0 -33
- package/dist/transfer-download-Pml7RMio.mjs.map +0 -1
- package/dist/transformations-9gfpwY65.mjs +0 -196
- package/dist/transformations-9gfpwY65.mjs.map +0 -1
- package/dist/transport-BIfH7_hx.d.mts +0 -42
- package/dist/transport-BIfH7_hx.d.mts.map +0 -1
- package/dist/transport-DKWIq53q.mjs +0 -136
- package/dist/transport-DKWIq53q.mjs.map +0 -1
- package/dist/trusted-proxy-tKiVtyTD.mjs +0 -51
- package/dist/trusted-proxy-tKiVtyTD.mjs.map +0 -1
- package/dist/turnstile-DpsoyOfg.mjs +0 -53
- package/dist/turnstile-DpsoyOfg.mjs.map +0 -1
- package/dist/types-B4sUC2p1.d.mts +0 -198
- package/dist/types-B4sUC2p1.d.mts.map +0 -1
- package/dist/types-B7Lmsh1E.d.mts +0 -887
- package/dist/types-B7Lmsh1E.d.mts.map +0 -1
- package/dist/types-BZakh7Ym.mjs +0 -22
- package/dist/types-BZakh7Ym.mjs.map +0 -1
- package/dist/types-B_CppEmv.d.mts +0 -264
- package/dist/types-B_CppEmv.d.mts.map +0 -1
- package/dist/types-BcrBrE6-.mjs +0 -159
- package/dist/types-BcrBrE6-.mjs.map +0 -1
- package/dist/types-BkUg2yHx.mjs +0 -92
- package/dist/types-BkUg2yHx.mjs.map +0 -1
- package/dist/types-CAZgq9fO.d.mts +0 -124
- package/dist/types-CAZgq9fO.d.mts.map +0 -1
- package/dist/types-Cd-O03VG.d.mts +0 -363
- package/dist/types-Cd-O03VG.d.mts.map +0 -1
- package/dist/types-Cr-Kg-3D.d.mts +0 -1641
- package/dist/types-Cr-Kg-3D.d.mts.map +0 -1
- package/dist/types-D2fvWd1i.d.mts +0 -359
- package/dist/types-D2fvWd1i.d.mts.map +0 -1
- package/dist/types-D7HUsguf.mjs +0 -77
- package/dist/types-D7HUsguf.mjs.map +0 -1
- package/dist/types-DA1Te3Oy.d.mts +0 -198
- package/dist/types-DA1Te3Oy.d.mts.map +0 -1
- package/dist/types-DhV6Q5bP.mjs +0 -18
- package/dist/types-DhV6Q5bP.mjs.map +0 -1
- package/dist/types-DnnVSl6Y.d.mts +0 -85
- package/dist/types-DnnVSl6Y.d.mts.map +0 -1
- package/dist/types-VT4-BugW.mjs +0 -16
- package/dist/types-VT4-BugW.mjs.map +0 -1
- package/dist/upload-attempts-B68ZGNu9.mjs +0 -32
- package/dist/upload-attempts-B68ZGNu9.mjs.map +0 -1
- package/dist/url-pattern-CCeZMGOh.mjs +0 -33
- package/dist/url-pattern-CCeZMGOh.mjs.map +0 -1
- package/dist/user-DDSL-sGw.mjs +0 -171
- package/dist/user-DDSL-sGw.mjs.map +0 -1
- package/dist/utils-DdhmO9w9.mjs +0 -439
- package/dist/utils-DdhmO9w9.mjs.map +0 -1
- package/dist/validate-CHosPEhs.mjs +0 -453
- package/dist/validate-CHosPEhs.mjs.map +0 -1
- package/dist/validate-CM79QXYE.d.mts +0 -432
- package/dist/validate-CM79QXYE.d.mts.map +0 -1
- package/dist/validation-BFecQczG.mjs +0 -218
- package/dist/validation-BFecQczG.mjs.map +0 -1
- package/dist/version-BRZXVifl.mjs +0 -9
- package/dist/version-BRZXVifl.mjs.map +0 -1
- package/dist/version-DUQDHgrf.mjs +0 -7
- package/dist/version-DUQDHgrf.mjs.map +0 -1
- package/dist/widgets-WdV72brA.mjs +0 -126
- package/dist/widgets-WdV72brA.mjs.map +0 -1
- package/dist/wxr-taxonomies-BHTdqkmZ.d.mts +0 -34
- package/dist/wxr-taxonomies-BHTdqkmZ.d.mts.map +0 -1
- package/dist/wxr-taxonomies-DP6ESgMN.mjs +0 -372
- package/dist/wxr-taxonomies-DP6ESgMN.mjs.map +0 -1
- package/dist/zod-generator-D6uE4WiS.mjs +0 -389
- package/dist/zod-generator-D6uE4WiS.mjs.map +0 -1
- package/src/astro/routes/api/relations/[id]/translations.ts +0 -33
- /package/dist/{api-tokens-CE1ECIg0.mjs → api-tokens-FaG1zPsj.mjs} +0 -0
- /package/dist/{ssrf-DpBH7aOt.mjs → ssrf-DZOt8Qof.mjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-lock-BaRBHCsH.mjs","names":["collectionSlug","slugPattern"],"sources":["../src/api/schemas/bylines.ts","../src/api/schemas/relations.ts","../src/api/schemas/content.ts","../src/api/schemas/schema.ts","../src/api/schemas/taxonomies.ts","../src/api/schemas/sections.ts","../src/api/schemas/settings.ts","../src/api/schemas/search.ts","../src/api/schemas/users.ts","../src/api/schemas/widgets.ts","../src/api/schemas/entry-lock.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { cursorPaginationQuery, httpUrl, localeCode } from \"./common.js\";\n\n/** Slug pattern: lowercase letters, digits, and hyphens; must start with a letter */\nconst bylineSlugPattern = /^[a-z][a-z0-9-]*$/;\n\nexport const bylineSummarySchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\tdisplayName: z.string(),\n\t\tbio: z.string().nullable(),\n\t\tavatarMediaId: z.string().nullable(),\n\t\t/**\n\t\t * Avatar media storage key + alt, folded in by the media join on the\n\t\t * content byline hydration path and the single-row byline finders.\n\t\t * Null on `findMany`, which doesn't join media.\n\t\t */\n\t\tavatarStorageKey: z.string().nullish(),\n\t\tavatarAlt: z.string().nullish(),\n\t\t/**\n\t\t * Avatar media LQIP placeholder (blurhash + dominant colour, migration\n\t\t * 024), from the same media join. Lets clients render a placeholder\n\t\t * while the avatar loads. Null under the same conditions as\n\t\t * `avatarStorageKey`.\n\t\t */\n\t\tavatarBlurhash: z.string().nullish(),\n\t\tavatarDominantColor: z.string().nullish(),\n\t\twebsiteUrl: z.string().nullable(),\n\t\tuserId: z.string().nullable(),\n\t\tisGuest: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\t/** Locale this byline row is presented in (migration 040). */\n\t\tlocale: z.string(),\n\t\t/**\n\t\t * Shared across translations of the same byline (migration 040).\n\t\t * Equals `id` for the anchor row; siblings inherit it from their\n\t\t * source. Nullable in storage for backwards compatibility.\n\t\t */\n\t\ttranslationGroup: z.string().nullable(),\n\t\t/**\n\t\t * Byline custom-field values (Discussion #1174). Keys are slugs\n\t\t * registered via the byline-fields admin API; values follow\n\t\t * `CustomFieldValue` (`string | boolean | null`). Always present\n\t\t * on hydrated responses — empty `{}` when no fields are\n\t\t * registered (Phase 3 AC #6). Marked optional in the schema for\n\t\t * historic-payload compatibility with pre-Phase-3 clients that\n\t\t * may not send the key on writes; hydration always populates it.\n\t\t */\n\t\tcustomFields: z.record(z.string(), z.union([z.string(), z.boolean(), z.null()])).optional(),\n\t})\n\t.meta({ id: \"BylineSummary\" });\n\nexport const bylineCreditSchema = z\n\t.object({\n\t\tbyline: bylineSummarySchema,\n\t\tsortOrder: z.number().int(),\n\t\troleLabel: z.string().nullable(),\n\t\tsource: z.enum([\"explicit\", \"inferred\"]).optional().meta({\n\t\t\tdescription: \"Whether this credit was explicitly assigned or inferred from authorId\",\n\t\t}),\n\t})\n\t.meta({ id: \"BylineCredit\" });\n\nexport const contentBylineInputSchema = z\n\t.object({\n\t\tbylineId: z.string().min(1),\n\t\troleLabel: z.string().nullish(),\n\t})\n\t.meta({ id: \"ContentBylineInput\" });\n\nexport const bylinesListQuery = cursorPaginationQuery\n\t.extend({\n\t\tsearch: z.string().optional(),\n\t\tisGuest: z.coerce.boolean().optional(),\n\t\tuserId: z.string().optional(),\n\t\t/**\n\t\t * Filter by locale (strict per-locale matching, post-migration 040).\n\t\t * Rejects empty strings so the picker can't silently fetch the\n\t\t * unfiltered list when the admin URL has `?locale=` with no value.\n\t\t */\n\t\tlocale: localeCode.optional(),\n\t})\n\t.meta({ id: \"BylinesListQuery\" });\n\nexport const bylineCreateBody = z\n\t.object({\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.regex(bylineSlugPattern, \"Slug must contain only lowercase letters, digits, and hyphens\"),\n\t\tdisplayName: z.string().min(1),\n\t\tbio: z.string().nullish(),\n\t\tavatarMediaId: z.string().nullish(),\n\t\twebsiteUrl: httpUrl.nullish(),\n\t\tuserId: z.string().nullish(),\n\t\tisGuest: z.boolean().optional(),\n\t\t/**\n\t\t * Locale this byline row belongs to. When omitted, the DB DEFAULT (the\n\t\t * configured `defaultLocale`) is used. Rejects empty strings — an\n\t\t * empty locale would create rows no resolver requests.\n\t\t */\n\t\tlocale: localeCode.optional(),\n\t\t/**\n\t\t * When set, the new row joins the source byline's translation_group\n\t\t * rather than minting a fresh one. Requires `locale`.\n\t\t */\n\t\ttranslationOf: z.string().min(1).optional(),\n\t\t/**\n\t\t * Byline custom-field values (Discussion #1174, Phase 6 — create-flow\n\t\t * parity with update). Keys are field slugs; values are unknown at\n\t\t * the API layer because the per-field type contract lives in the\n\t\t * registry and would require an extra query to enforce here. The\n\t\t * repository's `coerceFieldValue` validates against the field's\n\t\t * type and throws `EmDashValidationError` on mismatch — the route\n\t\t * maps that to a 400 `VALIDATION_ERROR`. Reserved-slug write\n\t\t * attempts fall out as `EmDashValidationError(\"Unknown byline\n\t\t * custom field …\")` because no registered field claims a reserved\n\t\t * slug.\n\t\t */\n\t\tcustomFields: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"BylineCreateBody\" });\n\nexport const bylineTranslationCreateBody = z\n\t.object({\n\t\tlocale: localeCode,\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.regex(bylineSlugPattern, \"Slug must contain only lowercase letters, digits, and hyphens\")\n\t\t\t.optional(),\n\t\tdisplayName: z.string().min(1).optional(),\n\t\tbio: z.string().nullish(),\n\t\tavatarMediaId: z.string().nullish(),\n\t\twebsiteUrl: httpUrl.nullish(),\n\t})\n\t.meta({ id: \"BylineTranslationCreateBody\" });\n\nexport const bylineTranslationsResponseSchema = z\n\t.object({\n\t\titems: z.array(bylineSummarySchema),\n\t})\n\t.meta({ id: \"BylineTranslationsResponse\" });\n\nexport const bylineUpdateBody = z\n\t.object({\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.regex(bylineSlugPattern, \"Slug must contain only lowercase letters, digits, and hyphens\")\n\t\t\t.optional(),\n\t\tdisplayName: z.string().min(1).optional(),\n\t\tbio: z.string().nullish(),\n\t\tavatarMediaId: z.string().nullish(),\n\t\twebsiteUrl: httpUrl.nullish(),\n\t\tuserId: z.string().nullish(),\n\t\tisGuest: z.boolean().optional(),\n\t\t/**\n\t\t * Byline custom-field values (Discussion #1174, Phase 3+4). Keys\n\t\t * are field slugs; values are unknown at the API layer because\n\t\t * the per-field type contract lives in the registry and would\n\t\t * require an extra query to enforce here. The repository's\n\t\t * `coerceFieldValue` validates against the field's type and\n\t\t * throws `EmDashValidationError` on mismatch — the route maps\n\t\t * that to a 400 `VALIDATION_ERROR`. Reserved-slug write attempts\n\t\t * fall out as `EmDashValidationError(\"Unknown byline custom\n\t\t * field …\")` because no registered field claims a reserved slug.\n\t\t */\n\t\tcustomFields: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"BylineUpdateBody\" });\n\nexport const bylineListResponseSchema = z\n\t.object({\n\t\titems: z.array(bylineSummarySchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"BylineListResponse\" });\n","import { z } from \"zod\";\n\nconst slugPattern = /^[a-z][a-z0-9_]*$/;\nconst collectionSlug = z\n\t.string()\n\t.min(1)\n\t.max(63)\n\t.regex(slugPattern, \"Invalid collection slug format\");\n\n/** NULL means unlimited on that side. */\nconst roleLimit = z.number().int().positive().nullable().optional();\nconst roleLabelSingular = z.string().min(1).max(200).nullable().optional();\n\nexport const createRelationBody = z\n\t.object({\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.max(63)\n\t\t\t.regex(slugPattern, \"Slug must be lowercase alphanumeric with underscores\"),\n\t\tparentCollection: collectionSlug,\n\t\tchildCollection: collectionSlug,\n\t\tparentLabel: z.string().min(1).max(200),\n\t\tparentLabelSingular: roleLabelSingular,\n\t\tchildLabel: z.string().min(1).max(200),\n\t\tchildLabelSingular: roleLabelSingular,\n\t\tmaxChildrenPerParent: roleLimit,\n\t\tmaxParentsPerChild: roleLimit,\n\t})\n\t.meta({ id: \"CreateRelationBody\" });\n\nexport const relationListQuery = z\n\t.object({\n\t\tcollection: collectionSlug.optional().meta({\n\t\t\tdescription: \"Only relations with this collection on one end\",\n\t\t}),\n\t})\n\t.meta({ id: \"RelationListQuery\" });\n\nexport const updateRelationBody = z\n\t.object({\n\t\tparentLabel: z.string().min(1).max(200).optional(),\n\t\tparentLabelSingular: roleLabelSingular,\n\t\tchildLabel: z.string().min(1).max(200).optional(),\n\t\tchildLabelSingular: roleLabelSingular,\n\t\tmaxChildrenPerParent: roleLimit,\n\t\tmaxParentsPerChild: roleLimit,\n\t})\n\t// Reject empty payloads: an update touching no field is a client mistake, not\n\t// a successful no-op. Without this, `{}` validates and the handler returns 200\n\t// with the unchanged row, so a typo'd payload looks like it landed.\n\t.refine((body) => Object.values(body).some((value) => value !== undefined), {\n\t\tmessage: \"At least one field is required\",\n\t})\n\t.meta({ id: \"UpdateRelationBody\" });\n\nexport const relationDefSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\tparentCollection: z.string(),\n\t\tchildCollection: z.string(),\n\t\tparentLabel: z.string(),\n\t\tparentLabelSingular: z.string().nullable(),\n\t\tchildLabel: z.string(),\n\t\tchildLabelSingular: z.string().nullable(),\n\t\tmaxChildrenPerParent: z.number().int().nullable(),\n\t\tmaxParentsPerChild: z.number().int().nullable(),\n\t})\n\t.meta({ id: \"RelationDef\" });\n\n/** A relation plus what deleting it would take: the fields that view it and\n * how many links it holds. */\nexport const relationWithUsageSchema = relationDefSchema\n\t.extend({\n\t\tboundFields: z.array(\n\t\t\tz.object({\n\t\t\t\tcollectionSlug: z.string(),\n\t\t\t\tfieldSlug: z.string(),\n\t\t\t\tside: z.enum([\"parent\", \"child\"]),\n\t\t\t}),\n\t\t),\n\t\tlinkCount: z.number().int(),\n\t})\n\t.meta({ id: \"RelationWithUsage\" });\n\nexport const relationListResponseSchema = z\n\t.object({ relations: z.array(relationWithUsageSchema) })\n\t.meta({ id: \"RelationListResponse\" });\n\nexport const relationResponseSchema = z\n\t.object({ relation: relationWithUsageSchema })\n\t.meta({ id: \"RelationResponse\" });\n\nexport const entryRefSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string().nullable(),\n\t\tcollection: z.string(),\n\t\t// Display label sourced from the entry's `title`, then `name`, field —\n\t\t// `null` when neither is set. Mirrors the runtime `EntryRef`.\n\t\ttitle: z.string().nullable(),\n\t\t// The actual locale of the resolved variant. When no variant matches the\n\t\t// requesting entry's locale, the ref falls back to another locale's row;\n\t\t// this field makes that substitution explicit instead of silently\n\t\t// presenting a wrong-locale entry under the requested context.\n\t\tlocale: z.string().nullable(),\n\t\t// The translation group the ref resolved from — the locale-stable identity\n\t\t// of the referenced entry, which `id` is not.\n\t\ttranslationGroup: z.string().nullable(),\n\t\tsortOrder: z.number().int().optional(),\n\t})\n\t.meta({ id: \"ReferenceEntryRef\" });\n\nexport const referenceChildrenResponseSchema = z\n\t.object({ children: z.array(entryRefSchema), nextCursor: z.string().optional() })\n\t.meta({ id: \"ReferenceChildrenResponse\" });\n\nexport const referenceParentsResponseSchema = z\n\t.object({ parents: z.array(entryRefSchema), nextCursor: z.string().optional() })\n\t.meta({ id: \"ReferenceParentsResponse\" });\n","import { z } from \"zod\";\n\nimport { SQL_BATCH_SIZE } from \"../../utils/chunks.js\";\nimport { bylineSummarySchema, bylineCreditSchema, contentBylineInputSchema } from \"./bylines.js\";\nimport { cursorPaginationQuery, httpUrl, localeCode } from \"./common.js\";\nimport { referenceChildrenResponseSchema } from \"./relations.js\";\n\n// ---------------------------------------------------------------------------\n// Content: Input schemas\n// ---------------------------------------------------------------------------\n\nconst contentDateTime = z.iso\n\t.datetime({ offset: true, message: \"must be an ISO 8601 datetime\" })\n\t.or(\n\t\tz.iso.datetime({\n\t\t\toffset: true,\n\t\t\tprecision: -1,\n\t\t\tmessage: \"must be an ISO 8601 datetime\",\n\t\t}),\n\t);\n\n/** SEO input — per-content meta fields */\nexport const contentSeoInput = z\n\t.object({\n\t\ttitle: z.string().max(200).nullish(),\n\t\tdescription: z.string().max(500).nullish(),\n\t\timage: z.string().nullish(),\n\t\tcanonical: httpUrl.nullish(),\n\t\tnoIndex: z.boolean().optional(),\n\t})\n\t.meta({ id: \"ContentSeoInput\" });\n\n/** ISO 8601 date or datetime bound for the content-list date range filter. */\nconst contentDateBound = z\n\t.union([contentDateTime, z.iso.date({ message: \"must be an ISO 8601 date\" })])\n\t.optional();\n\n/**\n * Byline ids for the content-list filter: either the literal `none` or a\n * comma-separated list, parsed into an array.\n *\n * The 25-id cap keeps the `IN (...)` clause clear of D1's bound-parameter\n * ceiling once the rest of the list query's placeholders are counted\n * (`SQL_BATCH_SIZE` is 50 for a query binding nothing else).\n */\nconst bylineFilterParam = z\n\t.string()\n\t.trim()\n\t.min(1)\n\t.max(2000)\n\t.optional()\n\t.transform((value) =>\n\t\tvalue === undefined\n\t\t\t? undefined\n\t\t\t: value === \"none\"\n\t\t\t\t? (\"none\" as const)\n\t\t\t\t: [...new Set(value.split(\",\").map((id) => id.trim()))].filter((id) => id.length > 0),\n\t)\n\t.refine((value) => value === undefined || value === \"none\" || value.length <= 25, {\n\t\tmessage: \"at most 25 bylines may be selected\",\n\t})\n\t.refine((value) => value === undefined || value === \"none\" || value.length > 0, {\n\t\tmessage: \"must contain at least one byline id\",\n\t});\n\n/** Query-string boolean. Explicit values only — `z.coerce.boolean()` reads \"false\" as true. */\nconst booleanParam = z\n\t.enum([\"1\", \"0\", \"true\", \"false\"])\n\t.optional()\n\t.transform((value) => value === \"1\" || value === \"true\");\n\nconst contentFieldComparable = z.union([z.string().max(2048), z.number()]);\nconst contentFieldFilterScalar = z.union([contentFieldComparable, z.boolean(), z.null()]);\nconst contentFieldFilterValue = z.union([\n\tcontentFieldFilterScalar,\n\tz\n\t\t.object({\n\t\t\tin: z\n\t\t\t\t.array(z.union([contentFieldComparable, z.boolean()]))\n\t\t\t\t.min(1)\n\t\t\t\t.max(SQL_BATCH_SIZE),\n\t\t})\n\t\t.strict(),\n\tz\n\t\t.object({\n\t\t\tgt: contentFieldComparable.optional(),\n\t\t\tgte: contentFieldComparable.optional(),\n\t\t\tlt: contentFieldComparable.optional(),\n\t\t\tlte: contentFieldComparable.optional(),\n\t\t})\n\t\t.strict()\n\t\t.refine((value) => Object.values(value).some((bound) => bound !== undefined), {\n\t\t\tmessage: \"Range filter must include at least one bound\",\n\t\t}),\n]);\n\nfunction contentFieldFilterOperandCount(value: unknown): number {\n\tif (value === null) return 0;\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return 1;\n\tif (\"in\" in value && Array.isArray(value.in)) return value.in.length;\n\treturn Object.values(value).filter((bound) => bound !== undefined).length;\n}\n\n/** AND-combined filters over custom fields explicitly marked as indexed. */\nexport const contentFieldFiltersSchema = z\n\t.record(\n\t\tz\n\t\t\t.string()\n\t\t\t.max(128)\n\t\t\t.regex(/^[a-z][a-z0-9_]*$/, \"must be a safe field identifier\"),\n\t\tcontentFieldFilterValue,\n\t)\n\t.refine((filters) => Object.keys(filters).length <= 20, {\n\t\tmessage: \"At most 20 indexed field filters are allowed\",\n\t})\n\t.refine(\n\t\t(filters) =>\n\t\t\tObject.values(filters).reduce<number>(\n\t\t\t\t(total, value) => total + contentFieldFilterOperandCount(value),\n\t\t\t\t0,\n\t\t\t) <= SQL_BATCH_SIZE,\n\t\t{\n\t\t\tmessage: `Indexed field filters have a total operand budget of ${SQL_BATCH_SIZE}`,\n\t\t},\n\t);\n\nconst contentFieldFiltersQuery = z\n\t.string()\n\t.max(8192)\n\t.transform((value, ctx): unknown => {\n\t\ttry {\n\t\t\treturn JSON.parse(value);\n\t\t} catch {\n\t\t\tctx.addIssue({ code: \"custom\", message: \"must be valid JSON\" });\n\t\t\treturn z.NEVER;\n\t\t}\n\t})\n\t.pipe(contentFieldFiltersSchema);\n\n/** Statuses the content list can filter by. */\nconst CONTENT_STATUSES = [\n\t\"draft\",\n\t\"published\",\n\t\"scheduled\",\n\t\"archived\",\n\t\"pending\",\n\t\"private\",\n\t\"future\",\n] as const;\n\nexport const contentListQuery = cursorPaginationQuery\n\t.extend({\n\t\t/** Filter by status; `all` (like omitting it) lists every status. */\n\t\tstatus: z\n\t\t\t.enum([...CONTENT_STATUSES, \"all\"])\n\t\t\t.optional()\n\t\t\t.transform((status) => (status === \"all\" ? undefined : status)),\n\t\torderBy: z.string().optional(),\n\t\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\t\tlocale: localeCode.optional(),\n\t\t/** Search across the collection's display fields, slug, and searchable custom fields. */\n\t\tq: z.string().trim().min(1).max(200).optional(),\n\t\t/** Filter to entries authored by this user (the `author_id` column). */\n\t\tauthorId: z.string().min(1).max(64).optional(),\n\t\t/** Which timestamp column the `dateFrom`/`dateTo` range applies to. */\n\t\tdateField: z.enum([\"createdAt\", \"updatedAt\", \"publishedAt\"]).optional(),\n\t\t/** Inclusive lower bound for the date range. Requires `dateField`. */\n\t\tdateFrom: contentDateBound,\n\t\t/** Inclusive upper bound for the date range. Requires `dateField`. */\n\t\tdateTo: contentDateBound,\n\t\t/**\n\t\t * Comma-separated byline ids; an entry matches if it is credited to any\n\t\t * of them. The literal `none` (alone) matches entries with no byline.\n\t\t */\n\t\tbylines: bylineFilterParam,\n\t\t/**\n\t\t * Also match the byline inferred from an entry's author when it has no\n\t\t * explicit credit — i.e. filter on the byline the list renders rather\n\t\t * than on the credits stored against the entry. Off by default.\n\t\t */\n\t\tincludeInferredBylines: booleanParam,\n\t\t/** JSON-encoded indexed custom-field filters, combined with AND semantics. */\n\t\tfieldFilters: contentFieldFiltersQuery.optional(),\n\t})\n\t.transform(({ bylines, ...rest }) => ({\n\t\t...rest,\n\t\tbylinesNone: bylines === \"none\",\n\t\tbylines: bylines === \"none\" ? undefined : bylines,\n\t}))\n\t.meta({ id: \"ContentListQuery\" });\n\n/** ISO 8601 datetime for `publishedAt` / `createdAt`. Routes gate writes behind `content:publish_any`. */\nconst contentDateOverride = contentDateTime.nullish();\n\nconst overrideLockFlag = z.boolean().optional().meta({\n\tdescription:\n\t\t\"Write even though another editor holds this entry's edit lock. Without it the write is refused with 409 ENTRY_LOCKED.\",\n});\n\nexport const contentCreateBody = z\n\t.object({\n\t\tdata: z.record(z.string(), z.unknown()),\n\t\tslug: z.string().nullish(),\n\t\tstatus: z.enum([\"draft\"]).optional(),\n\t\tbylines: z.array(contentBylineInputSchema).optional(),\n\t\tlocale: localeCode.optional(),\n\t\ttranslationOf: z.string().optional(),\n\t\tseo: contentSeoInput.optional(),\n\t\ttaxonomies: z.record(z.string(), z.array(z.string())).optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Taxonomy term assignments as { taxonomyName: [termSlug, ...] }, resolved in the entry's locale.\",\n\t\t}),\n\t\treferences: z.record(z.string(), z.array(z.string()).max(1000)).optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Reference selections as { fieldSlug: [entryId, ...] }, in display order. Written as content-reference links in the same transaction as the entry. A field bound to the child end of its relation selects the entries pointing at this one, which carry no order.\",\n\t\t}),\n\t\tpublishedAt: contentDateOverride,\n\t\tcreatedAt: contentDateOverride,\n\t\tmigrateBlocks: z.boolean().optional(),\n\t\treplaceBlocks: z.boolean().optional(),\n\t})\n\t.meta({ id: \"ContentCreateBody\" });\n\nexport const contentUpdateBody = z\n\t.object({\n\t\tdata: z.record(z.string(), z.unknown()).optional(),\n\t\tslug: z.string().nullish(),\n\t\tstatus: z.enum([\"draft\"]).optional(),\n\t\tauthorId: z.string().nullish(),\n\t\tbylines: z.array(contentBylineInputSchema).optional(),\n\t\t_rev: z\n\t\t\t.string()\n\t\t\t.optional()\n\t\t\t.meta({ description: \"Opaque revision token for optimistic concurrency\" }),\n\t\tskipRevision: z.boolean().optional(),\n\t\toverrideLock: overrideLockFlag,\n\t\tseo: contentSeoInput.optional(),\n\t\ttaxonomies: z.record(z.string(), z.array(z.string())).optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Replace taxonomy assignments as { taxonomyName: [termSlug, ...] }. Only named taxonomies are touched; pass an empty array to clear a taxonomy.\",\n\t\t}),\n\t\treferences: z.record(z.string(), z.array(z.string()).max(1000)).optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Reference selections as { fieldSlug: [entryId, ...] }, in display order. Written as content-reference links in the same transaction as the entry. A field bound to the child end of its relation selects the entries pointing at this one, which carry no order.\",\n\t\t}),\n\t\tpublishedAt: contentDateOverride,\n\t\tmigrateBlocks: z.boolean().optional(),\n\t\treplaceBlocks: z.boolean().optional(),\n\t})\n\t.meta({ id: \"ContentUpdateBody\" });\n\nexport const contentScheduleBody = z\n\t.object({\n\t\tscheduledAt: contentDateTime.meta({\n\t\t\tdescription: \"ISO 8601 datetime with Z or an explicit offset for scheduled publishing\",\n\t\t\texamples: [\"2025-06-15T09:00:00Z\"],\n\t\t}),\n\t\toverrideLock: overrideLockFlag,\n\t\t_rev: z\n\t\t\t.string()\n\t\t\t.optional()\n\t\t\t.meta({ description: \"Opaque revision token for optimistic concurrency\" }),\n\t})\n\t.meta({ id: \"ContentScheduleBody\" });\n\nexport const contentRevisionConditionBody = z\n\t.object({\n\t\t_rev: z\n\t\t\t.string()\n\t\t\t.optional()\n\t\t\t.meta({ description: \"Opaque revision token for optimistic concurrency\" }),\n\t\toverrideLock: overrideLockFlag,\n\t})\n\t.meta({ id: \"ContentRevisionConditionBody\" });\n\nexport const contentPublishBody = contentRevisionConditionBody\n\t.extend({\n\t\t// .optional() rather than .nullish(): publishing has no semantic\n\t\t// meaning for `null` (you can't \"clear\" a publish timestamp by\n\t\t// publishing). Tightening the schema here means callers either\n\t\t// pass a valid datetime or omit the field, and the route doesn't\n\t\t// have to silently drop a null that snuck through.\n\t\tpublishedAt: contentDateTime.optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Optional ISO 8601 datetime to backdate the publish (e.g. when migrating content). Requires content:publish_any permission. Without this, existing published_at is preserved on re-publish.\",\n\t\t}),\n\t})\n\t.meta({ id: \"ContentPublishBody\" });\n\nexport const contentPreviewUrlBody = z\n\t.object({\n\t\texpiresIn: z.union([z.string(), z.number()]).optional(),\n\t\tpathPattern: z.string().optional(),\n\t})\n\t.meta({ id: \"ContentPreviewUrlBody\" });\n\nexport const contentTermsBody = z\n\t.object({\n\t\ttermIds: z.array(z.string()),\n\t})\n\t.meta({ id: \"ContentTermsBody\" });\n\n/** A single term variant returned as part of an entry's term assignments. */\nconst contentEntryTermSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string().meta({ description: \"Taxonomy name\" }),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\tparentId: z.string().nullable(),\n\t\tlocale: localeCode,\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"ContentEntryTerm\" });\n\n/** Term assignments response for the content terms endpoint. */\nexport const contentTermsResponseSchema = z\n\t.object({\n\t\tterms: z.array(contentEntryTermSchema),\n\t\tunresolved: z.array(\n\t\t\tz.object({\n\t\t\t\ttranslationGroup: z.string(),\n\t\t\t\tavailableLocales: z.array(localeCode),\n\t\t\t\ttranslations: z.array(\n\t\t\t\t\tz.object({\n\t\t\t\t\t\tid: z.string(),\n\t\t\t\t\t\tslug: z.string(),\n\t\t\t\t\t\tlocale: localeCode,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t}),\n\t\t),\n\t\tentryLocale: localeCode,\n\t\tdefaultLocale: localeCode,\n\t\timplicitDefaultLocale: z.boolean(),\n\t})\n\t.meta({ id: \"ContentTermsResponse\" });\n\nexport const contentTrashQuery = cursorPaginationQuery\n\t.extend({\n\t\tlocale: localeCode.optional().meta({\n\t\t\tdescription: \"Restrict the trash listing to entries in this locale\",\n\t\t}),\n\t})\n\t.meta({ id: \"ContentTrashQuery\" });\n\n// ---------------------------------------------------------------------------\n// Content: Response schemas\n// ---------------------------------------------------------------------------\n\n/** SEO metadata on a content item */\nexport const contentSeoSchema = z\n\t.object({\n\t\ttitle: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\timage: z.string().nullable(),\n\t\tcanonical: z.string().nullable(),\n\t\tnoIndex: z.boolean(),\n\t})\n\t.meta({ id: \"ContentSeo\" });\n\n/** A single content item as returned by the API */\nexport const contentItemSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\ttype: z.string().meta({ description: \"Collection slug this item belongs to\" }),\n\t\tslug: z.string().nullable(),\n\t\tstatus: z.string().meta({ description: \"draft, published, or scheduled\" }),\n\t\tdata: z.record(z.string(), z.unknown()).meta({\n\t\t\tdescription: \"User-defined field values\",\n\t\t}),\n\t\tauthorId: z.string().nullable(),\n\t\tprimaryBylineId: z.string().nullable(),\n\t\tbyline: bylineSummarySchema.nullable().optional(),\n\t\tbylines: z.array(bylineCreditSchema).optional(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tpublishedAt: z.string().nullable(),\n\t\tscheduledAt: z.string().nullable(),\n\t\tliveRevisionId: z.string().nullable(),\n\t\tdraftRevisionId: z.string().nullable(),\n\t\tversion: z.number().int(),\n\t\tlocale: z.string().nullable(),\n\t\ttranslationGroup: z.string().nullable(),\n\t\tseo: contentSeoSchema.optional(),\n\t\t// First page of each reference field's selection, keyed by field slug. Only\n\t\t// present when the editor GET path opts into hydration\n\t\t// (`referenceOptions`); omitted otherwise, so it's optional here.\n\t\treferences: z.record(z.string(), referenceChildrenResponseSchema).optional(),\n\t})\n\t.meta({ id: \"ContentItem\" });\n\n/** Response for single content item endpoints (get, create, update) */\nexport const contentResponseSchema = z\n\t.object({\n\t\titem: contentItemSchema,\n\t\t_rev: z\n\t\t\t.string()\n\t\t\t.optional()\n\t\t\t.meta({ description: \"Opaque revision token for optimistic concurrency\" }),\n\t})\n\t.meta({ id: \"ContentResponse\" });\n\n/** Response for restoring an item from trash */\nexport const contentRestoreResponseSchema = z\n\t.object({\n\t\trestored: z.literal(true),\n\t\titem: contentItemSchema,\n\t\t_rev: z.string().meta({ description: \"Opaque revision token for optimistic concurrency\" }),\n\t})\n\t.meta({ id: \"ContentRestoreResponse\" });\n\n/** Response for content list endpoints */\nexport const contentListResponseSchema = z\n\t.object({\n\t\titems: z.array(contentItemSchema),\n\t\tnextCursor: z.string().optional(),\n\t\ttotal: z.number().int().nonnegative().optional(),\n\t})\n\t.meta({ id: \"ContentListResponse\" });\n\n/** A distinct content author for the admin author filter */\nexport const contentAuthorSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\temail: z.string(),\n\t\tavatarUrl: z.string().nullable(),\n\t})\n\t.meta({ id: \"ContentAuthor\" });\n\n/** Response for the content authors endpoint */\nexport const contentAuthorsResponseSchema = z\n\t.object({\n\t\titems: z.array(contentAuthorSchema),\n\t})\n\t.meta({ id: \"ContentAuthorsResponse\" });\n\n/** Trashed content item */\nexport const trashedContentItemSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\ttype: z.string(),\n\t\tslug: z.string().nullable(),\n\t\tstatus: z.string(),\n\t\tlocale: z.string().nullable(),\n\t\ttranslationGroup: z.string().nullable(),\n\t\tdata: z.record(z.string(), z.unknown()),\n\t\tauthorId: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tpublishedAt: z.string().nullable(),\n\t\tdeletedAt: z.string(),\n\t})\n\t.meta({ id: \"TrashedContentItem\" });\n\n/** Response for trashed content list */\nexport const trashedContentListResponseSchema = z\n\t.object({\n\t\titems: z.array(trashedContentItemSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"TrashedContentListResponse\" });\n\n/** Response for content compare (live vs draft) */\nexport const contentCompareResponseSchema = z\n\t.object({\n\t\thasChanges: z.boolean(),\n\t\tlive: z.record(z.string(), z.unknown()).nullable(),\n\t\tdraft: z.record(z.string(), z.unknown()).nullable(),\n\t})\n\t.meta({ id: \"ContentCompareResponse\" });\n\n/** Translation summary for a content item */\nexport const contentTranslationSchema = z.object({\n\tid: z.string(),\n\tlocale: z.string().nullable(),\n\tslug: z.string().nullable(),\n\tstatus: z.string(),\n\tupdatedAt: z.string(),\n});\n\n/** Response for content translations endpoint */\nexport const contentTranslationsResponseSchema = z\n\t.object({\n\t\ttranslationGroup: z.string(),\n\t\ttranslations: z.array(contentTranslationSchema),\n\t})\n\t.meta({ id: \"ContentTranslationsResponse\" });\n","import { z } from \"zod\";\n\nimport { MAX_COLLECTION_GROUP_LENGTH, MAX_COLLECTION_LIST_COLUMNS } from \"../../schema/types.js\";\nimport { compileUrlPattern } from \"../../schema/url-pattern.js\";\nimport { slugPattern } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Schema (collections & fields): Input schemas\n// ---------------------------------------------------------------------------\n\nconst collectionSupportValues = z.enum([\n\t\"drafts\",\n\t\"revisions\",\n\t\"preview\",\n\t\"scheduling\",\n\t\"search\",\n\t\"seo\",\n]);\n\nconst collectionSourcePattern = /^(template:.+|import:.+|manual|discovered|seed)$/;\n\nconst collectionListColumns = z.array(\n\tz.string().min(1).max(63).regex(slugPattern, \"Invalid field slug format\"),\n);\n\nconst collectionAdminInputConfig = z.object({\n\tlistColumns: collectionListColumns\n\t\t.max(\n\t\t\tMAX_COLLECTION_LIST_COLUMNS,\n\t\t\t`At most ${MAX_COLLECTION_LIST_COLUMNS} list columns are allowed`,\n\t\t)\n\t\t.optional(),\n});\n\nconst collectionAdminResponseConfig = z.object({\n\tlistColumns: collectionListColumns.optional(),\n});\n\nconst fieldTypeValues = z.enum([\n\t\"string\",\n\t\"text\",\n\t\"url\",\n\t\"number\",\n\t\"integer\",\n\t\"boolean\",\n\t\"datetime\",\n\t\"select\",\n\t\"multiSelect\",\n\t\"portableText\",\n\t\"image\",\n\t\"file\",\n\t\"reference\",\n\t\"json\",\n\t\"slug\",\n\t\"repeater\",\n\t\"blocks\",\n]);\n\nconst repeaterSubFieldSchema = z.object({\n\tslug: z.string().min(1).max(63).regex(slugPattern, \"Invalid slug format\"),\n\t// Keep in sync with REPEATER_SUB_FIELD_TYPES in schema/types.ts.\n\t// (\"url\" was already a documented sub-field type but missing here.)\n\ttype: z.enum([\n\t\t\"string\",\n\t\t\"text\",\n\t\t\"url\",\n\t\t\"number\",\n\t\t\"integer\",\n\t\t\"boolean\",\n\t\t\"datetime\",\n\t\t\"select\",\n\t\t\"image\",\n\t]),\n\tlabel: z.string().min(1),\n\trequired: z.boolean().optional(),\n\toptions: z.array(z.string()).optional(),\n});\n\nconst urlPatternValue = z.string().superRefine((pattern, ctx) => {\n\ttry {\n\t\tcompileUrlPattern(pattern);\n\t} catch {\n\t\tctx.addIssue({\n\t\t\tcode: \"custom\",\n\t\t\tmessage: \"Invalid URL pattern\",\n\t\t});\n\t}\n});\n\nconst fieldValidation = z\n\t.object({\n\t\trequired: z.boolean().optional(),\n\t\tmin: z.number().optional(),\n\t\tmax: z.number().optional(),\n\t\tminLength: z.number().int().min(0).optional(),\n\t\tmaxLength: z.number().int().min(0).optional(),\n\t\tpattern: z.string().optional(),\n\t\toptions: z.array(z.string()).optional(),\n\t\tsubFields: z.array(repeaterSubFieldSchema).min(1).optional(),\n\t\tminItems: z.number().int().min(0).optional(),\n\t\tmaxItems: z.number().int().min(1).optional(),\n\t\tallowedMimeTypes: z\n\t\t\t.array(\n\t\t\t\tz\n\t\t\t\t\t.string()\n\t\t\t\t\t.regex(/^[a-z0-9][a-z0-9!#$&^_+\\-.]*\\/[a-z0-9!#$&^_+\\-.]*$/i, \"Invalid MIME type\"),\n\t\t\t)\n\t\t\t.min(1, \"allowedMimeTypes must not be empty — omit the field to allow all types\")\n\t\t\t.max(64, \"allowedMimeTypes may contain at most 64 entries\")\n\t\t\t.optional(),\n\t\t// Reference fields: the picker targets a collection and may allow more\n\t\t// than one entry. Without these keys Zod strips them and the create\n\t\t// handler rejects the field for a missing target collection.\n\t\ttargetCollection: z.string().min(1).optional(),\n\t\tmultiple: z.boolean().optional(),\n\t\t// Reference fields: bind to an existing relation instead of creating one,\n\t\t// and say which of its ends this collection sits on.\n\t\trelation: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.max(63)\n\t\t\t.regex(slugPattern, \"Invalid relation slug format\")\n\t\t\t.optional(),\n\t\trelationSide: z.enum([\"parent\", \"child\"]).optional(),\n\t\tallowedTypes: z.array(z.string().min(1).max(63).regex(slugPattern)).optional(),\n\t\tretiredTypes: z.array(z.string().min(1).max(63).regex(slugPattern)).optional(),\n\t})\n\t.superRefine((validation, ctx) => {\n\t\tfor (const [minimum, maximum] of [\n\t\t\t[\"min\", \"max\"],\n\t\t\t[\"minLength\", \"maxLength\"],\n\t\t\t[\"minItems\", \"maxItems\"],\n\t\t] as const) {\n\t\t\tconst minimumValue = validation[minimum];\n\t\t\tconst maximumValue = validation[maximum];\n\t\t\tif (minimumValue !== undefined && maximumValue !== undefined && minimumValue > maximumValue) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tpath: [maximum],\n\t\t\t\t\tmessage: `${maximum} must be greater than or equal to ${minimum}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (validation.pattern !== undefined) {\n\t\t\ttry {\n\t\t\t\tRegExp(validation.pattern);\n\t\t\t} catch {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tpath: [\"pattern\"],\n\t\t\t\t\tmessage: \"Invalid validation pattern\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t})\n\t.optional();\n\nconst fieldWidgetOptions = z.record(z.string(), z.unknown()).optional();\n\n/** Admin sidebar folder label; an empty string clears it like `null`. */\nconst navGroupValue = z.string().trim().max(MAX_COLLECTION_GROUP_LENGTH);\n\nexport const createCollectionBody = z\n\t.object({\n\t\tslug: z.string().min(1).max(63).regex(slugPattern, \"Invalid slug format\"),\n\t\tlabel: z.string().min(1),\n\t\tlabelSingular: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\ticon: z.string().optional(),\n\t\tadmin: collectionAdminInputConfig.optional(),\n\t\tsupports: z.array(collectionSupportValues).optional(),\n\t\tsource: z.string().regex(collectionSourcePattern).optional(),\n\t\turlPattern: urlPatternValue.optional(),\n\t\troutable: z.boolean().optional(),\n\t\thasSeo: z.boolean().optional(),\n\t\thidden: z.boolean().optional(),\n\t\tsortOrder: z.number().int().nullish(),\n\t\teditLocking: z.boolean().optional(),\n\t\tgroup: navGroupValue.nullish(),\n\t})\n\t.meta({ id: \"CreateCollectionBody\" });\n\nexport const updateCollectionBody = z\n\t.object({\n\t\tlabel: z.string().min(1).optional(),\n\t\tlabelSingular: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\ticon: z.string().optional(),\n\t\tadmin: collectionAdminInputConfig.optional(),\n\t\tsupports: z.array(collectionSupportValues).optional(),\n\t\turlPattern: urlPatternValue.nullish(),\n\t\troutable: z.boolean().optional(),\n\t\thasSeo: z.boolean().optional(),\n\t\thidden: z.boolean().optional(),\n\t\tsortOrder: z.number().int().nullish(),\n\t\tgroup: navGroupValue.nullish(),\n\t\tcommentsEnabled: z.boolean().optional(),\n\t\tcommentsModeration: z.enum([\"all\", \"first_time\", \"none\"]).optional(),\n\t\tcommentsClosedAfterDays: z.number().int().min(0).optional(),\n\t\tcommentsAutoApproveUsers: z.boolean().optional(),\n\t\teditLocking: z.boolean().optional(),\n\t\ttitleField: z.string().min(1).max(63).regex(slugPattern, \"Invalid field slug format\").nullish(),\n\t\tdateField: z.string().min(1).max(63).regex(slugPattern, \"Invalid field slug format\").nullish(),\n\t})\n\t.meta({ id: \"UpdateCollectionBody\" });\n\nexport const createFieldBody = z\n\t.object({\n\t\tslug: z.string().min(1).max(63).regex(slugPattern, \"Invalid slug format\"),\n\t\tlabel: z.string().min(1),\n\t\ttype: fieldTypeValues,\n\t\trequired: z.boolean().optional(),\n\t\tunique: z.boolean().optional(),\n\t\tdefaultValue: z.unknown().optional(),\n\t\tvalidation: fieldValidation.nullable(),\n\t\twidget: z.string().optional(),\n\t\toptions: fieldWidgetOptions,\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t\tsearchable: z.boolean().optional(),\n\t\tindexed: z.boolean().optional(),\n\t\ttranslatable: z.boolean().optional(),\n\t})\n\t.meta({ id: \"CreateFieldBody\" });\n\nexport const updateFieldBody = z\n\t.object({\n\t\tlabel: z.string().min(1).optional(),\n\t\ttype: fieldTypeValues.optional(),\n\t\trequired: z.boolean().optional(),\n\t\tunique: z.boolean().optional(),\n\t\tdefaultValue: z.unknown().optional(),\n\t\tvalidation: fieldValidation.nullable(),\n\t\twidget: z.string().optional(),\n\t\toptions: fieldWidgetOptions,\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t\tsearchable: z.boolean().optional(),\n\t\tindexed: z.boolean().optional(),\n\t\ttranslatable: z.boolean().optional(),\n\t})\n\t.meta({ id: \"UpdateFieldBody\" });\n\nexport const fieldReorderBody = z\n\t.object({\n\t\tfieldSlugs: z.array(z.string().min(1)),\n\t})\n\t.meta({ id: \"FieldReorderBody\" });\n\nexport const collectionReorderBody = z\n\t.object({\n\t\t/** Full desired sidebar order. Collections left out fall back to alphabetical. */\n\t\tslugs: z.array(z.string().min(1)),\n\t})\n\t.meta({ id: \"CollectionReorderBody\" });\n\nexport const orphanRegisterBody = z\n\t.object({\n\t\tlabel: z.string().optional(),\n\t\tlabelSingular: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t})\n\t.meta({ id: \"OrphanRegisterBody\" });\n\nexport const schemaExportQuery = z.object({\n\tformat: z.string().optional(),\n});\n\nconst blockFieldTypeValues = z.enum([\n\t\"string\",\n\t\"text\",\n\t\"url\",\n\t\"number\",\n\t\"integer\",\n\t\"boolean\",\n\t\"datetime\",\n\t\"select\",\n\t\"multiSelect\",\n\t\"portableText\",\n\t\"image\",\n\t\"file\",\n\t\"repeater\",\n]);\n\nconst blockFieldValidation = z\n\t.object({\n\t\tmin: z.number().optional(),\n\t\tmax: z.number().optional(),\n\t\tminLength: z.number().int().min(0).optional(),\n\t\tmaxLength: z.number().int().min(0).optional(),\n\t\tpattern: z.string().optional(),\n\t\toptions: z.array(z.string()).optional(),\n\t\tsubFields: z.array(repeaterSubFieldSchema).min(1).optional(),\n\t\tminItems: z.number().int().min(0).optional(),\n\t\tmaxItems: z.number().int().min(1).optional(),\n\t\tallowedMimeTypes: z.array(z.string()).min(1).max(64).optional(),\n\t})\n\t.strict()\n\t.optional();\n\nexport const blockFieldDefinitionSchema = z\n\t.object({\n\t\tslug: z.string().min(1).max(63).regex(slugPattern, \"Invalid field slug format\"),\n\t\tlabel: z.string().min(1).max(200),\n\t\ttype: blockFieldTypeValues,\n\t\trequired: z.boolean().optional(),\n\t\tdefaultValue: z.unknown().optional(),\n\t\tvalidation: blockFieldValidation,\n\t\toptions: z.object({ darkVariant: z.boolean().optional() }).strict().optional(),\n\t})\n\t.strict();\n\nexport const createBlockTypeBody = z\n\t.object({\n\t\tslug: z.string().min(1).max(63).regex(slugPattern, \"Invalid block type slug format\"),\n\t\tlabel: z.string().min(1).max(200),\n\t\tdescription: z.string().optional(),\n\t\ticon: z.string().optional(),\n\t\tcategory: z.string().optional(),\n\t\tfields: z.array(blockFieldDefinitionSchema),\n\t})\n\t.strict()\n\t.meta({ id: \"CreateBlockTypeBody\" });\n\nexport const updateBlockTypeBody = z\n\t.object({\n\t\texpectedFingerprint: z.string().min(1),\n\t\tlabel: z.string().min(1).max(200).optional(),\n\t\tdescription: z.string().nullish(),\n\t\ticon: z.string().nullish(),\n\t\tcategory: z.string().nullish(),\n\t\tfields: z.array(blockFieldDefinitionSchema).optional(),\n\t\tbreaking: z.boolean().optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"UpdateBlockTypeBody\" });\n\nexport const activateBlockTypeVersionBody = z\n\t.object({ expectedFingerprint: z.string().min(1) })\n\t.strict()\n\t.meta({ id: \"ActivateBlockTypeVersionBody\" });\n\nexport const collectionGetQuery = z.object({\n\tincludeFields: z\n\t\t.string()\n\t\t.transform((v) => v === \"true\")\n\t\t.optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Schema: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const collectionSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\tlabelSingular: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\ticon: z.string().nullable(),\n\t\tadmin: collectionAdminResponseConfig.optional(),\n\t\tsupports: z.array(z.string()),\n\t\tsource: z.string().nullable(),\n\t\turlPattern: z.string().nullable(),\n\t\troutable: z.boolean(),\n\t\thasSeo: z.boolean(),\n\t\thidden: z.boolean(),\n\t\tsortOrder: z.number().int().nullable(),\n\t\teditLocking: z.boolean(),\n\t\tgroup: z.string().nullish(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\ttitleField: z.string().nullish(),\n\t\tdateField: z.string().nullish(),\n\t})\n\t.meta({ id: \"Collection\" });\n\nexport const fieldSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tcollectionId: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\ttype: fieldTypeValues,\n\t\trequired: z.boolean(),\n\t\tunique: z.boolean(),\n\t\tdefaultValue: z.unknown().nullable(),\n\t\tvalidation: z.record(z.string(), z.unknown()).nullable(),\n\t\twidget: z.string().nullable(),\n\t\toptions: z.record(z.string(), z.unknown()).nullable(),\n\t\tblockTypes: z.array(z.lazy(() => blockTypeSchema)).optional(),\n\t\tblockTypeFingerprint: z.string().optional(),\n\t\tsortOrder: z.number().int(),\n\t\tsearchable: z.boolean(),\n\t\tindexed: z.boolean(),\n\t\ttranslatable: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"Field\" });\n\nexport const collectionResponseSchema = z\n\t.object({ item: collectionSchema })\n\t.meta({ id: \"CollectionResponse\" });\n\nexport const collectionWithFieldsResponseSchema = z\n\t.object({\n\t\titem: collectionSchema.extend({ fields: z.array(fieldSchema) }),\n\t})\n\t.meta({ id: \"CollectionWithFieldsResponse\" });\n\nexport const collectionListResponseSchema = z\n\t.object({ items: z.array(collectionSchema) })\n\t.meta({ id: \"CollectionListResponse\" });\n\nexport const fieldResponseSchema = z.object({ item: fieldSchema }).meta({ id: \"FieldResponse\" });\n\nexport const fieldListResponseSchema = z\n\t.object({ items: z.array(fieldSchema) })\n\t.meta({ id: \"FieldListResponse\" });\n\nexport const blockTypeVersionSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tblockTypeId: z.string(),\n\t\tversion: z.number().int().positive(),\n\t\tfields: z.array(blockFieldDefinitionSchema),\n\t\tfingerprint: z.string(),\n\t\tactive: z.boolean(),\n\t\tunsupportedTypes: z.array(z.object({ type: z.string(), path: z.string() }).strict()).optional(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"BlockTypeVersion\" });\n\nexport const blockTypeSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\tdescription: z.string().optional(),\n\t\ticon: z.string().optional(),\n\t\tcategory: z.string().optional(),\n\t\tcurrentVersion: z.number().int().positive(),\n\t\tsource: z.enum([\"user\", \"seed\"]),\n\t\tversions: z.array(blockTypeVersionSchema),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"BlockType\" });\n\nexport const blockTypeResponseSchema = z\n\t.object({ item: blockTypeSchema })\n\t.meta({ id: \"BlockTypeResponse\" });\n\nexport const blockTypeListResponseSchema = z\n\t.object({ items: z.array(blockTypeSchema) })\n\t.meta({ id: \"BlockTypeListResponse\" });\n\nexport const orphanedTableSchema = z\n\t.object({\n\t\tslug: z.string(),\n\t\ttableName: z.string(),\n\t\trowCount: z.number().int(),\n\t})\n\t.meta({ id: \"OrphanedTable\" });\n\nexport const orphanedTableListResponseSchema = z\n\t.object({ items: z.array(orphanedTableSchema) })\n\t.meta({ id: \"OrphanedTableListResponse\" });\n","import { z } from \"zod\";\n\nimport { localeCode } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Taxonomy definitions: Input schemas\n// ---------------------------------------------------------------------------\n\n/** Collection slug format: lowercase alphanumeric + underscores, starts with letter */\nconst collectionSlugPattern = /^[a-z][a-z0-9_]*$/;\n\nconst collectionSlug = z\n\t.string()\n\t.min(1)\n\t.max(63)\n\t.regex(collectionSlugPattern, \"Invalid collection slug format\");\n\nexport const createTaxonomyDefBody = z\n\t.object({\n\t\tname: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.max(63)\n\t\t\t.regex(/^[a-z][a-z0-9_]*$/, \"Name must be lowercase alphanumeric with underscores\"),\n\t\tlabel: z.string().min(1).max(200),\n\t\tlabelSingular: z.string().min(1).max(200).optional(),\n\t\thierarchical: z.boolean().optional(),\n\t\tcollections: z.array(collectionSlug).max(100).optional(),\n\t\tlocale: localeCode.optional(),\n\t\ttranslationOf: z.string().min(1).optional(),\n\t})\n\t.meta({ id: \"CreateTaxonomyDefBody\" });\n\n/**\n * `name` and `locale` are absent on purpose: both identify the definition row\n * being written, and `.strict()` turns an attempt to change either into a 400\n * rather than a silently ignored field.\n */\nexport const updateTaxonomyDefBody = z\n\t.object({\n\t\tlabel: z.string().min(1).max(200).optional(),\n\t\tlabelSingular: z.string().min(1).max(200).nullish(),\n\t\thierarchical: z.boolean().optional(),\n\t\tcollections: z.array(collectionSlug).max(100).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"UpdateTaxonomyDefBody\" });\n\n// ---------------------------------------------------------------------------\n// Taxonomy terms: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const createTermBody = z\n\t.object({\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.optional()\n\t\t\t.meta({ description: \"Term slug. Omit to derive a unique slug from the label.\" }),\n\t\tlabel: z.string().min(1),\n\t\tparentId: z.string().nullish(),\n\t\tdescription: z.string().optional(),\n\t\tlocale: localeCode.optional(),\n\t\ttranslationOf: z.string().min(1).optional(),\n\t})\n\t.meta({ id: \"CreateTermBody\" });\n\nexport const bulkTagBody = z\n\t.object({\n\t\ttermId: z.string().min(1),\n\t\tapply: z.boolean().default(false),\n\t\trefreshOnly: z.boolean().optional(),\n\t\titems: z\n\t\t\t.array(\n\t\t\t\tz.union([\n\t\t\t\t\tz.object({ collection: collectionSlug, id: z.string().min(1) }).strict(),\n\t\t\t\t\tz.object({ url: z.string().min(1).max(2048) }).strict(),\n\t\t\t\t]),\n\t\t\t)\n\t\t\t.min(1)\n\t\t\t.max(50),\n\t})\n\t.strict()\n\t.meta({ id: \"BulkTagBody\" });\n\nexport const updateTermBody = z\n\t.object({\n\t\tslug: z.string().min(1).optional(),\n\t\tlabel: z.string().min(1).optional(),\n\t\tparentId: z.string().nullish(),\n\t\tdescription: z.string().optional(),\n\t})\n\t.meta({ id: \"UpdateTermBody\" });\n\nexport const reorderTermsBody = z\n\t.object({\n\t\tparentId: z.string().min(1).nullish().meta({\n\t\t\tdescription:\n\t\t\t\t\"Parent term whose children are being ordered (translation_group or row id). Omit or null for the top level, which for a flat taxonomy is every term.\",\n\t\t}),\n\t\tids: z.array(z.string().min(1)).max(100).meta({\n\t\t\tdescription:\n\t\t\t\t\"Terms to move, in the desired order — each a row id or translation_group. May be a subset of the group: the listed terms are permuted within the positions they already occupy and every other member keeps its place. An id outside the group is rejected with REORDER_MISMATCH.\",\n\t\t}),\n\t})\n\t.strict()\n\t.meta({ id: \"ReorderTermsBody\" });\n\nexport const termListQuery = z\n\t.object({\n\t\tlocale: localeCode.optional(),\n\t\tincludeCounts: z\n\t\t\t.enum([\"true\", \"false\"])\n\t\t\t.transform((v) => v === \"true\")\n\t\t\t.optional()\n\t\t\t.default(true)\n\t\t\t.meta({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Include each term's visible-usage count. Pass false to skip the aggregate; `count` is then absent from every term.\",\n\t\t\t}),\n\t\tresolveFallback: z\n\t\t\t.enum([\"true\", \"false\"])\n\t\t\t.transform((value) => value === \"true\")\n\t\t\t.optional()\n\t\t\t.default(false)\n\t\t\t.meta({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Resolve one term per translation group, preferring the requested locale and then the configured default locale.\",\n\t\t\t}),\n\t})\n\t.meta({ id: \"TermListQuery\" });\n\n// ---------------------------------------------------------------------------\n// Taxonomies: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const taxonomyDefSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tlabel: z.string(),\n\t\tlabelSingular: z.string().optional(),\n\t\thierarchical: z.boolean(),\n\t\tcollections: z.array(z.string()),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"TaxonomyDef\" });\n\nexport const taxonomyDefTranslationsSchema = z\n\t.object({\n\t\ttranslationGroup: z.string().nullable(),\n\t\ttranslations: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tlabel: z.string(),\n\t\t\t\tlocale: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"TaxonomyDefTranslations\" });\n\nexport const taxonomyListResponseSchema = z\n\t.object({ taxonomies: z.array(taxonomyDefSchema) })\n\t.meta({ id: \"TaxonomyListResponse\" });\n\nexport const taxonomyResponseSchema = z\n\t.object({ taxonomy: taxonomyDefSchema })\n\t.meta({ id: \"TaxonomyResponse\" });\n\nexport const termSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\tparentId: z.string().nullable(),\n\t\tdescription: z.string().optional(),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"Term\" });\n\nexport const termTranslationsSchema = z\n\t.object({\n\t\ttranslationGroup: z.string().nullable(),\n\t\ttranslations: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tslug: z.string(),\n\t\t\t\tlabel: z.string(),\n\t\t\t\tlocale: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"TermTranslations\" });\n\nexport const termWithCountSchema: z.ZodType = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\tparentId: z.string().nullable(),\n\t\tdescription: z.string().optional(),\n\t\tcount: z.number().int().optional(),\n\t\tchildren: z.array(z.lazy(() => termWithCountSchema)),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"TermWithCount\" });\n\nexport const termListResponseSchema = z\n\t.object({ terms: z.array(termWithCountSchema) })\n\t.meta({ id: \"TermListResponse\" });\n\nexport const termResponseSchema = z.object({ term: termSchema }).meta({ id: \"TermResponse\" });\n\nexport const termReorderResponseSchema = z\n\t.object({ reordered: z.literal(true) })\n\t.meta({ id: \"TermReorderResponse\" });\n\nexport const termGetResponseSchema = z\n\t.object({\n\t\tterm: termSchema.extend({\n\t\t\tcount: z.number().int(),\n\t\t\tchildren: z.array(\n\t\t\t\tz.object({\n\t\t\t\t\tid: z.string(),\n\t\t\t\t\tslug: z.string(),\n\t\t\t\t\tlabel: z.string(),\n\t\t\t\t}),\n\t\t\t),\n\t\t}),\n\t})\n\t.meta({ id: \"TermGetResponse\" });\n","import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Sections: Input schemas\n// ---------------------------------------------------------------------------\n\nconst sectionSource = z.enum([\"theme\", \"user\", \"import\"]);\n\nexport const sectionsListQuery = z\n\t.object({\n\t\tsource: sectionSource.optional(),\n\t\tsearch: z.string().optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(100).optional().default(50),\n\t\tcursor: z.string().max(2048).optional(),\n\t})\n\t.meta({ id: \"SectionsListQuery\" });\n\nexport const createSectionBody = z\n\t.object({\n\t\tslug: z.string().min(1),\n\t\ttitle: z.string().min(1),\n\t\tdescription: z.string().optional(),\n\t\tkeywords: z.array(z.string()).optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())),\n\t\tpreviewMediaId: z.string().optional(),\n\t\tsource: z.enum([\"user\", \"import\"]).optional(),\n\t\tthemeId: z.string().optional(),\n\t})\n\t.meta({ id: \"CreateSectionBody\" });\n\nexport const updateSectionBody = z\n\t.object({\n\t\tslug: z.string().min(1).optional(),\n\t\ttitle: z.string().min(1).optional(),\n\t\tdescription: z.string().optional(),\n\t\tkeywords: z.array(z.string()).optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())).optional(),\n\t\tpreviewMediaId: z.string().nullish(),\n\t})\n\t.meta({ id: \"UpdateSectionBody\" });\n\n// ---------------------------------------------------------------------------\n// Sections: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const sectionSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\ttitle: z.string(),\n\t\tdescription: z.string().nullable(),\n\t\tkeywords: z.array(z.string()).nullable(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())),\n\t\tpreviewMediaId: z.string().nullable(),\n\t\tsource: z.string(),\n\t\tthemeId: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"Section\" });\n\nexport const sectionListResponseSchema = z\n\t.object({\n\t\titems: z.array(sectionSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"SectionListResponse\" });\n","import { z } from \"zod\";\n\nimport { httpUrl } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Settings: Input schemas\n//\n// Media references on write are just `{ mediaId, alt? }` -- the resolved\n// fields (`url`, `contentType`, `width`, `height`) are server-computed and\n// stripped from any submitted body via Zod's default strip mode. See\n// `packages/core/src/settings/types.ts` for the in-memory shape.\n// ---------------------------------------------------------------------------\n\nconst mediaReferenceInput = z.object({\n\tmediaId: z.string(),\n\talt: z.string().optional(),\n});\n\nconst socialSettings = z.object({\n\ttwitter: z.string().optional(),\n\tgithub: z.string().optional(),\n\tfacebook: z.string().optional(),\n\tinstagram: z.string().optional(),\n\tlinkedin: z.string().optional(),\n\tyoutube: z.string().optional(),\n});\n\nconst seoSettingsInput = z.object({\n\ttitleSeparator: z.string().max(10).optional(),\n\tdefaultOgImage: mediaReferenceInput.nullable().optional(),\n\trobotsTxt: z.string().max(5000).optional(),\n\tgoogleVerification: z.string().max(100).optional(),\n\tbingVerification: z.string().max(100).optional(),\n});\n\nexport const settingsUpdateBody = z\n\t.object({\n\t\ttitle: z.string().optional(),\n\t\ttagline: z.string().optional(),\n\t\tlogo: mediaReferenceInput.nullable().optional(),\n\t\tfavicon: mediaReferenceInput.nullable().optional(),\n\t\turl: z.union([httpUrl, z.literal(\"\")]).optional(),\n\t\tpostsPerPage: z.number().int().min(1).max(100).optional(),\n\t\tdateFormat: z.string().optional(),\n\t\ttimezone: z.string().optional(),\n\t\tsocial: socialSettings.optional(),\n\t\tseo: seoSettingsInput.optional(),\n\t})\n\t.meta({ id: \"SettingsUpdateBody\" });\n\n// ---------------------------------------------------------------------------\n// Settings: Response schemas\n//\n// Responses carry the resolved fields populated by `resolveMediaReference`\n// in `settings/index.ts`. Generated OpenAPI clients need to see them so\n// they don't have to re-resolve the URL on the client. Fields stay\n// optional because the resolver returns the bare ref if the underlying\n// media row was deleted (orphaned reference).\n// ---------------------------------------------------------------------------\n\nconst mediaReferenceResponse = z.object({\n\tmediaId: z.string(),\n\talt: z.string().optional(),\n\t/** Resolved media file URL; absent if the underlying row is missing. */\n\turl: z.string().optional(),\n\t/** Stored MIME type (e.g. `image/svg+xml`). Populated alongside `url`. */\n\tcontentType: z.string().optional(),\n\t/** Pixel width if known. Populated alongside `url`. */\n\twidth: z.number().int().optional(),\n\t/** Pixel height if known. Populated alongside `url`. */\n\theight: z.number().int().optional(),\n});\n\nconst seoSettingsResponse = z.object({\n\ttitleSeparator: z.string().max(10).optional(),\n\tdefaultOgImage: mediaReferenceResponse.optional(),\n\trobotsTxt: z.string().max(5000).optional(),\n\tgoogleVerification: z.string().max(100).optional(),\n\tbingVerification: z.string().max(100).optional(),\n});\n\nexport const siteSettingsSchema = z\n\t.object({\n\t\ttitle: z.string().optional(),\n\t\ttagline: z.string().optional(),\n\t\tlogo: mediaReferenceResponse.optional(),\n\t\tfavicon: mediaReferenceResponse.optional(),\n\t\turl: z.string().optional(),\n\t\tpostsPerPage: z.number().int().optional(),\n\t\tdateFormat: z.string().optional(),\n\t\ttimezone: z.string().optional(),\n\t\tsocial: socialSettings.optional(),\n\t\tseo: seoSettingsResponse.optional(),\n\t})\n\t.meta({ id: \"SiteSettings\" });\n","import { z } from \"zod\";\n\nimport { SEARCH_TOKENIZERS } from \"../../search/types.js\";\nimport { localeCode } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Search: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const searchQuery = z\n\t.object({\n\t\tq: z.string().min(1),\n\t\tcollections: z.string().optional(),\n\t\tstatus: z.string().optional(),\n\t\tlocale: localeCode.optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(100).optional(),\n\t\tcursor: z.string().optional(),\n\t\tscope: z.enum([\"all\", \"title\"]).optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Which indexed fields to match against. 'title' matches only the collection's title field; collections without an indexed title field return no results. Defaults to 'all'.\",\n\t\t}),\n\t})\n\t.meta({ id: \"SearchQuery\" });\n\nexport const searchSuggestQuery = z\n\t.object({\n\t\tq: z.string().min(1),\n\t\tcollections: z.string().optional(),\n\t\tlocale: localeCode.optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(20).optional(),\n\t})\n\t.meta({ id: \"SearchSuggestQuery\" });\n\nexport const searchRebuildBody = z\n\t.object({\n\t\tcollection: z.string().min(1),\n\t})\n\t.meta({ id: \"SearchRebuildBody\" });\n\nexport const searchEnableBody = z\n\t.object({\n\t\tcollection: z.string().min(1),\n\t\tenabled: z.boolean(),\n\t\tweights: z.record(z.string(), z.number()).optional(),\n\t\ttokenize: z.enum(SEARCH_TOKENIZERS).optional(),\n\t})\n\t.meta({ id: \"SearchEnableBody\" });\n\n// ---------------------------------------------------------------------------\n// Search: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const searchResultSchema = z\n\t.object({\n\t\tcollection: z.string(),\n\t\tid: z.string(),\n\t\tslug: z.string().nullable(),\n\t\tlocale: z.string(),\n\t\ttitle: z.string().optional(),\n\t\tsnippet: z.string().optional(),\n\t\tscore: z.number(),\n\t})\n\t.meta({ id: \"SearchResult\" });\n\nexport const searchResponseSchema = z\n\t.object({\n\t\titems: z.array(searchResultSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"SearchResponse\" });\n","import { z } from \"zod\";\n\nimport { roleLevel } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Admin / Users: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const usersListQuery = z\n\t.object({\n\t\tsearch: z.string().optional(),\n\t\trole: z.string().optional(),\n\t\tcursor: z.string().max(2048).optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(100).optional().default(50),\n\t})\n\t.meta({ id: \"UsersListQuery\" });\n\nexport const userUpdateBody = z\n\t.object({\n\t\tname: z.string().optional(),\n\t\temail: z.email().optional(),\n\t\trole: roleLevel.optional(),\n\t})\n\t.meta({ id: \"UserUpdateBody\" });\n\nexport const allowedDomainCreateBody = z\n\t.object({\n\t\tdomain: z.string().min(1),\n\t\tdefaultRole: roleLevel,\n\t})\n\t.meta({ id: \"AllowedDomainCreateBody\" });\n\nexport const allowedDomainUpdateBody = z\n\t.object({\n\t\tenabled: z.boolean().optional(),\n\t\tdefaultRole: roleLevel.optional(),\n\t})\n\t.meta({ id: \"AllowedDomainUpdateBody\" });\n\n// ---------------------------------------------------------------------------\n// Admin / Users: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const userSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\temail: z.string(),\n\t\tname: z.string().nullable(),\n\t\tavatarUrl: z.string().nullable(),\n\t\trole: z.number().int(),\n\t\temailVerified: z.boolean(),\n\t\tdisabled: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tlastLogin: z.string().nullable(),\n\t\tcredentialCount: z.number().int().optional(),\n\t\toauthProviders: z.array(z.string()).optional(),\n\t})\n\t.meta({ id: \"User\" });\n\nexport const userListResponseSchema = z\n\t.object({\n\t\titems: z.array(userSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"UserListResponse\" });\n\nexport const userDetailSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\temail: z.string(),\n\t\tname: z.string().nullable(),\n\t\tavatarUrl: z.string().nullable(),\n\t\trole: z.number().int(),\n\t\temailVerified: z.boolean(),\n\t\tdisabled: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tlastLogin: z.string().nullable(),\n\t\tcredentials: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tname: z.string().nullable(),\n\t\t\t\tdeviceType: z.string().nullable(),\n\t\t\t\tcreatedAt: z.string(),\n\t\t\t\tlastUsedAt: z.string(),\n\t\t\t}),\n\t\t),\n\t\toauthAccounts: z.array(\n\t\t\tz.object({\n\t\t\t\tprovider: z.string(),\n\t\t\t\tcreatedAt: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"UserDetail\" });\n","import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Widgets: Input schemas\n// ---------------------------------------------------------------------------\n\nconst widgetType = z.enum([\"content\", \"menu\", \"component\"]);\n\nexport const createWidgetAreaBody = z\n\t.object({\n\t\tname: z.string().min(1),\n\t\tlabel: z.string().min(1),\n\t\tdescription: z.string().optional(),\n\t})\n\t.meta({ id: \"CreateWidgetAreaBody\" });\n\nexport const createWidgetBody = z\n\t.object({\n\t\ttype: widgetType,\n\t\ttitle: z.string().optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())).optional(),\n\t\tmenuName: z.string().optional(),\n\t\tcomponentId: z.string().optional(),\n\t\tcomponentProps: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"CreateWidgetBody\" });\n\nexport const updateWidgetBody = z\n\t.object({\n\t\ttype: widgetType.optional(),\n\t\ttitle: z.string().optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())).optional(),\n\t\tmenuName: z.string().optional(),\n\t\tcomponentId: z.string().optional(),\n\t\tcomponentProps: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"UpdateWidgetBody\" });\n\nexport const reorderWidgetsBody = z\n\t.object({\n\t\twidgetIds: z.array(z.string().min(1)),\n\t})\n\t.meta({ id: \"ReorderWidgetsBody\" });\n\n// ---------------------------------------------------------------------------\n// Widgets: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const widgetAreaSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tlabel: z.string(),\n\t\tdescription: z.string().nullable(),\n\t\tcreated_at: z.string(),\n\t\tupdated_at: z.string(),\n\t})\n\t.meta({ id: \"WidgetArea\" });\n\nexport const widgetSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\ttype: widgetType,\n\t\ttitle: z.string().optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())).optional(),\n\t\tmenuName: z.string().optional(),\n\t\tcomponentId: z.string().optional(),\n\t\tcomponentProps: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"Widget\" });\n\nexport const widgetAreaWithWidgetsSchema = widgetAreaSchema\n\t.extend({\n\t\twidgets: z.array(widgetSchema),\n\t})\n\t.meta({ id: \"WidgetAreaWithWidgets\" });\n\nexport const widgetAreaWithWidgetsAndCountSchema = widgetAreaWithWidgetsSchema\n\t.extend({\n\t\twidgetCount: z.number().int(),\n\t})\n\t.meta({ id: \"WidgetAreaWithWidgetsAndCount\" });\n","import { z } from \"zod\";\n\nexport const entryLockAcquireBody = z\n\t.object({\n\t\ttakeover: z.boolean().optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Take the lock from whoever holds it. Their next heartbeat or save reports the new holder.\",\n\t\t}),\n\t\ttoken: z.string().min(1).max(128).optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Identifies the caller's editing session. Send the same value on DELETE so a release from one tab does not drop a lock another tab of the same account still relies on.\",\n\t\t}),\n\t})\n\t.meta({ id: \"EntryLockAcquireBody\" });\n\nexport const entryLockHolderSchema = z\n\t.object({\n\t\tuserId: z.string(),\n\t\tuserName: z.string().nullable(),\n\t\tacquiredAt: z.string(),\n\t\texpiresAt: z.string(),\n\t})\n\t.meta({ id: \"EntryLockHolder\" });\n\nexport const entryLockStatusSchema = z\n\t.object({\n\t\tenabled: z.boolean().meta({\n\t\t\tdescription: \"Whether the collection takes edit locks at all\",\n\t\t}),\n\t\tholder: entryLockHolderSchema.nullable(),\n\t\theldByCaller: z.boolean(),\n\t})\n\t.meta({ id: \"EntryLockStatus\" });\n\nexport const entryLockReleaseResponseSchema = z\n\t.object({ released: z.boolean() })\n\t.meta({ id: \"EntryLockReleaseResponse\" });\n\nexport const entryLockConflictSchema = z.object({\n\tsuccess: z.literal(false),\n\terror: z.object({\n\t\tcode: z.literal(\"ENTRY_LOCKED\"),\n\t\tmessage: z.string(),\n\t\tdetails: entryLockHolderSchema,\n\t}),\n});\n\nexport const entryMutationConflictSchema = z.object({\n\tsuccess: z.literal(false),\n\terror: z.object({\n\t\tcode: z.string().meta({ examples: [\"CONFLICT\", \"ENTRY_LOCKED\"] }),\n\t\tmessage: z.string(),\n\t\tdetails: entryLockHolderSchema.optional(),\n\t}),\n});\n\nexport type EntryLockAcquireBody = z.infer<typeof entryLockAcquireBody>;\n"],"mappings":";;;;;;;;;AAKA,MAAM,oBAAoB;AAE1B,MAAa,sBAAsB,EACjC,OAAO;CACP,IAAI,EAAE,QAAQ;CACd,MAAM,EAAE,QAAQ;CAChB,aAAa,EAAE,QAAQ;CACvB,KAAK,EAAE,QAAQ,CAAC,UAAU;CAC1B,eAAe,EAAE,QAAQ,CAAC,UAAU;CAMpC,kBAAkB,EAAE,QAAQ,CAAC,SAAS;CACtC,WAAW,EAAE,QAAQ,CAAC,SAAS;CAO/B,gBAAgB,EAAE,QAAQ,CAAC,SAAS;CACpC,qBAAqB,EAAE,QAAQ,CAAC,SAAS;CACzC,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,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P,SAAS,EAAE,SAAS,CAAC,KAAK,EACzB,aAAa,kDACb,CAAC;CACF,QAAQ,sBAAsB,UAAU;CACxC,cAAc,EAAE,SAAS;CACzB,CAAC,CACD,KAAK,EAAE,IAAI,mBAAmB,CAAC;AAEjC,MAAa,iCAAiC,EAC5C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CACjC,KAAK,EAAE,IAAI,4BAA4B,CAAC;AAE1C,MAAa,0BAA0B,EAAE,OAAO;CAC/C,SAAS,EAAE,QAAQ,MAAM;CACzB,OAAO,EAAE,OAAO;EACf,MAAM,EAAE,QAAQ,eAAe;EAC/B,SAAS,EAAE,QAAQ;EACnB,SAAS;EACT,CAAC;CACF,CAAC;AAEF,MAAa,8BAA8B,EAAE,OAAO;CACnD,SAAS,EAAE,QAAQ,MAAM;CACzB,OAAO,EAAE,OAAO;EACf,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,eAAe,EAAE,CAAC;EACjE,SAAS,EAAE,QAAQ;EACnB,SAAS,sBAAsB,UAAU;EACzC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { t as EntryLockRepository } from "./entry-locks-BTyQLdbC.mjs";
|
|
2
|
+
import { t as ErrorCode } from "./errors-BN1QAnEY.mjs";
|
|
3
|
+
import { ulid } from "ulidx";
|
|
4
|
+
|
|
5
|
+
//#region src/api/handlers/entry-lock.ts
|
|
6
|
+
/**
|
|
7
|
+
* How long an entry stays locked without a heartbeat or save. Long enough to
|
|
8
|
+
* survive a pause in typing, short enough that a closed tab frees the entry
|
|
9
|
+
* within a coffee break.
|
|
10
|
+
*/
|
|
11
|
+
const ENTRY_LOCK_LEASE_MS = 420 * 1e3;
|
|
12
|
+
const ENTRY_LOCK_LEASE_SECONDS = ENTRY_LOCK_LEASE_MS / 1e3;
|
|
13
|
+
function toHolder(lock) {
|
|
14
|
+
return {
|
|
15
|
+
userId: lock.userId,
|
|
16
|
+
userName: lock.userName,
|
|
17
|
+
acquiredAt: lock.acquiredAt,
|
|
18
|
+
expiresAt: lock.expiresAt
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function holderLabel(holder) {
|
|
22
|
+
return holder.userName?.trim() ? holder.userName : "Another editor";
|
|
23
|
+
}
|
|
24
|
+
async function isLockingEnabled(db, collection) {
|
|
25
|
+
const row = await db.selectFrom("_emdash_collections").select("edit_locking").where("slug", "=", collection).executeTakeFirst();
|
|
26
|
+
if (!row) return null;
|
|
27
|
+
return row.edit_locking !== 0;
|
|
28
|
+
}
|
|
29
|
+
function collectionNotFound(collection) {
|
|
30
|
+
return {
|
|
31
|
+
success: false,
|
|
32
|
+
error: {
|
|
33
|
+
code: ErrorCode.COLLECTION_NOT_FOUND,
|
|
34
|
+
message: `Collection '${collection}' not found`
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Takes the entry's lock for `userId`, or reports who is holding it. A
|
|
40
|
+
* take-over is only granted when the caller asks for one.
|
|
41
|
+
*/
|
|
42
|
+
async function handleEntryLockAcquire(db, collection, entryId, userId, options = {}) {
|
|
43
|
+
try {
|
|
44
|
+
const enabled = await isLockingEnabled(db, collection);
|
|
45
|
+
if (enabled === null) return collectionNotFound(collection);
|
|
46
|
+
if (!enabled) return {
|
|
47
|
+
success: true,
|
|
48
|
+
data: {
|
|
49
|
+
enabled: false,
|
|
50
|
+
holder: null,
|
|
51
|
+
heldByCaller: false
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const claim = await new EntryLockRepository(db).acquire({
|
|
55
|
+
collection,
|
|
56
|
+
entryId,
|
|
57
|
+
userId,
|
|
58
|
+
token: options.token ?? ulid(),
|
|
59
|
+
leaseSeconds: ENTRY_LOCK_LEASE_SECONDS,
|
|
60
|
+
takeover: options.takeover
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
success: true,
|
|
64
|
+
data: {
|
|
65
|
+
enabled: true,
|
|
66
|
+
holder: toHolder(claim.lock),
|
|
67
|
+
heldByCaller: claim.outcome === "acquired"
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
} catch (error) {
|
|
71
|
+
console.error("[entry-lock] acquire failed:", error);
|
|
72
|
+
return {
|
|
73
|
+
success: false,
|
|
74
|
+
error: {
|
|
75
|
+
code: ErrorCode.ENTRY_LOCK_ERROR,
|
|
76
|
+
message: "Failed to acquire the entry lock"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function handleEntryLockRead(db, collection, entryId, userId) {
|
|
82
|
+
try {
|
|
83
|
+
const enabled = await isLockingEnabled(db, collection);
|
|
84
|
+
if (enabled === null) return collectionNotFound(collection);
|
|
85
|
+
if (!enabled) return {
|
|
86
|
+
success: true,
|
|
87
|
+
data: {
|
|
88
|
+
enabled: false,
|
|
89
|
+
holder: null,
|
|
90
|
+
heldByCaller: false
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const lock = await new EntryLockRepository(db).findLive(collection, entryId);
|
|
94
|
+
return {
|
|
95
|
+
success: true,
|
|
96
|
+
data: {
|
|
97
|
+
enabled: true,
|
|
98
|
+
holder: lock ? toHolder(lock) : null,
|
|
99
|
+
heldByCaller: lock?.userId === userId
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
} catch (error) {
|
|
103
|
+
console.error("[entry-lock] read failed:", error);
|
|
104
|
+
return {
|
|
105
|
+
success: false,
|
|
106
|
+
error: {
|
|
107
|
+
code: ErrorCode.ENTRY_LOCK_ERROR,
|
|
108
|
+
message: "Failed to read the entry lock"
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async function handleEntryLockRelease(db, collection, entryId, userId, options = {}) {
|
|
114
|
+
try {
|
|
115
|
+
return {
|
|
116
|
+
success: true,
|
|
117
|
+
data: { released: await new EntryLockRepository(db).release({
|
|
118
|
+
collection,
|
|
119
|
+
entryId,
|
|
120
|
+
userId,
|
|
121
|
+
token: options.token
|
|
122
|
+
}) }
|
|
123
|
+
};
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error("[entry-lock] release failed:", error);
|
|
126
|
+
return {
|
|
127
|
+
success: false,
|
|
128
|
+
error: {
|
|
129
|
+
code: ErrorCode.ENTRY_LOCK_ERROR,
|
|
130
|
+
message: "Failed to release the entry lock"
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Decides whether a write may proceed, and keeps the caller's own lease alive
|
|
137
|
+
* while it does. Resolves to `null` when the write is allowed.
|
|
138
|
+
*
|
|
139
|
+
* A write never takes a lock it was not given, so a CLI or API caller writing
|
|
140
|
+
* an unlocked entry leaves it unlocked.
|
|
141
|
+
*/
|
|
142
|
+
async function claimEntryLockForWrite(db, collection, entryId, userId, options = {}) {
|
|
143
|
+
if (options.override === true) return null;
|
|
144
|
+
const repo = new EntryLockRepository(db);
|
|
145
|
+
if (await repo.refreshHeld({
|
|
146
|
+
collection,
|
|
147
|
+
entryId,
|
|
148
|
+
userId,
|
|
149
|
+
leaseSeconds: ENTRY_LOCK_LEASE_SECONDS
|
|
150
|
+
})) return null;
|
|
151
|
+
const holder = await repo.findEnforceable(collection, entryId);
|
|
152
|
+
if (!holder) return null;
|
|
153
|
+
const details = toHolder(holder);
|
|
154
|
+
return {
|
|
155
|
+
code: ErrorCode.ENTRY_LOCKED,
|
|
156
|
+
message: `${holderLabel(details)} is holding this entry`,
|
|
157
|
+
details
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
//#endregion
|
|
162
|
+
export { handleEntryLockRelease as i, handleEntryLockAcquire as n, handleEntryLockRead as r, claimEntryLockForWrite as t };
|
|
163
|
+
//# sourceMappingURL=entry-lock-C6NcnZPV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-lock-C6NcnZPV.mjs","names":[],"sources":["../src/api/handlers/entry-lock.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\nimport { ulid } from \"ulidx\";\n\nimport { EntryLockRepository, type EntryLock } from \"../../database/repositories/entry-locks.js\";\nimport type { Database } from \"../../database/types.js\";\nimport { ErrorCode } from \"../errors.js\";\nimport type { ApiResult } from \"../types.js\";\n\n/**\n * How long an entry stays locked without a heartbeat or save. Long enough to\n * survive a pause in typing, short enough that a closed tab frees the entry\n * within a coffee break.\n */\nexport const ENTRY_LOCK_LEASE_MS = 7 * 60 * 1000;\n\nconst ENTRY_LOCK_LEASE_SECONDS = ENTRY_LOCK_LEASE_MS / 1000;\n\nexport interface EntryLockHolder {\n\tuserId: string;\n\tuserName: string | null;\n\tacquiredAt: string;\n\texpiresAt: string;\n}\n\nexport interface EntryLockStatus {\n\t/** Whether the collection takes edit locks at all. */\n\tenabled: boolean;\n\t/** The live lease, whoever holds it. */\n\tholder: EntryLockHolder | null;\n\t/** Whether `holder` is the caller. */\n\theldByCaller: boolean;\n}\n\nexport interface EntryLockRefusal {\n\tcode: typeof ErrorCode.ENTRY_LOCKED;\n\tmessage: string;\n\tdetails: EntryLockHolder;\n}\n\nfunction toHolder(lock: EntryLock): EntryLockHolder {\n\treturn {\n\t\tuserId: lock.userId,\n\t\tuserName: lock.userName,\n\t\tacquiredAt: lock.acquiredAt,\n\t\texpiresAt: lock.expiresAt,\n\t};\n}\n\nfunction holderLabel(holder: EntryLockHolder): string {\n\treturn holder.userName?.trim() ? holder.userName : \"Another editor\";\n}\n\nasync function isLockingEnabled(db: Kysely<Database>, collection: string): Promise<boolean | null> {\n\tconst row = await db\n\t\t.selectFrom(\"_emdash_collections\")\n\t\t.select(\"edit_locking\")\n\t\t.where(\"slug\", \"=\", collection)\n\t\t.executeTakeFirst();\n\tif (!row) return null;\n\treturn row.edit_locking !== 0;\n}\n\nfunction collectionNotFound(collection: string): ApiResult<never> {\n\treturn {\n\t\tsuccess: false,\n\t\terror: {\n\t\t\tcode: ErrorCode.COLLECTION_NOT_FOUND,\n\t\t\tmessage: `Collection '${collection}' not found`,\n\t\t},\n\t};\n}\n\n/**\n * Takes the entry's lock for `userId`, or reports who is holding it. A\n * take-over is only granted when the caller asks for one.\n */\nexport async function handleEntryLockAcquire(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\tuserId: string,\n\toptions: { takeover?: boolean; token?: string } = {},\n): Promise<ApiResult<EntryLockStatus>> {\n\ttry {\n\t\tconst enabled = await isLockingEnabled(db, collection);\n\t\tif (enabled === null) return collectionNotFound(collection);\n\t\tif (!enabled) {\n\t\t\treturn { success: true, data: { enabled: false, holder: null, heldByCaller: false } };\n\t\t}\n\n\t\tconst claim = await new EntryLockRepository(db).acquire({\n\t\t\tcollection,\n\t\t\tentryId,\n\t\t\tuserId,\n\t\t\ttoken: options.token ?? ulid(),\n\t\t\tleaseSeconds: ENTRY_LOCK_LEASE_SECONDS,\n\t\t\ttakeover: options.takeover,\n\t\t});\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\tenabled: true,\n\t\t\t\tholder: toHolder(claim.lock),\n\t\t\t\theldByCaller: claim.outcome === \"acquired\",\n\t\t\t},\n\t\t};\n\t} catch (error) {\n\t\tconsole.error(\"[entry-lock] acquire failed:\", error);\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: ErrorCode.ENTRY_LOCK_ERROR, message: \"Failed to acquire the entry lock\" },\n\t\t};\n\t}\n}\n\nexport async function handleEntryLockRead(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\tuserId: string,\n): Promise<ApiResult<EntryLockStatus>> {\n\ttry {\n\t\tconst enabled = await isLockingEnabled(db, collection);\n\t\tif (enabled === null) return collectionNotFound(collection);\n\t\tif (!enabled) {\n\t\t\treturn { success: true, data: { enabled: false, holder: null, heldByCaller: false } };\n\t\t}\n\n\t\tconst lock = await new EntryLockRepository(db).findLive(collection, entryId);\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\tenabled: true,\n\t\t\t\tholder: lock ? toHolder(lock) : null,\n\t\t\t\theldByCaller: lock?.userId === userId,\n\t\t\t},\n\t\t};\n\t} catch (error) {\n\t\tconsole.error(\"[entry-lock] read failed:\", error);\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: ErrorCode.ENTRY_LOCK_ERROR, message: \"Failed to read the entry lock\" },\n\t\t};\n\t}\n}\n\nexport async function handleEntryLockRelease(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\tuserId: string,\n\toptions: { token?: string } = {},\n): Promise<ApiResult<{ released: boolean }>> {\n\ttry {\n\t\tconst released = await new EntryLockRepository(db).release({\n\t\t\tcollection,\n\t\t\tentryId,\n\t\t\tuserId,\n\t\t\ttoken: options.token,\n\t\t});\n\t\treturn { success: true, data: { released } };\n\t} catch (error) {\n\t\tconsole.error(\"[entry-lock] release failed:\", error);\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: { code: ErrorCode.ENTRY_LOCK_ERROR, message: \"Failed to release the entry lock\" },\n\t\t};\n\t}\n}\n\n/**\n * Decides whether a write may proceed, and keeps the caller's own lease alive\n * while it does. Resolves to `null` when the write is allowed.\n *\n * A write never takes a lock it was not given, so a CLI or API caller writing\n * an unlocked entry leaves it unlocked.\n */\nexport async function claimEntryLockForWrite(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryId: string,\n\tuserId: string,\n\toptions: { override?: boolean } = {},\n): Promise<EntryLockRefusal | null> {\n\tif (options.override === true) return null;\n\n\tconst repo = new EntryLockRepository(db);\n\tconst heldByCaller = await repo.refreshHeld({\n\t\tcollection,\n\t\tentryId,\n\t\tuserId,\n\t\tleaseSeconds: ENTRY_LOCK_LEASE_SECONDS,\n\t});\n\tif (heldByCaller) return null;\n\n\tconst holder = await repo.findEnforceable(collection, entryId);\n\tif (!holder) return null;\n\n\tconst details = toHolder(holder);\n\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B,MAAM,SAAS,MAAM,KAAK,gBAAgB,YAAY,QAAQ;AAC9D,KAAI,CAAC,OAAQ,QAAO;CAEpB,MAAM,UAAU,SAAS,OAAO;AAChC,QAAO;EACN,MAAM,UAAU;EAChB,SAAS,GAAG,YAAY,QAAQ,CAAC;EACjC;EACA"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { u as isPostgres } from "./dialect-helpers-7_IqPdh9.mjs";
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
|
|
4
|
+
//#region src/database/repositories/entry-locks.ts
|
|
5
|
+
/**
|
|
6
|
+
* A refused claim proves a live lease existed at statement time, so a second
|
|
7
|
+
* pass only runs when that lease lapsed or was released in between.
|
|
8
|
+
*/
|
|
9
|
+
const CLAIM_ATTEMPTS = 2;
|
|
10
|
+
function toEntryLock(row) {
|
|
11
|
+
return {
|
|
12
|
+
collection: row.collection,
|
|
13
|
+
entryId: row.entry_id,
|
|
14
|
+
userId: row.user_id,
|
|
15
|
+
userName: row.user_name ?? null,
|
|
16
|
+
acquiredAt: row.acquired_at,
|
|
17
|
+
expiresAt: row.expires_at
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One lease per entry, keyed by `(collection, entry_id)`.
|
|
22
|
+
*
|
|
23
|
+
* Every timestamp comes from the database clock, so leases stay comparable
|
|
24
|
+
* across isolates whose wall clocks drift.
|
|
25
|
+
*/
|
|
26
|
+
var EntryLockRepository = class {
|
|
27
|
+
constructor(db) {
|
|
28
|
+
this.db = db;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Claims the entry for `userId`, or reports who holds it. An expired lease
|
|
32
|
+
* and the caller's own lease are both claimable; anyone else's live lease
|
|
33
|
+
* needs `takeover`.
|
|
34
|
+
*
|
|
35
|
+
* `token` identifies the caller's editing session. The row keeps the latest
|
|
36
|
+
* one and `release` matches on it, so two tabs of one account can share an
|
|
37
|
+
* entry without the first tab to close dropping the lease the other still
|
|
38
|
+
* relies on.
|
|
39
|
+
*/
|
|
40
|
+
async acquire(input) {
|
|
41
|
+
for (let attempt = 0; attempt < CLAIM_ATTEMPTS; attempt++) {
|
|
42
|
+
const claimed = await this.claim(input);
|
|
43
|
+
if (claimed) return {
|
|
44
|
+
outcome: "acquired",
|
|
45
|
+
lock: await this.withHolderName(claimed)
|
|
46
|
+
};
|
|
47
|
+
const holder = await this.findLive(input.collection, input.entryId);
|
|
48
|
+
if (holder) return {
|
|
49
|
+
outcome: "held",
|
|
50
|
+
lock: holder
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`Entry lock claim did not settle for ${input.collection}/${input.entryId}`);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Extends the caller's own live lease, and reports whether they had one.
|
|
57
|
+
* `false` lets a write path tell "mine, extended" from "someone else's, or
|
|
58
|
+
* none" without taking a lease it was never given.
|
|
59
|
+
*/
|
|
60
|
+
async refreshHeld(input) {
|
|
61
|
+
const result = await this.db.updateTable("_emdash_entry_locks").set({ expires_at: this.timestampOffset(input.leaseSeconds) }).where("collection", "=", input.collection).where("entry_id", "=", input.entryId).where("user_id", "=", input.userId).where(this.leaseIsLive("expires_at")).executeTakeFirst();
|
|
62
|
+
return Number(result.numUpdatedRows ?? 0) > 0;
|
|
63
|
+
}
|
|
64
|
+
async findLive(collection, entryId) {
|
|
65
|
+
const row = await this.liveQuery(collection, entryId).executeTakeFirst();
|
|
66
|
+
return row ? toEntryLock(row) : null;
|
|
67
|
+
}
|
|
68
|
+
/** The live lease, but only while the collection still has locking switched on. */
|
|
69
|
+
async findEnforceable(collection, entryId) {
|
|
70
|
+
const row = await this.liveQuery(collection, entryId).innerJoin("_emdash_collections", "_emdash_collections.slug", "_emdash_entry_locks.collection").where("_emdash_collections.edit_locking", "!=", 0).executeTakeFirst();
|
|
71
|
+
return row ? toEntryLock(row) : null;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Drops the caller's lease. With `token`, only the session that last
|
|
75
|
+
* claimed the row can drop it; without, any session of the account can.
|
|
76
|
+
*/
|
|
77
|
+
async release(key) {
|
|
78
|
+
let query = this.db.deleteFrom("_emdash_entry_locks").where("collection", "=", key.collection).where("entry_id", "=", key.entryId).where("user_id", "=", key.userId);
|
|
79
|
+
if (key.token !== void 0) query = query.where("token", "=", key.token);
|
|
80
|
+
const result = await query.executeTakeFirst();
|
|
81
|
+
return Number(result.numDeletedRows ?? 0) > 0;
|
|
82
|
+
}
|
|
83
|
+
/** Drops every lease on an entry, whoever holds it. */
|
|
84
|
+
async releaseEntry(collection, entryId) {
|
|
85
|
+
await this.db.deleteFrom("_emdash_entry_locks").where("collection", "=", collection).where("entry_id", "=", entryId).execute();
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Insert-or-steal in one statement. The conflict branch keeps the original
|
|
89
|
+
* acquisition time when the holder is unchanged, so the admin can show how
|
|
90
|
+
* long the entry has been open rather than how long ago it was last typed
|
|
91
|
+
* into.
|
|
92
|
+
*
|
|
93
|
+
* Column references in the conflict branch are table-qualified: Postgres
|
|
94
|
+
* sees both the stored row and `excluded` there and rejects a bare name as
|
|
95
|
+
* ambiguous.
|
|
96
|
+
*/
|
|
97
|
+
async claim(input) {
|
|
98
|
+
const now = this.timestampOffset(0);
|
|
99
|
+
const expiresAt = this.timestampOffset(input.leaseSeconds);
|
|
100
|
+
return this.db.insertInto("_emdash_entry_locks").values({
|
|
101
|
+
collection: input.collection,
|
|
102
|
+
entry_id: input.entryId,
|
|
103
|
+
user_id: input.userId,
|
|
104
|
+
token: input.token,
|
|
105
|
+
acquired_at: now,
|
|
106
|
+
expires_at: expiresAt
|
|
107
|
+
}).onConflict((oc) => {
|
|
108
|
+
const update = oc.columns(["collection", "entry_id"]).doUpdateSet({
|
|
109
|
+
user_id: input.userId,
|
|
110
|
+
token: input.token,
|
|
111
|
+
acquired_at: sql`CASE
|
|
112
|
+
WHEN ${sql.ref("_emdash_entry_locks.user_id")} = ${input.userId}
|
|
113
|
+
THEN ${sql.ref("_emdash_entry_locks.acquired_at")}
|
|
114
|
+
ELSE ${now}
|
|
115
|
+
END`,
|
|
116
|
+
expires_at: expiresAt
|
|
117
|
+
});
|
|
118
|
+
if (input.takeover === true) return update;
|
|
119
|
+
return update.where((eb) => eb.or([eb("_emdash_entry_locks.user_id", "=", input.userId), this.leaseHasExpired("_emdash_entry_locks.expires_at")]));
|
|
120
|
+
}).returningAll().executeTakeFirst();
|
|
121
|
+
}
|
|
122
|
+
liveQuery(collection, entryId) {
|
|
123
|
+
return this.db.selectFrom("_emdash_entry_locks").leftJoin("users", "users.id", "_emdash_entry_locks.user_id").select([
|
|
124
|
+
"_emdash_entry_locks.collection",
|
|
125
|
+
"_emdash_entry_locks.entry_id",
|
|
126
|
+
"_emdash_entry_locks.user_id",
|
|
127
|
+
"_emdash_entry_locks.token",
|
|
128
|
+
"_emdash_entry_locks.acquired_at",
|
|
129
|
+
"_emdash_entry_locks.expires_at",
|
|
130
|
+
"users.name as user_name"
|
|
131
|
+
]).where("_emdash_entry_locks.collection", "=", collection).where("_emdash_entry_locks.entry_id", "=", entryId).where(this.leaseIsLive("_emdash_entry_locks.expires_at"));
|
|
132
|
+
}
|
|
133
|
+
async withHolderName(row) {
|
|
134
|
+
const user = await this.db.selectFrom("users").select("name").where("id", "=", row.user_id).executeTakeFirst();
|
|
135
|
+
return {
|
|
136
|
+
collection: row.collection,
|
|
137
|
+
entryId: row.entry_id,
|
|
138
|
+
userId: row.user_id,
|
|
139
|
+
userName: user?.name ?? null,
|
|
140
|
+
acquiredAt: row.acquired_at,
|
|
141
|
+
expiresAt: row.expires_at
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
leaseIsLive(column) {
|
|
145
|
+
const expiresAt = sql.ref(column);
|
|
146
|
+
return isPostgres(this.db) ? sql`${expiresAt}::timestamptz > clock_timestamp()` : sql`${expiresAt} > strftime('%Y-%m-%dT%H:%M:%fZ', 'now')`;
|
|
147
|
+
}
|
|
148
|
+
leaseHasExpired(column) {
|
|
149
|
+
const expiresAt = sql.ref(column);
|
|
150
|
+
return isPostgres(this.db) ? sql`${expiresAt}::timestamptz <= clock_timestamp()` : sql`${expiresAt} <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now')`;
|
|
151
|
+
}
|
|
152
|
+
timestampOffset(offsetSeconds) {
|
|
153
|
+
if (isPostgres(this.db)) return sql`to_char(
|
|
154
|
+
(clock_timestamp() AT TIME ZONE 'UTC') + (${offsetSeconds} * INTERVAL '1 second'),
|
|
155
|
+
'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'
|
|
156
|
+
)`;
|
|
157
|
+
return sql`strftime(
|
|
158
|
+
'%Y-%m-%dT%H:%M:%fZ',
|
|
159
|
+
'now',
|
|
160
|
+
${`${offsetSeconds >= 0 ? "+" : ""}${offsetSeconds} seconds`}
|
|
161
|
+
)`;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
//#endregion
|
|
166
|
+
export { EntryLockRepository as t };
|
|
167
|
+
//# sourceMappingURL=entry-locks-BTyQLdbC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-locks-BTyQLdbC.mjs","names":[],"sources":["../src/database/repositories/entry-locks.ts"],"sourcesContent":["import type { Kysely, RawBuilder } from \"kysely\";\nimport { sql } from \"kysely\";\n\nimport { isPostgres } from \"../dialect-helpers.js\";\nimport type { Database } from \"../types.js\";\n\nexport interface EntryLock {\n\tcollection: string;\n\tentryId: string;\n\tuserId: string;\n\t/** Display name of the holder, `null` when the account has none set. */\n\tuserName: string | null;\n\tacquiredAt: string;\n\texpiresAt: string;\n}\n\nexport type EntryLockClaim =\n\t| { outcome: \"acquired\"; lock: EntryLock }\n\t| { outcome: \"held\"; lock: EntryLock };\n\ninterface LockKey {\n\tcollection: string;\n\tentryId: string;\n\tuserId: string;\n}\n\ninterface LeaseInput extends LockKey {\n\tleaseSeconds: number;\n}\n\ninterface LockRow {\n\tcollection: string;\n\tentry_id: string;\n\tuser_id: string;\n\ttoken: string;\n\tacquired_at: string;\n\texpires_at: string;\n}\n\n/**\n * A refused claim proves a live lease existed at statement time, so a second\n * pass only runs when that lease lapsed or was released in between.\n */\nconst CLAIM_ATTEMPTS = 2;\n\nfunction toEntryLock(row: LockRow & { user_name: string | null }): EntryLock {\n\treturn {\n\t\tcollection: row.collection,\n\t\tentryId: row.entry_id,\n\t\tuserId: row.user_id,\n\t\tuserName: row.user_name ?? null,\n\t\tacquiredAt: row.acquired_at,\n\t\texpiresAt: row.expires_at,\n\t};\n}\n\n/**\n * One lease per entry, keyed by `(collection, entry_id)`.\n *\n * Every timestamp comes from the database clock, so leases stay comparable\n * across isolates whose wall clocks drift.\n */\nexport class EntryLockRepository {\n\tconstructor(private db: Kysely<Database>) {}\n\n\t/**\n\t * Claims the entry for `userId`, or reports who holds it. An expired lease\n\t * and the caller's own lease are both claimable; anyone else's live lease\n\t * needs `takeover`.\n\t *\n\t * `token` identifies the caller's editing session. The row keeps the latest\n\t * one and `release` matches on it, so two tabs of one account can share an\n\t * entry without the first tab to close dropping the lease the other still\n\t * relies on.\n\t */\n\tasync acquire(\n\t\tinput: LeaseInput & { token: string; takeover?: boolean },\n\t): Promise<EntryLockClaim> {\n\t\tfor (let attempt = 0; attempt < CLAIM_ATTEMPTS; attempt++) {\n\t\t\tconst claimed = await this.claim(input);\n\t\t\tif (claimed) return { outcome: \"acquired\", lock: await this.withHolderName(claimed) };\n\n\t\t\tconst holder = await this.findLive(input.collection, input.entryId);\n\t\t\tif (holder) return { outcome: \"held\", lock: holder };\n\t\t}\n\t\tthrow new Error(`Entry lock claim did not settle for ${input.collection}/${input.entryId}`);\n\t}\n\n\t/**\n\t * Extends the caller's own live lease, and reports whether they had one.\n\t * `false` lets a write path tell \"mine, extended\" from \"someone else's, or\n\t * none\" without taking a lease it was never given.\n\t */\n\tasync refreshHeld(input: LeaseInput): Promise<boolean> {\n\t\tconst result = await this.db\n\t\t\t.updateTable(\"_emdash_entry_locks\")\n\t\t\t.set({ expires_at: this.timestampOffset(input.leaseSeconds) })\n\t\t\t.where(\"collection\", \"=\", input.collection)\n\t\t\t.where(\"entry_id\", \"=\", input.entryId)\n\t\t\t.where(\"user_id\", \"=\", input.userId)\n\t\t\t.where(this.leaseIsLive(\"expires_at\"))\n\t\t\t.executeTakeFirst();\n\t\treturn Number(result.numUpdatedRows ?? 0) > 0;\n\t}\n\n\tasync findLive(collection: string, entryId: string): Promise<EntryLock | null> {\n\t\tconst row = await this.liveQuery(collection, entryId).executeTakeFirst();\n\t\treturn row ? toEntryLock(row) : null;\n\t}\n\n\t/** The live lease, but only while the collection still has locking switched on. */\n\tasync findEnforceable(collection: string, entryId: string): Promise<EntryLock | null> {\n\t\tconst row = await this.liveQuery(collection, entryId)\n\t\t\t.innerJoin(\n\t\t\t\t\"_emdash_collections\",\n\t\t\t\t\"_emdash_collections.slug\",\n\t\t\t\t\"_emdash_entry_locks.collection\",\n\t\t\t)\n\t\t\t.where(\"_emdash_collections.edit_locking\", \"!=\", 0)\n\t\t\t.executeTakeFirst();\n\t\treturn row ? toEntryLock(row) : null;\n\t}\n\n\t/**\n\t * Drops the caller's lease. With `token`, only the session that last\n\t * claimed the row can drop it; without, any session of the account can.\n\t */\n\tasync release(key: LockKey & { token?: string }): Promise<boolean> {\n\t\tlet query = this.db\n\t\t\t.deleteFrom(\"_emdash_entry_locks\")\n\t\t\t.where(\"collection\", \"=\", key.collection)\n\t\t\t.where(\"entry_id\", \"=\", key.entryId)\n\t\t\t.where(\"user_id\", \"=\", key.userId);\n\t\tif (key.token !== undefined) query = query.where(\"token\", \"=\", key.token);\n\t\tconst result = await query.executeTakeFirst();\n\t\treturn Number(result.numDeletedRows ?? 0) > 0;\n\t}\n\n\t/** Drops every lease on an entry, whoever holds it. */\n\tasync releaseEntry(collection: string, entryId: string): Promise<void> {\n\t\tawait this.db\n\t\t\t.deleteFrom(\"_emdash_entry_locks\")\n\t\t\t.where(\"collection\", \"=\", collection)\n\t\t\t.where(\"entry_id\", \"=\", entryId)\n\t\t\t.execute();\n\t}\n\n\t/**\n\t * Insert-or-steal in one statement. The conflict branch keeps the original\n\t * acquisition time when the holder is unchanged, so the admin can show how\n\t * long the entry has been open rather than how long ago it was last typed\n\t * into.\n\t *\n\t * Column references in the conflict branch are table-qualified: Postgres\n\t * sees both the stored row and `excluded` there and rejects a bare name as\n\t * ambiguous.\n\t */\n\tprivate async claim(\n\t\tinput: LeaseInput & { token: string; takeover?: boolean },\n\t): Promise<LockRow | undefined> {\n\t\tconst now = this.timestampOffset(0);\n\t\tconst expiresAt = this.timestampOffset(input.leaseSeconds);\n\t\treturn this.db\n\t\t\t.insertInto(\"_emdash_entry_locks\")\n\t\t\t.values({\n\t\t\t\tcollection: input.collection,\n\t\t\t\tentry_id: input.entryId,\n\t\t\t\tuser_id: input.userId,\n\t\t\t\ttoken: input.token,\n\t\t\t\tacquired_at: now,\n\t\t\t\texpires_at: expiresAt,\n\t\t\t})\n\t\t\t.onConflict((oc) => {\n\t\t\t\tconst update = oc.columns([\"collection\", \"entry_id\"]).doUpdateSet({\n\t\t\t\t\tuser_id: input.userId,\n\t\t\t\t\ttoken: input.token,\n\t\t\t\t\tacquired_at: sql<string>`CASE\n\t\t\t\t\t\tWHEN ${sql.ref(\"_emdash_entry_locks.user_id\")} = ${input.userId}\n\t\t\t\t\t\tTHEN ${sql.ref(\"_emdash_entry_locks.acquired_at\")}\n\t\t\t\t\t\tELSE ${now}\n\t\t\t\t\tEND`,\n\t\t\t\t\texpires_at: expiresAt,\n\t\t\t\t});\n\t\t\t\tif (input.takeover === true) return update;\n\t\t\t\treturn update.where((eb) =>\n\t\t\t\t\teb.or([\n\t\t\t\t\t\teb(\"_emdash_entry_locks.user_id\", \"=\", input.userId),\n\t\t\t\t\t\tthis.leaseHasExpired(\"_emdash_entry_locks.expires_at\"),\n\t\t\t\t\t]),\n\t\t\t\t);\n\t\t\t})\n\t\t\t.returningAll()\n\t\t\t.executeTakeFirst();\n\t}\n\n\tprivate liveQuery(collection: string, entryId: string) {\n\t\treturn this.db\n\t\t\t.selectFrom(\"_emdash_entry_locks\")\n\t\t\t.leftJoin(\"users\", \"users.id\", \"_emdash_entry_locks.user_id\")\n\t\t\t.select([\n\t\t\t\t\"_emdash_entry_locks.collection\",\n\t\t\t\t\"_emdash_entry_locks.entry_id\",\n\t\t\t\t\"_emdash_entry_locks.user_id\",\n\t\t\t\t\"_emdash_entry_locks.token\",\n\t\t\t\t\"_emdash_entry_locks.acquired_at\",\n\t\t\t\t\"_emdash_entry_locks.expires_at\",\n\t\t\t\t\"users.name as user_name\",\n\t\t\t])\n\t\t\t.where(\"_emdash_entry_locks.collection\", \"=\", collection)\n\t\t\t.where(\"_emdash_entry_locks.entry_id\", \"=\", entryId)\n\t\t\t.where(this.leaseIsLive(\"_emdash_entry_locks.expires_at\"));\n\t}\n\n\tprivate async withHolderName(row: LockRow): Promise<EntryLock> {\n\t\tconst user = await this.db\n\t\t\t.selectFrom(\"users\")\n\t\t\t.select(\"name\")\n\t\t\t.where(\"id\", \"=\", row.user_id)\n\t\t\t.executeTakeFirst();\n\t\treturn {\n\t\t\tcollection: row.collection,\n\t\t\tentryId: row.entry_id,\n\t\t\tuserId: row.user_id,\n\t\t\tuserName: user?.name ?? null,\n\t\t\tacquiredAt: row.acquired_at,\n\t\t\texpiresAt: row.expires_at,\n\t\t};\n\t}\n\n\tprivate leaseIsLive(column: string) {\n\t\tconst expiresAt = sql.ref(column);\n\t\treturn isPostgres(this.db)\n\t\t\t? sql<boolean>`${expiresAt}::timestamptz > clock_timestamp()`\n\t\t\t: sql<boolean>`${expiresAt} > strftime('%Y-%m-%dT%H:%M:%fZ', 'now')`;\n\t}\n\n\tprivate leaseHasExpired(column: string) {\n\t\tconst expiresAt = sql.ref(column);\n\t\treturn isPostgres(this.db)\n\t\t\t? sql<boolean>`${expiresAt}::timestamptz <= clock_timestamp()`\n\t\t\t: sql<boolean>`${expiresAt} <= strftime('%Y-%m-%dT%H:%M:%fZ', 'now')`;\n\t}\n\n\tprivate timestampOffset(offsetSeconds: number): RawBuilder<string> {\n\t\tif (isPostgres(this.db)) {\n\t\t\treturn sql<string>`to_char(\n\t\t\t\t(clock_timestamp() AT TIME ZONE 'UTC') + (${offsetSeconds} * INTERVAL '1 second'),\n\t\t\t\t'YYYY-MM-DD\"T\"HH24:MI:SS.MS\"Z\"'\n\t\t\t)`;\n\t\t}\n\t\treturn sql<string>`strftime(\n\t\t\t'%Y-%m-%dT%H:%M:%fZ',\n\t\t\t'now',\n\t\t\t${`${offsetSeconds >= 0 ? \"+\" : \"\"}${offsetSeconds} seconds`}\n\t\t)`;\n\t}\n}\n"],"mappings":";;;;;;;;AA2CA,MAAM,iBAAiB;AAEvB,SAAS,YAAY,KAAwD;AAC5E,QAAO;EACN,YAAY,IAAI;EAChB,SAAS,IAAI;EACb,QAAQ,IAAI;EACZ,UAAU,IAAI,aAAa;EAC3B,YAAY,IAAI;EAChB,WAAW,IAAI;EACf;;;;;;;;AASF,IAAa,sBAAb,MAAiC;CAChC,YAAY,AAAQ,IAAsB;EAAtB;;;;;;;;;;;;CAYpB,MAAM,QACL,OAC0B;AAC1B,OAAK,IAAI,UAAU,GAAG,UAAU,gBAAgB,WAAW;GAC1D,MAAM,UAAU,MAAM,KAAK,MAAM,MAAM;AACvC,OAAI,QAAS,QAAO;IAAE,SAAS;IAAY,MAAM,MAAM,KAAK,eAAe,QAAQ;IAAE;GAErF,MAAM,SAAS,MAAM,KAAK,SAAS,MAAM,YAAY,MAAM,QAAQ;AACnE,OAAI,OAAQ,QAAO;IAAE,SAAS;IAAQ,MAAM;IAAQ;;AAErD,QAAM,IAAI,MAAM,uCAAuC,MAAM,WAAW,GAAG,MAAM,UAAU;;;;;;;CAQ5F,MAAM,YAAY,OAAqC;EACtD,MAAM,SAAS,MAAM,KAAK,GACxB,YAAY,sBAAsB,CAClC,IAAI,EAAE,YAAY,KAAK,gBAAgB,MAAM,aAAa,E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