pagescms 0.0.0-stage → 3.0.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 +66 -2
- package/dist/package/_headers +7 -0
- package/dist/package/cli.mjs +138 -0
- package/dist/package/config-CAscGjBB.js +123 -0
- package/dist/package/config.mjs +1 -0
- package/dist/package/favicon.ico +0 -0
- package/dist/package/favicon.svg +16 -0
- package/dist/package/generate-B-YdQuMX.js +48 -0
- package/dist/package/generate.mjs +1 -0
- package/dist/package/images/astro-blog-template.webp +0 -0
- package/dist/package/images/eleventy-blog-template.webp +0 -0
- package/dist/package/images/email-logo.png +0 -0
- package/dist/package/images/nextjs-blog-template.webp +0 -0
- package/dist/package/images/social-card.png +0 -0
- package/dist/package/migrate.mjs +184 -0
- package/dist/package/reference/docs/configuration/actions.md +160 -0
- package/dist/package/reference/docs/configuration/components.md +56 -0
- package/dist/package/reference/docs/configuration/content/filename.md +63 -0
- package/dist/package/reference/docs/configuration/content/formats.md +63 -0
- package/dist/package/reference/docs/configuration/content/index.md +138 -0
- package/dist/package/reference/docs/configuration/content/view.md +52 -0
- package/dist/package/reference/docs/configuration/fields/block.md +62 -0
- package/dist/package/reference/docs/configuration/fields/boolean.md +22 -0
- package/dist/package/reference/docs/configuration/fields/code.md +29 -0
- package/dist/package/reference/docs/configuration/fields/date.md +35 -0
- package/dist/package/reference/docs/configuration/fields/file.md +34 -0
- package/dist/package/reference/docs/configuration/fields/image.md +48 -0
- package/dist/package/reference/docs/configuration/fields/index.md +130 -0
- package/dist/package/reference/docs/configuration/fields/number.md +28 -0
- package/dist/package/reference/docs/configuration/fields/object.md +63 -0
- package/dist/package/reference/docs/configuration/fields/reference.md +64 -0
- package/dist/package/reference/docs/configuration/fields/rich-text.md +126 -0
- package/dist/package/reference/docs/configuration/fields/select.md +48 -0
- package/dist/package/reference/docs/configuration/fields/string.md +31 -0
- package/dist/package/reference/docs/configuration/fields/text.md +30 -0
- package/dist/package/reference/docs/configuration/fields/uuid.md +28 -0
- package/dist/package/reference/docs/configuration/index.md +88 -0
- package/dist/package/reference/docs/configuration/localization.md +138 -0
- package/dist/package/reference/docs/configuration/media.md +77 -0
- package/dist/package/reference/docs/configuration/settings.md +85 -0
- package/dist/package/reference/docs/extending/custom-field.md +107 -0
- package/dist/package/reference/docs/extending/field-api.md +71 -0
- package/dist/package/reference/docs/extending/plugins.md +67 -0
- package/dist/package/reference/docs/guides/actions.md +14 -0
- package/dist/package/reference/docs/guides/collaborators.md +43 -0
- package/dist/package/reference/docs/guides/editing.md +36 -0
- package/dist/package/reference/docs/guides/media.md +24 -0
- package/dist/package/reference/docs/guides/translations.md +40 -0
- package/dist/package/reference/docs/how-it-works.md +33 -0
- package/dist/package/reference/docs/index.md +25 -0
- package/dist/package/reference/docs/quick-start.md +87 -0
- package/dist/package/reference/docs/reference.md +84 -0
- package/dist/package/reference/docs/self-hosting/cloudflare.md +62 -0
- package/dist/package/reference/docs/self-hosting/environment-variables.md +84 -0
- package/dist/package/reference/docs/self-hosting/github-app.md +54 -0
- package/dist/package/reference/docs/self-hosting/index.md +44 -0
- package/dist/package/reference/docs/self-hosting/netlify.md +41 -0
- package/dist/package/reference/docs/self-hosting/node.md +42 -0
- package/dist/package/reference/docs/self-hosting/upgrading.md +44 -0
- package/dist/package/reference/docs/self-hosting/vercel.md +41 -0
- package/dist/package/reference/docs.json +119 -0
- package/dist/package/reference/manifest.json +190 -0
- package/dist/package/reference.md +79 -0
- package/dist/package/serve-D2bbxXbp.js +25 -0
- package/dist/package/smtp.mjs +13 -0
- package/dist/package/vite-BUlNpf2j.js +260 -0
- package/dist/package/vite.mjs +1 -0
- package/dist/types/client/api/account.d.ts +33 -0
- package/dist/types/client/api/actions.d.ts +67 -0
- package/dist/types/client/api/activity.d.ts +4 -0
- package/dist/types/client/api/admin.d.ts +11 -0
- package/dist/types/client/api/auth.d.ts +375 -0
- package/dist/types/client/api/authentication.d.ts +2 -0
- package/dist/types/client/api/cache.d.ts +6 -0
- package/dist/types/client/api/collaborators.d.ts +13 -0
- package/dist/types/client/api/collections.d.ts +4 -0
- package/dist/types/client/api/configuration.d.ts +10 -0
- package/dist/types/client/api/dashboard.d.ts +2 -0
- package/dist/types/client/api/entries.d.ts +14 -0
- package/dist/types/client/api/entry-write.d.ts +3394 -0
- package/dist/types/client/api/fixed-file.d.ts +11 -0
- package/dist/types/client/api/index.d.ts +8 -0
- package/dist/types/client/api/local-account.d.ts +1 -0
- package/dist/types/client/api/media.d.ts +38 -0
- package/dist/types/client/api/reference.d.ts +7 -0
- package/dist/types/client/api/repositories.d.ts +1 -0
- package/dist/types/client/api/repository-search.d.ts +6 -0
- package/dist/types/client/api/repository.d.ts +14 -0
- package/dist/types/client/queries/admin.d.ts +179 -0
- package/dist/types/client/queries/content.d.ts +2012 -0
- package/dist/types/client/queries/file-history.d.ts +13 -0
- package/dist/types/client/queries/keys.d.ts +32 -0
- package/dist/types/client/queries/references.d.ts +59 -0
- package/dist/types/client/queries/repository-invalidation.d.ts +7 -0
- package/dist/types/client/queries/repository.d.ts +271 -0
- package/dist/types/client/queries/session.d.ts +116 -0
- package/dist/types/client.d.ts +1 -0
- package/dist/types/components/action-history-menu.d.ts +11 -0
- package/dist/types/components/code-editor-language.d.ts +1 -0
- package/dist/types/components/code-editor.d.ts +23 -0
- package/dist/types/components/code-field.d.ts +10 -0
- package/dist/types/components/collaborator-identity.d.ts +5 -0
- package/dist/types/components/collaborator-invite-input.d.ts +8 -0
- package/dist/types/components/collaborators-loading.d.ts +2 -0
- package/dist/types/components/collection-entry-creator.d.ts +14 -0
- package/dist/types/components/component-preloading.d.ts +1 -0
- package/dist/types/components/content-entry-editor.d.ts +20 -0
- package/dist/types/components/content-entry-skeleton.d.ts +4 -0
- package/dist/types/components/content-icon.d.ts +8 -0
- package/dist/types/components/dropdown-loading-row.d.ts +5 -0
- package/dist/types/components/editor-layout.d.ts +5 -0
- package/dist/types/components/editor-skeleton.d.ts +4 -0
- package/dist/types/components/error-alert.d.ts +6 -0
- package/dist/types/components/file-editor-history.d.ts +4 -0
- package/dist/types/components/file-editor-menu.d.ts +12 -0
- package/dist/types/components/github-icon.d.ts +2 -0
- package/dist/types/components/gradient-avatar-fallback.d.ts +4 -0
- package/dist/types/components/media-file-icon.d.ts +4 -0
- package/dist/types/components/media-thumbnail.d.ts +18 -0
- package/dist/types/components/operation-error.d.ts +18 -0
- package/dist/types/components/option-combobox.d.ts +24 -0
- package/dist/types/components/otp-verification-form.d.ts +13 -0
- package/dist/types/components/repository-action-buttons.d.ts +24 -0
- package/dist/types/components/repository-breadcrumb.d.ts +11 -0
- package/dist/types/components/repository-page-header.d.ts +15 -0
- package/dist/types/components/repository-shell.d.ts +26 -0
- package/dist/types/components/rich-text-field.d.ts +13 -0
- package/dist/types/components/root-error.d.ts +2 -0
- package/dist/types/components/search-input.d.ts +7 -0
- package/dist/types/components/settings-back-link.d.ts +4 -0
- package/dist/types/components/settings-layout.d.ts +17 -0
- package/dist/types/components/settings-loading.d.ts +2 -0
- package/dist/types/components/settings-row.d.ts +2 -0
- package/dist/types/components/sign-in-form.d.ts +6 -0
- package/dist/types/components/startup-error.d.ts +1 -0
- package/dist/types/components/structured-content-field.d.ts +23 -0
- package/dist/types/components/table-pager.d.ts +9 -0
- package/dist/types/components/ui/alert-dialog.d.ts +18 -0
- package/dist/types/components/ui/alert.d.ts +10 -0
- package/dist/types/components/ui/avatar.d.ts +12 -0
- package/dist/types/components/ui/badge.d.ts +9 -0
- package/dist/types/components/ui/breadcrumb.d.ts +11 -0
- package/dist/types/components/ui/button-group.d.ts +11 -0
- package/dist/types/components/ui/button.d.ts +10 -0
- package/dist/types/components/ui/card.d.ts +11 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/collapsible.d.ts +5 -0
- package/dist/types/components/ui/combobox.d.ts +27 -0
- package/dist/types/components/ui/command.d.ts +18 -0
- package/dist/types/components/ui/dialog.d.ts +17 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/types/components/ui/editor/blockquote.d.ts +3 -0
- package/dist/types/components/ui/editor/document.d.ts +6 -0
- package/dist/types/components/ui/editor/html-policy.d.ts +20 -0
- package/dist/types/components/ui/editor/image.d.ts +12 -0
- package/dist/types/components/ui/editor/index.d.ts +52 -0
- package/dist/types/components/ui/editor/preserve.d.ts +39 -0
- package/dist/types/components/ui/editor/slash-command/commands-list.d.ts +24 -0
- package/dist/types/components/ui/editor/slash-command/commands.d.ts +14 -0
- package/dist/types/components/ui/editor/slash-command/suggestion.d.ts +42 -0
- package/dist/types/components/ui/empty.d.ts +11 -0
- package/dist/types/components/ui/field.d.ts +24 -0
- package/dist/types/components/ui/input-group.d.ts +16 -0
- package/dist/types/components/ui/input-otp.d.ts +11 -0
- package/dist/types/components/ui/input.d.ts +3 -0
- package/dist/types/components/ui/label.d.ts +4 -0
- package/dist/types/components/ui/pagination.d.ts +17 -0
- package/dist/types/components/ui/popover.d.ts +10 -0
- package/dist/types/components/ui/progress.d.ts +4 -0
- package/dist/types/components/ui/radio-group.d.ts +5 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/select.d.ts +15 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +14 -0
- package/dist/types/components/ui/sidebar.d.ts +69 -0
- package/dist/types/components/ui/skeleton.d.ts +2 -0
- package/dist/types/components/ui/sonner.d.ts +3 -0
- package/dist/types/components/ui/spinner.d.ts +3 -0
- package/dist/types/components/ui/switch.d.ts +6 -0
- package/dist/types/components/ui/table.d.ts +19 -0
- package/dist/types/components/ui/tabs.d.ts +11 -0
- package/dist/types/components/ui/textarea.d.ts +3 -0
- package/dist/types/components/ui/toggle-group.d.ts +10 -0
- package/dist/types/components/ui/toggle.d.ts +9 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/deployment/builtins/resend-email.server.d.ts +2 -0
- package/dist/types/deployment/conformance/media-storage.d.ts +15 -0
- package/dist/types/deployment/contracts/client.d.ts +17 -0
- package/dist/types/deployment/contracts/server.server.d.ts +15 -0
- package/dist/types/deployment/contracts/version.d.ts +4 -0
- package/dist/types/deployment/default/client.d.ts +2 -0
- package/dist/types/deployment/default/server.server.d.ts +2 -0
- package/dist/types/features/account/account-copy.d.ts +11 -0
- package/dist/types/features/account/account-deleted-notice.d.ts +3 -0
- package/dist/types/features/account/account-menu.d.ts +7 -0
- package/dist/types/features/account/account-messages.d.ts +2 -0
- package/dist/types/features/account/app-header.d.ts +6 -0
- package/dist/types/features/account/content-editing-preferences.d.ts +3 -0
- package/dist/types/features/account/delete-account.d.ts +6 -0
- package/dist/types/features/account/language-field.d.ts +6 -0
- package/dist/types/features/account/language-preference.d.ts +4 -0
- package/dist/types/features/account/local-account-data.d.ts +1 -0
- package/dist/types/features/account/local-account-storage.d.ts +8 -0
- package/dist/types/features/account/profile-editor.d.ts +51 -0
- package/dist/types/features/account/profile-fields.d.ts +17 -0
- package/dist/types/features/account/profile-loading.d.ts +1 -0
- package/dist/types/features/account/profile-picture.d.ts +13 -0
- package/dist/types/features/account/profile-settings.d.ts +8 -0
- package/dist/types/features/account/profile-setup-heading.d.ts +1 -0
- package/dist/types/features/account/profile-setup.d.ts +5 -0
- package/dist/types/features/account/require-profile.d.ts +6 -0
- package/dist/types/features/account/sign-in-layout.d.ts +5 -0
- package/dist/types/features/account/sign-in-page.d.ts +9 -0
- package/dist/types/features/account/theme-preference.d.ts +1 -0
- package/dist/types/features/account/use-account-preferences.d.ts +14 -0
- package/dist/types/features/account/use-profile-editor.d.ts +41 -0
- package/dist/types/features/account/use-profile-update.d.ts +19 -0
- package/dist/types/features/activity/activity-feed-item.d.ts +7 -0
- package/dist/types/features/activity/activity-feed-skeleton.d.ts +1 -0
- package/dist/types/features/activity/activity-feed.d.ts +11 -0
- package/dist/types/features/activity/activity-query.d.ts +5 -0
- package/dist/types/features/admin/action-run-status.d.ts +5 -0
- package/dist/types/features/admin/actions-page.d.ts +9 -0
- package/dist/types/features/admin/actions-skeleton.d.ts +1 -0
- package/dist/types/features/admin/admin-loading.d.ts +5 -0
- package/dist/types/features/admin/admin-page.d.ts +2 -0
- package/dist/types/features/admin/allowlist-table.d.ts +12 -0
- package/dist/types/features/admin/cache-copy.d.ts +4 -0
- package/dist/types/features/admin/cache-files-trigger.d.ts +1 -0
- package/dist/types/features/admin/cache-files.d.ts +6 -0
- package/dist/types/features/admin/cache-page.d.ts +6 -0
- package/dist/types/features/admin/cache-skeleton.d.ts +1 -0
- package/dist/types/features/admin/collaborators-page.d.ts +6 -0
- package/dist/types/features/admin/collaborators-skeleton.d.ts +2 -0
- package/dist/types/features/admin/configuration-contribution.d.ts +5 -0
- package/dist/types/features/admin/configuration-page.d.ts +9 -0
- package/dist/types/features/admin/configuration-setup.d.ts +1 -0
- package/dist/types/features/admin/configuration-skeleton.d.ts +1 -0
- package/dist/types/features/admin/plugin-page.d.ts +14 -0
- package/dist/types/features/admin/repository-actions-page.d.ts +1 -0
- package/dist/types/features/admin/repository-admin-access.d.ts +6 -0
- package/dist/types/features/admin/repository-admin-page.d.ts +12 -0
- package/dist/types/features/admin/repository-configuration-page.d.ts +1 -0
- package/dist/types/features/admin/sign-in-allowlist.d.ts +1 -0
- package/dist/types/features/admin/use-action-run-tracking.d.ts +5 -0
- package/dist/types/features/collaborators/collaborator-status.d.ts +4 -0
- package/dist/types/features/collaborators/collaborators-contribution.d.ts +5 -0
- package/dist/types/features/collections/collection-cell.d.ts +25 -0
- package/dist/types/features/collections/collection-header.d.ts +28 -0
- package/dist/types/features/collections/collection-model.d.ts +32 -0
- package/dist/types/features/collections/collection-page.d.ts +4 -0
- package/dist/types/features/collections/collection-skeleton.d.ts +1 -0
- package/dist/types/features/collections/collection-table-layout.d.ts +18 -0
- package/dist/types/features/collections/collection-table.d.ts +44 -0
- package/dist/types/features/content/content-mutations.d.ts +78 -0
- package/dist/types/features/content/unavailable-entry.d.ts +6 -0
- package/dist/types/features/content/use-entry-actions.d.ts +100 -0
- package/dist/types/features/dashboard/about-dialog.d.ts +2 -0
- package/dist/types/features/dashboard/branch-manager.d.ts +8 -0
- package/dist/types/features/dashboard/branch-picker.d.ts +2 -0
- package/dist/types/features/dashboard/create-branch-dialog.d.ts +8 -0
- package/dist/types/features/dashboard/recent-repositories.d.ts +14 -0
- package/dist/types/features/dashboard/recent-repository-list.d.ts +3 -0
- package/dist/types/features/dashboard/relative-time.d.ts +1 -0
- package/dist/types/features/dashboard/repository-dashboard.d.ts +13 -0
- package/dist/types/features/dashboard/repository-loading.d.ts +10 -0
- package/dist/types/features/dashboard/repository-selector.d.ts +10 -0
- package/dist/types/features/dashboard/repository-template-preview.d.ts +8 -0
- package/dist/types/features/dashboard/repository-templates.d.ts +5 -0
- package/dist/types/features/drafts/collection-creation.d.ts +20 -0
- package/dist/types/features/drafts/draft-discard-dialog.d.ts +8 -0
- package/dist/types/features/drafts/draft-field-preview.d.ts +10 -0
- package/dist/types/features/drafts/draft-merge-dialog.d.ts +11 -0
- package/dist/types/features/drafts/draft-merge-fields.d.ts +2 -0
- package/dist/types/features/drafts/draft-read-cache.d.ts +13 -0
- package/dist/types/features/drafts/draft-save-button.d.ts +19 -0
- package/dist/types/features/drafts/draft-session.d.ts +63 -0
- package/dist/types/features/drafts/draft-store.d.ts +44 -0
- package/dist/types/features/drafts/merge-draft.d.ts +22 -0
- package/dist/types/features/drafts/relative-age.d.ts +1 -0
- package/dist/types/features/drafts/saved-draft-menu.d.ts +6 -0
- package/dist/types/features/drafts/use-content-draft.d.ts +30 -0
- package/dist/types/features/drafts/use-draft-merge.d.ts +15 -0
- package/dist/types/features/drafts/use-duplicate-entry.d.ts +7 -0
- package/dist/types/features/drafts/use-review-viewport.d.ts +28 -0
- package/dist/types/features/editor/commit-message-dialog.d.ts +8 -0
- package/dist/types/features/editor/editor-component-loaders.d.ts +8 -0
- package/dist/types/features/editor/entry-breadcrumb.d.ts +28 -0
- package/dist/types/features/editor/entry-page-header.d.ts +9 -0
- package/dist/types/features/editor/entry-title.d.ts +13 -0
- package/dist/types/features/editor/field-locale-menu.d.ts +10 -0
- package/dist/types/features/editor/field-locale-values.d.ts +5 -0
- package/dist/types/features/editor/fields/core-field-renderers.d.ts +1 -0
- package/dist/types/features/editor/fields/custom-field-components.d.ts +3 -0
- package/dist/types/features/editor/fields/field-renderer-registry.d.ts +23 -0
- package/dist/types/features/editor/fields/field-types.d.ts +15 -0
- package/dist/types/features/editor/fields/field-validation.d.ts +27 -0
- package/dist/types/features/editor/fields/structured-field-options.d.ts +9 -0
- package/dist/types/features/editor/fields/use-reference-options.d.ts +14 -0
- package/dist/types/features/editor/file-locale-menu.d.ts +26 -0
- package/dist/types/features/editor/locale-context.d.ts +31 -0
- package/dist/types/features/editor/locale-selection.d.ts +13 -0
- package/dist/types/features/editor/rich-text-media.d.ts +10 -0
- package/dist/types/features/editor/start-translation-dialog.d.ts +10 -0
- package/dist/types/features/editor/translation-preferences.d.ts +8 -0
- package/dist/types/features/editor/translation-start.d.ts +13 -0
- package/dist/types/features/media/media-breadcrumb.d.ts +8 -0
- package/dist/types/features/media/media-browser.d.ts +23 -0
- package/dist/types/features/media/media-delivery.d.ts +35 -0
- package/dist/types/features/media/media-drag-overlay.d.ts +1 -0
- package/dist/types/features/media/media-entry.d.ts +21 -0
- package/dist/types/features/media/media-folder-tree.d.ts +8 -0
- package/dist/types/features/media/media-model.d.ts +22 -0
- package/dist/types/features/media/media-move-dialog.d.ts +12 -0
- package/dist/types/features/media/media-mutations.d.ts +43 -0
- package/dist/types/features/media/media-page.d.ts +6 -0
- package/dist/types/features/media/media-picker-dialog.d.ts +14 -0
- package/dist/types/features/media/media-skeleton.d.ts +6 -0
- package/dist/types/features/media/media-upload.d.ts +28 -0
- package/dist/types/features/media/media-view.d.ts +3 -0
- package/dist/types/features/media/upload-conflict-dialog.d.ts +5 -0
- package/dist/types/features/media/upload-conflicts.d.ts +47 -0
- package/dist/types/features/pending-writes/account-operation.d.ts +10 -0
- package/dist/types/features/pending-writes/pending-write.d.ts +9 -0
- package/dist/types/features/pending-writes/use-operation.d.ts +30 -0
- package/dist/types/features/plugins/standalone-plugin-page.d.ts +4 -0
- package/dist/types/features/plugins/standalone-plugin-routes.d.ts +9 -0
- package/dist/types/features/repository/configuration-required.d.ts +10 -0
- package/dist/types/features/repository/overview-draft-actions.d.ts +5 -0
- package/dist/types/features/repository/overview-entry.d.ts +6 -0
- package/dist/types/features/repository/overview-file-item.d.ts +8 -0
- package/dist/types/features/repository/overview-loading.d.ts +4 -0
- package/dist/types/features/repository/overview-local-files.d.ts +10 -0
- package/dist/types/features/repository/overview-media-upload.d.ts +8 -0
- package/dist/types/features/repository/overview-shortcuts.d.ts +11 -0
- package/dist/types/features/repository/overview.d.ts +7 -0
- package/dist/types/features/repository/repository-loading.d.ts +2 -0
- package/dist/types/features/repository/repository-route-resource.d.ts +8 -0
- package/dist/types/features/repository/repository-route-state.d.ts +8 -0
- package/dist/types/features/repository/repository-shell-loading.d.ts +1 -0
- package/dist/types/features/repository/repository-unavailable-error.d.ts +2 -0
- package/dist/types/features/repository/use-overview-files.d.ts +9 -0
- package/dist/types/features/settings/account-access-table.d.ts +8 -0
- package/dist/types/features/settings/account-settings-contribution.d.ts +4 -0
- package/dist/types/features/settings/settings-navigation.d.ts +14 -0
- package/dist/types/features/settings/shared-projects.d.ts +3 -0
- package/dist/types/features/settings/user-settings-skeleton.d.ts +5 -0
- package/dist/types/features/settings/user-settings.d.ts +1 -0
- package/dist/types/fields/definition.d.ts +23 -0
- package/dist/types/fields/registry.d.ts +2 -0
- package/dist/types/hooks/use-media-github-link.d.ts +10 -0
- package/dist/types/hooks/use-mobile.d.ts +1 -0
- package/dist/types/hooks/use-page-scrolled.d.ts +1 -0
- package/dist/types/hooks/use-repository-coordinates.d.ts +7 -0
- package/dist/types/hooks/use-repository-github-link.d.ts +2 -0
- package/dist/types/hooks/use-route-retry.d.ts +5 -0
- package/dist/types/hooks/use-sidebar-scroll.d.ts +5 -0
- package/dist/types/hooks/use-unsaved-warning.d.ts +1 -0
- package/dist/types/i18n/catalogs.d.ts +3 -0
- package/dist/types/i18n/dates.d.ts +3 -0
- package/dist/types/i18n/document-title.d.ts +10 -0
- package/dist/types/i18n/error-catalogs.d.ts +4 -0
- package/dist/types/i18n/errors.d.ts +13 -0
- package/dist/types/i18n/known-errors.d.ts +2 -0
- package/dist/types/i18n/locale.d.ts +6 -0
- package/dist/types/i18n/localized-error.d.ts +4 -0
- package/dist/types/i18n/localized-route-head.d.ts +5 -0
- package/dist/types/i18n/message.d.ts +8 -0
- package/dist/types/i18n/plugin-catalogs.d.ts +3 -0
- package/dist/types/i18n/test-provider.d.ts +4 -0
- package/dist/types/integrations/tanstack-query/devtools.d.ts +5 -0
- package/dist/types/integrations/tanstack-query/root-provider.d.ts +4 -0
- package/dist/types/lib/access-denial.d.ts +10 -0
- package/dist/types/lib/action-run-tracker.d.ts +34 -0
- package/dist/types/lib/action-run-tracking.d.ts +9 -0
- package/dist/types/lib/actions.d.ts +32 -0
- package/dist/types/lib/activity.d.ts +23 -0
- package/dist/types/lib/auth-error.d.ts +1 -0
- package/dist/types/lib/auth-redirect.d.ts +2 -0
- package/dist/types/lib/authentication.d.ts +20 -0
- package/dist/types/lib/avatar-gradient.d.ts +1 -0
- package/dist/types/lib/base64.d.ts +3 -0
- package/dist/types/lib/cn.d.ts +1 -0
- package/dist/types/lib/collaborator-invites.d.ts +4 -0
- package/dist/types/lib/collaborator-key.d.ts +2 -0
- package/dist/types/lib/collaborator-status.d.ts +1 -0
- package/dist/types/lib/commit-message.d.ts +27 -0
- package/dist/types/lib/component-loader.d.ts +2 -0
- package/dist/types/lib/component-preloading.d.ts +11 -0
- package/dist/types/lib/configuration-completion.d.ts +10 -0
- package/dist/types/lib/content-field-values.d.ts +8 -0
- package/dist/types/lib/content-field.d.ts +2 -0
- package/dist/types/lib/content-filename.d.ts +6 -0
- package/dist/types/lib/content-icon-loader.d.ts +2 -0
- package/dist/types/lib/content-operations.d.ts +15 -0
- package/dist/types/lib/content-validation.d.ts +5 -0
- package/dist/types/lib/core-route-paths.d.ts +2 -0
- package/dist/types/lib/date-field.d.ts +4 -0
- package/dist/types/lib/deferred-component.d.ts +8 -0
- package/dist/types/lib/field-value-shapes.d.ts +11 -0
- package/dist/types/lib/field-values.d.ts +9 -0
- package/dist/types/lib/file-history.d.ts +2 -0
- package/dist/types/lib/file-types.d.ts +13 -0
- package/dist/types/lib/i18n-media.d.ts +4 -0
- package/dist/types/lib/i18n-schema.d.ts +44 -0
- package/dist/types/lib/i18n-values.d.ts +21 -0
- package/dist/types/lib/i18n.d.ts +43 -0
- package/dist/types/lib/icon-name.d.ts +1 -0
- package/dist/types/lib/markdown-images.d.ts +2 -0
- package/dist/types/lib/media-assets.d.ts +9 -0
- package/dist/types/lib/media-field-values.d.ts +20 -0
- package/dist/types/lib/media-upload-name.d.ts +3 -0
- package/dist/types/lib/media-variants.d.ts +4 -0
- package/dist/types/lib/notifications.d.ts +16 -0
- package/dist/types/lib/operation-error.d.ts +3 -0
- package/dist/types/lib/page-title.d.ts +9 -0
- package/dist/types/lib/profile.d.ts +6 -0
- package/dist/types/lib/reference-pages.d.ts +12 -0
- package/dist/types/lib/repository-identity.d.ts +18 -0
- package/dist/types/lib/repository-page-path.d.ts +4 -0
- package/dist/types/lib/repository.d.ts +13 -0
- package/dist/types/lib/select-options.d.ts +4 -0
- package/dist/types/lib/use-raw-search.d.ts +2 -0
- package/dist/types/package/cli.d.ts +2 -0
- package/dist/types/package/cloudflare-project-routes.d.ts +2 -0
- package/dist/types/package/config.d.ts +41 -0
- package/dist/types/package/configured-icons.d.ts +2 -0
- package/dist/types/package/constants.d.ts +2 -0
- package/dist/types/package/deploy-config.d.ts +1 -0
- package/dist/types/package/generate.d.ts +10 -0
- package/dist/types/package/icon-path.d.ts +2 -0
- package/dist/types/package/load.d.ts +1 -0
- package/dist/types/package/migrate.d.ts +31 -0
- package/dist/types/package/node-middleware.d.ts +7 -0
- package/dist/types/package/runtime.d.ts +20 -0
- package/dist/types/package/runtime.server.d.ts +11 -0
- package/dist/types/package/serve.d.ts +5 -0
- package/dist/types/package/server-entry.d.ts +1 -0
- package/dist/types/package/smtp.d.ts +9 -0
- package/dist/types/package/smtp.server.d.ts +2 -0
- package/dist/types/package/vite.d.ts +23 -0
- package/dist/types/plugins/client.d.ts +129 -0
- package/dist/types/plugins/compose.server.d.ts +30 -0
- package/dist/types/plugins/email/cloudflare.server.d.ts +6 -0
- package/dist/types/plugins/email/resend.server.d.ts +2 -0
- package/dist/types/plugins/email/smtp.server.d.ts +15 -0
- package/dist/types/plugins/identity.d.ts +4 -0
- package/dist/types/plugins/server.d.ts +83 -0
- package/dist/types/routeTree.gen.d.ts +592 -0
- package/dist/types/router.d.ts +6 -0
- package/dist/types/routes/__root.d.ts +8 -0
- package/dist/types/routes/admin.d.ts +17 -0
- package/dist/types/routes/auth.error.d.ts +4 -0
- package/dist/types/routes/auth.redirect.d.ts +5 -0
- package/dist/types/routes/github.$owner.$repo.$branch.$page.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.actions.d.ts +13 -0
- package/dist/types/routes/github.$owner.$repo.$branch.cache.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collaborators.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collection.$name.d.ts +90 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collection.$name_.edit.$.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collection.$name_.entry.$.d.ts +15 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collection.$name_.new.d.ts +28 -0
- package/dist/types/routes/github.$owner.$repo.$branch.configuration.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.d.ts +6 -0
- package/dist/types/routes/github.$owner.$repo.$branch.file.$name.d.ts +19 -0
- package/dist/types/routes/github.$owner.$repo.$branch.index.d.ts +32 -0
- package/dist/types/routes/github.$owner.$repo.$branch.media.$name.d.ts +14 -0
- package/dist/types/routes/github.$owner.$repo.index.d.ts +7 -0
- package/dist/types/routes/index.d.ts +11 -0
- package/dist/types/routes/onboarding.d.ts +7 -0
- package/dist/types/routes/settings.d.ts +1 -0
- package/dist/types/routes/sign-in.d.ts +11 -0
- package/dist/types/server/access/policy.d.ts +108 -0
- package/dist/types/server/access/repository-identity-policy.d.ts +3 -0
- package/dist/types/server/access/repository-identity.d.ts +65 -0
- package/dist/types/server/access/repository-policy.d.ts +33 -0
- package/dist/types/server/access/repository.d.ts +227 -0
- package/dist/types/server/account/account.d.ts +39 -0
- package/dist/types/server/account/deletion.d.ts +15 -0
- package/dist/types/server/account/preferences.d.ts +6 -0
- package/dist/types/server/actions/actions.d.ts +152 -0
- package/dist/types/server/activity/capture.d.ts +33 -0
- package/dist/types/server/activity/details.d.ts +23 -0
- package/dist/types/server/activity/store.d.ts +50 -0
- package/dist/types/server/activity/webhook.d.ts +4 -0
- package/dist/types/server/admin/access.d.ts +4 -0
- package/dist/types/server/admin/admin.d.ts +43 -0
- package/dist/types/server/admin/sign-in-allowlist.d.ts +16 -0
- package/dist/types/server/auth/index.d.ts +751 -0
- package/dist/types/server/auth/oauth-account.d.ts +23 -0
- package/dist/types/server/auth/oauth-token-adapter.d.ts +2 -0
- package/dist/types/server/auth/oauth-token-crypto.d.ts +7 -0
- package/dist/types/server/auth/rate-limit.d.ts +3 -0
- package/dist/types/server/auth/secret-crypto.d.ts +5 -0
- package/dist/types/server/auth/sign-in-allowlist.d.ts +4 -0
- package/dist/types/server/cache/configuration-access.d.ts +33 -0
- package/dist/types/server/cache/configuration-read.d.ts +5 -0
- package/dist/types/server/cache/configuration.d.ts +67 -0
- package/dist/types/server/cache/directory-store.d.ts +35 -0
- package/dist/types/server/cache/directory.d.ts +65 -0
- package/dist/types/server/cache/policy.d.ts +14 -0
- package/dist/types/server/cache/repository-read.d.ts +3 -0
- package/dist/types/server/cache/repository.d.ts +30 -0
- package/dist/types/server/collaborators/api.d.ts +2 -0
- package/dist/types/server/collaborators/branches.d.ts +7 -0
- package/dist/types/server/collaborators/collaborators.d.ts +90 -0
- package/dist/types/server/collaborators/membership-match.d.ts +5 -0
- package/dist/types/server/collaborators/shared-projects.d.ts +13 -0
- package/dist/types/server/content/collection.d.ts +67 -0
- package/dist/types/server/content/conflict.d.ts +1 -0
- package/dist/types/server/content/entry-editor.d.ts +2308 -0
- package/dist/types/server/content/localized-directory.d.ts +7 -0
- package/dist/types/server/content/reference.d.ts +26 -0
- package/dist/types/server/content/write-response.d.ts +7 -0
- package/dist/types/server/context-cloudflare.d.ts +1050 -0
- package/dist/types/server/context-node.d.ts +1051 -0
- package/dist/types/server/context.d.ts +1094 -0
- package/dist/types/server/csrf.d.ts +2 -0
- package/dist/types/server/db/client.d.ts +10 -0
- package/dist/types/server/db/core.d.ts +27 -0
- package/dist/types/server/db/schema.d.ts +3270 -0
- package/dist/types/server/db/sql.d.ts +8 -0
- package/dist/types/server/email/email.d.ts +15 -0
- package/dist/types/server/email/templates.d.ts +36 -0
- package/dist/types/server/email/translations.d.ts +121 -0
- package/dist/types/server/github/account.d.ts +7 -0
- package/dist/types/server/github/api.d.ts +208 -0
- package/dist/types/server/github/app-install.d.ts +2 -0
- package/dist/types/server/github/app.d.ts +21 -0
- package/dist/types/server/github/installation-token-cache.d.ts +5 -0
- package/dist/types/server/github/large-collection.d.ts +2 -0
- package/dist/types/server/github/webhook-response.d.ts +2 -0
- package/dist/types/server/github/webhook.d.ts +37 -0
- package/dist/types/server/http.d.ts +7 -0
- package/dist/types/server/index.d.ts +5 -0
- package/dist/types/server/media/media.d.ts +145 -0
- package/dist/types/server/media/preview.d.ts +8 -0
- package/dist/types/server/media/provider.d.ts +233 -0
- package/dist/types/server/repository/activity.d.ts +2 -0
- package/dist/types/server/repository/branches.d.ts +12 -0
- package/dist/types/server/repository/provider.d.ts +155 -0
- package/dist/types/server/repository/repositories.d.ts +55 -0
- package/dist/types/server/request-body.d.ts +4 -0
- package/dist/types/server/routes/account.d.ts +4 -0
- package/dist/types/server/routes/actions.d.ts +4 -0
- package/dist/types/server/routes/activity.d.ts +4 -0
- package/dist/types/server/routes/admin.d.ts +4 -0
- package/dist/types/server/routes/app-version.d.ts +1 -0
- package/dist/types/server/routes/auth.d.ts +4 -0
- package/dist/types/server/routes/cache.d.ts +4 -0
- package/dist/types/server/routes/collaborators.d.ts +4 -0
- package/dist/types/server/routes/configuration.d.ts +4 -0
- package/dist/types/server/routes/entries.d.ts +4 -0
- package/dist/types/server/routes/health.d.ts +6 -0
- package/dist/types/server/routes/index.d.ts +3 -0
- package/dist/types/server/routes/media.d.ts +4 -0
- package/dist/types/server/routes/plugin-request.d.ts +3 -0
- package/dist/types/server/routes/plugins.d.ts +4 -0
- package/dist/types/server/routes/repositories.d.ts +4 -0
- package/dist/types/server/routes/shared.d.ts +16 -0
- package/dist/types/server/routes/webhooks.d.ts +4 -0
- package/dist/types/server/runtime/runtime-ports.d.ts +4 -0
- package/dist/types/server/runtime-config.d.ts +41 -0
- package/dist/types/server/services/account-language.d.ts +3 -0
- package/dist/types/server/services/account.d.ts +41 -0
- package/dist/types/server/services/actions.d.ts +107 -0
- package/dist/types/server/services/activity.d.ts +51 -0
- package/dist/types/server/services/admin.d.ts +61 -0
- package/dist/types/server/services/authentication-state.d.ts +3 -0
- package/dist/types/server/services/cache-management.d.ts +41 -0
- package/dist/types/server/services/cache.d.ts +25 -0
- package/dist/types/server/services/collaborators.d.ts +22 -0
- package/dist/types/server/services/configuration-editor.d.ts +36 -0
- package/dist/types/server/services/configuration.d.ts +20 -0
- package/dist/types/server/services/content.d.ts +4764 -0
- package/dist/types/server/services/context.d.ts +37 -0
- package/dist/types/server/services/dashboard.d.ts +20 -0
- package/dist/types/server/services/entry-translations.d.ts +9 -0
- package/dist/types/server/services/errors.d.ts +14 -0
- package/dist/types/server/services/index.d.ts +12 -0
- package/dist/types/server/services/local-account-data.d.ts +4 -0
- package/dist/types/server/services/media.d.ts +96 -0
- package/dist/types/server/services/reference.d.ts +10 -0
- package/dist/types/server/services/repository.d.ts +40 -0
- package/dist/types/shared/account-preferences.d.ts +13 -0
- package/dist/types/shared/application-operations.d.ts +2 -0
- package/dist/types/shared/collection-presentation.d.ts +13 -0
- package/dist/types/shared/configuration-compatibility.d.ts +10 -0
- package/dist/types/shared/configuration-components.d.ts +4 -0
- package/dist/types/shared/configuration-content.d.ts +21 -0
- package/dist/types/shared/configuration-discovery.d.ts +3 -0
- package/dist/types/shared/configuration-names.d.ts +7 -0
- package/dist/types/shared/configuration-navigation.d.ts +25 -0
- package/dist/types/shared/configuration-schema.d.ts +653 -0
- package/dist/types/shared/configuration-settings.d.ts +4 -0
- package/dist/types/shared/configuration-source.d.ts +17 -0
- package/dist/types/shared/configuration-yaml.d.ts +23 -0
- package/dist/types/shared/configuration.d.ts +4 -0
- package/dist/types/shared/content-conflict.d.ts +2 -0
- package/dist/types/shared/content-serialization.d.ts +18 -0
- package/dist/types/shared/field-validation-error.d.ts +3 -0
- package/dist/types/shared/git-path.d.ts +11 -0
- package/dist/types/shared/json.d.ts +13 -0
- package/dist/types/shared/media-error.d.ts +9 -0
- package/dist/types/shared/repository-search.d.ts +5 -0
- package/dist/types/shared/repository-templates.d.ts +17 -0
- package/dist/types/shared/requests/account.d.ts +16 -0
- package/dist/types/shared/requests/action.d.ts +52 -0
- package/dist/types/shared/requests/activity.d.ts +7 -0
- package/dist/types/shared/requests/admin.d.ts +35 -0
- package/dist/types/shared/requests/branch.d.ts +7 -0
- package/dist/types/shared/requests/cache.d.ts +22 -0
- package/dist/types/shared/requests/collaborator.d.ts +20 -0
- package/dist/types/shared/requests/collection.d.ts +10 -0
- package/dist/types/shared/requests/configuration.d.ts +21 -0
- package/dist/types/shared/requests/entry-write.d.ts +108 -0
- package/dist/types/shared/requests/entry.d.ts +17 -0
- package/dist/types/shared/requests/fixed-file.d.ts +8 -0
- package/dist/types/shared/requests/local-account.d.ts +4 -0
- package/dist/types/shared/requests/media.d.ts +135 -0
- package/dist/types/shared/requests/reference.d.ts +14 -0
- package/dist/types/shared/requests/repository-template.d.ts +6 -0
- package/dist/types/shared/requests/repository.d.ts +6 -0
- package/dist/types/shared/requests/ui-language.d.ts +4 -0
- package/dist/types/shared/sign-in-allowlist.d.ts +18 -0
- package/dist/types/shared/yaml-aliases.d.ts +1 -0
- package/docs/public/configuration/actions.md +160 -0
- package/docs/public/configuration/components.md +56 -0
- package/docs/public/configuration/content/filename.md +63 -0
- package/docs/public/configuration/content/formats.md +63 -0
- package/docs/public/configuration/content/index.md +138 -0
- package/docs/public/configuration/content/view.md +52 -0
- package/docs/public/configuration/fields/block.md +62 -0
- package/docs/public/configuration/fields/boolean.md +22 -0
- package/docs/public/configuration/fields/code.md +29 -0
- package/docs/public/configuration/fields/date.md +35 -0
- package/docs/public/configuration/fields/file.md +34 -0
- package/docs/public/configuration/fields/image.md +48 -0
- package/docs/public/configuration/fields/index.md +130 -0
- package/docs/public/configuration/fields/number.md +28 -0
- package/docs/public/configuration/fields/object.md +63 -0
- package/docs/public/configuration/fields/reference.md +64 -0
- package/docs/public/configuration/fields/rich-text.md +126 -0
- package/docs/public/configuration/fields/select.md +48 -0
- package/docs/public/configuration/fields/string.md +31 -0
- package/docs/public/configuration/fields/text.md +30 -0
- package/docs/public/configuration/fields/uuid.md +28 -0
- package/docs/public/configuration/index.md +88 -0
- package/docs/public/configuration/localization.md +138 -0
- package/docs/public/configuration/media.md +77 -0
- package/docs/public/configuration/settings.md +85 -0
- package/docs/public/docs.json +119 -0
- package/docs/public/extending/custom-field.md +107 -0
- package/docs/public/extending/field-api.md +71 -0
- package/docs/public/extending/plugins.md +67 -0
- package/docs/public/guides/actions.md +14 -0
- package/docs/public/guides/collaborators.md +43 -0
- package/docs/public/guides/editing.md +36 -0
- package/docs/public/guides/media.md +24 -0
- package/docs/public/guides/translations.md +40 -0
- package/docs/public/how-it-works.md +33 -0
- package/docs/public/index.md +25 -0
- package/docs/public/quick-start.md +87 -0
- package/docs/public/reference.md +84 -0
- package/docs/public/self-hosting/cloudflare.md +62 -0
- package/docs/public/self-hosting/environment-variables.md +84 -0
- package/docs/public/self-hosting/github-app.md +54 -0
- package/docs/public/self-hosting/index.md +44 -0
- package/docs/public/self-hosting/netlify.md +41 -0
- package/docs/public/self-hosting/node.md +42 -0
- package/docs/public/self-hosting/upgrading.md +44 -0
- package/docs/public/self-hosting/vercel.md +41 -0
- package/drizzle/0000_wet_overlord.sql +268 -0
- package/drizzle/meta/0000_snapshot.json +1858 -0
- package/drizzle/meta/_journal.json +13 -0
- package/index.html +53 -0
- package/package.json +368 -3
- package/public/_headers +7 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +16 -0
- package/public/images/astro-blog-template.webp +0 -0
- package/public/images/eleventy-blog-template.webp +0 -0
- package/public/images/email-logo.png +0 -0
- package/public/images/nextjs-blog-template.webp +0 -0
- package/public/images/social-card.png +0 -0
- package/public/reference/docs/configuration/actions.md +160 -0
- package/public/reference/docs/configuration/components.md +56 -0
- package/public/reference/docs/configuration/content/filename.md +63 -0
- package/public/reference/docs/configuration/content/formats.md +63 -0
- package/public/reference/docs/configuration/content/index.md +138 -0
- package/public/reference/docs/configuration/content/view.md +52 -0
- package/public/reference/docs/configuration/fields/block.md +62 -0
- package/public/reference/docs/configuration/fields/boolean.md +22 -0
- package/public/reference/docs/configuration/fields/code.md +29 -0
- package/public/reference/docs/configuration/fields/date.md +35 -0
- package/public/reference/docs/configuration/fields/file.md +34 -0
- package/public/reference/docs/configuration/fields/image.md +48 -0
- package/public/reference/docs/configuration/fields/index.md +130 -0
- package/public/reference/docs/configuration/fields/number.md +28 -0
- package/public/reference/docs/configuration/fields/object.md +63 -0
- package/public/reference/docs/configuration/fields/reference.md +64 -0
- package/public/reference/docs/configuration/fields/rich-text.md +126 -0
- package/public/reference/docs/configuration/fields/select.md +48 -0
- package/public/reference/docs/configuration/fields/string.md +31 -0
- package/public/reference/docs/configuration/fields/text.md +30 -0
- package/public/reference/docs/configuration/fields/uuid.md +28 -0
- package/public/reference/docs/configuration/index.md +88 -0
- package/public/reference/docs/configuration/localization.md +138 -0
- package/public/reference/docs/configuration/media.md +77 -0
- package/public/reference/docs/configuration/settings.md +85 -0
- package/public/reference/docs/extending/custom-field.md +107 -0
- package/public/reference/docs/extending/field-api.md +71 -0
- package/public/reference/docs/extending/plugins.md +67 -0
- package/public/reference/docs/guides/actions.md +14 -0
- package/public/reference/docs/guides/collaborators.md +43 -0
- package/public/reference/docs/guides/editing.md +36 -0
- package/public/reference/docs/guides/media.md +24 -0
- package/public/reference/docs/guides/translations.md +40 -0
- package/public/reference/docs/how-it-works.md +33 -0
- package/public/reference/docs/index.md +25 -0
- package/public/reference/docs/quick-start.md +87 -0
- package/public/reference/docs/reference.md +84 -0
- package/public/reference/docs/self-hosting/cloudflare.md +62 -0
- package/public/reference/docs/self-hosting/environment-variables.md +84 -0
- package/public/reference/docs/self-hosting/github-app.md +54 -0
- package/public/reference/docs/self-hosting/index.md +44 -0
- package/public/reference/docs/self-hosting/netlify.md +41 -0
- package/public/reference/docs/self-hosting/node.md +42 -0
- package/public/reference/docs/self-hosting/upgrading.md +44 -0
- package/public/reference/docs/self-hosting/vercel.md +41 -0
- package/public/reference/docs.json +119 -0
- package/public/reference/manifest.json +190 -0
- package/public/reference.md +79 -0
- package/scripts/collaborators.mjs +470 -0
- package/scripts/setup-github-app.mjs +837 -0
- package/src/client/api/account.ts +48 -0
- package/src/client/api/actions.ts +53 -0
- package/src/client/api/activity.ts +17 -0
- package/src/client/api/admin.ts +25 -0
- package/src/client/api/auth.ts +8 -0
- package/src/client/api/authentication.ts +8 -0
- package/src/client/api/cache.ts +18 -0
- package/src/client/api/collaborators.ts +18 -0
- package/src/client/api/collections.ts +26 -0
- package/src/client/api/configuration.ts +38 -0
- package/src/client/api/dashboard.ts +6 -0
- package/src/client/api/entries.ts +53 -0
- package/src/client/api/entry-write.ts +54 -0
- package/src/client/api/fixed-file.ts +23 -0
- package/src/client/api/index.ts +98 -0
- package/src/client/api/local-account.ts +5 -0
- package/src/client/api/media.ts +62 -0
- package/src/client/api/reference.ts +9 -0
- package/src/client/api/repositories.ts +7 -0
- package/src/client/api/repository-search.ts +18 -0
- package/src/client/api/repository.ts +39 -0
- package/src/client/queries/admin.ts +19 -0
- package/src/client/queries/content.ts +114 -0
- package/src/client/queries/file-history.ts +44 -0
- package/src/client/queries/keys.ts +56 -0
- package/src/client/queries/references.ts +124 -0
- package/src/client/queries/repository-invalidation.ts +27 -0
- package/src/client/queries/repository.ts +96 -0
- package/src/client/queries/session.ts +45 -0
- package/src/client.tsx +15 -0
- package/src/components/action-history-menu.tsx +273 -0
- package/src/components/code-editor-language.ts +29 -0
- package/src/components/code-editor.tsx +146 -0
- package/src/components/code-field.tsx +42 -0
- package/src/components/collaborator-identity.tsx +34 -0
- package/src/components/collaborator-invite-input.tsx +160 -0
- package/src/components/collaborators-loading.tsx +53 -0
- package/src/components/collection-entry-creator.tsx +558 -0
- package/src/components/component-preloading.tsx +23 -0
- package/src/components/content-entry-editor.tsx +1240 -0
- package/src/components/content-entry-skeleton.tsx +200 -0
- package/src/components/content-icon.tsx +51 -0
- package/src/components/dropdown-loading-row.tsx +19 -0
- package/src/components/editor-layout.tsx +16 -0
- package/src/components/editor-skeleton.tsx +21 -0
- package/src/components/error-alert.tsx +44 -0
- package/src/components/file-editor-history.tsx +191 -0
- package/src/components/file-editor-menu.tsx +113 -0
- package/src/components/github-icon.tsx +17 -0
- package/src/components/gradient-avatar-fallback.tsx +39 -0
- package/src/components/media-file-icon.tsx +40 -0
- package/src/components/media-thumbnail.tsx +199 -0
- package/src/components/operation-error.tsx +161 -0
- package/src/components/option-combobox.tsx +195 -0
- package/src/components/otp-verification-form.tsx +125 -0
- package/src/components/repository-action-buttons.tsx +547 -0
- package/src/components/repository-breadcrumb.tsx +169 -0
- package/src/components/repository-page-header.tsx +97 -0
- package/src/components/repository-shell.tsx +938 -0
- package/src/components/rich-text-field.tsx +324 -0
- package/src/components/root-error.tsx +77 -0
- package/src/components/search-input.tsx +37 -0
- package/src/components/settings-back-link.tsx +43 -0
- package/src/components/settings-layout.tsx +178 -0
- package/src/components/settings-loading.tsx +19 -0
- package/src/components/settings-row.ts +9 -0
- package/src/components/sign-in-form.tsx +285 -0
- package/src/components/startup-error.tsx +93 -0
- package/src/components/structured-content-field.tsx +1900 -0
- package/src/components/table-pager.tsx +62 -0
- package/src/components/ui/alert-dialog.tsx +199 -0
- package/src/components/ui/alert.tsx +78 -0
- package/src/components/ui/avatar.tsx +113 -0
- package/src/components/ui/badge.tsx +53 -0
- package/src/components/ui/breadcrumb.tsx +128 -0
- package/src/components/ui/button-group.tsx +84 -0
- package/src/components/ui/button.tsx +67 -0
- package/src/components/ui/card.tsx +102 -0
- package/src/components/ui/checkbox.tsx +38 -0
- package/src/components/ui/collapsible.tsx +31 -0
- package/src/components/ui/combobox.tsx +336 -0
- package/src/components/ui/command.tsx +202 -0
- package/src/components/ui/dialog.tsx +174 -0
- package/src/components/ui/dropdown-menu.tsx +279 -0
- package/src/components/ui/editor/blockquote.ts +45 -0
- package/src/components/ui/editor/document.ts +29 -0
- package/src/components/ui/editor/html-policy.ts +945 -0
- package/src/components/ui/editor/image.ts +309 -0
- package/src/components/ui/editor/index.tsx +1383 -0
- package/src/components/ui/editor/preserve.ts +494 -0
- package/src/components/ui/editor/slash-command/commands-list.tsx +122 -0
- package/src/components/ui/editor/slash-command/commands.ts +66 -0
- package/src/components/ui/editor/slash-command/suggestion.tsx +305 -0
- package/src/components/ui/editor/typeset.css +1120 -0
- package/src/components/ui/empty.tsx +104 -0
- package/src/components/ui/field.tsx +246 -0
- package/src/components/ui/input-group.tsx +155 -0
- package/src/components/ui/input-otp.tsx +84 -0
- package/src/components/ui/input.tsx +18 -0
- package/src/components/ui/label.tsx +23 -0
- package/src/components/ui/pagination.tsx +153 -0
- package/src/components/ui/popover.tsx +86 -0
- package/src/components/ui/progress.tsx +29 -0
- package/src/components/ui/radio-group.tsx +41 -0
- package/src/components/ui/scroll-area.tsx +52 -0
- package/src/components/ui/select.tsx +206 -0
- package/src/components/ui/separator.tsx +25 -0
- package/src/components/ui/sheet.tsx +152 -0
- package/src/components/ui/sidebar.tsx +693 -0
- package/src/components/ui/skeleton.tsx +14 -0
- package/src/components/ui/sonner.tsx +88 -0
- package/src/components/ui/spinner.tsx +24 -0
- package/src/components/ui/switch.tsx +32 -0
- package/src/components/ui/table.tsx +165 -0
- package/src/components/ui/tabs.tsx +88 -0
- package/src/components/ui/textarea.tsx +17 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +47 -0
- package/src/components/ui/tooltip.tsx +54 -0
- package/src/deployment/builtins/resend-email.server.ts +75 -0
- package/src/deployment/conformance/media-storage.ts +177 -0
- package/src/deployment/contracts/client.ts +331 -0
- package/src/deployment/contracts/server.server.ts +55 -0
- package/src/deployment/contracts/version.ts +8 -0
- package/src/deployment/default/client.ts +6 -0
- package/src/deployment/default/server.server.ts +8 -0
- package/src/features/account/account-copy.ts +17 -0
- package/src/features/account/account-deleted-notice.tsx +23 -0
- package/src/features/account/account-menu.tsx +139 -0
- package/src/features/account/account-messages.ts +4 -0
- package/src/features/account/app-header.tsx +46 -0
- package/src/features/account/content-editing-preferences.tsx +104 -0
- package/src/features/account/delete-account.tsx +236 -0
- package/src/features/account/language-field.tsx +79 -0
- package/src/features/account/language-preference.tsx +101 -0
- package/src/features/account/local-account-data.tsx +131 -0
- package/src/features/account/local-account-storage.ts +82 -0
- package/src/features/account/profile-editor.ts +269 -0
- package/src/features/account/profile-fields.tsx +156 -0
- package/src/features/account/profile-loading.tsx +51 -0
- package/src/features/account/profile-picture.tsx +272 -0
- package/src/features/account/profile-settings.tsx +50 -0
- package/src/features/account/profile-setup-heading.tsx +17 -0
- package/src/features/account/profile-setup.tsx +171 -0
- package/src/features/account/require-profile.ts +40 -0
- package/src/features/account/sign-in-layout.tsx +29 -0
- package/src/features/account/sign-in-page.tsx +45 -0
- package/src/features/account/theme-preference.tsx +89 -0
- package/src/features/account/use-account-preferences.ts +96 -0
- package/src/features/account/use-profile-editor.ts +102 -0
- package/src/features/account/use-profile-update.ts +64 -0
- package/src/features/activity/activity-feed-item.tsx +320 -0
- package/src/features/activity/activity-feed-skeleton.tsx +28 -0
- package/src/features/activity/activity-feed.tsx +113 -0
- package/src/features/activity/activity-query.ts +17 -0
- package/src/features/admin/action-run-status.tsx +103 -0
- package/src/features/admin/actions-page.tsx +869 -0
- package/src/features/admin/actions-skeleton.tsx +155 -0
- package/src/features/admin/admin-loading.tsx +165 -0
- package/src/features/admin/admin-page.tsx +573 -0
- package/src/features/admin/allowlist-table.tsx +125 -0
- package/src/features/admin/cache-copy.ts +12 -0
- package/src/features/admin/cache-files-trigger.tsx +17 -0
- package/src/features/admin/cache-files.tsx +196 -0
- package/src/features/admin/cache-page.tsx +302 -0
- package/src/features/admin/cache-skeleton.tsx +76 -0
- package/src/features/admin/collaborators-page.tsx +425 -0
- package/src/features/admin/collaborators-skeleton.tsx +95 -0
- package/src/features/admin/configuration-contribution.tsx +44 -0
- package/src/features/admin/configuration-page.tsx +303 -0
- package/src/features/admin/configuration-setup.tsx +51 -0
- package/src/features/admin/configuration-skeleton.tsx +68 -0
- package/src/features/admin/plugin-page.tsx +115 -0
- package/src/features/admin/repository-actions-page.tsx +32 -0
- package/src/features/admin/repository-admin-access.ts +35 -0
- package/src/features/admin/repository-admin-page.tsx +75 -0
- package/src/features/admin/repository-configuration-page.tsx +18 -0
- package/src/features/admin/sign-in-allowlist.tsx +381 -0
- package/src/features/admin/use-action-run-tracking.ts +32 -0
- package/src/features/collaborators/collaborator-status.tsx +47 -0
- package/src/features/collaborators/collaborators-contribution.tsx +59 -0
- package/src/features/collections/collection-cell.tsx +336 -0
- package/src/features/collections/collection-header.tsx +233 -0
- package/src/features/collections/collection-model.ts +232 -0
- package/src/features/collections/collection-page.tsx +836 -0
- package/src/features/collections/collection-skeleton.tsx +106 -0
- package/src/features/collections/collection-table-layout.tsx +158 -0
- package/src/features/collections/collection-table.tsx +828 -0
- package/src/features/content/content-mutations.ts +544 -0
- package/src/features/content/unavailable-entry.tsx +64 -0
- package/src/features/content/use-entry-actions.tsx +399 -0
- package/src/features/dashboard/about-dialog.tsx +212 -0
- package/src/features/dashboard/branch-manager.tsx +118 -0
- package/src/features/dashboard/branch-picker.ts +17 -0
- package/src/features/dashboard/create-branch-dialog.tsx +182 -0
- package/src/features/dashboard/recent-repositories.ts +119 -0
- package/src/features/dashboard/recent-repository-list.tsx +82 -0
- package/src/features/dashboard/relative-time.ts +30 -0
- package/src/features/dashboard/repository-dashboard.tsx +174 -0
- package/src/features/dashboard/repository-loading.tsx +119 -0
- package/src/features/dashboard/repository-selector.tsx +398 -0
- package/src/features/dashboard/repository-template-preview.tsx +46 -0
- package/src/features/dashboard/repository-templates.tsx +237 -0
- package/src/features/drafts/collection-creation.ts +78 -0
- package/src/features/drafts/draft-discard-dialog.tsx +90 -0
- package/src/features/drafts/draft-field-preview.tsx +128 -0
- package/src/features/drafts/draft-merge-dialog.tsx +322 -0
- package/src/features/drafts/draft-merge-fields.ts +25 -0
- package/src/features/drafts/draft-read-cache.ts +73 -0
- package/src/features/drafts/draft-save-button.tsx +240 -0
- package/src/features/drafts/draft-session.ts +374 -0
- package/src/features/drafts/draft-store.ts +438 -0
- package/src/features/drafts/merge-draft.ts +131 -0
- package/src/features/drafts/relative-age.ts +13 -0
- package/src/features/drafts/saved-draft-menu.tsx +108 -0
- package/src/features/drafts/use-content-draft.tsx +157 -0
- package/src/features/drafts/use-draft-merge.tsx +253 -0
- package/src/features/drafts/use-duplicate-entry.ts +124 -0
- package/src/features/drafts/use-review-viewport.ts +61 -0
- package/src/features/editor/commit-message-dialog.tsx +100 -0
- package/src/features/editor/editor-component-loaders.ts +35 -0
- package/src/features/editor/entry-breadcrumb.ts +64 -0
- package/src/features/editor/entry-page-header.tsx +51 -0
- package/src/features/editor/entry-title.ts +55 -0
- package/src/features/editor/field-locale-menu.tsx +166 -0
- package/src/features/editor/field-locale-values.ts +69 -0
- package/src/features/editor/fields/core-field-renderers.tsx +300 -0
- package/src/features/editor/fields/custom-field-components.ts +15 -0
- package/src/features/editor/fields/field-renderer-registry.ts +45 -0
- package/src/features/editor/fields/field-types.ts +15 -0
- package/src/features/editor/fields/field-validation.tsx +174 -0
- package/src/features/editor/fields/structured-field-options.ts +66 -0
- package/src/features/editor/fields/use-reference-options.ts +47 -0
- package/src/features/editor/file-locale-menu.tsx +487 -0
- package/src/features/editor/locale-context.tsx +264 -0
- package/src/features/editor/locale-selection.tsx +63 -0
- package/src/features/editor/rich-text-media.ts +134 -0
- package/src/features/editor/start-translation-dialog.tsx +136 -0
- package/src/features/editor/translation-preferences.ts +58 -0
- package/src/features/editor/translation-start.ts +35 -0
- package/src/features/media/media-breadcrumb.tsx +84 -0
- package/src/features/media/media-browser.tsx +1236 -0
- package/src/features/media/media-delivery.ts +348 -0
- package/src/features/media/media-drag-overlay.tsx +59 -0
- package/src/features/media/media-entry.tsx +417 -0
- package/src/features/media/media-folder-tree.tsx +216 -0
- package/src/features/media/media-model.ts +60 -0
- package/src/features/media/media-move-dialog.tsx +97 -0
- package/src/features/media/media-mutations.ts +351 -0
- package/src/features/media/media-page.tsx +24 -0
- package/src/features/media/media-picker-dialog.tsx +123 -0
- package/src/features/media/media-skeleton.tsx +97 -0
- package/src/features/media/media-upload.ts +340 -0
- package/src/features/media/media-view.ts +16 -0
- package/src/features/media/upload-conflict-dialog.tsx +126 -0
- package/src/features/media/upload-conflicts.ts +166 -0
- package/src/features/pending-writes/account-operation.ts +44 -0
- package/src/features/pending-writes/pending-write.ts +41 -0
- package/src/features/pending-writes/use-operation.ts +158 -0
- package/src/features/plugins/standalone-plugin-page.tsx +31 -0
- package/src/features/plugins/standalone-plugin-routes.tsx +70 -0
- package/src/features/repository/configuration-required.tsx +91 -0
- package/src/features/repository/overview-draft-actions.tsx +28 -0
- package/src/features/repository/overview-entry.ts +59 -0
- package/src/features/repository/overview-file-item.tsx +115 -0
- package/src/features/repository/overview-loading.tsx +94 -0
- package/src/features/repository/overview-local-files.tsx +138 -0
- package/src/features/repository/overview-media-upload.tsx +183 -0
- package/src/features/repository/overview-shortcuts.tsx +138 -0
- package/src/features/repository/overview.tsx +88 -0
- package/src/features/repository/repository-loading.ts +12 -0
- package/src/features/repository/repository-route-resource.ts +26 -0
- package/src/features/repository/repository-route-state.tsx +147 -0
- package/src/features/repository/repository-shell-loading.tsx +228 -0
- package/src/features/repository/repository-unavailable-error.tsx +90 -0
- package/src/features/repository/use-overview-files.ts +74 -0
- package/src/features/settings/account-access-table.tsx +69 -0
- package/src/features/settings/account-settings-contribution.tsx +88 -0
- package/src/features/settings/settings-navigation.ts +99 -0
- package/src/features/settings/shared-projects.tsx +246 -0
- package/src/features/settings/user-settings-skeleton.tsx +132 -0
- package/src/features/settings/user-settings.tsx +426 -0
- package/src/fields/custom/README.md +56 -0
- package/src/fields/definition.ts +45 -0
- package/src/fields/registry.ts +9 -0
- package/src/hooks/use-media-github-link.ts +29 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-page-scrolled.ts +14 -0
- package/src/hooks/use-repository-coordinates.ts +15 -0
- package/src/hooks/use-repository-github-link.ts +8 -0
- package/src/hooks/use-route-retry.ts +27 -0
- package/src/hooks/use-sidebar-scroll.ts +48 -0
- package/src/hooks/use-unsaved-warning.ts +14 -0
- package/src/i18n/catalogs.ts +37 -0
- package/src/i18n/dates.ts +19 -0
- package/src/i18n/document-title.tsx +22 -0
- package/src/i18n/error-catalogs.ts +37 -0
- package/src/i18n/errors.ts +71 -0
- package/src/i18n/known-errors.ts +2738 -0
- package/src/i18n/lingui.config.mjs +18 -0
- package/src/i18n/locale.ts +51 -0
- package/src/i18n/localized-error.tsx +7 -0
- package/src/i18n/localized-route-head.tsx +82 -0
- package/src/i18n/message.ts +34 -0
- package/src/i18n/plugin-catalogs.ts +97 -0
- package/src/i18n/po.d.ts +5 -0
- package/src/i18n/test-provider.tsx +12 -0
- package/src/integrations/tanstack-query/devtools.tsx +6 -0
- package/src/integrations/tanstack-query/root-provider.tsx +26 -0
- package/src/lib/access-denial.ts +96 -0
- package/src/lib/action-run-tracker.ts +144 -0
- package/src/lib/action-run-tracking.ts +204 -0
- package/src/lib/actions.ts +105 -0
- package/src/lib/activity.ts +119 -0
- package/src/lib/auth-error.ts +15 -0
- package/src/lib/auth-redirect.ts +29 -0
- package/src/lib/authentication.ts +22 -0
- package/src/lib/avatar-gradient.ts +10 -0
- package/src/lib/base64.ts +29 -0
- package/src/lib/cn.ts +1 -0
- package/src/lib/collaborator-invites.ts +55 -0
- package/src/lib/collaborator-key.ts +4 -0
- package/src/lib/collaborator-status.ts +10 -0
- package/src/lib/commit-message.ts +149 -0
- package/src/lib/component-loader.ts +13 -0
- package/src/lib/component-preloading.ts +152 -0
- package/src/lib/configuration-completion.ts +61 -0
- package/src/lib/configuration-reference.d.mts +2 -0
- package/src/lib/configuration-reference.mjs +5 -0
- package/src/lib/content-field-values.ts +157 -0
- package/src/lib/content-field.ts +5 -0
- package/src/lib/content-filename.ts +116 -0
- package/src/lib/content-icon-loader.ts +42 -0
- package/src/lib/content-operations.ts +49 -0
- package/src/lib/content-validation.ts +68 -0
- package/src/lib/core-route-paths.ts +15 -0
- package/src/lib/date-field.ts +53 -0
- package/src/lib/deferred-component.tsx +42 -0
- package/src/lib/field-value-shapes.ts +94 -0
- package/src/lib/field-values.ts +467 -0
- package/src/lib/file-history.ts +9 -0
- package/src/lib/file-types.ts +88 -0
- package/src/lib/i18n-media.ts +77 -0
- package/src/lib/i18n-schema.ts +38 -0
- package/src/lib/i18n-values.ts +428 -0
- package/src/lib/i18n.ts +408 -0
- package/src/lib/icon-name.ts +2 -0
- package/src/lib/markdown-images.ts +156 -0
- package/src/lib/media-assets.ts +39 -0
- package/src/lib/media-field-values.ts +378 -0
- package/src/lib/media-upload-name.ts +41 -0
- package/src/lib/media-variants.ts +18 -0
- package/src/lib/notifications.ts +156 -0
- package/src/lib/operation-error.ts +9 -0
- package/src/lib/page-title.ts +13 -0
- package/src/lib/profile.ts +50 -0
- package/src/lib/reference-pages.ts +24 -0
- package/src/lib/repository-identity.ts +73 -0
- package/src/lib/repository-page-path.ts +29 -0
- package/src/lib/repository.ts +68 -0
- package/src/lib/select-options.ts +23 -0
- package/src/lib/use-raw-search.ts +9 -0
- package/src/locales/de/messages.po +5696 -0
- package/src/locales/en/messages.po +6125 -0
- package/src/locales/es/messages.po +5919 -0
- package/src/locales/fr/messages.po +6125 -0
- package/src/locales/ja/messages.po +5696 -0
- package/src/locales/pt-BR/messages.po +5919 -0
- package/src/locales/zh-CN/messages.po +5919 -0
- package/src/package/cli.ts +132 -0
- package/src/package/cloudflare-project-routes.ts +16 -0
- package/src/package/config.ts +224 -0
- package/src/package/configured-icons.ts +58 -0
- package/src/package/constants.ts +4 -0
- package/src/package/deploy-config.ts +59 -0
- package/src/package/generate.ts +108 -0
- package/src/package/icon-path.ts +9 -0
- package/src/package/libsql-web.mjs +1 -0
- package/src/package/libsql.mjs +1 -0
- package/src/package/load.ts +19 -0
- package/src/package/migrate.ts +365 -0
- package/src/package/node-middleware.ts +29 -0
- package/src/package/runtime.server.ts +66 -0
- package/src/package/runtime.ts +115 -0
- package/src/package/serve.ts +47 -0
- package/src/package/server-entry.ts +1 -0
- package/src/package/smtp.server.ts +52 -0
- package/src/package/smtp.ts +24 -0
- package/src/package/vite.ts +376 -0
- package/src/plugins/client.ts +141 -0
- package/src/plugins/compose.server.ts +429 -0
- package/src/plugins/email/cloudflare.server.ts +58 -0
- package/src/plugins/email/resend.server.ts +12 -0
- package/src/plugins/email/smtp.server.ts +77 -0
- package/src/plugins/identity.ts +17 -0
- package/src/plugins/server.ts +106 -0
- package/src/routeTree.gen.ts +510 -0
- package/src/router.tsx +49 -0
- package/src/routes/__root.tsx +149 -0
- package/src/routes/admin.tsx +77 -0
- package/src/routes/auth.error.tsx +64 -0
- package/src/routes/auth.redirect.tsx +12 -0
- package/src/routes/github.$owner.$repo.$branch.$page.tsx +54 -0
- package/src/routes/github.$owner.$repo.$branch.actions.tsx +41 -0
- package/src/routes/github.$owner.$repo.$branch.cache.tsx +42 -0
- package/src/routes/github.$owner.$repo.$branch.collaborators.tsx +58 -0
- package/src/routes/github.$owner.$repo.$branch.collection.$name.tsx +96 -0
- package/src/routes/github.$owner.$repo.$branch.collection.$name_.edit.$.tsx +13 -0
- package/src/routes/github.$owner.$repo.$branch.collection.$name_.entry.$.tsx +95 -0
- package/src/routes/github.$owner.$repo.$branch.collection.$name_.new.tsx +125 -0
- package/src/routes/github.$owner.$repo.$branch.configuration.tsx +49 -0
- package/src/routes/github.$owner.$repo.$branch.file.$name.tsx +81 -0
- package/src/routes/github.$owner.$repo.$branch.index.tsx +57 -0
- package/src/routes/github.$owner.$repo.$branch.media.$name.tsx +104 -0
- package/src/routes/github.$owner.$repo.$branch.tsx +203 -0
- package/src/routes/github.$owner.$repo.index.tsx +104 -0
- package/src/routes/index.tsx +65 -0
- package/src/routes/onboarding.tsx +51 -0
- package/src/routes/settings.tsx +39 -0
- package/src/routes/sign-in.tsx +71 -0
- package/src/server/access/policy.ts +316 -0
- package/src/server/access/repository-identity-policy.ts +120 -0
- package/src/server/access/repository-identity.ts +361 -0
- package/src/server/access/repository-policy.ts +85 -0
- package/src/server/access/repository.ts +759 -0
- package/src/server/account/account.ts +62 -0
- package/src/server/account/deletion.ts +74 -0
- package/src/server/account/preferences.ts +50 -0
- package/src/server/actions/actions.ts +767 -0
- package/src/server/activity/capture.ts +228 -0
- package/src/server/activity/details.ts +154 -0
- package/src/server/activity/store.ts +174 -0
- package/src/server/activity/webhook.ts +159 -0
- package/src/server/admin/access.ts +9 -0
- package/src/server/admin/admin.ts +159 -0
- package/src/server/admin/sign-in-allowlist.ts +60 -0
- package/src/server/auth/index.ts +284 -0
- package/src/server/auth/oauth-account.ts +131 -0
- package/src/server/auth/oauth-token-adapter.ts +48 -0
- package/src/server/auth/oauth-token-crypto.ts +56 -0
- package/src/server/auth/rate-limit.ts +56 -0
- package/src/server/auth/secret-crypto.ts +57 -0
- package/src/server/auth/sign-in-allowlist.ts +33 -0
- package/src/server/cache/configuration-access.ts +23 -0
- package/src/server/cache/configuration-read.ts +30 -0
- package/src/server/cache/configuration.ts +483 -0
- package/src/server/cache/directory-store.ts +314 -0
- package/src/server/cache/directory.ts +735 -0
- package/src/server/cache/policy.ts +69 -0
- package/src/server/cache/repository-read.ts +119 -0
- package/src/server/cache/repository.ts +345 -0
- package/src/server/collaborators/api.ts +39 -0
- package/src/server/collaborators/branches.ts +72 -0
- package/src/server/collaborators/collaborators.ts +600 -0
- package/src/server/collaborators/membership-match.ts +10 -0
- package/src/server/collaborators/shared-projects.ts +51 -0
- package/src/server/content/collection.ts +301 -0
- package/src/server/content/conflict.ts +11 -0
- package/src/server/content/entry-editor.ts +1487 -0
- package/src/server/content/localized-directory.ts +104 -0
- package/src/server/content/reference.ts +347 -0
- package/src/server/content/write-response.ts +32 -0
- package/src/server/context-cloudflare.ts +91 -0
- package/src/server/context-node.ts +80 -0
- package/src/server/context.ts +262 -0
- package/src/server/csrf.ts +27 -0
- package/src/server/db/client.ts +56 -0
- package/src/server/db/core.ts +69 -0
- package/src/server/db/schema.ts +447 -0
- package/src/server/db/sql.ts +49 -0
- package/src/server/email/email.ts +19 -0
- package/src/server/email/templates.ts +233 -0
- package/src/server/email/translations.ts +144 -0
- package/src/server/github/account.ts +72 -0
- package/src/server/github/api.ts +1375 -0
- package/src/server/github/app-install.ts +15 -0
- package/src/server/github/app.ts +228 -0
- package/src/server/github/installation-token-cache.ts +23 -0
- package/src/server/github/large-collection.ts +48 -0
- package/src/server/github/webhook-response.ts +81 -0
- package/src/server/github/webhook.ts +1013 -0
- package/src/server/http.ts +56 -0
- package/src/server/index.ts +57 -0
- package/src/server/media/media.ts +884 -0
- package/src/server/media/preview.ts +145 -0
- package/src/server/media/provider.ts +722 -0
- package/src/server/repository/activity.ts +20 -0
- package/src/server/repository/branches.ts +35 -0
- package/src/server/repository/provider.ts +237 -0
- package/src/server/repository/repositories.ts +340 -0
- package/src/server/request-body.ts +33 -0
- package/src/server/routes/account.ts +107 -0
- package/src/server/routes/actions.ts +65 -0
- package/src/server/routes/activity.ts +17 -0
- package/src/server/routes/admin.ts +46 -0
- package/src/server/routes/app-version.ts +51 -0
- package/src/server/routes/auth.ts +35 -0
- package/src/server/routes/cache.ts +41 -0
- package/src/server/routes/collaborators.ts +32 -0
- package/src/server/routes/configuration.ts +35 -0
- package/src/server/routes/entries.ts +103 -0
- package/src/server/routes/health.ts +78 -0
- package/src/server/routes/index.ts +154 -0
- package/src/server/routes/media.ts +95 -0
- package/src/server/routes/plugin-request.ts +110 -0
- package/src/server/routes/plugins.ts +30 -0
- package/src/server/routes/repositories.ts +68 -0
- package/src/server/routes/shared.ts +109 -0
- package/src/server/routes/webhooks.ts +11 -0
- package/src/server/runtime/runtime-ports.ts +7 -0
- package/src/server/runtime-config.ts +284 -0
- package/src/server/services/account-language.ts +21 -0
- package/src/server/services/account.ts +145 -0
- package/src/server/services/actions.ts +361 -0
- package/src/server/services/activity.ts +339 -0
- package/src/server/services/admin.ts +106 -0
- package/src/server/services/authentication-state.ts +58 -0
- package/src/server/services/cache-management.ts +165 -0
- package/src/server/services/cache.ts +100 -0
- package/src/server/services/collaborators.ts +138 -0
- package/src/server/services/configuration-editor.ts +272 -0
- package/src/server/services/configuration.ts +102 -0
- package/src/server/services/content.ts +598 -0
- package/src/server/services/context.ts +91 -0
- package/src/server/services/dashboard.ts +74 -0
- package/src/server/services/entry-translations.ts +44 -0
- package/src/server/services/errors.ts +159 -0
- package/src/server/services/index.ts +48 -0
- package/src/server/services/local-account-data.ts +91 -0
- package/src/server/services/media.ts +507 -0
- package/src/server/services/reference.ts +39 -0
- package/src/server/services/repository.ts +188 -0
- package/src/shadcn-tailwind.css +674 -0
- package/src/shared/account-preferences.ts +55 -0
- package/src/shared/application-operations.ts +40 -0
- package/src/shared/collection-presentation.ts +32 -0
- package/src/shared/configuration-compatibility.ts +192 -0
- package/src/shared/configuration-components.ts +98 -0
- package/src/shared/configuration-content.ts +120 -0
- package/src/shared/configuration-discovery.ts +111 -0
- package/src/shared/configuration-names.ts +52 -0
- package/src/shared/configuration-navigation.ts +166 -0
- package/src/shared/configuration-schema.ts +1257 -0
- package/src/shared/configuration-settings.ts +22 -0
- package/src/shared/configuration-source.ts +186 -0
- package/src/shared/configuration-yaml.ts +206 -0
- package/src/shared/configuration.ts +296 -0
- package/src/shared/content-conflict.ts +6 -0
- package/src/shared/content-serialization.ts +252 -0
- package/src/shared/field-validation-error.ts +32 -0
- package/src/shared/git-path.ts +68 -0
- package/src/shared/json.ts +30 -0
- package/src/shared/media-error.ts +23 -0
- package/src/shared/repository-search.ts +43 -0
- package/src/shared/repository-templates.ts +22 -0
- package/src/shared/requests/account.ts +37 -0
- package/src/shared/requests/action.ts +169 -0
- package/src/shared/requests/activity.ts +31 -0
- package/src/shared/requests/admin.ts +98 -0
- package/src/shared/requests/branch.ts +25 -0
- package/src/shared/requests/cache.ts +62 -0
- package/src/shared/requests/collaborator.ts +49 -0
- package/src/shared/requests/collection.ts +32 -0
- package/src/shared/requests/configuration.ts +41 -0
- package/src/shared/requests/entry-write.ts +221 -0
- package/src/shared/requests/entry.ts +35 -0
- package/src/shared/requests/fixed-file.ts +29 -0
- package/src/shared/requests/local-account.ts +5 -0
- package/src/shared/requests/media.ts +215 -0
- package/src/shared/requests/reference.ts +51 -0
- package/src/shared/requests/repository-template.ts +32 -0
- package/src/shared/requests/repository.ts +28 -0
- package/src/shared/requests/ui-language.ts +15 -0
- package/src/shared/sign-in-allowlist.ts +77 -0
- package/src/shared/yaml-aliases.ts +25 -0
- package/src/styles.css +453 -0
|
@@ -0,0 +1,1257 @@
|
|
|
1
|
+
import { isRecord } from '#/shared/json'
|
|
2
|
+
import { filenamePathIssue, filenameTemplatePath } from '#/lib/content-filename'
|
|
3
|
+
import { ICON_NAME_PATTERN } from '#/lib/icon-name'
|
|
4
|
+
import { configurationNameIssues } from '#/shared/configuration-names'
|
|
5
|
+
import { RepositoryI18nSchema, ContentI18nSchema } from '#/lib/i18n-schema'
|
|
6
|
+
import { normalizeConfiguration } from '#/shared/configuration'
|
|
7
|
+
/**
|
|
8
|
+
* The Zod schema for the configuration file. Used in the settings editor.
|
|
9
|
+
*
|
|
10
|
+
* Look at the `lib/config.ts` file to understand how we use this schema.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { z } from 'zod'
|
|
14
|
+
import type { ZodType } from 'zod'
|
|
15
|
+
|
|
16
|
+
import { normalizeGitPath } from '#/shared/git-path'
|
|
17
|
+
import { customFieldDefinition } from '#/fields/registry'
|
|
18
|
+
import clientDeployment from '#pagescms/deployment/client'
|
|
19
|
+
import type { ConfigurationSchemaContribution } from '#/plugins/client'
|
|
20
|
+
|
|
21
|
+
const fieldTypes = new Set([
|
|
22
|
+
'boolean',
|
|
23
|
+
'code',
|
|
24
|
+
'date',
|
|
25
|
+
'file',
|
|
26
|
+
'image',
|
|
27
|
+
'number',
|
|
28
|
+
'reference',
|
|
29
|
+
'rich-text',
|
|
30
|
+
'select',
|
|
31
|
+
'string',
|
|
32
|
+
'text',
|
|
33
|
+
'uuid',
|
|
34
|
+
])
|
|
35
|
+
|
|
36
|
+
function hasLocalization(value: unknown): boolean {
|
|
37
|
+
if (Array.isArray(value)) return value.some(hasLocalization)
|
|
38
|
+
if (!isRecord(value)) return false
|
|
39
|
+
if (value.i18n !== undefined || value.localized !== undefined) return true
|
|
40
|
+
if (
|
|
41
|
+
['content', 'items', 'fields', 'blocks'].some((key) =>
|
|
42
|
+
hasLocalization(value[key]),
|
|
43
|
+
)
|
|
44
|
+
)
|
|
45
|
+
return true
|
|
46
|
+
return (
|
|
47
|
+
isRecord(value.components) &&
|
|
48
|
+
Object.values(value.components).some(hasLocalization)
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function configurationLocalizationIssue(configuration: unknown) {
|
|
53
|
+
if (!hasLocalization(configuration)) return undefined
|
|
54
|
+
try {
|
|
55
|
+
normalizeConfiguration(configuration)
|
|
56
|
+
return undefined
|
|
57
|
+
} catch (error) {
|
|
58
|
+
return {
|
|
59
|
+
code: 'custom' as const,
|
|
60
|
+
message:
|
|
61
|
+
error instanceof Error
|
|
62
|
+
? error.message
|
|
63
|
+
: 'Invalid localization configuration',
|
|
64
|
+
path: ['i18n'],
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Source validation applies runtime checks to the authored configuration.
|
|
70
|
+
const configurationShapeSchemas = new WeakMap<ZodType, ZodType>()
|
|
71
|
+
|
|
72
|
+
export function configurationShapeSchema(schema: ZodType) {
|
|
73
|
+
return configurationShapeSchemas.get(schema) ?? schema
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isSafeGitPath(value: string) {
|
|
77
|
+
try {
|
|
78
|
+
normalizeGitPath(value)
|
|
79
|
+
return true
|
|
80
|
+
} catch {
|
|
81
|
+
return false
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const ConfigurationIconSchema = z
|
|
86
|
+
.string()
|
|
87
|
+
.regex(ICON_NAME_PATTERN, {
|
|
88
|
+
message:
|
|
89
|
+
"'icon' must be a Hugeicons name, with or without the Icon suffix (e.g. News01 or News01Icon).",
|
|
90
|
+
})
|
|
91
|
+
.optional()
|
|
92
|
+
|
|
93
|
+
const ActionSchema = z
|
|
94
|
+
.object({
|
|
95
|
+
name: z
|
|
96
|
+
.string({
|
|
97
|
+
error: (issue) =>
|
|
98
|
+
issue.input === undefined
|
|
99
|
+
? "'name' is required."
|
|
100
|
+
: "'name' must be a string.",
|
|
101
|
+
})
|
|
102
|
+
.regex(/^[a-zA-Z0-9-_]+$/, {
|
|
103
|
+
message: "'name' must be alphanumeric with dashes and underscores.",
|
|
104
|
+
}),
|
|
105
|
+
label: z.string({
|
|
106
|
+
error: (issue) =>
|
|
107
|
+
issue.input === undefined
|
|
108
|
+
? "'label' is required."
|
|
109
|
+
: "'label' must be a string.",
|
|
110
|
+
}),
|
|
111
|
+
icon: ConfigurationIconSchema,
|
|
112
|
+
workflow: z.string({
|
|
113
|
+
error: (issue) =>
|
|
114
|
+
issue.input === undefined
|
|
115
|
+
? "'workflow' is required."
|
|
116
|
+
: "'workflow' must be a string.",
|
|
117
|
+
}),
|
|
118
|
+
ref: z
|
|
119
|
+
.string({
|
|
120
|
+
message: "'ref' must be a string.",
|
|
121
|
+
})
|
|
122
|
+
.optional(),
|
|
123
|
+
cancelable: z
|
|
124
|
+
.boolean({
|
|
125
|
+
message: "'cancelable' must be a boolean.",
|
|
126
|
+
})
|
|
127
|
+
.optional(),
|
|
128
|
+
scope: z
|
|
129
|
+
.enum(['collection', 'entry', 'sidebar', 'overview'], {
|
|
130
|
+
message:
|
|
131
|
+
"'scope' must be 'collection', 'entry', 'sidebar', or 'overview'.",
|
|
132
|
+
})
|
|
133
|
+
.optional(),
|
|
134
|
+
confirm: z
|
|
135
|
+
.union([
|
|
136
|
+
z.boolean({
|
|
137
|
+
message: "'confirm' must be a boolean or an object.",
|
|
138
|
+
}),
|
|
139
|
+
z
|
|
140
|
+
.object({
|
|
141
|
+
title: z.string().optional(),
|
|
142
|
+
message: z.string().optional(),
|
|
143
|
+
button: z.string().optional(),
|
|
144
|
+
})
|
|
145
|
+
.strict(),
|
|
146
|
+
])
|
|
147
|
+
.optional(),
|
|
148
|
+
fields: z
|
|
149
|
+
.array(
|
|
150
|
+
z
|
|
151
|
+
.object({
|
|
152
|
+
name: z
|
|
153
|
+
.string({
|
|
154
|
+
error: (issue) =>
|
|
155
|
+
issue.input === undefined
|
|
156
|
+
? "'fields[].name' is required."
|
|
157
|
+
: "'fields[].name' must be a string.",
|
|
158
|
+
})
|
|
159
|
+
.regex(/^[a-zA-Z0-9-_]+$/, {
|
|
160
|
+
message:
|
|
161
|
+
"'fields[].name' must be alphanumeric with dashes and underscores.",
|
|
162
|
+
}),
|
|
163
|
+
label: z.string({
|
|
164
|
+
error: (issue) =>
|
|
165
|
+
issue.input === undefined
|
|
166
|
+
? "'fields[].label' is required."
|
|
167
|
+
: "'fields[].label' must be a string.",
|
|
168
|
+
}),
|
|
169
|
+
type: z.enum(['text', 'textarea', 'select', 'checkbox', 'number'], {
|
|
170
|
+
message:
|
|
171
|
+
"'fields[].type' must be 'text', 'textarea', 'select', 'checkbox', or 'number'.",
|
|
172
|
+
}),
|
|
173
|
+
required: z.boolean().optional(),
|
|
174
|
+
default: z.union([z.string(), z.number(), z.boolean()]).optional(),
|
|
175
|
+
options: z
|
|
176
|
+
.array(
|
|
177
|
+
z
|
|
178
|
+
.object({
|
|
179
|
+
label: z.string(),
|
|
180
|
+
value: z.string(),
|
|
181
|
+
})
|
|
182
|
+
.strict(),
|
|
183
|
+
)
|
|
184
|
+
.optional(),
|
|
185
|
+
})
|
|
186
|
+
.strict()
|
|
187
|
+
.superRefine((field, ctx) => {
|
|
188
|
+
if (
|
|
189
|
+
field.type === 'select' &&
|
|
190
|
+
(!field.options || field.options.length === 0)
|
|
191
|
+
) {
|
|
192
|
+
ctx.addIssue({
|
|
193
|
+
code: 'custom',
|
|
194
|
+
message: "'fields[].options' is required for select fields.",
|
|
195
|
+
path: ['options'],
|
|
196
|
+
})
|
|
197
|
+
}
|
|
198
|
+
if (field.type !== 'select' && field.options) {
|
|
199
|
+
ctx.addIssue({
|
|
200
|
+
code: 'custom',
|
|
201
|
+
message:
|
|
202
|
+
"'fields[].options' is only allowed for select fields.",
|
|
203
|
+
path: ['options'],
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
}),
|
|
207
|
+
{
|
|
208
|
+
message: "'fields' must be an array of action field definitions.",
|
|
209
|
+
},
|
|
210
|
+
)
|
|
211
|
+
.optional(),
|
|
212
|
+
})
|
|
213
|
+
.strict()
|
|
214
|
+
|
|
215
|
+
const CommitTemplatesSchema = z
|
|
216
|
+
.object({
|
|
217
|
+
create: z
|
|
218
|
+
.string({
|
|
219
|
+
message: "'create' must be a string.",
|
|
220
|
+
})
|
|
221
|
+
.optional(),
|
|
222
|
+
update: z
|
|
223
|
+
.string({
|
|
224
|
+
message: "'update' must be a string.",
|
|
225
|
+
})
|
|
226
|
+
.optional(),
|
|
227
|
+
delete: z
|
|
228
|
+
.string({
|
|
229
|
+
message: "'delete' must be a string.",
|
|
230
|
+
})
|
|
231
|
+
.optional(),
|
|
232
|
+
rename: z
|
|
233
|
+
.string({
|
|
234
|
+
message: "'rename' must be a string.",
|
|
235
|
+
})
|
|
236
|
+
.optional(),
|
|
237
|
+
})
|
|
238
|
+
.strict()
|
|
239
|
+
|
|
240
|
+
const CommitIdentitySchema = z.enum(['app', 'user'], {
|
|
241
|
+
message: "'identity' must be either 'app' or 'user'.",
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
// Media configuration object schema (for single object)
|
|
245
|
+
const MediaConfigObject = z
|
|
246
|
+
.object({
|
|
247
|
+
input: z
|
|
248
|
+
.string({
|
|
249
|
+
message: "'input' is required.",
|
|
250
|
+
})
|
|
251
|
+
.regex(/^(?:[^/](?:.*[^/])?)?$/, {
|
|
252
|
+
message:
|
|
253
|
+
"'input' must be a valid relative path (no leading or trailing slash).",
|
|
254
|
+
})
|
|
255
|
+
.refine(isSafeGitPath, {
|
|
256
|
+
message: "'input' cannot escape the repository root.",
|
|
257
|
+
}),
|
|
258
|
+
output: z
|
|
259
|
+
.string({
|
|
260
|
+
message: "'output' is required.",
|
|
261
|
+
})
|
|
262
|
+
.regex(/^(?:\/?[^/](?:.*[^/])?|\/?)$/, {
|
|
263
|
+
message: "'output' must be a valid path with no trailing slash.",
|
|
264
|
+
}),
|
|
265
|
+
path: z
|
|
266
|
+
.string()
|
|
267
|
+
.regex(/^(?:[^/](?:.*[^/])?)?$/, {
|
|
268
|
+
message:
|
|
269
|
+
"'path' must be a valid relative path (no leading or trailing slash).",
|
|
270
|
+
})
|
|
271
|
+
.refine(isSafeGitPath, {
|
|
272
|
+
message: "'path' cannot escape the repository root.",
|
|
273
|
+
})
|
|
274
|
+
.optional(),
|
|
275
|
+
extensions: z
|
|
276
|
+
.array(
|
|
277
|
+
z.string({
|
|
278
|
+
message: "Entries in the 'extensions' array must be strings.",
|
|
279
|
+
}),
|
|
280
|
+
{
|
|
281
|
+
message: "'extensions' must be an array of strings.",
|
|
282
|
+
},
|
|
283
|
+
)
|
|
284
|
+
.optional(),
|
|
285
|
+
categories: z
|
|
286
|
+
.array(
|
|
287
|
+
z.enum(
|
|
288
|
+
[
|
|
289
|
+
'image',
|
|
290
|
+
'document',
|
|
291
|
+
'video',
|
|
292
|
+
'audio',
|
|
293
|
+
'compressed',
|
|
294
|
+
'code',
|
|
295
|
+
'font',
|
|
296
|
+
'spreadsheet',
|
|
297
|
+
],
|
|
298
|
+
{
|
|
299
|
+
message:
|
|
300
|
+
"Entries in the 'categories' array must be 'image', 'document', 'video', 'audio', 'compressed', 'code', 'font', or 'spreadsheet'.",
|
|
301
|
+
},
|
|
302
|
+
),
|
|
303
|
+
{
|
|
304
|
+
message: "'categories' must be an array of strings.",
|
|
305
|
+
},
|
|
306
|
+
)
|
|
307
|
+
.optional(),
|
|
308
|
+
rename: z
|
|
309
|
+
.union([
|
|
310
|
+
z.boolean({
|
|
311
|
+
message: "'rename' must be a boolean, 'safe', or 'random'.",
|
|
312
|
+
}),
|
|
313
|
+
z.enum(['safe', 'random'], {
|
|
314
|
+
message: "'rename' must be a boolean, 'safe', or 'random'.",
|
|
315
|
+
}),
|
|
316
|
+
])
|
|
317
|
+
.optional(),
|
|
318
|
+
commit: z
|
|
319
|
+
.object(
|
|
320
|
+
{
|
|
321
|
+
templates: CommitTemplatesSchema.optional(),
|
|
322
|
+
identity: CommitIdentitySchema.optional(),
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
message: "'commit' must be an object.",
|
|
326
|
+
},
|
|
327
|
+
)
|
|
328
|
+
.optional(),
|
|
329
|
+
name: z.string().optional(),
|
|
330
|
+
label: z.string().optional(),
|
|
331
|
+
icon: ConfigurationIconSchema,
|
|
332
|
+
actions: z
|
|
333
|
+
.array(ActionSchema, {
|
|
334
|
+
message: "'actions' must be an array of action definitions.",
|
|
335
|
+
})
|
|
336
|
+
.optional(),
|
|
337
|
+
})
|
|
338
|
+
.strict()
|
|
339
|
+
|
|
340
|
+
// Schema for list attribute (used in both field and content entries)
|
|
341
|
+
const ListSchema = z.union([
|
|
342
|
+
z.boolean(),
|
|
343
|
+
z
|
|
344
|
+
.object(
|
|
345
|
+
{
|
|
346
|
+
min: z
|
|
347
|
+
.number()
|
|
348
|
+
.min(0, "'min' must be a positive integer (minimum 0).")
|
|
349
|
+
.optional(),
|
|
350
|
+
max: z
|
|
351
|
+
.number()
|
|
352
|
+
.min(1, "'max' must be a positive integer (minimum 1).")
|
|
353
|
+
.optional(),
|
|
354
|
+
collapsible: z
|
|
355
|
+
.union([
|
|
356
|
+
z.boolean(),
|
|
357
|
+
z.object(
|
|
358
|
+
{
|
|
359
|
+
collapsed: z.boolean().optional(),
|
|
360
|
+
summary: z.string().optional(),
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
message:
|
|
364
|
+
"'collapsible' must be either a boolean or an object with 'collapsed' and 'summary' properties.",
|
|
365
|
+
},
|
|
366
|
+
),
|
|
367
|
+
])
|
|
368
|
+
.optional(),
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
message:
|
|
372
|
+
"'list' must be either a boolean or an object with 'min' and 'max' properties.",
|
|
373
|
+
},
|
|
374
|
+
)
|
|
375
|
+
.strict(),
|
|
376
|
+
])
|
|
377
|
+
|
|
378
|
+
const FilenameConfigurationSchema = z.union([
|
|
379
|
+
z.string({
|
|
380
|
+
message: "'filename' must be a string or an object.",
|
|
381
|
+
}),
|
|
382
|
+
z
|
|
383
|
+
.object(
|
|
384
|
+
{
|
|
385
|
+
template: z.string({
|
|
386
|
+
error: (issue) =>
|
|
387
|
+
issue.input === undefined
|
|
388
|
+
? "'template' is required."
|
|
389
|
+
: "'template' must be a string.",
|
|
390
|
+
}),
|
|
391
|
+
field: z
|
|
392
|
+
.union([
|
|
393
|
+
z.boolean({
|
|
394
|
+
message: "'field' must be a boolean or 'create'.",
|
|
395
|
+
}),
|
|
396
|
+
z.enum(['create'], {
|
|
397
|
+
message: "'field' must be a boolean or 'create'.",
|
|
398
|
+
}),
|
|
399
|
+
])
|
|
400
|
+
.optional(),
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
message:
|
|
404
|
+
"'filename' object must contain 'template' and optionally 'field'.",
|
|
405
|
+
},
|
|
406
|
+
)
|
|
407
|
+
.strict(),
|
|
408
|
+
])
|
|
409
|
+
|
|
410
|
+
const ContentOperationsSchema = z
|
|
411
|
+
.object({
|
|
412
|
+
create: z
|
|
413
|
+
.boolean({
|
|
414
|
+
message: "'operations.create' must be a boolean.",
|
|
415
|
+
})
|
|
416
|
+
.optional(),
|
|
417
|
+
rename: z
|
|
418
|
+
.boolean({
|
|
419
|
+
message: "'operations.rename' must be a boolean.",
|
|
420
|
+
})
|
|
421
|
+
.optional(),
|
|
422
|
+
delete: z
|
|
423
|
+
.boolean({
|
|
424
|
+
message: "'operations.delete' must be a boolean.",
|
|
425
|
+
})
|
|
426
|
+
.optional(),
|
|
427
|
+
})
|
|
428
|
+
.strict()
|
|
429
|
+
|
|
430
|
+
// Generator for Field Object Schema (components do not have a `name` field)
|
|
431
|
+
const generateFieldObjectSchema = (
|
|
432
|
+
isComponent?: boolean,
|
|
433
|
+
isBlock?: boolean,
|
|
434
|
+
): z.ZodType => {
|
|
435
|
+
let baseObjectSchema = {
|
|
436
|
+
label: z
|
|
437
|
+
.union([
|
|
438
|
+
z.literal(false),
|
|
439
|
+
z.string({
|
|
440
|
+
message: "'label' must be a string or 'false'.",
|
|
441
|
+
}),
|
|
442
|
+
])
|
|
443
|
+
.optional(),
|
|
444
|
+
description: z.string().optional().nullable(),
|
|
445
|
+
component: z
|
|
446
|
+
.string({
|
|
447
|
+
error: "'component' must be a string.",
|
|
448
|
+
})
|
|
449
|
+
.regex(/^[a-zA-Z0-9-_]+$/, {
|
|
450
|
+
message:
|
|
451
|
+
'Component key must be alphanumeric with dashes and underscores.',
|
|
452
|
+
})
|
|
453
|
+
.optional(),
|
|
454
|
+
default: z.any().nullable().optional(),
|
|
455
|
+
localized: z.boolean().optional(),
|
|
456
|
+
fields: z
|
|
457
|
+
.array(
|
|
458
|
+
z.lazy(() => generateFieldObjectSchema()),
|
|
459
|
+
{ message: "'fields' must be an array of field definitions." },
|
|
460
|
+
)
|
|
461
|
+
.optional(),
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if (!isComponent) {
|
|
465
|
+
baseObjectSchema = {
|
|
466
|
+
...{
|
|
467
|
+
name: z
|
|
468
|
+
.string({
|
|
469
|
+
error: (issue) =>
|
|
470
|
+
issue.input === undefined
|
|
471
|
+
? "'name' is required."
|
|
472
|
+
: "'name' must be a string.",
|
|
473
|
+
})
|
|
474
|
+
.regex(/^[a-zA-Z0-9-_]+$/, {
|
|
475
|
+
message: "'name' must be alphanumeric with dashes and underscores.",
|
|
476
|
+
}),
|
|
477
|
+
},
|
|
478
|
+
...baseObjectSchema,
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (!isBlock) {
|
|
483
|
+
baseObjectSchema = {
|
|
484
|
+
...{
|
|
485
|
+
type: z
|
|
486
|
+
.string({
|
|
487
|
+
error: "'type' must be a string.",
|
|
488
|
+
})
|
|
489
|
+
.min(1, { message: "'type' cannot be empty." })
|
|
490
|
+
.refine(
|
|
491
|
+
(val) =>
|
|
492
|
+
fieldTypes.has(val) ||
|
|
493
|
+
['object', 'block'].includes(val) ||
|
|
494
|
+
Boolean(customFieldDefinition(val)),
|
|
495
|
+
{
|
|
496
|
+
message: "'type' must be a valid field type.",
|
|
497
|
+
path: ['type'],
|
|
498
|
+
},
|
|
499
|
+
)
|
|
500
|
+
.optional(),
|
|
501
|
+
list: ListSchema.optional(),
|
|
502
|
+
hidden: z
|
|
503
|
+
.boolean({
|
|
504
|
+
message: "'hidden' must be a boolean.",
|
|
505
|
+
})
|
|
506
|
+
.optional()
|
|
507
|
+
.nullable(),
|
|
508
|
+
readonly: z
|
|
509
|
+
.boolean({
|
|
510
|
+
message: "'readonly' must be a boolean.",
|
|
511
|
+
})
|
|
512
|
+
.optional()
|
|
513
|
+
.nullable(),
|
|
514
|
+
required: z
|
|
515
|
+
.boolean({
|
|
516
|
+
message: "'required' must be a boolean.",
|
|
517
|
+
})
|
|
518
|
+
.optional()
|
|
519
|
+
.nullable(),
|
|
520
|
+
pattern: z
|
|
521
|
+
.union([
|
|
522
|
+
z.string({
|
|
523
|
+
message: "'pattern' must be a valid regex string.",
|
|
524
|
+
}),
|
|
525
|
+
z
|
|
526
|
+
.object(
|
|
527
|
+
{
|
|
528
|
+
regex: z.string({
|
|
529
|
+
error: (issue) =>
|
|
530
|
+
issue.input === undefined
|
|
531
|
+
? "'regex' is required."
|
|
532
|
+
: "'regex' must be a valid regex string.",
|
|
533
|
+
}),
|
|
534
|
+
message: z
|
|
535
|
+
.string({
|
|
536
|
+
message: "'message' must be a string.",
|
|
537
|
+
})
|
|
538
|
+
.optional(),
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
message:
|
|
542
|
+
"'pattern' must be a string (regex) or an object with 'regex' and optionally 'message' properties.",
|
|
543
|
+
},
|
|
544
|
+
)
|
|
545
|
+
.strict(),
|
|
546
|
+
])
|
|
547
|
+
.optional(),
|
|
548
|
+
options: z
|
|
549
|
+
.object({
|
|
550
|
+
preserve: z
|
|
551
|
+
.array(
|
|
552
|
+
z.union([
|
|
553
|
+
z.literal('hugo-shortcodes'),
|
|
554
|
+
z
|
|
555
|
+
.object({
|
|
556
|
+
start: z.string().min(1),
|
|
557
|
+
end: z.string().min(1),
|
|
558
|
+
})
|
|
559
|
+
.strict(),
|
|
560
|
+
]),
|
|
561
|
+
)
|
|
562
|
+
.optional(),
|
|
563
|
+
snippets: z
|
|
564
|
+
.array(
|
|
565
|
+
z
|
|
566
|
+
.object({
|
|
567
|
+
label: z.string().trim().min(1),
|
|
568
|
+
source: z
|
|
569
|
+
.string()
|
|
570
|
+
.refine(
|
|
571
|
+
(value) => value.trim().length > 0,
|
|
572
|
+
'Snippet source cannot be empty.',
|
|
573
|
+
),
|
|
574
|
+
format: z.enum(['html', 'markdown']).optional(),
|
|
575
|
+
})
|
|
576
|
+
.strict(),
|
|
577
|
+
)
|
|
578
|
+
.optional(),
|
|
579
|
+
html: z
|
|
580
|
+
.object({
|
|
581
|
+
keep: z.array(z.string().min(1)).optional(),
|
|
582
|
+
strip: z.array(z.string().min(1)).optional(),
|
|
583
|
+
drop: z.array(z.string().min(1)).optional(),
|
|
584
|
+
attributes: z
|
|
585
|
+
.array(z.string().regex(/^[a-z][a-z0-9-]*$/))
|
|
586
|
+
.optional(),
|
|
587
|
+
})
|
|
588
|
+
.strict()
|
|
589
|
+
.optional(),
|
|
590
|
+
})
|
|
591
|
+
.loose()
|
|
592
|
+
.optional()
|
|
593
|
+
.nullable(),
|
|
594
|
+
blocks: z
|
|
595
|
+
.array(
|
|
596
|
+
z.lazy(() => generateFieldObjectSchema(false, true)),
|
|
597
|
+
{ message: "'blocks' must be an array of field definitions." },
|
|
598
|
+
)
|
|
599
|
+
.optional(),
|
|
600
|
+
blockKey: z
|
|
601
|
+
.string({
|
|
602
|
+
message: "'blockKey' must be a string.",
|
|
603
|
+
})
|
|
604
|
+
.min(1, {
|
|
605
|
+
message: "'blockKey' cannot be empty.",
|
|
606
|
+
})
|
|
607
|
+
.optional(),
|
|
608
|
+
},
|
|
609
|
+
...baseObjectSchema,
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
return z.lazy(() =>
|
|
614
|
+
z
|
|
615
|
+
.object(baseObjectSchema)
|
|
616
|
+
.strict()
|
|
617
|
+
.superRefine((data: unknown, ctx: z.RefinementCtx) => {
|
|
618
|
+
if (!isRecord(data)) return
|
|
619
|
+
if (!isBlock) {
|
|
620
|
+
const hasType = data.type !== undefined
|
|
621
|
+
const hasComponent = data.component !== undefined
|
|
622
|
+
if (hasType === hasComponent) {
|
|
623
|
+
ctx.addIssue({
|
|
624
|
+
code: 'custom',
|
|
625
|
+
message: "Field must have exactly one of 'type' or 'component'.",
|
|
626
|
+
path: ['type', 'component'],
|
|
627
|
+
})
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
if (data.type === 'block' && data.blocks === undefined) {
|
|
632
|
+
ctx.addIssue({
|
|
633
|
+
code: 'custom',
|
|
634
|
+
message: "Fields with type 'block' must have a 'blocks' attribute.",
|
|
635
|
+
path: ['blocks'],
|
|
636
|
+
})
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
if (data.type === 'object' && data.fields === undefined) {
|
|
640
|
+
ctx.addIssue({
|
|
641
|
+
code: 'custom',
|
|
642
|
+
message:
|
|
643
|
+
"Fields with type 'object' must have a 'fields' attribute.",
|
|
644
|
+
path: ['fields'],
|
|
645
|
+
})
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (
|
|
649
|
+
isBlock &&
|
|
650
|
+
data.fields === undefined &&
|
|
651
|
+
data.component === undefined
|
|
652
|
+
) {
|
|
653
|
+
ctx.addIssue({
|
|
654
|
+
code: 'custom',
|
|
655
|
+
message:
|
|
656
|
+
"Blocks must have a 'fields' attribute or inherit one from a component.",
|
|
657
|
+
path: ['fields', 'component'],
|
|
658
|
+
})
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
if (data.blockKey !== undefined && data.type !== 'block') {
|
|
662
|
+
ctx.addIssue({
|
|
663
|
+
code: 'custom',
|
|
664
|
+
message:
|
|
665
|
+
"'blockKey' attribute is only valid when 'type' is 'block'.",
|
|
666
|
+
path: ['blockKey'],
|
|
667
|
+
})
|
|
668
|
+
}
|
|
669
|
+
}),
|
|
670
|
+
)
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
const ContentLeafSchema = z
|
|
674
|
+
.object({
|
|
675
|
+
name: z
|
|
676
|
+
.string({
|
|
677
|
+
error: (issue) =>
|
|
678
|
+
issue.input === undefined
|
|
679
|
+
? "'name' is required."
|
|
680
|
+
: "'name' must be a string.",
|
|
681
|
+
})
|
|
682
|
+
.regex(/^[a-zA-Z0-9-_]+$/, {
|
|
683
|
+
message: "'name' must be alphanumeric with dashes and underscores.",
|
|
684
|
+
}),
|
|
685
|
+
label: z.string().optional(),
|
|
686
|
+
icon: ConfigurationIconSchema,
|
|
687
|
+
description: z.string().optional().nullable(),
|
|
688
|
+
type: z.enum(['collection', 'file'], {
|
|
689
|
+
error: (issue) =>
|
|
690
|
+
issue.input === undefined
|
|
691
|
+
? "'type' is required."
|
|
692
|
+
: "'type' must be either 'collection' or 'file'.",
|
|
693
|
+
}),
|
|
694
|
+
path: z
|
|
695
|
+
.string({
|
|
696
|
+
error: (issue) =>
|
|
697
|
+
issue.input === undefined
|
|
698
|
+
? "'path' is required."
|
|
699
|
+
: "'path' must be a string.",
|
|
700
|
+
})
|
|
701
|
+
.regex(/^(?:[^/](?:.*[^/])?)?$/, {
|
|
702
|
+
message:
|
|
703
|
+
"'path' must be a valid relative path (no leading or trailing slash).",
|
|
704
|
+
})
|
|
705
|
+
.refine(isSafeGitPath, {
|
|
706
|
+
message: "'path' cannot escape the repository root.",
|
|
707
|
+
}),
|
|
708
|
+
large: z.boolean().optional(),
|
|
709
|
+
create: z
|
|
710
|
+
.object({ label: z.string().trim().min(1) })
|
|
711
|
+
.strict()
|
|
712
|
+
.optional(),
|
|
713
|
+
operations: z.union([ContentOperationsSchema, z.literal(false)]).optional(),
|
|
714
|
+
filename: FilenameConfigurationSchema.optional().nullable(),
|
|
715
|
+
exclude: z
|
|
716
|
+
.array(
|
|
717
|
+
z.string({
|
|
718
|
+
message: "Entries in the 'exclude' array must be strings.",
|
|
719
|
+
}),
|
|
720
|
+
{
|
|
721
|
+
message: "'exclude' must be an array of strings.",
|
|
722
|
+
},
|
|
723
|
+
)
|
|
724
|
+
.optional(),
|
|
725
|
+
view: z
|
|
726
|
+
.object(
|
|
727
|
+
{
|
|
728
|
+
layout: z
|
|
729
|
+
.enum(['tree', 'list'], {
|
|
730
|
+
message: "'layout' must be either 'tree' or 'list'.",
|
|
731
|
+
})
|
|
732
|
+
.optional(),
|
|
733
|
+
foldersFirst: z
|
|
734
|
+
.boolean({
|
|
735
|
+
message: "'foldersFirst' must be a boolean.",
|
|
736
|
+
})
|
|
737
|
+
.optional()
|
|
738
|
+
.nullable(),
|
|
739
|
+
node: z
|
|
740
|
+
.union(
|
|
741
|
+
[
|
|
742
|
+
z.object(
|
|
743
|
+
{
|
|
744
|
+
filename: z.string({
|
|
745
|
+
error: (issue) =>
|
|
746
|
+
issue.input === undefined
|
|
747
|
+
? "'filename' is required."
|
|
748
|
+
: "'filename' must be a string.",
|
|
749
|
+
}),
|
|
750
|
+
hideDirs: z
|
|
751
|
+
.enum(['all', 'nodes', 'others'], {
|
|
752
|
+
message:
|
|
753
|
+
"'hideDirs' must be one of 'nodes', 'others', or 'all'.",
|
|
754
|
+
})
|
|
755
|
+
.optional(),
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
message:
|
|
759
|
+
"'node' must contain 'filename' and optionally 'hideDirs'.",
|
|
760
|
+
},
|
|
761
|
+
),
|
|
762
|
+
z.string({
|
|
763
|
+
message:
|
|
764
|
+
"'node' must be a string or an object with 'filename' and optionally 'hideDirs' attributes.",
|
|
765
|
+
}),
|
|
766
|
+
],
|
|
767
|
+
{
|
|
768
|
+
message:
|
|
769
|
+
"'node' must be a string or an object with 'filename' and 'hideDirs'.",
|
|
770
|
+
},
|
|
771
|
+
)
|
|
772
|
+
.optional(),
|
|
773
|
+
fields: z
|
|
774
|
+
.array(
|
|
775
|
+
z.string({
|
|
776
|
+
message: "Entries in the 'fields' array must be strings.",
|
|
777
|
+
}),
|
|
778
|
+
{
|
|
779
|
+
message: "'fields' must be an array of strings.",
|
|
780
|
+
},
|
|
781
|
+
)
|
|
782
|
+
.optional(),
|
|
783
|
+
primary: z
|
|
784
|
+
.string({
|
|
785
|
+
message: "'primary' must be a string.",
|
|
786
|
+
})
|
|
787
|
+
.optional()
|
|
788
|
+
.nullable(),
|
|
789
|
+
sort: z
|
|
790
|
+
.array(
|
|
791
|
+
z.string({
|
|
792
|
+
message: "Entries in the 'sort' array must be strings.",
|
|
793
|
+
}),
|
|
794
|
+
{
|
|
795
|
+
message: "'sort' must be an array of strings.",
|
|
796
|
+
},
|
|
797
|
+
)
|
|
798
|
+
.optional(),
|
|
799
|
+
search: z
|
|
800
|
+
.array(
|
|
801
|
+
z.string({
|
|
802
|
+
message: "Entries in the 'search' array must be strings.",
|
|
803
|
+
}),
|
|
804
|
+
{
|
|
805
|
+
message: "'search' must be an array of strings.",
|
|
806
|
+
},
|
|
807
|
+
)
|
|
808
|
+
.optional(),
|
|
809
|
+
default: z
|
|
810
|
+
.object(
|
|
811
|
+
{
|
|
812
|
+
search: z
|
|
813
|
+
.string({
|
|
814
|
+
message: "'search' must be a string.",
|
|
815
|
+
})
|
|
816
|
+
.optional()
|
|
817
|
+
.nullable(),
|
|
818
|
+
sort: z
|
|
819
|
+
.string({
|
|
820
|
+
message: "'sort' must be a string.",
|
|
821
|
+
})
|
|
822
|
+
.optional()
|
|
823
|
+
.nullable(),
|
|
824
|
+
order: z
|
|
825
|
+
.enum(['asc', 'desc'], {
|
|
826
|
+
message: "'order' must be either 'asc' or 'desc'.",
|
|
827
|
+
})
|
|
828
|
+
.optional()
|
|
829
|
+
.nullable(),
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
message:
|
|
833
|
+
"'default' must be an object with 'search', 'sort' and 'order' attributes.",
|
|
834
|
+
},
|
|
835
|
+
)
|
|
836
|
+
.strict()
|
|
837
|
+
.optional()
|
|
838
|
+
.nullable(),
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
message:
|
|
842
|
+
"'view' must be an object with 'fields', 'primary', 'sort', 'search' and 'default' attributes.",
|
|
843
|
+
},
|
|
844
|
+
)
|
|
845
|
+
.strict()
|
|
846
|
+
.optional()
|
|
847
|
+
.nullable(),
|
|
848
|
+
format: z
|
|
849
|
+
.enum(
|
|
850
|
+
[
|
|
851
|
+
'yaml-frontmatter',
|
|
852
|
+
'json-frontmatter',
|
|
853
|
+
'toml-frontmatter',
|
|
854
|
+
'yaml',
|
|
855
|
+
'json',
|
|
856
|
+
'toml',
|
|
857
|
+
'datagrid',
|
|
858
|
+
'code',
|
|
859
|
+
'raw',
|
|
860
|
+
],
|
|
861
|
+
{
|
|
862
|
+
message:
|
|
863
|
+
"'format' must be 'yaml-frontmatter', 'json-frontmatter', 'tom-frontmatter', 'yaml', 'json', 'toml', 'datagrid', 'code' or 'raw'.",
|
|
864
|
+
},
|
|
865
|
+
)
|
|
866
|
+
.optional()
|
|
867
|
+
.nullable(),
|
|
868
|
+
delimiters: z
|
|
869
|
+
.union([
|
|
870
|
+
z
|
|
871
|
+
.array(
|
|
872
|
+
z.string({
|
|
873
|
+
message: 'Delimiters must be strings',
|
|
874
|
+
}),
|
|
875
|
+
)
|
|
876
|
+
.length(2, "'delimiters' must contain exactly two string values."),
|
|
877
|
+
z.string({
|
|
878
|
+
message: "'delimiters' must be a string or array of 2 strings.",
|
|
879
|
+
}),
|
|
880
|
+
])
|
|
881
|
+
.optional(),
|
|
882
|
+
i18n: ContentI18nSchema.optional(),
|
|
883
|
+
localized: z.boolean().optional(),
|
|
884
|
+
subfolders: z
|
|
885
|
+
.boolean({
|
|
886
|
+
message: "'subfolders' must be a boolean.",
|
|
887
|
+
})
|
|
888
|
+
.optional()
|
|
889
|
+
.nullable(),
|
|
890
|
+
fields: z
|
|
891
|
+
.array(generateFieldObjectSchema(), {
|
|
892
|
+
message: "'fields' must be an array of field definitions.",
|
|
893
|
+
})
|
|
894
|
+
.optional(),
|
|
895
|
+
list: ListSchema.optional(),
|
|
896
|
+
commit: z
|
|
897
|
+
.object(
|
|
898
|
+
{
|
|
899
|
+
templates: CommitTemplatesSchema.optional(),
|
|
900
|
+
allowCustomMessage: z.boolean().optional(),
|
|
901
|
+
identity: CommitIdentitySchema.optional(),
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
message: "'commit' must be an object.",
|
|
905
|
+
},
|
|
906
|
+
)
|
|
907
|
+
.optional(),
|
|
908
|
+
actions: z
|
|
909
|
+
.array(ActionSchema, {
|
|
910
|
+
message: "'actions' must be an array of action definitions.",
|
|
911
|
+
})
|
|
912
|
+
.optional(),
|
|
913
|
+
})
|
|
914
|
+
.strict()
|
|
915
|
+
.superRefine(({ type, create, large, filename, subfolders }, ctx) => {
|
|
916
|
+
if (large !== undefined && type !== 'collection')
|
|
917
|
+
ctx.addIssue({
|
|
918
|
+
code: 'custom',
|
|
919
|
+
path: ['large'],
|
|
920
|
+
message: "'large' is only supported on collections.",
|
|
921
|
+
})
|
|
922
|
+
if (create && type !== 'collection')
|
|
923
|
+
ctx.addIssue({
|
|
924
|
+
code: 'custom',
|
|
925
|
+
path: ['create'],
|
|
926
|
+
message: "'create' is only supported on collections.",
|
|
927
|
+
})
|
|
928
|
+
if (type !== 'collection' || filename == null) return
|
|
929
|
+
const template = typeof filename === 'string' ? filename : filename.template
|
|
930
|
+
const issue = filenamePathIssue(
|
|
931
|
+
filenameTemplatePath(template),
|
|
932
|
+
subfolders !== false,
|
|
933
|
+
)
|
|
934
|
+
if (issue)
|
|
935
|
+
ctx.addIssue({
|
|
936
|
+
code: 'custom',
|
|
937
|
+
message: issue,
|
|
938
|
+
path:
|
|
939
|
+
typeof filename === 'string'
|
|
940
|
+
? ['filename']
|
|
941
|
+
: ['filename', 'template'],
|
|
942
|
+
})
|
|
943
|
+
})
|
|
944
|
+
|
|
945
|
+
const ContentGroupSchema: z.ZodType = z.lazy(() =>
|
|
946
|
+
z
|
|
947
|
+
.object({
|
|
948
|
+
name: z
|
|
949
|
+
.string({
|
|
950
|
+
error: (issue) =>
|
|
951
|
+
issue.input === undefined
|
|
952
|
+
? "'name' is required."
|
|
953
|
+
: "'name' must be a string.",
|
|
954
|
+
})
|
|
955
|
+
.regex(/^[a-zA-Z0-9-_]+$/, {
|
|
956
|
+
message: "'name' must be alphanumeric with dashes and underscores.",
|
|
957
|
+
}),
|
|
958
|
+
label: z.string().optional(),
|
|
959
|
+
description: z.string().optional().nullable(),
|
|
960
|
+
type: z.literal('group', {
|
|
961
|
+
error: "'type' must be 'group'.",
|
|
962
|
+
}),
|
|
963
|
+
items: z.array(ContentObjectSchema, {
|
|
964
|
+
message: "'items' must be an array of content entries.",
|
|
965
|
+
}),
|
|
966
|
+
})
|
|
967
|
+
.strict(),
|
|
968
|
+
)
|
|
969
|
+
|
|
970
|
+
const ContentObjectSchema: z.ZodType = z.lazy(() =>
|
|
971
|
+
z.union([ContentLeafSchema, ContentGroupSchema]),
|
|
972
|
+
)
|
|
973
|
+
|
|
974
|
+
// Plugins can add, replace, or remove media properties. Core identity and path properties remain fixed.
|
|
975
|
+
// Contributions are composed once per deployment and shared by browser and server.
|
|
976
|
+
export function createMediaConfigurationShape(
|
|
977
|
+
contributions: readonly {
|
|
978
|
+
id: string
|
|
979
|
+
configurationSchema?: ConfigurationSchemaContribution
|
|
980
|
+
}[] = [],
|
|
981
|
+
) {
|
|
982
|
+
const shape: Record<string, z.ZodType> = { ...MediaConfigObject.shape }
|
|
983
|
+
const touched = new Set<string>()
|
|
984
|
+
for (const { id, configurationSchema } of contributions) {
|
|
985
|
+
if (!configurationSchema) continue
|
|
986
|
+
if (
|
|
987
|
+
!isRecord(configurationSchema) ||
|
|
988
|
+
Object.keys(configurationSchema).some((key) => key !== 'media') ||
|
|
989
|
+
(configurationSchema.media !== undefined &&
|
|
990
|
+
!isRecord(configurationSchema.media))
|
|
991
|
+
)
|
|
992
|
+
throw new Error(
|
|
993
|
+
`Invalid configuration schema contribution in plugin ${id}`,
|
|
994
|
+
)
|
|
995
|
+
for (const [name, change] of Object.entries(
|
|
996
|
+
configurationSchema.media ?? {},
|
|
997
|
+
)) {
|
|
998
|
+
if (
|
|
999
|
+
!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name) ||
|
|
1000
|
+
!isRecord(change) ||
|
|
1001
|
+
!['add', 'replace', 'remove'].includes(String(change.action))
|
|
1002
|
+
)
|
|
1003
|
+
throw new Error(`Invalid media property ${name} in plugin ${id}`)
|
|
1004
|
+
if (['name', 'input', 'output'].includes(name))
|
|
1005
|
+
throw new Error(
|
|
1006
|
+
`Media property ${name} is required by core and cannot be modified`,
|
|
1007
|
+
)
|
|
1008
|
+
if (touched.has(name))
|
|
1009
|
+
throw new Error(`Conflicting media property ${name}`)
|
|
1010
|
+
touched.add(name)
|
|
1011
|
+
const exists = Object.hasOwn(shape, name)
|
|
1012
|
+
if (change.action === 'add' ? exists : !exists)
|
|
1013
|
+
throw new Error(`Cannot ${change.action} media property ${name}`)
|
|
1014
|
+
if (change.action === 'remove') {
|
|
1015
|
+
delete shape[name]
|
|
1016
|
+
} else {
|
|
1017
|
+
if (typeof change.schema !== 'function')
|
|
1018
|
+
throw new Error(`Invalid schema for media property ${name}`)
|
|
1019
|
+
const value = change.schema(z)
|
|
1020
|
+
if (!(value instanceof z.ZodType))
|
|
1021
|
+
throw new Error(`Invalid schema for media property ${name}`)
|
|
1022
|
+
shape[name] = value
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
return shape
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
export function createConfigurationSchema(
|
|
1030
|
+
contributions: readonly {
|
|
1031
|
+
id: string
|
|
1032
|
+
configurationSchema?: ConfigurationSchemaContribution
|
|
1033
|
+
}[] = [],
|
|
1034
|
+
shape = createMediaConfigurationShape(contributions),
|
|
1035
|
+
) {
|
|
1036
|
+
// Preserve the core compile-time shape; plugin changes are checked at runtime.
|
|
1037
|
+
const mediaConfig = z.object(shape).strict() as typeof MediaConfigObject
|
|
1038
|
+
// Named media configuration schema (for array entries)
|
|
1039
|
+
const NamedMediaConfig = mediaConfig.extend({
|
|
1040
|
+
name: z.string({
|
|
1041
|
+
error: (issue) =>
|
|
1042
|
+
issue.input === undefined
|
|
1043
|
+
? "'name' is required for media configurations in array format."
|
|
1044
|
+
: "'name' must be a string.",
|
|
1045
|
+
}),
|
|
1046
|
+
})
|
|
1047
|
+
|
|
1048
|
+
// Media schema
|
|
1049
|
+
const MediaSchema = z.union([
|
|
1050
|
+
z
|
|
1051
|
+
.string()
|
|
1052
|
+
.regex(/^(?:[^/](?:.*[^/])?)?$/, {
|
|
1053
|
+
message:
|
|
1054
|
+
"'media' must be a valid relative path (no leading or trailing slash).",
|
|
1055
|
+
})
|
|
1056
|
+
.refine(isSafeGitPath, {
|
|
1057
|
+
message: "'media' cannot escape the repository root.",
|
|
1058
|
+
}),
|
|
1059
|
+
mediaConfig,
|
|
1060
|
+
z.array(NamedMediaConfig, {
|
|
1061
|
+
message:
|
|
1062
|
+
"'media' must be a string, an object, or an array of named media configurations.",
|
|
1063
|
+
}),
|
|
1064
|
+
])
|
|
1065
|
+
|
|
1066
|
+
const shapeSchema = z
|
|
1067
|
+
.object({
|
|
1068
|
+
hide: z
|
|
1069
|
+
.boolean({
|
|
1070
|
+
message: "'hide' must be a boolean.",
|
|
1071
|
+
})
|
|
1072
|
+
.optional(),
|
|
1073
|
+
i18n: RepositoryI18nSchema.optional(),
|
|
1074
|
+
media: MediaSchema.optional(),
|
|
1075
|
+
content: z
|
|
1076
|
+
.array(ContentObjectSchema, {
|
|
1077
|
+
message:
|
|
1078
|
+
"'content' must be an array of objects with at least one entry.",
|
|
1079
|
+
})
|
|
1080
|
+
.optional(),
|
|
1081
|
+
components: z
|
|
1082
|
+
.record(
|
|
1083
|
+
z.string().regex(/^[a-zA-Z0-9-_]+$/, {
|
|
1084
|
+
message:
|
|
1085
|
+
'Component key must be alphanumeric with dashes and underscores.',
|
|
1086
|
+
}),
|
|
1087
|
+
generateFieldObjectSchema(true),
|
|
1088
|
+
)
|
|
1089
|
+
.optional(),
|
|
1090
|
+
actions: z
|
|
1091
|
+
.array(ActionSchema, {
|
|
1092
|
+
message: "'actions' must be an array of action definitions.",
|
|
1093
|
+
})
|
|
1094
|
+
.optional(),
|
|
1095
|
+
settings: z
|
|
1096
|
+
.union([
|
|
1097
|
+
z
|
|
1098
|
+
.object(
|
|
1099
|
+
{
|
|
1100
|
+
cache: z
|
|
1101
|
+
.boolean({ message: "'cache' must be a boolean." })
|
|
1102
|
+
.optional(),
|
|
1103
|
+
config: z
|
|
1104
|
+
.boolean({
|
|
1105
|
+
message: "'config' must be a boolean.",
|
|
1106
|
+
})
|
|
1107
|
+
.optional(),
|
|
1108
|
+
hide: z
|
|
1109
|
+
.boolean({
|
|
1110
|
+
message: "'hide' must be a boolean.",
|
|
1111
|
+
})
|
|
1112
|
+
.optional(),
|
|
1113
|
+
content: z
|
|
1114
|
+
.object(
|
|
1115
|
+
{
|
|
1116
|
+
merge: z
|
|
1117
|
+
.boolean({
|
|
1118
|
+
message: "'merge' must be a boolean.",
|
|
1119
|
+
})
|
|
1120
|
+
.optional(),
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
message: "'content' must be an object.",
|
|
1124
|
+
},
|
|
1125
|
+
)
|
|
1126
|
+
.optional(),
|
|
1127
|
+
commit: z
|
|
1128
|
+
.object(
|
|
1129
|
+
{
|
|
1130
|
+
templates: CommitTemplatesSchema.optional(),
|
|
1131
|
+
allowCustomMessage: z.boolean().optional(),
|
|
1132
|
+
identity: CommitIdentitySchema.optional(),
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
message: "'commit' must be an object.",
|
|
1136
|
+
},
|
|
1137
|
+
)
|
|
1138
|
+
.optional(),
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
message: "'settings' must be an object.",
|
|
1142
|
+
},
|
|
1143
|
+
)
|
|
1144
|
+
.strict()
|
|
1145
|
+
.optional(),
|
|
1146
|
+
z.boolean({
|
|
1147
|
+
message: "'settings' must be a boolean or an object.",
|
|
1148
|
+
}),
|
|
1149
|
+
])
|
|
1150
|
+
.optional(),
|
|
1151
|
+
})
|
|
1152
|
+
.strict()
|
|
1153
|
+
.superRefine((data, ctx) => {
|
|
1154
|
+
const nameIssues = configurationNameIssues(data)
|
|
1155
|
+
for (const issue of nameIssues) ctx.addIssue({ code: 'custom', ...issue })
|
|
1156
|
+
data.actions?.forEach((action, index) => {
|
|
1157
|
+
if (
|
|
1158
|
+
action.scope &&
|
|
1159
|
+
action.scope !== 'sidebar' &&
|
|
1160
|
+
action.scope !== 'overview'
|
|
1161
|
+
)
|
|
1162
|
+
ctx.addIssue({
|
|
1163
|
+
code: 'custom',
|
|
1164
|
+
message:
|
|
1165
|
+
"Top-level actions may only use a 'scope' of 'sidebar' or 'overview'.",
|
|
1166
|
+
path: ['actions', index, 'scope'],
|
|
1167
|
+
})
|
|
1168
|
+
})
|
|
1169
|
+
const validateContentItem = (
|
|
1170
|
+
item: unknown,
|
|
1171
|
+
path: (string | number)[],
|
|
1172
|
+
) => {
|
|
1173
|
+
if (!isRecord(item)) return
|
|
1174
|
+
|
|
1175
|
+
if (item.type === 'group') {
|
|
1176
|
+
if (Array.isArray(item.items)) {
|
|
1177
|
+
item.items.forEach((child: unknown, index: number) =>
|
|
1178
|
+
validateContentItem(child, [...path, 'items', index]),
|
|
1179
|
+
)
|
|
1180
|
+
}
|
|
1181
|
+
return
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
const actions = Array.isArray(item.actions) ? item.actions : []
|
|
1185
|
+
actions.forEach((action: unknown, actionIndex: number) => {
|
|
1186
|
+
if (!isRecord(action)) return
|
|
1187
|
+
if (
|
|
1188
|
+
item.type === 'collection' &&
|
|
1189
|
+
action.scope !== 'collection' &&
|
|
1190
|
+
action.scope !== 'entry'
|
|
1191
|
+
) {
|
|
1192
|
+
ctx.addIssue({
|
|
1193
|
+
code: 'custom',
|
|
1194
|
+
message:
|
|
1195
|
+
"Collection actions must define a 'scope' of 'collection' or 'entry'.",
|
|
1196
|
+
path: [...path, 'actions', actionIndex, 'scope'],
|
|
1197
|
+
})
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
if (item.type === 'file' && action.scope != null) {
|
|
1201
|
+
ctx.addIssue({
|
|
1202
|
+
code: 'custom',
|
|
1203
|
+
message: "File actions cannot define a 'scope'.",
|
|
1204
|
+
path: [...path, 'actions', actionIndex, 'scope'],
|
|
1205
|
+
})
|
|
1206
|
+
}
|
|
1207
|
+
})
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
const content = data.content
|
|
1211
|
+
if (Array.isArray(content))
|
|
1212
|
+
content.forEach((item, index) =>
|
|
1213
|
+
validateContentItem(item, ['content', index]),
|
|
1214
|
+
)
|
|
1215
|
+
const media = Array.isArray(data.media) ? data.media : [data.media]
|
|
1216
|
+
media.forEach((item, index) => {
|
|
1217
|
+
if (!isRecord(item) || !Array.isArray(item.actions)) return
|
|
1218
|
+
item.actions.forEach((action: unknown, actionIndex: number) => {
|
|
1219
|
+
if (
|
|
1220
|
+
isRecord(action) &&
|
|
1221
|
+
(action.scope === 'sidebar' || action.scope === 'overview')
|
|
1222
|
+
)
|
|
1223
|
+
ctx.addIssue({
|
|
1224
|
+
code: 'custom',
|
|
1225
|
+
message:
|
|
1226
|
+
"Media actions cannot use a 'scope' of 'sidebar' or 'overview'.",
|
|
1227
|
+
path: [
|
|
1228
|
+
'media',
|
|
1229
|
+
...(Array.isArray(data.media) ? [index] : []),
|
|
1230
|
+
'actions',
|
|
1231
|
+
actionIndex,
|
|
1232
|
+
'scope',
|
|
1233
|
+
],
|
|
1234
|
+
})
|
|
1235
|
+
})
|
|
1236
|
+
})
|
|
1237
|
+
})
|
|
1238
|
+
.nullable()
|
|
1239
|
+
|
|
1240
|
+
const schema = shapeSchema.superRefine((data, ctx) => {
|
|
1241
|
+
if (configurationNameIssues(data).length) return
|
|
1242
|
+
const issue = configurationLocalizationIssue(data)
|
|
1243
|
+
if (issue) ctx.addIssue(issue)
|
|
1244
|
+
})
|
|
1245
|
+
configurationShapeSchemas.set(schema, shapeSchema)
|
|
1246
|
+
return schema
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
const ConfigurationSchema = createConfigurationSchema()
|
|
1250
|
+
export const DeploymentMediaConfigurationShape = createMediaConfigurationShape(
|
|
1251
|
+
clientDeployment.plugins,
|
|
1252
|
+
)
|
|
1253
|
+
export const DeploymentConfigurationSchema = createConfigurationSchema(
|
|
1254
|
+
[],
|
|
1255
|
+
DeploymentMediaConfigurationShape,
|
|
1256
|
+
)
|
|
1257
|
+
export { ConfigurationSchema }
|