tansy 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +218 -2
- package/app/account/account-client.d.ts +16 -0
- package/app/account/account-client.js +138 -0
- package/app/account/layout.d.ts +4 -0
- package/app/account/layout.js +22 -0
- package/app/account/page.d.ts +6 -0
- package/app/account/page.js +15 -0
- package/app/api/account/api-keys/[id]/route.d.ts +1 -0
- package/app/api/account/api-keys/[id]/route.js +8 -0
- package/app/api/account/api-keys/route.d.ts +2 -0
- package/app/api/account/api-keys/route.js +52 -0
- package/app/api/account/fields/route.d.ts +1 -0
- package/app/api/account/fields/route.js +13 -0
- package/app/api/account/locale/route.d.ts +2 -0
- package/app/api/account/locale/route.js +22 -0
- package/app/api/audit/route.d.ts +1 -0
- package/app/api/audit/route.js +11 -0
- package/app/api/auth/[...all]/route.d.ts +2 -0
- package/app/api/auth/[...all]/route.js +3 -0
- package/app/api/auth-config/route.d.ts +1 -0
- package/app/api/auth-config/route.js +4 -0
- package/app/api/background/route.d.ts +2 -0
- package/app/api/background/route.js +4 -0
- package/app/api/batch/route.d.ts +1 -0
- package/app/api/batch/route.js +26 -0
- package/app/api/block-layouts/[id]/route.d.ts +1 -0
- package/app/api/block-layouts/[id]/route.js +8 -0
- package/app/api/block-layouts/route.d.ts +2 -0
- package/app/api/block-layouts/route.js +14 -0
- package/app/api/block-types/[id]/route.d.ts +3 -0
- package/app/api/block-types/[id]/route.js +27 -0
- package/app/api/block-types/route.d.ts +2 -0
- package/app/api/block-types/route.js +23 -0
- package/app/api/collections/[id]/content/[contentId]/draft/publish/route.d.ts +1 -0
- package/app/api/collections/[id]/content/[contentId]/draft/publish/route.js +9 -0
- package/app/api/collections/[id]/content/[contentId]/draft/route.d.ts +3 -0
- package/app/api/collections/[id]/content/[contentId]/draft/route.js +27 -0
- package/app/api/collections/[id]/content/[contentId]/preview-token/route.d.ts +5 -0
- package/app/api/collections/[id]/content/[contentId]/preview-token/route.js +13 -0
- package/app/api/collections/[id]/content/[contentId]/review/approve/route.d.ts +2 -0
- package/app/api/collections/[id]/content/[contentId]/review/approve/route.js +20 -0
- package/app/api/collections/[id]/content/[contentId]/review/changes/route.d.ts +2 -0
- package/app/api/collections/[id]/content/[contentId]/review/changes/route.js +11 -0
- package/app/api/collections/[id]/content/[contentId]/review/route.d.ts +4 -0
- package/app/api/collections/[id]/content/[contentId]/review/route.js +21 -0
- package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/diff/route.d.ts +1 -0
- package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/diff/route.js +8 -0
- package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/restore/route.d.ts +1 -0
- package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/restore/route.js +10 -0
- package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/route.d.ts +1 -0
- package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/route.js +6 -0
- package/app/api/collections/[id]/content/[contentId]/revisions/route.d.ts +1 -0
- package/app/api/collections/[id]/content/[contentId]/revisions/route.js +12 -0
- package/app/api/collections/[id]/content/[contentId]/route.d.ts +7 -0
- package/app/api/collections/[id]/content/[contentId]/route.js +47 -0
- package/app/api/collections/[id]/content/[contentId]/schedule/route.d.ts +2 -0
- package/app/api/collections/[id]/content/[contentId]/schedule/route.js +19 -0
- package/app/api/collections/[id]/content/[contentId]/translate/route.d.ts +6 -0
- package/app/api/collections/[id]/content/[contentId]/translate/route.js +27 -0
- package/app/api/collections/[id]/content/[contentId]/translations/[locale]/route.d.ts +2 -0
- package/app/api/collections/[id]/content/[contentId]/translations/[locale]/route.js +17 -0
- package/app/api/collections/[id]/content/route.d.ts +2 -0
- package/app/api/collections/[id]/content/route.js +45 -0
- package/app/api/collections/[id]/fields/route.d.ts +1 -0
- package/app/api/collections/[id]/fields/route.js +23 -0
- package/app/api/collections/[id]/import/route.d.ts +9 -0
- package/app/api/collections/[id]/import/route.js +42 -0
- package/app/api/collections/[id]/localization/route.d.ts +4 -0
- package/app/api/collections/[id]/localization/route.js +25 -0
- package/app/api/collections/[id]/records/[recordId]/route.d.ts +3 -0
- package/app/api/collections/[id]/records/[recordId]/route.js +39 -0
- package/app/api/collections/[id]/records/route.d.ts +2 -0
- package/app/api/collections/[id]/records/route.js +31 -0
- package/app/api/collections/[id]/route.d.ts +3 -0
- package/app/api/collections/[id]/route.js +17 -0
- package/app/api/collections/[id]/rules/route.d.ts +1 -0
- package/app/api/collections/[id]/rules/route.js +10 -0
- package/app/api/collections/[id]/scope/route.d.ts +6 -0
- package/app/api/collections/[id]/scope/route.js +15 -0
- package/app/api/collections/[id]/translations/xliff/route.d.ts +4 -0
- package/app/api/collections/[id]/translations/xliff/route.js +41 -0
- package/app/api/collections/[id]/trash/[trashId]/restore/route.d.ts +5 -0
- package/app/api/collections/[id]/trash/[trashId]/restore/route.js +14 -0
- package/app/api/collections/[id]/trash/[trashId]/route.d.ts +2 -0
- package/app/api/collections/[id]/trash/[trashId]/route.js +9 -0
- package/app/api/collections/[id]/view/route.d.ts +1 -0
- package/app/api/collections/[id]/view/route.js +8 -0
- package/app/api/collections/route.d.ts +3 -0
- package/app/api/collections/route.js +31 -0
- package/app/api/collections/views/route.d.ts +1 -0
- package/app/api/collections/views/route.js +16 -0
- package/app/api/ext/[...path]/route.d.ts +5 -0
- package/app/api/ext/[...path]/route.js +10 -0
- package/app/api/extensions/[name]/settings/route.d.ts +2 -0
- package/app/api/extensions/[name]/settings/route.js +25 -0
- package/app/api/extensions/hook-deliveries/[id]/retry/route.d.ts +2 -0
- package/app/api/extensions/hook-deliveries/[id]/retry/route.js +9 -0
- package/app/api/field-presets/[id]/route.d.ts +2 -0
- package/app/api/field-presets/[id]/route.js +18 -0
- package/app/api/field-presets/route.d.ts +2 -0
- package/app/api/field-presets/route.js +14 -0
- package/app/api/field-types/route.d.ts +1 -0
- package/app/api/field-types/route.js +3 -0
- package/app/api/files/[id]/bytes/route.d.ts +9 -0
- package/app/api/files/[id]/bytes/route.js +20 -0
- package/app/api/files/[id]/focus/route.d.ts +1 -0
- package/app/api/files/[id]/focus/route.js +22 -0
- package/app/api/files/[id]/info/route.d.ts +2 -0
- package/app/api/files/[id]/info/route.js +16 -0
- package/app/api/files/[id]/route.d.ts +2 -0
- package/app/api/files/[id]/route.js +25 -0
- package/app/api/files/[id]/text/route.d.ts +2 -0
- package/app/api/files/[id]/text/route.js +49 -0
- package/app/api/files/[id]/token/route.d.ts +2 -0
- package/app/api/files/[id]/token/route.js +15 -0
- package/app/api/files/route.d.ts +1 -0
- package/app/api/files/route.js +12 -0
- package/app/api/files/upload/route.d.ts +2 -0
- package/app/api/files/upload/route.js +14 -0
- package/app/api/health/route.d.ts +9 -0
- package/app/api/health/route.js +11 -0
- package/app/api/locales/route.d.ts +2 -0
- package/app/api/locales/route.js +14 -0
- package/app/api/mcp/route.d.ts +1 -0
- package/app/api/mcp/route.js +6 -0
- package/app/api/me/route.d.ts +1 -0
- package/app/api/me/route.js +8 -0
- package/app/api/metrics/route.d.ts +8 -0
- package/app/api/metrics/route.js +13 -0
- package/app/api/preview/enter/route.d.ts +2 -0
- package/app/api/preview/enter/route.js +20 -0
- package/app/api/preview/exit/route.d.ts +1 -0
- package/app/api/preview/exit/route.js +7 -0
- package/app/api/preview/route.d.ts +2 -0
- package/app/api/preview/route.js +13 -0
- package/app/api/ready/route.d.ts +7 -0
- package/app/api/ready/route.js +15 -0
- package/app/api/realtime/route.d.ts +2 -0
- package/app/api/realtime/route.js +17 -0
- package/app/api/redirects/[id]/route.d.ts +2 -0
- package/app/api/redirects/[id]/route.js +19 -0
- package/app/api/redirects/route.d.ts +2 -0
- package/app/api/redirects/route.js +19 -0
- package/app/api/resolve/route.d.ts +2 -0
- package/app/api/resolve/route.js +17 -0
- package/app/api/reviews/route.d.ts +2 -0
- package/app/api/reviews/route.js +7 -0
- package/app/api/roles/[name]/route.d.ts +2 -0
- package/app/api/roles/[name]/route.js +18 -0
- package/app/api/roles/route.d.ts +2 -0
- package/app/api/roles/route.js +41 -0
- package/app/api/schema/export/route.d.ts +1 -0
- package/app/api/schema/export/route.js +3 -0
- package/app/api/schema/import/route.d.ts +1 -0
- package/app/api/schema/import/route.js +21 -0
- package/app/api/schema/openapi/route.d.ts +1 -0
- package/app/api/schema/openapi/route.js +4 -0
- package/app/api/schema/types/route.d.ts +1 -0
- package/app/api/schema/types/route.js +5 -0
- package/app/api/settings/auth/route.d.ts +2 -0
- package/app/api/settings/auth/route.js +19 -0
- package/app/api/settings/auth/test-email/route.d.ts +1 -0
- package/app/api/settings/auth/test-email/route.js +15 -0
- package/app/api/settings/locales/[code]/route.d.ts +2 -0
- package/app/api/settings/locales/[code]/route.js +15 -0
- package/app/api/settings/locales/route.d.ts +2 -0
- package/app/api/settings/locales/route.js +11 -0
- package/app/api/settings/localization/route.d.ts +1 -0
- package/app/api/settings/localization/route.js +25 -0
- package/app/api/settings/site/route.d.ts +2 -0
- package/app/api/settings/site/route.js +28 -0
- package/app/api/setup/route.d.ts +1 -0
- package/app/api/setup/route.js +10 -0
- package/app/api/translators/route.d.ts +2 -0
- package/app/api/translators/route.js +4 -0
- package/app/api/trash/route.d.ts +6 -0
- package/app/api/trash/route.js +14 -0
- package/app/api/user-fields/route.d.ts +2 -0
- package/app/api/user-fields/route.js +19 -0
- package/app/api/users/[id]/ban/route.d.ts +2 -0
- package/app/api/users/[id]/ban/route.js +25 -0
- package/app/api/users/[id]/fields/route.d.ts +2 -0
- package/app/api/users/[id]/fields/route.js +15 -0
- package/app/api/users/[id]/impersonate/route.d.ts +1 -0
- package/app/api/users/[id]/impersonate/route.js +22 -0
- package/app/api/users/[id]/password/route.d.ts +1 -0
- package/app/api/users/[id]/password/route.js +14 -0
- package/app/api/users/[id]/role/route.d.ts +1 -0
- package/app/api/users/[id]/role/route.js +18 -0
- package/app/api/users/[id]/route.d.ts +3 -0
- package/app/api/users/[id]/route.js +32 -0
- package/app/api/users/[id]/sessions/route.d.ts +2 -0
- package/app/api/users/[id]/sessions/route.js +16 -0
- package/app/api/users/route.d.ts +2 -0
- package/app/api/users/route.js +40 -0
- package/app/api/webhooks/[id]/deliveries/route.d.ts +1 -0
- package/app/api/webhooks/[id]/deliveries/route.js +4 -0
- package/app/api/webhooks/[id]/route.d.ts +2 -0
- package/app/api/webhooks/[id]/route.js +13 -0
- package/app/api/webhooks/route.d.ts +2 -0
- package/app/api/webhooks/route.js +10 -0
- package/app/auth/forgot-password/page.d.ts +1 -0
- package/app/auth/forgot-password/page.js +27 -0
- package/app/auth/reset-password/page.d.ts +6 -0
- package/app/auth/reset-password/page.js +6 -0
- package/app/auth/reset-password/reset-form.d.ts +3 -0
- package/app/auth/reset-password/reset-form.js +22 -0
- package/app/auth/setup/page.d.ts +5 -0
- package/app/auth/setup/page.js +6 -0
- package/app/auth/setup/setup-form.d.ts +3 -0
- package/app/auth/setup/setup-form.js +27 -0
- package/app/auth/signin/page.d.ts +7 -0
- package/app/auth/signin/page.js +6 -0
- package/app/auth/signin/signin-form.d.ts +7 -0
- package/app/auth/signin/signin-form.js +97 -0
- package/app/auth/signup/page.d.ts +1 -0
- package/app/auth/signup/page.js +35 -0
- package/app/auth/two-factor/page.d.ts +5 -0
- package/app/auth/two-factor/page.js +6 -0
- package/app/auth/two-factor/two-factor-form.d.ts +3 -0
- package/app/auth/two-factor/two-factor-form.js +24 -0
- package/app/dashboard/audit/page.client.d.ts +3 -0
- package/app/dashboard/audit/page.client.js +37 -0
- package/app/dashboard/audit/page.d.ts +1 -0
- package/app/dashboard/audit/page.js +8 -0
- package/app/dashboard/blocks/[id]/page.d.ts +5 -0
- package/app/dashboard/blocks/[id]/page.js +18 -0
- package/app/dashboard/blocks/new/page.d.ts +1 -0
- package/app/dashboard/blocks/new/page.js +12 -0
- package/app/dashboard/blocks/page.client.d.ts +10 -0
- package/app/dashboard/blocks/page.client.js +53 -0
- package/app/dashboard/blocks/page.d.ts +1 -0
- package/app/dashboard/blocks/page.js +11 -0
- package/app/dashboard/collections/[id]/content/[contentId]/history/page.client.d.ts +9 -0
- package/app/dashboard/collections/[id]/content/[contentId]/history/page.client.js +80 -0
- package/app/dashboard/collections/[id]/content/[contentId]/history/page.d.ts +6 -0
- package/app/dashboard/collections/[id]/content/[contentId]/history/page.js +12 -0
- package/app/dashboard/collections/[id]/content/[contentId]/page.d.ts +6 -0
- package/app/dashboard/collections/[id]/content/[contentId]/page.js +12 -0
- package/app/dashboard/collections/[id]/content/new/page.d.ts +5 -0
- package/app/dashboard/collections/[id]/content/new/page.js +12 -0
- package/app/dashboard/collections/[id]/import/page.client.d.ts +5 -0
- package/app/dashboard/collections/[id]/import/page.client.js +97 -0
- package/app/dashboard/collections/[id]/import/page.d.ts +6 -0
- package/app/dashboard/collections/[id]/import/page.js +13 -0
- package/app/dashboard/collections/[id]/load.d.ts +7 -0
- package/app/dashboard/collections/[id]/load.js +20 -0
- package/app/dashboard/collections/[id]/page.client.d.ts +22 -0
- package/app/dashboard/collections/[id]/page.client.js +207 -0
- package/app/dashboard/collections/[id]/page.d.ts +5 -0
- package/app/dashboard/collections/[id]/page.js +28 -0
- package/app/dashboard/collections/[id]/rules/page.client.d.ts +3 -0
- package/app/dashboard/collections/[id]/rules/page.client.js +32 -0
- package/app/dashboard/collections/[id]/rules/page.d.ts +5 -0
- package/app/dashboard/collections/[id]/rules/page.js +8 -0
- package/app/dashboard/collections/[id]/schema/page.client.d.ts +5 -0
- package/app/dashboard/collections/[id]/schema/page.client.js +129 -0
- package/app/dashboard/collections/[id]/schema/page.d.ts +5 -0
- package/app/dashboard/collections/[id]/schema/page.js +13 -0
- package/app/dashboard/collections/[id]/view/page.d.ts +5 -0
- package/app/dashboard/collections/[id]/view/page.js +13 -0
- package/app/dashboard/collections/create/page.client.d.ts +3 -0
- package/app/dashboard/collections/create/page.client.js +47 -0
- package/app/dashboard/collections/create/page.d.ts +1 -0
- package/app/dashboard/collections/create/page.js +8 -0
- package/app/dashboard/collections/create-view/page.d.ts +1 -0
- package/app/dashboard/collections/create-view/page.js +8 -0
- package/app/dashboard/collections/page.client.d.ts +13 -0
- package/app/dashboard/collections/page.client.js +84 -0
- package/app/dashboard/collections/page.d.ts +1 -0
- package/app/dashboard/collections/page.js +10 -0
- package/app/dashboard/ext/[...path]/page.client.d.ts +5 -0
- package/app/dashboard/ext/[...path]/page.client.js +6 -0
- package/app/dashboard/ext/[...path]/page.d.ts +5 -0
- package/app/dashboard/ext/[...path]/page.js +23 -0
- package/app/dashboard/extensions/[name]/settings/page.client.d.ts +16 -0
- package/app/dashboard/extensions/[name]/settings/page.client.js +179 -0
- package/app/dashboard/extensions/[name]/settings/page.d.ts +5 -0
- package/app/dashboard/extensions/[name]/settings/page.js +30 -0
- package/app/dashboard/extensions/directory/page.d.ts +1 -0
- package/app/dashboard/extensions/directory/page.js +14 -0
- package/app/dashboard/extensions/page.client.d.ts +4 -0
- package/app/dashboard/extensions/page.client.js +29 -0
- package/app/dashboard/extensions/page.d.ts +1 -0
- package/app/dashboard/extensions/page.js +59 -0
- package/app/dashboard/field-presets/page.client.d.ts +15 -0
- package/app/dashboard/field-presets/page.client.js +54 -0
- package/app/dashboard/field-presets/page.d.ts +1 -0
- package/app/dashboard/field-presets/page.js +13 -0
- package/app/dashboard/files/page.client.d.ts +10 -0
- package/app/dashboard/files/page.client.js +74 -0
- package/app/dashboard/files/page.d.ts +1 -0
- package/app/dashboard/files/page.js +13 -0
- package/app/dashboard/languages/page.client.d.ts +4 -0
- package/app/dashboard/languages/page.client.js +132 -0
- package/app/dashboard/languages/page.d.ts +1 -0
- package/app/dashboard/languages/page.js +8 -0
- package/app/dashboard/layout.d.ts +4 -0
- package/app/dashboard/layout.js +47 -0
- package/app/dashboard/page.client.d.ts +5 -0
- package/app/dashboard/page.client.js +6 -0
- package/app/dashboard/page.d.ts +1 -0
- package/app/dashboard/page.js +65 -0
- package/app/dashboard/redirects/page.client.d.ts +3 -0
- package/app/dashboard/redirects/page.client.js +62 -0
- package/app/dashboard/redirects/page.d.ts +1 -0
- package/app/dashboard/redirects/page.js +8 -0
- package/app/dashboard/reviews/page.client.d.ts +2 -0
- package/app/dashboard/reviews/page.client.js +27 -0
- package/app/dashboard/reviews/page.d.ts +1 -0
- package/app/dashboard/reviews/page.js +8 -0
- package/app/dashboard/roles/page.client.d.ts +5 -0
- package/app/dashboard/roles/page.client.js +122 -0
- package/app/dashboard/roles/page.d.ts +1 -0
- package/app/dashboard/roles/page.js +12 -0
- package/app/dashboard/schema/page.client.d.ts +3 -0
- package/app/dashboard/schema/page.client.js +43 -0
- package/app/dashboard/schema/page.d.ts +1 -0
- package/app/dashboard/schema/page.js +8 -0
- package/app/dashboard/settings/page.client.d.ts +3 -0
- package/app/dashboard/settings/page.client.js +110 -0
- package/app/dashboard/settings/page.d.ts +1 -0
- package/app/dashboard/settings/page.js +8 -0
- package/app/dashboard/site/page.client.d.ts +14 -0
- package/app/dashboard/site/page.client.js +35 -0
- package/app/dashboard/site/page.d.ts +2 -0
- package/app/dashboard/site/page.js +24 -0
- package/app/dashboard/trash/page.client.d.ts +1 -0
- package/app/dashboard/trash/page.client.js +59 -0
- package/app/dashboard/trash/page.d.ts +2 -0
- package/app/dashboard/trash/page.js +9 -0
- package/app/dashboard/users/[id]/page.client.d.ts +5 -0
- package/app/dashboard/users/[id]/page.client.js +47 -0
- package/app/dashboard/users/[id]/page.d.ts +5 -0
- package/app/dashboard/users/[id]/page.js +9 -0
- package/app/dashboard/users/fields/page.client.d.ts +12 -0
- package/app/dashboard/users/fields/page.client.js +50 -0
- package/app/dashboard/users/fields/page.d.ts +1 -0
- package/app/dashboard/users/fields/page.js +10 -0
- package/app/dashboard/users/page.client.d.ts +58 -0
- package/app/dashboard/users/page.client.js +41 -0
- package/app/dashboard/users/page.d.ts +1 -0
- package/app/dashboard/users/page.js +8 -0
- package/app/dashboard/webhooks/page.client.d.ts +12 -0
- package/app/dashboard/webhooks/page.client.js +75 -0
- package/app/dashboard/webhooks/page.d.ts +1 -0
- package/app/dashboard/webhooks/page.js +10 -0
- package/app/fonts/GeistMonoVF.woff +0 -0
- package/app/fonts/GeistVF.woff +0 -0
- package/app/landing.d.ts +1 -0
- package/app/landing.js +5 -0
- package/app/layout.d.ts +6 -0
- package/app/layout.js +30 -0
- package/components/LabelsInput.d.ts +13 -0
- package/components/LabelsInput.js +19 -0
- package/components/PluginBoundary.d.ts +18 -0
- package/components/PluginBoundary.js +37 -0
- package/components/admin-client.d.ts +65 -0
- package/components/admin-client.js +101 -0
- package/components/auth/AuthCard.d.ts +13 -0
- package/components/auth/AuthCard.js +18 -0
- package/components/auth/AuthConfig.d.ts +29 -0
- package/components/auth/AuthConfig.js +14 -0
- package/components/auth/useAuthWidgets.d.ts +17 -0
- package/components/auth/useAuthWidgets.js +21 -0
- package/components/blocks/BlockTypeForm.d.ts +11 -0
- package/components/blocks/BlockTypeForm.js +50 -0
- package/components/blocks/block-icons.d.ts +6 -0
- package/components/blocks/block-icons.js +22 -0
- package/components/captcha/CaptchaWidget.d.ts +14 -0
- package/components/captcha/CaptchaWidget.js +67 -0
- package/components/collections/CollectionGrid.d.ts +20 -0
- package/components/collections/CollectionGrid.js +24 -0
- package/components/collections/FilterBuilder.d.ts +32 -0
- package/components/collections/FilterBuilder.js +150 -0
- package/components/collections/LanguagePanel.d.ts +33 -0
- package/components/collections/LanguagePanel.js +56 -0
- package/components/collections/RecordForm.d.ts +17 -0
- package/components/collections/RecordForm.js +490 -0
- package/components/collections/ReviewCard.d.ts +6 -0
- package/components/collections/ReviewCard.js +32 -0
- package/components/collections/ReviewPanel.d.ts +21 -0
- package/components/collections/ReviewPanel.js +45 -0
- package/components/collections/TranslationExchange.d.ts +16 -0
- package/components/collections/TranslationExchange.js +43 -0
- package/components/collections/ViewForm.d.ts +11 -0
- package/components/collections/ViewForm.js +38 -0
- package/components/fields/DescribeFile.d.ts +23 -0
- package/components/fields/DescribeFile.js +106 -0
- package/components/fields/FieldConfigEditor.d.ts +24 -0
- package/components/fields/FieldConfigEditor.js +113 -0
- package/components/fields/FieldListEditor.d.ts +20 -0
- package/components/fields/FieldListEditor.js +33 -0
- package/components/fields/FieldValueInput.d.ts +23 -0
- package/components/fields/FieldValueInput.js +101 -0
- package/components/fields/FileValueInput.d.ts +9 -0
- package/components/fields/FileValueInput.js +78 -0
- package/components/fields/FocusPicker.d.ts +15 -0
- package/components/fields/FocusPicker.js +24 -0
- package/components/fields/ReferencePicker.d.ts +12 -0
- package/components/fields/ReferencePicker.js +59 -0
- package/components/fields/RichTextEditor.d.ts +13 -0
- package/components/fields/RichTextEditor.js +116 -0
- package/components/fields/icons.d.ts +3 -0
- package/components/fields/icons.js +21 -0
- package/components/fields/show-if.d.ts +2 -0
- package/components/fields/show-if.js +10 -0
- package/components/fields/types.d.ts +102 -0
- package/components/fields/types.js +15 -0
- package/components/i18n.d.ts +98 -0
- package/components/i18n.js +109 -0
- package/components/shell/AppShell.d.ts +28 -0
- package/components/shell/AppShell.js +109 -0
- package/components/shell/DashboardLoading.d.ts +8 -0
- package/components/shell/DashboardLoading.js +25 -0
- package/components/shell/TopBarSwitcher.d.ts +9 -0
- package/components/shell/TopBarSwitcher.js +53 -0
- package/components/site/AdminBar.d.ts +5 -0
- package/components/site/AdminBar.js +14 -0
- package/components/site/Pager.d.ts +18 -0
- package/components/site/Pager.js +18 -0
- package/components/site/ThemedPage.d.ts +16 -0
- package/components/site/ThemedPage.js +28 -0
- package/components/stream/Inserter.d.ts +14 -0
- package/components/stream/Inserter.js +115 -0
- package/components/stream/Menu.d.ts +10 -0
- package/components/stream/Menu.js +15 -0
- package/components/stream/Outline.d.ts +12 -0
- package/components/stream/Outline.js +26 -0
- package/components/stream/SaveLayout.d.ts +7 -0
- package/components/stream/SaveLayout.js +34 -0
- package/components/stream/StreamEditor.d.ts +16 -0
- package/components/stream/StreamEditor.js +389 -0
- package/components/stream/StreamField.d.ts +93 -0
- package/components/stream/StreamField.js +119 -0
- package/components/stream/editor-context.d.ts +24 -0
- package/components/stream/editor-context.js +66 -0
- package/components/stream/embed.d.ts +8 -0
- package/components/stream/embed.js +45 -0
- package/components/stream/site-canvas.d.ts +46 -0
- package/components/stream/site-canvas.js +76 -0
- package/components/stream/stream-ops.d.ts +47 -0
- package/components/stream/stream-ops.js +111 -0
- package/components/ui/Switch.d.ts +8 -0
- package/components/ui/Switch.js +6 -0
- package/components/ui/kit.d.ts +231 -0
- package/components/ui/kit.js +168 -0
- package/components/ui/row-link.d.ts +7 -0
- package/components/ui/row-link.js +24 -0
- package/components/users/UserFieldsForm.d.ts +20 -0
- package/components/users/UserFieldsForm.js +43 -0
- package/core/audit/fold.d.ts +18 -0
- package/core/audit/fold.js +33 -0
- package/core/audit/index.d.ts +26 -0
- package/core/audit/index.js +79 -0
- package/core/audit/query.d.ts +28 -0
- package/core/audit/query.js +21 -0
- package/core/auth/access.d.ts +33 -0
- package/core/auth/access.js +35 -0
- package/core/auth/branding.d.ts +17 -0
- package/core/auth/branding.js +30 -0
- package/core/auth/extension-hooks.d.ts +26 -0
- package/core/auth/extension-hooks.js +78 -0
- package/core/auth/extensions.d.ts +138 -0
- package/core/auth/extensions.js +1 -0
- package/core/auth/instance.d.ts +4189 -0
- package/core/auth/instance.js +387 -0
- package/core/auth/lockout.d.ts +10 -0
- package/core/auth/lockout.js +34 -0
- package/core/auth/maintenance.d.ts +2 -0
- package/core/auth/maintenance.js +16 -0
- package/core/auth/plugin-adapter.d.ts +59 -0
- package/core/auth/plugin-adapter.js +469 -0
- package/core/auth/plugin-models.d.ts +57 -0
- package/core/auth/plugin-models.js +124 -0
- package/core/auth/public-config.d.ts +36 -0
- package/core/auth/public-config.js +30 -0
- package/core/auth/secrets.d.ts +3 -0
- package/core/auth/secrets.js +23 -0
- package/core/auth/server-only-paths.d.ts +11 -0
- package/core/auth/server-only-paths.js +16 -0
- package/core/auth/settings-schema.d.ts +116 -0
- package/core/auth/settings-schema.js +135 -0
- package/core/auth/settings.d.ts +21 -0
- package/core/auth/settings.js +98 -0
- package/core/auth/setup.d.ts +30 -0
- package/core/auth/setup.js +73 -0
- package/core/auth/shared-accounts.d.ts +18 -0
- package/core/auth/shared-accounts.js +38 -0
- package/core/auth/user-fields.d.ts +96 -0
- package/core/auth/user-fields.js +217 -0
- package/core/auth/users.d.ts +25 -0
- package/core/auth/users.js +46 -0
- package/core/authz/guard.d.ts +96 -0
- package/core/authz/guard.js +247 -0
- package/core/authz/page.d.ts +23 -0
- package/core/authz/page.js +87 -0
- package/core/authz/permissions.d.ts +81 -0
- package/core/authz/permissions.js +145 -0
- package/core/authz/principal.d.ts +70 -0
- package/core/authz/principal.js +87 -0
- package/core/authz/records.d.ts +67 -0
- package/core/authz/records.js +186 -0
- package/core/authz/role-admin.d.ts +61 -0
- package/core/authz/role-admin.js +194 -0
- package/core/authz/roles.d.ts +23 -0
- package/core/authz/roles.js +93 -0
- package/core/authz/rules/evaluate.d.ts +89 -0
- package/core/authz/rules/evaluate.js +350 -0
- package/core/authz/rules/parser.d.ts +28 -0
- package/core/authz/rules/parser.js +144 -0
- package/core/authz/rules/postgres.d.ts +18 -0
- package/core/authz/rules/postgres.js +143 -0
- package/core/authz/rules/sql.d.ts +55 -0
- package/core/authz/rules/sql.js +153 -0
- package/core/background/after-response.d.ts +11 -0
- package/core/background/after-response.js +26 -0
- package/core/background/endpoint.d.ts +8 -0
- package/core/background/endpoint.js +28 -0
- package/core/background/mode.d.ts +15 -0
- package/core/background/mode.js +16 -0
- package/core/background/runner.d.ts +38 -0
- package/core/background/runner.js +126 -0
- package/core/backup/archive.d.ts +22 -0
- package/core/backup/archive.js +163 -0
- package/core/backup/cli.d.ts +30 -0
- package/core/backup/cli.js +198 -0
- package/core/backup/config.d.ts +28 -0
- package/core/backup/config.js +30 -0
- package/core/backup/crypto.d.ts +26 -0
- package/core/backup/crypto.js +158 -0
- package/core/backup/database.d.ts +57 -0
- package/core/backup/database.js +253 -0
- package/core/backup/job.d.ts +16 -0
- package/core/backup/job.js +60 -0
- package/core/backup/service.d.ts +137 -0
- package/core/backup/service.js +386 -0
- package/core/blocks/layouts.d.ts +22 -0
- package/core/blocks/layouts.js +27 -0
- package/core/blocks/limits.d.ts +8 -0
- package/core/blocks/limits.js +2 -0
- package/core/blocks/service.d.ts +115 -0
- package/core/blocks/service.js +231 -0
- package/core/blocks/stream.d.ts +59 -0
- package/core/blocks/stream.js +220 -0
- package/core/captcha/index.d.ts +30 -0
- package/core/captcha/index.js +110 -0
- package/core/captcha/types.d.ts +46 -0
- package/core/captcha/types.js +1 -0
- package/core/config/index.d.ts +20 -0
- package/core/config/index.js +30 -0
- package/core/content/access.d.ts +99 -0
- package/core/content/access.js +24 -0
- package/core/content/batch.d.ts +19 -0
- package/core/content/batch.js +132 -0
- package/core/content/chunks.d.ts +2 -0
- package/core/content/chunks.js +8 -0
- package/core/content/collections.d.ts +199 -0
- package/core/content/collections.js +52 -0
- package/core/content/content-service.d.ts +152 -0
- package/core/content/content-service.js +1077 -0
- package/core/content/csv.d.ts +24 -0
- package/core/content/csv.js +132 -0
- package/core/content/db.d.ts +10 -0
- package/core/content/db.js +74 -0
- package/core/content/diff.d.ts +40 -0
- package/core/content/diff.js +65 -0
- package/core/content/flat.d.ts +20 -0
- package/core/content/flat.js +37 -0
- package/core/content/ids.d.ts +1 -0
- package/core/content/ids.js +7 -0
- package/core/content/import.d.ts +108 -0
- package/core/content/import.js +263 -0
- package/core/content/locks.d.ts +39 -0
- package/core/content/locks.js +66 -0
- package/core/content/overview.d.ts +54 -0
- package/core/content/overview.js +136 -0
- package/core/content/public-records.d.ts +51 -0
- package/core/content/public-records.js +364 -0
- package/core/content/query.d.ts +61 -0
- package/core/content/query.js +103 -0
- package/core/content/records.d.ts +69 -0
- package/core/content/records.js +62 -0
- package/core/content/relations.d.ts +56 -0
- package/core/content/relations.js +177 -0
- package/core/content/reviews.d.ts +70 -0
- package/core/content/reviews.js +141 -0
- package/core/content/revision-store.d.ts +16 -0
- package/core/content/revision-store.js +27 -0
- package/core/content/revisions.d.ts +155 -0
- package/core/content/revisions.js +194 -0
- package/core/content/rule-lookup.d.ts +9 -0
- package/core/content/rule-lookup.js +48 -0
- package/core/content/scheduler.d.ts +3 -0
- package/core/content/scheduler.js +73 -0
- package/core/content/trash.d.ts +159 -0
- package/core/content/trash.js +144 -0
- package/core/content/workflow.d.ts +25 -0
- package/core/content/workflow.js +22 -0
- package/core/extend/admin-nav.d.ts +51 -0
- package/core/extend/admin-nav.js +109 -0
- package/core/extend/admin-paths.d.ts +8 -0
- package/core/extend/admin-paths.js +35 -0
- package/core/extend/admin.d.ts +404 -0
- package/core/extend/admin.js +3 -0
- package/core/extend/auth-call.d.ts +5 -0
- package/core/extend/auth-call.js +73 -0
- package/core/extend/cron.d.ts +27 -0
- package/core/extend/cron.js +56 -0
- package/core/extend/csp.d.ts +19 -0
- package/core/extend/csp.js +27 -0
- package/core/extend/define.d.ts +936 -0
- package/core/extend/define.js +13 -0
- package/core/extend/directory.d.ts +18 -0
- package/core/extend/directory.js +44 -0
- package/core/extend/events.d.ts +7 -0
- package/core/extend/events.js +22 -0
- package/core/extend/hook-deliveries.d.ts +38 -0
- package/core/extend/hook-deliveries.js +117 -0
- package/core/extend/hooks.d.ts +32 -0
- package/core/extend/hooks.js +89 -0
- package/core/extend/jobs.d.ts +30 -0
- package/core/extend/jobs.js +131 -0
- package/core/extend/lifecycle.d.ts +14 -0
- package/core/extend/lifecycle.js +116 -0
- package/core/extend/loader.d.ts +11 -0
- package/core/extend/loader.js +85 -0
- package/core/extend/mail.d.ts +9 -0
- package/core/extend/mail.js +94 -0
- package/core/extend/manifest.d.ts +14 -0
- package/core/extend/manifest.js +177 -0
- package/core/extend/mcp.d.ts +25 -0
- package/core/extend/mcp.js +51 -0
- package/core/extend/records.d.ts +9 -0
- package/core/extend/records.js +125 -0
- package/core/extend/registry.d.ts +51 -0
- package/core/extend/registry.js +132 -0
- package/core/extend/requests.d.ts +4 -0
- package/core/extend/requests.js +27 -0
- package/core/extend/routes.d.ts +3 -0
- package/core/extend/routes.js +55 -0
- package/core/extend/routing.d.ts +12 -0
- package/core/extend/routing.js +33 -0
- package/core/extend/safe-http.d.ts +17 -0
- package/core/extend/safe-http.js +72 -0
- package/core/extend/schema.d.ts +10 -0
- package/core/extend/schema.js +40 -0
- package/core/extend/semver.d.ts +5 -0
- package/core/extend/semver.js +46 -0
- package/core/extend/settings-schema.d.ts +10 -0
- package/core/extend/settings-schema.js +73 -0
- package/core/extend/settings.d.ts +29 -0
- package/core/extend/settings.js +149 -0
- package/core/extend/start.d.ts +3 -0
- package/core/extend/start.js +86 -0
- package/core/extend/store.d.ts +10 -0
- package/core/extend/store.js +79 -0
- package/core/extend/system-collections.d.ts +7 -0
- package/core/extend/system-collections.js +18 -0
- package/core/extend/tools.d.ts +24 -0
- package/core/extend/tools.js +295 -0
- package/core/extend/users.d.ts +10 -0
- package/core/extend/users.js +44 -0
- package/core/extend/webhook-input.d.ts +12 -0
- package/core/extend/webhook-input.js +8 -0
- package/core/extend/webhooks.d.ts +65 -0
- package/core/extend/webhooks.js +134 -0
- package/core/fields/builtin.d.ts +9 -0
- package/core/fields/builtin.js +335 -0
- package/core/fields/define.d.ts +111 -0
- package/core/fields/define.js +79 -0
- package/core/fields/markdown.d.ts +9 -0
- package/core/fields/markdown.js +127 -0
- package/core/fields/presets.d.ts +47 -0
- package/core/fields/presets.js +34 -0
- package/core/fields/registry.d.ts +74 -0
- package/core/fields/registry.js +172 -0
- package/core/fields/rich-text.d.ts +20 -0
- package/core/fields/rich-text.js +83 -0
- package/core/fields/safe-pattern.d.ts +8 -0
- package/core/fields/safe-pattern.js +80 -0
- package/core/fields/test-kit.d.ts +24 -0
- package/core/fields/test-kit.js +79 -0
- package/core/fields/upgrades.d.ts +5 -0
- package/core/fields/upgrades.js +99 -0
- package/core/fields/validate.d.ts +14 -0
- package/core/fields/validate.js +65 -0
- package/core/files/cleanup.d.ts +3 -0
- package/core/files/cleanup.js +39 -0
- package/core/files/focus.d.ts +42 -0
- package/core/files/focus.js +42 -0
- package/core/files/http.d.ts +7 -0
- package/core/files/http.js +29 -0
- package/core/files/refs.d.ts +19 -0
- package/core/files/refs.js +129 -0
- package/core/files/service.d.ts +197 -0
- package/core/files/service.js +446 -0
- package/core/files/sniff.d.ts +12 -0
- package/core/files/sniff.js +98 -0
- package/core/files/text.d.ts +45 -0
- package/core/files/text.js +94 -0
- package/core/files/tokens.d.ts +7 -0
- package/core/files/tokens.js +24 -0
- package/core/http/cors.d.ts +17 -0
- package/core/http/cors.js +59 -0
- package/core/http/errors.d.ts +21 -0
- package/core/http/errors.js +29 -0
- package/core/http/plain.d.ts +2 -0
- package/core/http/plain.js +2 -0
- package/core/http/plugin-origins.d.ts +7 -0
- package/core/http/plugin-origins.js +62 -0
- package/core/http/rate-limit.d.ts +3 -0
- package/core/http/rate-limit.js +23 -0
- package/core/http/read-limit.d.ts +6 -0
- package/core/http/read-limit.js +25 -0
- package/core/http/request.d.ts +13 -0
- package/core/http/request.js +47 -0
- package/core/i18n/admin.d.ts +60 -0
- package/core/i18n/admin.js +100 -0
- package/core/i18n/catalogs/ar.d.ts +3 -0
- package/core/i18n/catalogs/ar.js +1473 -0
- package/core/i18n/catalogs/en.d.ts +1631 -0
- package/core/i18n/catalogs/en.js +1476 -0
- package/core/i18n/catalogs/index.d.ts +7 -0
- package/core/i18n/catalogs/index.js +8 -0
- package/core/i18n/codes.d.ts +27 -0
- package/core/i18n/codes.js +121 -0
- package/core/i18n/context.d.ts +77 -0
- package/core/i18n/context.js +16 -0
- package/core/i18n/editor.d.ts +12 -0
- package/core/i18n/editor.js +44 -0
- package/core/i18n/exchange.d.ts +35 -0
- package/core/i18n/exchange.js +132 -0
- package/core/i18n/labels-schema.d.ts +3 -0
- package/core/i18n/labels-schema.js +4 -0
- package/core/i18n/labels.d.ts +14 -0
- package/core/i18n/labels.js +15 -0
- package/core/i18n/locales.d.ts +97 -0
- package/core/i18n/locales.js +222 -0
- package/core/i18n/messages.d.ts +41 -0
- package/core/i18n/messages.js +109 -0
- package/core/i18n/outdated.d.ts +14 -0
- package/core/i18n/outdated.js +33 -0
- package/core/i18n/permissions.d.ts +17 -0
- package/core/i18n/permissions.js +34 -0
- package/core/i18n/request.d.ts +47 -0
- package/core/i18n/request.js +67 -0
- package/core/i18n/routing.d.ts +27 -0
- package/core/i18n/routing.js +37 -0
- package/core/i18n/segments.d.ts +44 -0
- package/core/i18n/segments.js +88 -0
- package/core/i18n/startup.d.ts +9 -0
- package/core/i18n/startup.js +36 -0
- package/core/i18n/storage.d.ts +92 -0
- package/core/i18n/storage.js +186 -0
- package/core/i18n/synced.d.ts +19 -0
- package/core/i18n/synced.js +39 -0
- package/core/i18n/translate.d.ts +22 -0
- package/core/i18n/translate.js +51 -0
- package/core/i18n/xliff.d.ts +32 -0
- package/core/i18n/xliff.js +77 -0
- package/core/mail/index.d.ts +95 -0
- package/core/mail/index.js +162 -0
- package/core/mail/rich.d.ts +6 -0
- package/core/mail/rich.js +105 -0
- package/core/ops/health.d.ts +28 -0
- package/core/ops/health.js +45 -0
- package/core/ops/metrics.d.ts +9 -0
- package/core/ops/metrics.js +108 -0
- package/core/realtime/clients.d.ts +8 -0
- package/core/realtime/clients.js +254 -0
- package/core/realtime/hub.d.ts +26 -0
- package/core/realtime/hub.js +22 -0
- package/core/schema/ddl.d.ts +68 -0
- package/core/schema/ddl.js +237 -0
- package/core/schema/describe.d.ts +52 -0
- package/core/schema/describe.js +175 -0
- package/core/schema/diff.d.ts +51 -0
- package/core/schema/diff.js +108 -0
- package/core/schema/names.d.ts +7 -0
- package/core/schema/names.js +21 -0
- package/core/schema/portable.d.ts +129 -0
- package/core/schema/portable.js +428 -0
- package/core/schema/service.d.ts +268 -0
- package/core/schema/service.js +608 -0
- package/core/schema/views-postgres.d.ts +18 -0
- package/core/schema/views-postgres.js +134 -0
- package/core/schema/views.d.ts +19 -0
- package/core/schema/views.js +70 -0
- package/core/scope/context.d.ts +75 -0
- package/core/scope/context.js +79 -0
- package/core/scope/data.d.ts +43 -0
- package/core/scope/data.js +469 -0
- package/core/scope/label.d.ts +7 -0
- package/core/scope/label.js +11 -0
- package/core/scope/limits.d.ts +23 -0
- package/core/scope/limits.js +72 -0
- package/core/scope/plugin.d.ts +28 -0
- package/core/scope/plugin.js +156 -0
- package/core/scope/provider.d.ts +111 -0
- package/core/scope/provider.js +188 -0
- package/core/scope/registry.d.ts +12 -0
- package/core/scope/registry.js +26 -0
- package/core/scope/request.d.ts +19 -0
- package/core/scope/request.js +62 -0
- package/core/scope/site.d.ts +19 -0
- package/core/scope/site.js +32 -0
- package/core/search/engine.d.ts +45 -0
- package/core/search/engine.js +97 -0
- package/core/search/extract.d.ts +20 -0
- package/core/search/extract.js +34 -0
- package/core/search/index.d.ts +35 -0
- package/core/search/index.js +202 -0
- package/core/search/sync.d.ts +17 -0
- package/core/search/sync.js +145 -0
- package/core/search/types.d.ts +49 -0
- package/core/search/types.js +1 -0
- package/core/settings/scoped.d.ts +13 -0
- package/core/settings/scoped.js +35 -0
- package/core/site/admin-bar.d.ts +22 -0
- package/core/site/admin-bar.js +34 -0
- package/core/site/cache.d.ts +20 -0
- package/core/site/cache.js +103 -0
- package/core/site/filter.d.ts +10 -0
- package/core/site/filter.js +93 -0
- package/core/site/identity.d.ts +45 -0
- package/core/site/identity.js +86 -0
- package/core/site/page.d.ts +148 -0
- package/core/site/page.js +215 -0
- package/core/site/preview.d.ts +32 -0
- package/core/site/preview.js +83 -0
- package/core/site/reader.d.ts +16 -0
- package/core/site/reader.js +142 -0
- package/core/site/words.d.ts +60 -0
- package/core/site/words.js +86 -0
- package/core/storage/index.d.ts +10 -0
- package/core/storage/index.js +50 -0
- package/core/storage/local.d.ts +9 -0
- package/core/storage/local.js +78 -0
- package/core/storage/remote.d.ts +23 -0
- package/core/storage/remote.js +58 -0
- package/core/storage/s3.d.ts +21 -0
- package/core/storage/s3.js +108 -0
- package/core/storage/types.d.ts +82 -0
- package/core/storage/types.js +1 -0
- package/core/theme/define.d.ts +209 -0
- package/core/theme/define.js +84 -0
- package/core/theme/installed.d.ts +18 -0
- package/core/theme/installed.js +32 -0
- package/core/theme/schema.d.ts +11 -0
- package/core/theme/schema.js +25 -0
- package/core/theme/tokens.d.ts +23 -0
- package/core/theme/tokens.js +68 -0
- package/core/ui/preferences.d.ts +3 -0
- package/core/ui/preferences.js +7 -0
- package/core/urls/base-path.d.ts +28 -0
- package/core/urls/base-path.js +54 -0
- package/core/urls/path.d.ts +12 -0
- package/core/urls/path.js +47 -0
- package/core/urls/pattern.d.ts +23 -0
- package/core/urls/pattern.js +124 -0
- package/core/urls/redirects.d.ts +50 -0
- package/core/urls/redirects.js +85 -0
- package/core/urls/resolve.d.ts +33 -0
- package/core/urls/resolve.js +133 -0
- package/core/urls/site-href.d.ts +13 -0
- package/core/urls/site-href.js +13 -0
- package/core/version.d.ts +2 -0
- package/core/version.js +2 -0
- package/entry/admin.d.ts +6 -0
- package/entry/admin.js +5 -0
- package/entry/config.d.ts +3 -0
- package/entry/config.js +3 -0
- package/entry/fields.d.ts +2 -0
- package/entry/fields.js +2 -0
- package/entry/headless.d.ts +20 -0
- package/entry/headless.js +27 -0
- package/entry/next.d.mts +5 -0
- package/entry/next.mjs +84 -0
- package/entry/plugin.d.ts +26 -0
- package/entry/plugin.js +11 -0
- package/entry/react.d.ts +9 -0
- package/entry/react.js +8 -0
- package/entry/search.d.ts +3 -0
- package/entry/search.js +1 -0
- package/entry/server.d.ts +6 -0
- package/entry/server.js +5 -0
- package/entry/storage.d.ts +6 -0
- package/entry/storage.js +3 -0
- package/entry/testing.d.ts +1 -0
- package/entry/testing.js +1 -0
- package/entry/theme.d.ts +3 -0
- package/entry/theme.js +2 -0
- package/generated/client-postgres/client.d.ts +1 -0
- package/generated/client-postgres/client.js +5 -0
- package/generated/client-postgres/default.d.ts +1 -0
- package/generated/client-postgres/default.js +5 -0
- package/generated/client-postgres/edge.d.ts +1 -0
- package/generated/client-postgres/edge.js +644 -0
- package/generated/client-postgres/index-browser.js +670 -0
- package/generated/client-postgres/index.d.ts +61076 -0
- package/generated/client-postgres/index.js +644 -0
- package/generated/client-postgres/package.json +139 -0
- package/generated/client-postgres/query_compiler_fast_bg.js +2 -0
- package/generated/client-postgres/query_compiler_fast_bg.wasm +0 -0
- package/generated/client-postgres/query_compiler_fast_bg.wasm-base64.js +2 -0
- package/generated/client-postgres/runtime/client.d.ts +3490 -0
- package/generated/client-postgres/runtime/client.js +105 -0
- package/generated/client-postgres/runtime/index-browser.d.ts +90 -0
- package/generated/client-postgres/runtime/index-browser.js +6 -0
- package/generated/client-postgres/runtime/wasm-compiler-edge.js +100 -0
- package/generated/client-postgres/schema.prisma +661 -0
- package/generated/client-postgres/wasm-edge-light-loader.mjs +5 -0
- package/generated/client-postgres/wasm-worker-loader.mjs +5 -0
- package/generated/client-sqlite/client.d.ts +1 -0
- package/generated/client-sqlite/client.js +5 -0
- package/generated/client-sqlite/default.d.ts +1 -0
- package/generated/client-sqlite/default.js +5 -0
- package/generated/client-sqlite/edge.d.ts +1 -0
- package/generated/client-sqlite/edge.js +641 -0
- package/generated/client-sqlite/index-browser.js +667 -0
- package/generated/client-sqlite/index.d.ts +60911 -0
- package/generated/client-sqlite/index.js +641 -0
- package/generated/client-sqlite/package.json +139 -0
- package/generated/client-sqlite/query_compiler_fast_bg.js +2 -0
- package/generated/client-sqlite/query_compiler_fast_bg.wasm +0 -0
- package/generated/client-sqlite/query_compiler_fast_bg.wasm-base64.js +2 -0
- package/generated/client-sqlite/runtime/client.d.ts +3490 -0
- package/generated/client-sqlite/runtime/client.js +105 -0
- package/generated/client-sqlite/runtime/index-browser.d.ts +90 -0
- package/generated/client-sqlite/runtime/index-browser.js +6 -0
- package/generated/client-sqlite/runtime/wasm-compiler-edge.js +100 -0
- package/generated/client-sqlite/schema.prisma +661 -0
- package/generated/client-sqlite/wasm-edge-light-loader.mjs +5 -0
- package/generated/client-sqlite/wasm-worker-loader.mjs +5 -0
- package/generated/schema-postgres/collection.prisma +316 -0
- package/generated/schema-postgres/extend.prisma +101 -0
- package/generated/schema-postgres/schema.prisma +8 -0
- package/generated/schema-postgres/security.prisma +64 -0
- package/generated/schema-postgres/user.prisma +168 -0
- package/lib/argon2/index.d.ts +2 -0
- package/lib/argon2/index.js +5 -0
- package/lib/auth-client.d.ts +1789 -0
- package/lib/auth-client.js +26 -0
- package/lib/client/api.d.ts +58 -0
- package/lib/client/api.js +106 -0
- package/lib/client/realtime.d.ts +2 -0
- package/lib/client/realtime.js +20 -0
- package/lib/paths.d.ts +8 -0
- package/lib/paths.js +17 -0
- package/lib/preferences.d.ts +2 -0
- package/lib/preferences.js +2 -0
- package/lib/prisma/index.d.ts +5 -0
- package/lib/prisma/index.js +19 -0
- package/lib/prisma/kind.d.ts +4 -0
- package/lib/prisma/kind.js +3 -0
- package/lib/slugify/index.d.ts +2 -0
- package/lib/slugify/index.js +3 -0
- package/lib/time.d.ts +2 -0
- package/lib/time.js +28 -0
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +1 -0
- package/package.json +153 -4
- package/prisma/migrations/20261109000000_baseline/migration.sql +275 -0
- package/prisma/migrations/20261109024631_add_block_types/migration.sql +37 -0
- package/prisma/migrations/20261109032318_add_files/migration.sql +37 -0
- package/prisma/migrations/20261109034155_add_revisions/migration.sql +36 -0
- package/prisma/migrations/20261109035535_add_view_collections/migration.sql +3 -0
- package/prisma/migrations/20261109041354_add_user_fields/migration.sql +21 -0
- package/prisma/migrations/20261109044425_add_extensibility/migration.sql +44 -0
- package/prisma/migrations/20261109055558_add_request_logs/migration.sql +18 -0
- package/prisma/migrations/20261109143022_add_file_temporary/migration.sql +22 -0
- package/prisma/migrations/20261109172829_add_extension_ownership/migration.sql +5 -0
- package/prisma/migrations/20261109211834_plugin_state/migration.sql +17 -0
- package/prisma/migrations/20261109222046_field_presets_layouts_upgrades/migration.sql +34 -0
- package/prisma/migrations/20261109224638_site_content_model/migration.sql +16 -0
- package/prisma/migrations/20261113004025_durable_hooks/migration.sql +20 -0
- package/prisma/migrations/20261114015159_localization/migration.sql +93 -0
- package/prisma/migrations/20261115005518_schema_labels/migration.sql +5 -0
- package/prisma/migrations/20261116120000_review_workflow/migration.sql +24 -0
- package/prisma/migrations/20261116130000_drop_request_log/migration.sql +5 -0
- package/prisma/migrations/20261116170000_row_scopes/migration.sql +5 -0
- package/prisma/migrations/20261116191352_redirect_scope/migration.sql +19 -0
- package/prisma/migrations/20261116200034_stored_file_scope/migration.sql +24 -0
- package/prisma/migrations/20261116211311_audit_webhook_scope/migration.sql +43 -0
- package/prisma/migrations/20261117152203_trash_records/migration.sql +42 -0
- package/prisma/migrations/20261117154617_file_text/migration.sql +28 -0
- package/prisma/migrations/20261117200538_image_focus/migration.sql +3 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/migrations-postgres/20261109045000_baseline/migration.sql +542 -0
- package/prisma/migrations-postgres/20261109055558_add_request_logs/migration.sql +20 -0
- package/prisma/migrations-postgres/20261109143022_add_file_temporary/migration.sql +2 -0
- package/prisma/migrations-postgres/20261109172829_add_extension_ownership/migration.sql +5 -0
- package/prisma/migrations-postgres/20261109211834_plugin_state/migration.sql +19 -0
- package/prisma/migrations-postgres/20261109222046_field_presets_layouts_upgrades/migration.sql +40 -0
- package/prisma/migrations-postgres/20261109224638_site_content_model/migration.sql +18 -0
- package/prisma/migrations-postgres/20261113004025_durable_hooks/migration.sql +22 -0
- package/prisma/migrations-postgres/20261114015159_localization/migration.sql +43 -0
- package/prisma/migrations-postgres/20261115005518_schema_labels/migration.sql +5 -0
- package/prisma/migrations-postgres/20261116120000_review_workflow/migration.sql +28 -0
- package/prisma/migrations-postgres/20261116130000_drop_request_log/migration.sql +3 -0
- package/prisma/migrations-postgres/20261116170000_row_scopes/migration.sql +5 -0
- package/prisma/migrations-postgres/20261116191352_redirect_scope/migration.sql +8 -0
- package/prisma/migrations-postgres/20261116200034_stored_file_scope/migration.sql +5 -0
- package/prisma/migrations-postgres/20261116211311_audit_webhook_scope/migration.sql +8 -0
- package/prisma/migrations-postgres/20261117152203_trash_records/migration.sql +52 -0
- package/prisma/migrations-postgres/20261117154617_file_text/migration.sql +5 -0
- package/prisma/migrations-postgres/20261117200538_image_focus/migration.sql +3 -0
- package/prisma/migrations-postgres/migration_lock.toml +3 -0
- package/prisma/schema/collection.prisma +316 -0
- package/prisma/schema/extend.prisma +101 -0
- package/prisma/schema/schema.prisma +8 -0
- package/prisma/schema/security.prisma +64 -0
- package/prisma/schema/user.prisma +168 -0
- package/prisma.config.ts +29 -0
- package/routes/api-table.generated.d.ts +4 -0
- package/routes/api-table.generated.js +100 -0
- package/routes/api.d.ts +12 -0
- package/routes/api.js +45 -0
- package/routes/client-page.d.ts +11 -0
- package/routes/client-page.js +13 -0
- package/routes/client-pages.generated.d.ts +5 -0
- package/routes/client-pages.generated.js +40 -0
- package/routes/match.d.ts +8 -0
- package/routes/match.js +60 -0
- package/routes/pages-table.generated.d.ts +12 -0
- package/routes/pages-table.generated.js +45 -0
- package/routes/pages.d.ts +16 -0
- package/routes/pages.js +44 -0
- package/routes/proxy.d.ts +16 -0
- package/routes/proxy.js +89 -0
- package/routes/public-pages.d.ts +24 -0
- package/routes/public-pages.js +47 -0
- package/routes/root-layout.d.ts +8 -0
- package/routes/root-layout.js +12 -0
- package/routes/site.d.ts +32 -0
- package/routes/site.js +131 -0
- package/routes/start.d.ts +7 -0
- package/routes/start.js +37 -0
- package/scripts/commands.mjs +84 -0
- package/scripts/doctor.mjs +165 -0
- package/scripts/empty.mjs +2 -0
- package/scripts/init.mjs +253 -0
- package/scripts/scaffold.mjs +293 -0
- package/scripts/sync.mjs +262 -0
- package/scripts/tansy.mjs +383 -0
- package/sdk/index.d.ts +276 -0
- package/sdk/index.js +296 -0
- package/styles/admin.css +15 -0
- package/styles/base.css +13 -0
- package/styles/components.css +500 -0
- package/styles/editor.css +234 -0
- package/styles/reset.css +34 -0
- package/styles/rich-text.css +14 -0
- package/styles/tokens-dark.css +65 -0
- package/styles/tokens.css +141 -0
- package/styles/utilities.css +129 -0
- package/types/content.d.ts +54 -0
- package/types/content.js +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mohamed Salah
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,219 @@
|
|
|
1
|
-
|
|
1
|
+
<h1>
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mhmdsalahsebai/tansy/main/apps/docs/public/brand/logo-light.png">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/mhmdsalahsebai/tansy/main/apps/docs/public/brand/logo-dark.png" alt="Tansy" height="64">
|
|
5
|
+
</picture>
|
|
6
|
+
</h1>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
**A self-hosted CMS for Next.js where collections, fields and access rules are defined in the dashboard, so they change without a deploy.**
|
|
9
|
+
|
|
10
|
+
[](https://www.npmjs.com/package/tansy)
|
|
11
|
+
[](https://github.com/mhmdsalahsebai/tansy/blob/main/LICENSE)
|
|
12
|
+
|
|
13
|
+
[Documentation](https://tansycms.vercel.app) · [Live demo](https://tansy-demo.vercel.app/dashboard) · [Plugins](https://tansycms.vercel.app/docs/plugins) · [Changelog](https://github.com/mhmdsalahsebai/tansy/blob/main/CHANGELOG.md)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm create tansy@latest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> **Beta.** Tansy is pre-1.0 and under active development. Any release can change anything — package
|
|
20
|
+
> names, commands, configuration keys, environment variables, database columns — in a patch release
|
|
21
|
+
> and without a deprecation period. Pin exact versions, read the [changelog](https://github.com/mhmdsalahsebai/tansy/blob/main/CHANGELOG.md) before
|
|
22
|
+
> every upgrade, and take a [backup](https://tansycms.vercel.app/docs/guides/backups) first. The compatibility promises in
|
|
23
|
+
> [upgrading](https://tansycms.vercel.app/docs/guides/upgrading) start at 1.0.
|
|
24
|
+
|
|
25
|
+
## Why Tansy
|
|
26
|
+
|
|
27
|
+
- **The schema lives in the database.** Editors add collections, fields and blocks from the dashboard while the site keeps serving. Export it as JSON when you want it in git.
|
|
28
|
+
- **One access model for everything.** Roles, permissions and per-collection rules decide what the REST API, realtime, the SDK, MCP and your theme may read or write, through the same check.
|
|
29
|
+
- **It runs inside your Next.js app.** `npm install tansy` and `tansy init` add the dashboard at `/dashboard` and the API at `/api` beside your own routes. Or run it headless and read it over HTTP.
|
|
30
|
+
- **SQLite or Postgres, your server or serverless.** One file to start. Every migration ships for both databases.
|
|
31
|
+
- **Features are plugins, and plugins use only public extension points.** The blog, shop and courses are built on the same API you get, so yours can do what they do.
|
|
32
|
+
|
|
33
|
+
## Try the demo
|
|
34
|
+
|
|
35
|
+
A live install with the blog, shop and AI plugins, the halo theme and some sample content:
|
|
36
|
+
**<https://tansy-demo.vercel.app/dashboard>**
|
|
37
|
+
|
|
38
|
+
| Email | Password |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `demo@example.com` | `explore-tansy-demo` |
|
|
41
|
+
|
|
42
|
+
The demo account is shared by everyone. Write posts, publish them, upload images, add fields
|
|
43
|
+
and collections: the demo is put back as it was every hour, so change whatever you like. It can't
|
|
44
|
+
touch users, roles, settings, webhooks or API keys, or change its own password. To keep what you
|
|
45
|
+
build, run your own copy with `npm create tansy@latest`, which takes a minute.
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
**Content**
|
|
50
|
+
|
|
51
|
+
- Collections, fields and URL patterns defined at runtime, plus singletons and read-only view collections built from SQL.
|
|
52
|
+
- A block editor: stream fields made of blocks you define in the dashboard or ship in a plugin.
|
|
53
|
+
- Drafts, scheduled publishing, revisions with a diff, a review step before publishing, and a trash you can restore from.
|
|
54
|
+
- A media library on local disk, S3 or any S3-compatible service, Cloudinary, Bunny, Vercel Blob or Uploadthing, with focal points and alternative text.
|
|
55
|
+
- CSV and JSON import, and the whole schema exported or imported as JSON.
|
|
56
|
+
- Search in the database, or in [Meilisearch, Typesense or Algolia](https://tansycms.vercel.app/docs/guides/search), kept in step by a queue that retries.
|
|
57
|
+
|
|
58
|
+
**Access and sign-in**
|
|
59
|
+
|
|
60
|
+
- Users, roles and permissions managed from the dashboard, built on [better-auth](https://www.better-auth.com).
|
|
61
|
+
- Password, passkeys, magic links and email codes, authenticator-app MFA that can be required for the dashboard, and OAuth through `@tansy/social-sign-in`.
|
|
62
|
+
- Per-collection rules in one filter language, such as `status = "published" || owner = @request.auth.id`, compiled to SQL where they can be.
|
|
63
|
+
- Custom user fields that rules read, API keys with their own permissions, and an audit log of every write.
|
|
64
|
+
|
|
65
|
+
**APIs**
|
|
66
|
+
|
|
67
|
+
- REST with filters, sorting and relation expansion, `POST /api/batch`, and an OpenAPI 3.1 description.
|
|
68
|
+
- Realtime subscriptions, under the same rules as reads.
|
|
69
|
+
- A typed TypeScript SDK (`tansy/sdk`) with types generated from your schema by `tansy types`.
|
|
70
|
+
- Signed webhooks with retries.
|
|
71
|
+
- An MCP server at `/api/mcp`, so an AI agent can read and write content with an API key's permissions.
|
|
72
|
+
|
|
73
|
+
**Languages**
|
|
74
|
+
|
|
75
|
+
- Records translated per field, each language published on its own, with a fallback chain.
|
|
76
|
+
- An address per language (`/fr/...` or a domain per language), `hreflang`, and right-to-left pages.
|
|
77
|
+
- Translators limited to their own language, XLIFF export and import, and machine translation through a plugin.
|
|
78
|
+
- The dashboard in English and Arabic.
|
|
79
|
+
|
|
80
|
+
**Running it**
|
|
81
|
+
|
|
82
|
+
- `tansy backup` and `tansy restore`: one encrypted archive of the database and uploads, by hand or on a schedule.
|
|
83
|
+
- Background work (scheduled publishing, webhooks, the search queue, plugins' jobs) kept in the database, on a server or serverless.
|
|
84
|
+
- Health and readiness checks, Prometheus metrics, and `tansy doctor` to check an install.
|
|
85
|
+
- A Docker image and a `docker compose` file for Postgres.
|
|
86
|
+
|
|
87
|
+
**Extending it**
|
|
88
|
+
|
|
89
|
+
- [Plugins](https://tansycms.vercel.app/docs/guides/plugins) add collections, field types, blocks, permissions, routes, jobs, dashboard pages and agent tools.
|
|
90
|
+
- [Hook files](https://tansycms.vercel.app/docs/extending) in `cms_hooks/` add record hooks, routes and jobs without a rebuild.
|
|
91
|
+
- [Themes](https://tansycms.vercel.app/docs/guides/themes) render the public site, in the same app or headless over the API.
|
|
92
|
+
- `tansy plugin new`, `tansy field new` and `tansy theme new` scaffold each of them.
|
|
93
|
+
|
|
94
|
+
Before you commit to it, [limits](https://tansycms.vercel.app/docs/guides/limits) lists every boundary in one place.
|
|
95
|
+
|
|
96
|
+
## Official plugins
|
|
97
|
+
|
|
98
|
+
| Package | What it adds |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| [`@tansy/blog`](https://tansycms.vercel.app/docs/plugins/blog) | Posts, categories, tags, authors, comments and feeds |
|
|
101
|
+
| [`@tansy/shop`](https://tansycms.vercel.app/docs/plugins/shop) | Products, variants, stock, a cart, shipping zones, orders and fulfilment |
|
|
102
|
+
| [`@tansy/payments`](https://tansycms.vercel.app/docs/plugins/payments) | Subscriptions and one-time purchases through better-auth's payment plugins: Stripe, Polar, Dodo Payments, Creem and Commet |
|
|
103
|
+
| [`@tansy/subscriptions`](https://tansycms.vercel.app/docs/plugins/subscriptions) | Plans, what each one opens, and who is on which plan, in one section of the dashboard |
|
|
104
|
+
| [`@tansy/lms`](https://tansycms.vercel.app/docs/plugins/lms) | Courses, lessons, enrollments, progress, quizzes and verifiable certificates, free or paid |
|
|
105
|
+
| [`@tansy/newsletter`](https://tansycms.vercel.app/docs/plugins/newsletter) | Double opt-in subscribers, one-click unsubscribe, and campaigns sent in batches, including any post |
|
|
106
|
+
| [`@tansy/forms`](https://tansycms.vercel.app/docs/plugins/forms) | Contact and other forms built from blocks, kept as submissions, emailed, and guarded against spam |
|
|
107
|
+
| [`@tansy/ai`](https://tansycms.vercel.app/docs/plugins/ai) | An assistant on the Vercel AI SDK that creates and edits content and fills forms. OpenAI, Anthropic, Google, Mistral, xAI, Groq, DeepSeek, OpenRouter, Vercel AI Gateway, OpenCode, Command Code, or any OpenAI-compatible server |
|
|
108
|
+
| [`@tansy/analytics`](https://tansycms.vercel.app/docs/plugins/analytics) | Cookie-free page views counted by the CMS, or sent to Plausible, Umami, Google Analytics, Fathom or Matomo, with the numbers on the dashboard |
|
|
109
|
+
| [`@tansy/seo`](https://tansycms.vercel.app/docs/plugins/seo) | Search-engine fields and a sitemap built from each collection's URL pattern |
|
|
110
|
+
| [`@tansy/email`](https://tansycms.vercel.app/docs/plugins/email) | Email through Resend, Postmark, SendGrid, Mailgun, Amazon SES or Brevo instead of SMTP, with a delivery log |
|
|
111
|
+
| [`@tansy/social-sign-in`](https://tansycms.vercel.app/docs/plugins/social-sign-in) | Google, GitHub and other OAuth providers, each configured on the dashboard |
|
|
112
|
+
| [`@tansy/captcha`](https://tansycms.vercel.app/docs/plugins/captcha) | Cloudflare Turnstile, hCaptcha or reCAPTCHA on sign-in and on plugins' forms |
|
|
113
|
+
| [`@tansy/pwned-passwords`](https://tansycms.vercel.app/docs/plugins/pwned-passwords) | Refuses passwords found in known breaches, checked by hash range |
|
|
114
|
+
| [`@tansy/multi-tenant`](https://tansycms.vercel.app/docs/plugins/multi-tenant) | Many sites or customers in one instance, each with its own members, roles, domains, content, files and limits |
|
|
115
|
+
| [`@tansy/request-logs`](https://tansycms.vercel.app/docs/plugins/request-logs) | A log of every API request, on the dashboard and sent to storage, an HTTP drain or the console |
|
|
116
|
+
| [`@tansy/logs-otlp`](https://tansycms.vercel.app/docs/plugins/logs-otlp) | The audit and request logs over OpenTelemetry, to Grafana, Honeycomb, Datadog, Axiom or any collector |
|
|
117
|
+
|
|
118
|
+
Each provider is a package of its own, such as `@tansy/payments-stripe` or `@tansy/ai-anthropic`, so a site installs only the ones it uses.
|
|
119
|
+
|
|
120
|
+
## Official themes
|
|
121
|
+
|
|
122
|
+
| Package | For |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| [`@tansy/theme-blank`](https://tansycms.vercel.app/docs/guides/themes) | The smallest theme that works, made to be copied |
|
|
125
|
+
| [`@tansy/theme-blog`](https://tansycms.vercel.app/docs/guides/themes) | A blog: a menu, posts on the home page, post pages and plain pages |
|
|
126
|
+
| [`@tansy/theme-magazine`](https://tansycms.vercel.app/docs/themes/magazine) | A magazine: a hero with search, image cards and a sidebar |
|
|
127
|
+
| [`@tansy/theme-halo`](https://tansycms.vercel.app/docs/themes/halo) | A news front page whose sections editors curate |
|
|
128
|
+
| [`@tansy/theme-dispatch`](https://tansycms.vercel.app/docs/themes/dispatch) | A newsletter's site: the sign-up form up front and posts as numbered issues |
|
|
129
|
+
| [`@tansy/theme-storefront`](https://tansycms.vercel.app/docs/themes/storefront) | A shop: product cards, a product page with a size picker, and a cart |
|
|
130
|
+
| [`@tansy/theme-academy`](https://tansycms.vercel.app/docs/themes/academy) | A school's site for the LMS: the course catalogue, course pages and plans |
|
|
131
|
+
|
|
132
|
+
## Starting a new project
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
npm create tansy@latest
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
It asks what you're making, which theme, where it will run, SQLite or Postgres (or Postgres in Docker), where uploads go and which features to add, then installs, migrates and can create your admin account. Every question has a flag, and `--yes` takes the defaults: see [Start a new project](https://tansycms.vercel.app/docs/getting-started/new-project).
|
|
139
|
+
|
|
140
|
+
## Adding it to a Next.js app
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npx create-next-app@latest my-site
|
|
144
|
+
cd my-site
|
|
145
|
+
npm install tansy
|
|
146
|
+
npx tansy init # writes the entry files and a .env with new secrets
|
|
147
|
+
npx tansy migrate
|
|
148
|
+
npm run dev
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`tansy init` never overwrites a file. Your root layout and home page move to `app/(site)/`, because the admin has its own root layout, and anything it can't change safely is printed as a step to do by hand. `npx tansy doctor` checks the result. The admin is at `/dashboard` and the API at `/api`, and your own routes, such as `/api/hello`, keep working beside them. Choose other paths with `tansy init --admin /admin --api /cms-api`.
|
|
152
|
+
|
|
153
|
+
`npx tansy init --site` adds a page that renders a theme, and the theme comes from `tansy.config.ts`:
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
import { blog } from "@tansy/theme-blog";
|
|
157
|
+
|
|
158
|
+
export default defineCms({ theme: blog({ tagline: "Field notes" }) });
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Quick start with Docker
|
|
162
|
+
|
|
163
|
+
No configuration is needed. Data, uploads and generated secrets live in the `/data` volume.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
docker build -t tansy .
|
|
167
|
+
docker run --name tansy -p 8090:8090 -v tansy-data:/data tansy
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
The server log prints a one-time setup link. Open it to create the superadmin, then sign in at <http://localhost:8090>. If you publish a different port or a real domain, set `BETTER_AUTH_URL` to that address with `-e`.
|
|
171
|
+
|
|
172
|
+
For production with Postgres, set `POSTGRES_PASSWORD` and `BETTER_AUTH_URL`, then run `docker compose up -d`. The setup link is in `docker compose logs tansy`. Before going live, set up [backups](https://tansycms.vercel.app/docs/guides/backups) and copy `TANSY_BACKUP_KEY` from `/data/secrets.env` somewhere safe. Point your load balancer's health check at `/api/ready`, and see [running it](https://tansycms.vercel.app/docs/guides/operations) for what to watch.
|
|
173
|
+
|
|
174
|
+
## Running from source
|
|
175
|
+
|
|
176
|
+
Requires Node 24. SQLite is the default database, and any Postgres works through `DATABASE_URL`.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
npm install
|
|
180
|
+
npm run tansy -- init # writes .env with new secrets
|
|
181
|
+
npm run tansy -- migrate
|
|
182
|
+
npm run dev
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
On first start the server log prints a one-time setup link. Open it to create the superadmin.
|
|
186
|
+
|
|
187
|
+
`tansy init` is complete on its own: a SQLite file beside the app and uploads on local disk, like
|
|
188
|
+
Django's defaults. Before a real deployment, read [going to production](https://tansycms.vercel.app/docs/guides/production) —
|
|
189
|
+
above all, choose the database before you have content, because records don't move between SQLite
|
|
190
|
+
and Postgres.
|
|
191
|
+
|
|
192
|
+
## Checks
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm run check # type-check, lint, unit and contract tests
|
|
196
|
+
npm run docs:build # the documentation site in apps/docs
|
|
197
|
+
TEST_DATABASE_URL=file:./.data/cms_test.db npm run test:integration # wipes that file
|
|
198
|
+
TEST_DATABASE_URL=file:./.data/cms_test.db npm run test:package # the same suite, against the tarball in a fresh app
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Contributing
|
|
202
|
+
|
|
203
|
+
See [CONTRIBUTING.md](https://github.com/mhmdsalahsebai/tansy/blob/main/CONTRIBUTING.md) for the repository's layout, its commands, and the three rules
|
|
204
|
+
a change has to keep: the [security model](https://github.com/mhmdsalahsebai/tansy/blob/main/docs/contributing/security-model.md), the
|
|
205
|
+
[dashboard design system](https://github.com/mhmdsalahsebai/tansy/blob/main/docs/contributing/design-system.md) and translatable text.
|
|
206
|
+
|
|
207
|
+
## Releases
|
|
208
|
+
|
|
209
|
+
Every package in this repository moves on its own version, so a release publishes only what changed.
|
|
210
|
+
`node scripts/set-version.mjs <package> <version>` moves one package, and pushing a
|
|
211
|
+
`<package>@<version>` tag, such as `@tansy/blog@0.1.2`, runs the release workflow, which checks,
|
|
212
|
+
builds, publishes that package to npm with provenance and opens a GitHub release from its changelog:
|
|
213
|
+
a plugin's or theme's `CHANGELOG.md` in its folder, or [CHANGELOG.md](https://github.com/mhmdsalahsebai/tansy/blob/main/CHANGELOG.md) for `tansy` and create-tansy. What a release may change before 1.0, and what it may not
|
|
214
|
+
after, is [the deprecation policy](https://github.com/mhmdsalahsebai/tansy/blob/main/docs/contributing/deprecation.md), written for users as the
|
|
215
|
+
[upgrading guide](https://tansycms.vercel.app/docs/guides/upgrading).
|
|
216
|
+
|
|
217
|
+
## Licence
|
|
218
|
+
|
|
219
|
+
MIT. See [LICENSE](https://github.com/mhmdsalahsebai/tansy/blob/main/LICENSE). The same licence covers every plugin and theme in this repository.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type UserFieldValue } from "../../components/users/UserFieldsForm";
|
|
3
|
+
interface Props {
|
|
4
|
+
initialName: string;
|
|
5
|
+
email: string;
|
|
6
|
+
twoFactorEnabled: boolean;
|
|
7
|
+
permissions: string[];
|
|
8
|
+
denied: boolean;
|
|
9
|
+
enrollMfa: boolean;
|
|
10
|
+
customFields: UserFieldValue[];
|
|
11
|
+
interfaceLocale: string | null;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/** `children` are plugins' account panels, after the person's own details. */
|
|
15
|
+
export default function AccountClient({ initialName, email, twoFactorEnabled, permissions, denied, enrollMfa, customFields, interfaceLocale, children }: Props): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { QRCodeSVG } from "qrcode.react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { Alert, Button, Card, Field, Input, Modal, PageHeader } from "../../components/ui/kit";
|
|
6
|
+
import { authClient } from "../../lib/auth-client";
|
|
7
|
+
import UserFieldsForm from "../../components/users/UserFieldsForm";
|
|
8
|
+
import { api, unwrap, useAction, useApi } from "../../lib/client/api";
|
|
9
|
+
import { apiPath } from "../../lib/paths";
|
|
10
|
+
import { useT } from "../../components/i18n";
|
|
11
|
+
import { ADMIN_LOCALE_NAMES, ADMIN_LOCALES } from "../../core/i18n/catalogs";
|
|
12
|
+
/** The dashboard's language for this person, saved on their profile and remembered by the browser. */
|
|
13
|
+
function InterfaceLanguage({ initial }) {
|
|
14
|
+
const { t } = useT();
|
|
15
|
+
const [value, setValue] = useState(initial ?? "");
|
|
16
|
+
const { busy, error, run } = useAction();
|
|
17
|
+
const save = async (next) => {
|
|
18
|
+
setValue(next);
|
|
19
|
+
// The whole dashboard changes language, and right to left with it, so the page reloads.
|
|
20
|
+
if (await run(() => api(apiPath("/account/locale"), { method: "PUT", body: { locale: next || null } })))
|
|
21
|
+
window.location.reload();
|
|
22
|
+
};
|
|
23
|
+
return (_jsxs(Card, { title: t("account.language"), description: t("account.languageHint"), children: [error && _jsx(Alert, { children: error }), _jsx(Field, { label: t("account.language"), children: _jsxs("select", { className: "cms-input", value: value, disabled: busy, onChange: (event) => void save(event.target.value), children: [_jsx("option", { value: "", children: t("account.browserLanguage") }), ADMIN_LOCALES.map((code) => _jsx("option", { value: code, lang: code, children: ADMIN_LOCALE_NAMES[code] ?? code }, code))] }) })] }));
|
|
24
|
+
}
|
|
25
|
+
function Profile({ initialName, email }) {
|
|
26
|
+
const { t } = useT();
|
|
27
|
+
const [name, setName] = useState(initialName);
|
|
28
|
+
const [saved, setSaved] = useState(false);
|
|
29
|
+
const { busy, error, run } = useAction();
|
|
30
|
+
return (_jsxs(Card, { title: t("account.profile"), children: [error && _jsx(Alert, { children: error }), saved && _jsx(Alert, { kind: "success", children: t("account.saved") }), _jsx(Field, { label: t("account.email"), children: _jsx(Input, { value: email, disabled: true }) }), _jsx(Field, { label: t("account.name"), children: _jsx(Input, { value: name, onChange: (e) => setName(e.target.value) }) }), _jsx(Button, { loading: busy, onClick: async () => setSaved(await run(() => unwrap(authClient.updateUser({ name })))), children: t("account.save") })] }));
|
|
31
|
+
}
|
|
32
|
+
function Password() {
|
|
33
|
+
const { t } = useT();
|
|
34
|
+
const [current, setCurrent] = useState("");
|
|
35
|
+
const [next, setNext] = useState("");
|
|
36
|
+
const [saved, setSaved] = useState(false);
|
|
37
|
+
const { busy, error, run } = useAction();
|
|
38
|
+
const submit = async (e) => {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
const ok = await run(() => unwrap(authClient.changePassword({ currentPassword: current, newPassword: next, revokeOtherSessions: true })));
|
|
41
|
+
setSaved(ok);
|
|
42
|
+
if (ok) {
|
|
43
|
+
setCurrent("");
|
|
44
|
+
setNext("");
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (_jsxs(Card, { title: t("account.password"), description: t("account.passwordHint"), children: [error && _jsx(Alert, { children: error }), saved && _jsx(Alert, { kind: "success", children: t("account.passwordChanged") }), _jsxs("form", { onSubmit: submit, className: "cms-stack-4", children: [_jsx(Field, { label: t("account.currentPassword"), children: _jsx(Input, { required: true, type: "password", autoComplete: "current-password", value: current, onChange: (e) => setCurrent(e.target.value) }) }), _jsx(Field, { label: t("account.newPassword"), children: _jsx(Input, { required: true, type: "password", autoComplete: "new-password", value: next, onChange: (e) => setNext(e.target.value) }) }), _jsx(Button, { type: "submit", loading: busy, children: t("account.changePassword") })] })] }));
|
|
48
|
+
}
|
|
49
|
+
function TwoFactor({ enabled }) {
|
|
50
|
+
const { t } = useT();
|
|
51
|
+
const [password, setPassword] = useState("");
|
|
52
|
+
const [setup, setSetup] = useState(null);
|
|
53
|
+
const [code, setCode] = useState("");
|
|
54
|
+
const [codes, setCodes] = useState(null);
|
|
55
|
+
const { busy, error, run } = useAction();
|
|
56
|
+
const start = () => run(async () => {
|
|
57
|
+
const data = await unwrap(authClient.twoFactor.enable({ password }));
|
|
58
|
+
if (data?.method !== "totp")
|
|
59
|
+
throw new Error(t("account.setupFailed"));
|
|
60
|
+
setSetup({ uri: data.totpURI, backupCodes: data.backupCodes });
|
|
61
|
+
setPassword("");
|
|
62
|
+
});
|
|
63
|
+
const confirm = () => run(async () => {
|
|
64
|
+
await unwrap(authClient.twoFactor.verifyTotp({ code }));
|
|
65
|
+
setCodes(setup?.backupCodes ?? []);
|
|
66
|
+
setSetup(null);
|
|
67
|
+
});
|
|
68
|
+
const disable = async () => {
|
|
69
|
+
if (await run(() => unwrap(authClient.twoFactor.disable({ password }))))
|
|
70
|
+
window.location.reload();
|
|
71
|
+
};
|
|
72
|
+
const regenerate = () => run(async () => {
|
|
73
|
+
const data = await unwrap(authClient.twoFactor.generateBackupCodes({ password }));
|
|
74
|
+
setCodes(data?.backupCodes ?? []);
|
|
75
|
+
setPassword("");
|
|
76
|
+
});
|
|
77
|
+
return (_jsxs(Card, { title: t("account.twoFactor"), description: t("account.twoFactorHint"), children: [error && _jsx(Alert, { children: error }), codes && (_jsxs("div", { className: "cms-stack-3", children: [_jsx(Alert, { kind: "warning", children: t("account.backupCodes") }), _jsx("pre", { className: "cms-codes", children: codes.map((c) => _jsx("span", { children: c }, c)) }), _jsx(Button, { variant: "secondary", onClick: () => window.location.reload(), children: t("account.savedThem") })] })), setup && (_jsxs("div", { className: "cms-stack-3", children: [_jsx("p", { className: "cms-text-sm cms-soft", children: t("account.scan") }), _jsx("div", { className: "cms-qr", children: _jsx(QRCodeSVG, { value: setup.uri, size: 176 }) }), _jsx(Field, { label: t("account.code"), children: _jsx(Input, { autoComplete: "one-time-code", value: code, onChange: (e) => setCode(e.target.value) }) }), _jsx(Button, { loading: busy, onClick: confirm, children: t("account.turnOn") })] })), !setup && !codes && (_jsxs(_Fragment, { children: [_jsxs("p", { className: "cms-text-sm cms-soft", children: [t("account.statusLabel"), " ", _jsx("strong", { children: enabled ? t("account.on") : t("account.off") })] }), _jsx(Field, { label: t("account.confirmPassword"), children: _jsx(Input, { type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }), _jsx("div", { className: "cms-flex cms-gap-2", children: enabled ? (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "secondary", loading: busy, disabled: !password, onClick: regenerate, children: t("account.newBackupCodes") }), _jsx(Button, { variant: "danger", loading: busy, disabled: !password, onClick: disable, children: t("account.turnOff") })] })) : (_jsx(Button, { loading: busy, disabled: !password, onClick: start, children: t("account.setUp") })) })] }))] }));
|
|
78
|
+
}
|
|
79
|
+
function Passkeys() {
|
|
80
|
+
const { t } = useT();
|
|
81
|
+
const [keys, setKeys] = useState([]);
|
|
82
|
+
const [tick, setTick] = useState(0);
|
|
83
|
+
const [name, setName] = useState("");
|
|
84
|
+
const { busy, error, run } = useAction();
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
let active = true;
|
|
87
|
+
authClient.passkey.listUserPasskeys().then((result) => { if (active)
|
|
88
|
+
setKeys(result.data ?? []); });
|
|
89
|
+
return () => { active = false; };
|
|
90
|
+
}, [tick]);
|
|
91
|
+
const refresh = () => setTick((t) => t + 1);
|
|
92
|
+
return (_jsxs(Card, { title: t("account.passkeys"), description: t("account.passkeysHint"), children: [error && _jsx(Alert, { children: error }), _jsx("ul", { className: "cms-divide", children: keys.map((key) => (_jsxs("li", { className: "cms-row cms-between cms-py-2 cms-text-sm cms-body", children: [_jsx("span", { children: key.name || t("account.unnamedPasskey") }), _jsx(Button, { variant: "secondary", onClick: () => run(async () => { await unwrap(authClient.passkey.deletePasskey({ id: key.id })); refresh(); }), children: t("account.remove") })] }, key.id))) }), _jsxs("div", { className: "cms-flex cms-gap-2", children: [_jsx(Input, { placeholder: t("account.passkeyName"), value: name, onChange: (e) => setName(e.target.value) }), _jsx(Button, { loading: busy, className: "cms-no-shrink", onClick: () => run(async () => { await unwrap(authClient.passkey.addPasskey({ name })); setName(""); refresh(); }), children: t("account.addPasskey") })] })] }));
|
|
93
|
+
}
|
|
94
|
+
function Sessions() {
|
|
95
|
+
const { t, locale } = useT();
|
|
96
|
+
const [sessions, setSessions] = useState([]);
|
|
97
|
+
const [tick, setTick] = useState(0);
|
|
98
|
+
const { busy, error, run } = useAction();
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
let active = true;
|
|
101
|
+
authClient.listSessions().then((result) => { if (active)
|
|
102
|
+
setSessions(result.data ?? []); });
|
|
103
|
+
return () => { active = false; };
|
|
104
|
+
}, [tick]);
|
|
105
|
+
const refresh = () => setTick((t) => t + 1);
|
|
106
|
+
return (_jsxs(Card, { title: t("account.devices"), actions: _jsx(Button, { variant: "secondary", loading: busy, onClick: () => run(async () => { await unwrap(authClient.revokeOtherSessions()); refresh(); }), children: t("account.signOutOthers") }), children: [error && _jsx(Alert, { children: error }), _jsx("ul", { className: "cms-divide", children: sessions.map((session) => (_jsxs("li", { className: "cms-row cms-between cms-gap-3 cms-py-2 cms-text-sm", children: [_jsxs("span", { className: "cms-min-0", children: [_jsx("span", { className: "cms-block cms-truncate cms-strong", children: session.userAgent ?? t("account.unknownDevice") }), _jsxs("span", { className: "cms-hint", children: [session.ipAddress ?? t("account.unknownIp"), " \u00B7 ", new Date(session.createdAt).toLocaleString(locale)] })] }), _jsx(Button, { variant: "secondary", onClick: () => run(async () => { await unwrap(authClient.revokeSession({ token: session.token })); refresh(); }), children: t("account.signOut") })] }, session.id))) })] }));
|
|
107
|
+
}
|
|
108
|
+
function ApiKeys({ permissions }) {
|
|
109
|
+
const { t, locale } = useT();
|
|
110
|
+
const canCreate = permissions.includes("api-key:create");
|
|
111
|
+
const canRevoke = permissions.includes("api-key:revoke");
|
|
112
|
+
const list = useApi(apiPath("/account/api-keys"));
|
|
113
|
+
const [open, setOpen] = useState(false);
|
|
114
|
+
const [name, setName] = useState("");
|
|
115
|
+
const [days, setDays] = useState(90);
|
|
116
|
+
const [selected, setSelected] = useState([]);
|
|
117
|
+
const [created, setCreated] = useState(null);
|
|
118
|
+
const { busy, error, run } = useAction();
|
|
119
|
+
const grantable = permissions.filter((p) => p.startsWith("record:") || p.startsWith("collection:read") || p.startsWith("ext."));
|
|
120
|
+
const create = async () => {
|
|
121
|
+
const ok = await run(async () => {
|
|
122
|
+
const result = await api(apiPath("/account/api-keys"), { method: "POST", body: { name, permissions: selected, expiresInDays: days } });
|
|
123
|
+
setCreated(result.key);
|
|
124
|
+
});
|
|
125
|
+
if (ok) {
|
|
126
|
+
setOpen(false);
|
|
127
|
+
setName("");
|
|
128
|
+
setSelected([]);
|
|
129
|
+
list.reload();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
return (_jsxs(Card, { title: t("account.apiKeys"), description: t("account.apiKeysHint"), actions: canCreate ? _jsx(Button, { onClick: () => setOpen(true), children: t("account.newKey") }) : undefined, children: [list.error && _jsx(Alert, { children: list.error }), error && !open && _jsx(Alert, { children: error }), created && _jsxs(Alert, { kind: "warning", children: [t("account.copyKey"), "\n", _jsx("code", { className: "cms-break-all", children: created })] }), _jsx("ul", { className: "cms-divide", children: list.data?.map((key) => (_jsxs("li", { className: "cms-row cms-between cms-gap-3 cms-py-2 cms-text-sm", children: [_jsxs("span", { children: [_jsxs("span", { className: "cms-block cms-strong", children: [key.name, " ", _jsxs("code", { className: "cms-hint", children: [key.start, "\u2026"] })] }), _jsxs("span", { className: "cms-hint", children: [key.expiresAt ? t("account.expires", { date: new Date(key.expiresAt).toLocaleDateString(locale) }) : t("account.noExpiry"), " \u00B7 ", t("account.permissionCount", { count: key.permissions.length })] })] }), canRevoke && _jsx(Button, { variant: "secondary", onClick: () => run(async () => { await api(apiPath(`/account/api-keys/${key.id}`), { method: "DELETE" }); list.reload(); }), children: t("account.revoke") })] }, key.id))) }), _jsx(Modal, { open: open, onClose: () => setOpen(false), title: t("account.newApiKey"), children: _jsxs("div", { className: "cms-stack-4", children: [error && _jsx(Alert, { children: error }), _jsx(Field, { label: t("account.name"), children: _jsx(Input, { value: name, onChange: (e) => setName(e.target.value) }) }), _jsx(Field, { label: t("account.expiresInDays"), children: _jsx(Input, { type: "number", min: 1, value: days, onChange: (e) => setDays(Number(e.target.value)) }) }), _jsxs("fieldset", { className: "cms-scroll-48 cms-stack-1", children: [_jsx("legend", { className: "cms-label cms-mb-1", children: t("account.permissions") }), grantable.map((permission) => (_jsxs("label", { className: "cms-check-label", children: [_jsx("input", { type: "checkbox", checked: selected.includes(permission), onChange: (e) => setSelected(e.target.checked ? [...selected, permission] : selected.filter((p) => p !== permission)) }), permission] }, permission)))] }), _jsxs("div", { className: "cms-flex cms-end cms-gap-2", children: [_jsx(Button, { variant: "secondary", onClick: () => setOpen(false), children: t("account.cancel") }), _jsx(Button, { loading: busy, disabled: !name || selected.length === 0, onClick: create, children: t("account.create") })] })] }) })] }));
|
|
133
|
+
}
|
|
134
|
+
/** `children` are plugins' account panels, after the person's own details. */
|
|
135
|
+
export default function AccountClient({ initialName, email, twoFactorEnabled, permissions, denied, enrollMfa, customFields, interfaceLocale, children }) {
|
|
136
|
+
const { t } = useT();
|
|
137
|
+
return (_jsxs("div", { className: "cms-gutter cms-stack-6", children: [_jsx(PageHeader, { title: t("account.yourAccount") }), denied && _jsx(Alert, { kind: "warning", children: t("account.denied") }), enrollMfa && _jsx(Alert, { kind: "warning", children: t("account.enrollMfa") }), _jsx(Profile, { initialName: initialName, email: email }), children, _jsx(InterfaceLanguage, { initial: interfaceLocale }), _jsx(UserFieldsForm, { fields: customFields, url: apiPath("/account/fields"), method: "PATCH", own: true }), _jsx(Password, {}), _jsx(TwoFactor, { enabled: twoFactorEnabled }), _jsx(Passkeys, {}), _jsx(Sessions, {}), permissions.includes("api-key:list") && _jsx(ApiKeys, { permissions: permissions })] }));
|
|
138
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { loadAdminBranding } from "../../core/auth/branding";
|
|
3
|
+
import { AppShell } from "../../components/shell/AppShell";
|
|
4
|
+
import { requireScopedUser } from "../../core/authz/page";
|
|
5
|
+
import { accountPath, adminPath } from "../../lib/paths";
|
|
6
|
+
import { AdminI18nProvider } from "../../components/i18n";
|
|
7
|
+
import { adminDirection, adminLocale, adminMessages } from "../../core/i18n/admin";
|
|
8
|
+
import { formatters } from "../../core/i18n/messages";
|
|
9
|
+
export default async function AccountLayout({ children }) {
|
|
10
|
+
// In the scope value the dashboard would open in, so someone whose dashboard access comes from a scoped role gets the link too.
|
|
11
|
+
const principal = await requireScopedUser();
|
|
12
|
+
const locale = await adminLocale(principal.user.id);
|
|
13
|
+
const messages = adminMessages(locale);
|
|
14
|
+
const { t } = formatters(locale, messages);
|
|
15
|
+
const nav = [
|
|
16
|
+
...(principal.permissions.has("dashboard:access") ? [{ name: t("nav.Dashboard"), href: adminPath(), icon: "home" }] : []),
|
|
17
|
+
{ name: t("nav.Account"), href: accountPath(), icon: "account" },
|
|
18
|
+
];
|
|
19
|
+
const { appName, logoUrl } = await loadAdminBranding();
|
|
20
|
+
const direction = adminDirection(locale);
|
|
21
|
+
return (_jsx(AdminI18nProvider, { locale: locale, direction: direction, messages: messages, children: _jsx("div", { lang: locale, dir: direction, className: "cms-contents", children: _jsx(AppShell, { appName: appName, logoUrl: logoUrl, nav: nav, email: principal.user.email, impersonating: Boolean(principal.session.impersonatedBy), children: children }) }) }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { userFieldValues } from "../../core/auth/user-fields";
|
|
3
|
+
import { requireUser } from "../../core/authz/page";
|
|
4
|
+
import { adminConfigIfProvided } from "../../core/config";
|
|
5
|
+
import { PluginBoundary } from "../../components/PluginBoundary";
|
|
6
|
+
import { plain } from "../../core/http/plain";
|
|
7
|
+
import AccountClient from "./account-client";
|
|
8
|
+
import { chosenAdminLocale } from "../../core/i18n/admin";
|
|
9
|
+
export default async function AccountPage({ searchParams }) {
|
|
10
|
+
const principal = await requireUser();
|
|
11
|
+
const { denied, enroll } = await searchParams;
|
|
12
|
+
const user = { id: principal.user.id, email: principal.user.email, permissions: [...principal.permissions] };
|
|
13
|
+
const panels = (adminConfigIfProvided()?.plugins ?? []).flatMap((plugin) => (plugin.accountPanels ?? []).map((panel) => ({ ...panel, plugin: plugin.name })));
|
|
14
|
+
return (_jsx(AccountClient, { initialName: principal.user.name, email: principal.user.email, twoFactorEnabled: principal.user.twoFactorEnabled, permissions: [...principal.permissions], customFields: plain(await userFieldValues(principal.user.id, { includeHidden: false })), denied: denied === "1", enrollMfa: enroll === "mfa", interfaceLocale: await chosenAdminLocale(principal.user.id), children: panels.map(({ plugin, id, component: Panel }) => _jsx(PluginBoundary, { plugin: plugin, children: _jsx(Panel, { user: user }) }, `${plugin}:${id}`)) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DELETE: import("../../../../../core/authz/guard").GuardedHandler;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { headers } from "next/headers";
|
|
2
|
+
import { route } from "../../../../../core/authz/guard";
|
|
3
|
+
export const DELETE = route({ access: "permission", permission: "api-key:revoke", audit: "api_key.revoke" }, async ({ params, runtime, auditTarget }) => {
|
|
4
|
+
auditTarget("api_key", params.id);
|
|
5
|
+
// better-auth scopes this to the session's own keys.
|
|
6
|
+
await runtime.auth.api.deleteApiKey({ headers: await headers(), body: { keyId: params.id } });
|
|
7
|
+
return null;
|
|
8
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { headers } from "next/headers";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { route } from "../../../../core/authz/guard";
|
|
4
|
+
import { fromStatements, isKnownPermission, toStatements } from "../../../../core/authz/permissions";
|
|
5
|
+
import { isSubset } from "../../../../core/authz/roles";
|
|
6
|
+
import { HttpError } from "../../../../core/http/errors";
|
|
7
|
+
const assertEnabled = (enabled) => {
|
|
8
|
+
if (!enabled)
|
|
9
|
+
throw new HttpError(403, "API_KEYS_DISABLED", "API keys are disabled.");
|
|
10
|
+
};
|
|
11
|
+
export const GET = route({ access: "permission", permission: "api-key:list" }, async ({ runtime }) => {
|
|
12
|
+
const result = await runtime.auth.api.listApiKeys({ headers: await headers() });
|
|
13
|
+
return result.apiKeys.map((key) => ({
|
|
14
|
+
id: key.id,
|
|
15
|
+
name: key.name,
|
|
16
|
+
start: key.start,
|
|
17
|
+
createdAt: key.createdAt,
|
|
18
|
+
expiresAt: key.expiresAt,
|
|
19
|
+
lastRequest: key.lastRequest,
|
|
20
|
+
permissions: [...fromStatements(key.permissions)],
|
|
21
|
+
scope: boundScope(key.metadata),
|
|
22
|
+
}));
|
|
23
|
+
});
|
|
24
|
+
const body = z.object({
|
|
25
|
+
name: z.string().trim().min(1).max(80),
|
|
26
|
+
permissions: z.array(z.string()).min(1).max(200),
|
|
27
|
+
expiresInDays: z.number().int().min(1).max(3650),
|
|
28
|
+
/** Binds the key to this request's row scope value, such as a tenant: it works there and nowhere else. */
|
|
29
|
+
scope: z.boolean().optional(),
|
|
30
|
+
});
|
|
31
|
+
const boundScope = (metadata) => {
|
|
32
|
+
const scope = metadata?.scope;
|
|
33
|
+
return typeof scope === "string" ? scope : null;
|
|
34
|
+
};
|
|
35
|
+
export const POST = route({ access: "permission", permission: "api-key:create", body, audit: "api_key.create", fresh: true }, async ({ body, principal, runtime, auditTarget }) => {
|
|
36
|
+
assertEnabled(runtime.settings.apiKeys.enabled);
|
|
37
|
+
if (body.expiresInDays > runtime.settings.apiKeys.maxLifetimeDays) {
|
|
38
|
+
throw new HttpError(400, "KEY_LIFETIME", `Keys can last at most ${runtime.settings.apiKeys.maxLifetimeDays} days.`);
|
|
39
|
+
}
|
|
40
|
+
if (!body.permissions.every(isKnownPermission) || !isSubset(body.permissions, principal.permissions)) {
|
|
41
|
+
throw new HttpError(403, "KEY_EXCEEDS_ACTOR", "A key cannot have permissions you do not hold.");
|
|
42
|
+
}
|
|
43
|
+
// Permissions held only within a scope value count only for a key bound to it.
|
|
44
|
+
const scope = body.scope ? principal.scope ?? null : null;
|
|
45
|
+
if (body.scope && scope === null)
|
|
46
|
+
throw new HttpError(400, "SCOPE_REQUIRED", "Choose where the key is for before binding it.");
|
|
47
|
+
const created = await runtime.auth.api.createApiKey({
|
|
48
|
+
body: { userId: principal.user.id, name: body.name, expiresIn: body.expiresInDays * 86_400, permissions: toStatements(body.permissions), ...(scope ? { metadata: { scope } } : {}) },
|
|
49
|
+
});
|
|
50
|
+
auditTarget("api_key", created.id, { name: body.name, permissions: body.permissions, ...(scope ? { scope } : {}) });
|
|
51
|
+
return { id: created.id, key: created.key, name: created.name };
|
|
52
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PATCH: import("../../../../core/authz/guard").GuardedHandler;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { setOwnValues, userFieldValues } from "../../../../core/auth/user-fields";
|
|
3
|
+
import { route } from "../../../../core/authz/guard";
|
|
4
|
+
import { isSharedAccount, SHARED_ACCOUNT_MESSAGE } from "../../../../core/auth/shared-accounts";
|
|
5
|
+
import { HttpError } from "../../../../core/http/errors";
|
|
6
|
+
const body = z.object({ values: z.record(z.string(), z.unknown()) });
|
|
7
|
+
export const PATCH = route({ access: "authenticated", body, audit: "account.update_fields", maxBodyBytes: 64 * 1024 }, async ({ body, principal, auditTarget }) => {
|
|
8
|
+
if (isSharedAccount(principal.user.email))
|
|
9
|
+
throw new HttpError(403, "SHARED_ACCOUNT", SHARED_ACCOUNT_MESSAGE);
|
|
10
|
+
auditTarget("user", principal.user.id, { fields: Object.keys(body.values).slice(0, 100) });
|
|
11
|
+
await setOwnValues(principal.user.id, body.values);
|
|
12
|
+
return userFieldValues(principal.user.id, { includeHidden: false });
|
|
13
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { route } from "../../../../core/authz/guard";
|
|
3
|
+
import { HttpError } from "../../../../core/http/errors";
|
|
4
|
+
import { isSharedAccount } from "../../../../core/auth/shared-accounts";
|
|
5
|
+
import { ADMIN_LOCALE_COOKIE, saveAdminLocale, supportedAdminLocale } from "../../../../core/i18n/admin";
|
|
6
|
+
const body = z.object({ locale: z.string().max(35).nullable() });
|
|
7
|
+
/** The person's dashboard and email language. Null follows their browser. */
|
|
8
|
+
export const PUT = route({ access: "authenticated", body, audit: "account.update_locale" }, async ({ body, principal, request, auditTarget }) => {
|
|
9
|
+
if (principal.kind !== "user")
|
|
10
|
+
throw new HttpError(403, "FORBIDDEN", "Only a signed-in person has an interface language.");
|
|
11
|
+
const locale = body.locale === null ? null : supportedAdminLocale(body.locale);
|
|
12
|
+
if (body.locale !== null && !locale)
|
|
13
|
+
throw new HttpError(400, "INVALID_LOCALE", "The dashboard isn't available in that language.");
|
|
14
|
+
// A shared account's visitors each keep their own language, in their browser's cookie only.
|
|
15
|
+
if (!isSharedAccount(principal.user.email))
|
|
16
|
+
await saveAdminLocale(principal.user.id, locale);
|
|
17
|
+
auditTarget("user", principal.user.id, { locale });
|
|
18
|
+
// Pages outside the dashboard, such as sign-in, read the cookie rather than the profile.
|
|
19
|
+
const secure = request.nextUrl.protocol === "https:" ? "; Secure" : "";
|
|
20
|
+
const cookie = locale ? `${ADMIN_LOCALE_COOKIE}=${locale}; Path=/; Max-Age=31536000; SameSite=Lax; HttpOnly${secure}` : `${ADMIN_LOCALE_COOKIE}=; Path=/; Max-Age=0; SameSite=Lax; HttpOnly${secure}`;
|
|
21
|
+
return new Response(JSON.stringify({ locale }), { headers: { "content-type": "application/json", "cache-control": "no-store", "set-cookie": cookie } });
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GET: import("../../../core/authz/guard").GuardedHandler;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { route } from "../../../core/authz/guard";
|
|
3
|
+
import { listAudit } from "../../../core/audit/query";
|
|
4
|
+
const query = z.object({
|
|
5
|
+
page: z.coerce.number().int().min(1).default(1),
|
|
6
|
+
perPage: z.coerce.number().int().min(1).max(100).default(50),
|
|
7
|
+
action: z.string().trim().max(100).optional(),
|
|
8
|
+
actor: z.string().trim().max(320).optional(),
|
|
9
|
+
outcome: z.enum(["success", "failure", "denied"]).optional(),
|
|
10
|
+
});
|
|
11
|
+
export const GET = route({ access: "permission", permission: "audit:read", query }, async ({ query }) => listAudit(query));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GET: import("../../../core/authz/guard").GuardedHandler;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { route } from "../../../core/authz/guard";
|
|
2
|
+
import { publicAuthConfig } from "../../../core/auth/public-config";
|
|
3
|
+
// PocketBase's listAuthMethods: lets sign-in screens show only what is enabled.
|
|
4
|
+
export const GET = route({ access: "public", reason: "Sign-in screens need the enabled methods before authentication" }, async ({ runtime: { settings } }) => publicAuthConfig(settings));
|