@basicbenframework/cms 0.0.0-stage → 0.6.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 +9 -0
- package/README.md +206 -2
- package/db/migrations/001_create_users.js +15 -0
- package/db/migrations/002_create_posts.js +18 -0
- package/db/migrations/003_create_categories.js +19 -0
- package/db/migrations/004_create_tags.js +16 -0
- package/db/migrations/005_create_post_tags.js +16 -0
- package/db/migrations/006_create_pages.js +26 -0
- package/db/migrations/007_create_comments.js +24 -0
- package/db/migrations/008_create_media.js +22 -0
- package/db/migrations/009_update_posts_blogging.js +27 -0
- package/db/migrations/010_create_settings.js +29 -0
- package/db/migrations/011_add_user_roles.js +23 -0
- package/db/migrations/012_create_auth_tokens.js +30 -0
- package/db/migrations/013_add_email_verified.js +24 -0
- package/db/migrations/014_create_user_two_factor.js +30 -0
- package/db/migrations/015_create_user_credentials.js +35 -0
- package/db/migrations/016_create_rate_limits.js +31 -0
- package/db/migrations/017_add_content_html.js +38 -0
- package/db/migrations/018_create_api_tokens.js +34 -0
- package/db/migrations/019_create_post_categories.js +40 -0
- package/db/migrations/020_add_author_profiles.js +60 -0
- package/db/migrations/021_add_page_featured_image.js +23 -0
- package/db/migrations/022_backfill_post_slugs_and_excerpts.js +57 -0
- package/db/migrations/023_add_user_session_controls.js +25 -0
- package/db/migrations/024_add_post_status_and_trash.js +45 -0
- package/db/migrations/025_add_social_and_indexing_fields.js +40 -0
- package/db/migrations/026_create_post_revisions.js +29 -0
- package/db/migrations/027_add_media_dimensions.js +19 -0
- package/db/migrations/028_create_navigation_menus.js +65 -0
- package/db/migrations/029_create_redirects.js +40 -0
- package/db/migrations/030_add_comment_status_and_notifications.js +53 -0
- package/db/migrations/031_create_post_locks.js +38 -0
- package/db/migrations/032_create_snippets.js +31 -0
- package/db/migrations/033_create_members.js +70 -0
- package/db/migrations/034_add_post_visibility.js +28 -0
- package/db/migrations/035_create_newsletters.js +72 -0
- package/db/migrations/036_create_analytics.js +89 -0
- package/db/migrations/037_create_ops_heartbeats.js +30 -0
- package/db/migrations/038_create_content_types.js +84 -0
- package/db/migrations/039_create_content_type_fields.js +47 -0
- package/db/migrations/040_create_taxonomies.js +80 -0
- package/db/migrations/041_add_newsletter_handoff.js +28 -0
- package/db/migrations/042_create_mysendbox_contacts.js +63 -0
- package/lib/cli/backup.d.mts +2 -0
- package/lib/cli/backup.mjs +124 -0
- package/lib/cli/export.d.mts +2 -0
- package/lib/cli/export.mjs +54 -0
- package/lib/cli/import-ghost.d.mts +2 -0
- package/lib/cli/import-ghost.mjs +50 -0
- package/lib/cli/import-json.d.mts +2 -0
- package/lib/cli/import-json.mjs +61 -0
- package/lib/cli/import-wordpress.d.mts +2 -0
- package/lib/cli/import-wordpress.mjs +169 -0
- package/lib/cli/import-wxr.d.mts +2 -0
- package/lib/cli/import-wxr.mjs +55 -0
- package/lib/cli/index.d.mts +2 -0
- package/lib/cli/index.mjs +53 -0
- package/lib/cli/lib/backup.d.mts +112 -0
- package/lib/cli/lib/backup.mjs +297 -0
- package/lib/cli/lib/ghost.d.mts +30 -0
- package/lib/cli/lib/ghost.mjs +201 -0
- package/lib/cli/lib/html-to-markdown.d.mts +61 -0
- package/lib/cli/lib/html-to-markdown.mjs +523 -0
- package/lib/cli/lib/import-common.d.mts +100 -0
- package/lib/cli/lib/import-common.mjs +252 -0
- package/lib/cli/lib/json-import.d.mts +22 -0
- package/lib/cli/lib/json-import.mjs +422 -0
- package/lib/cli/lib/site-import.d.mts +32 -0
- package/lib/cli/lib/site-import.mjs +456 -0
- package/lib/cli/lib/wordpress-rest.d.mts +25 -0
- package/lib/cli/lib/wordpress-rest.mjs +177 -0
- package/lib/cli/lib/wxr.d.mts +18 -0
- package/lib/cli/lib/wxr.mjs +307 -0
- package/lib/cli/lib/xml.d.mts +33 -0
- package/lib/cli/lib/xml.mjs +186 -0
- package/lib/cli/restore.d.mts +2 -0
- package/lib/cli/restore.mjs +98 -0
- package/lib/client/components/Alert.d.ts +7 -0
- package/lib/client/components/Alert.js +8 -0
- package/lib/client/components/Avatar.d.ts +15 -0
- package/lib/client/components/Avatar.js +10 -0
- package/lib/client/components/BackLink.d.ts +7 -0
- package/lib/client/components/BackLink.js +6 -0
- package/lib/client/components/Button.d.ts +7 -0
- package/lib/client/components/Button.js +12 -0
- package/lib/client/components/Card.d.ts +7 -0
- package/lib/client/components/Card.js +6 -0
- package/lib/client/components/CommentThread.d.ts +15 -0
- package/lib/client/components/CommentThread.js +101 -0
- package/lib/client/components/Empty.d.ts +6 -0
- package/lib/client/components/Empty.js +6 -0
- package/lib/client/components/Input.d.ts +6 -0
- package/lib/client/components/Input.js +6 -0
- package/lib/client/components/Link.d.ts +31 -0
- package/lib/client/components/Link.js +49 -0
- package/lib/client/components/Loading.d.ts +1 -0
- package/lib/client/components/Loading.js +6 -0
- package/lib/client/components/Logo.d.ts +5 -0
- package/lib/client/components/Logo.js +4 -0
- package/lib/client/components/MarkdownEditor.d.ts +41 -0
- package/lib/client/components/MarkdownEditor.js +156 -0
- package/lib/client/components/Nav/DarkModeToggle.d.ts +6 -0
- package/lib/client/components/Nav/DarkModeToggle.js +6 -0
- package/lib/client/components/Nav/DesktopNav.d.ts +8 -0
- package/lib/client/components/Nav/DesktopNav.js +9 -0
- package/lib/client/components/Nav/MobileNav.d.ts +9 -0
- package/lib/client/components/Nav/MobileNav.js +15 -0
- package/lib/client/components/NavLink.d.ts +8 -0
- package/lib/client/components/NavLink.js +6 -0
- package/lib/client/components/PageHeader.d.ts +8 -0
- package/lib/client/components/PageHeader.js +6 -0
- package/lib/client/components/PostCard.d.ts +8 -0
- package/lib/client/components/PostCard.js +7 -0
- package/lib/client/components/Textarea.d.ts +6 -0
- package/lib/client/components/Textarea.js +6 -0
- package/lib/client/components/ThemeContext.d.ts +18 -0
- package/lib/client/components/ThemeContext.js +8 -0
- package/lib/client/components/admin/AdminIcons.d.ts +13 -0
- package/lib/client/components/admin/AdminIcons.js +66 -0
- package/lib/client/components/admin/ContentModelPanels.d.ts +22 -0
- package/lib/client/components/admin/ContentModelPanels.js +93 -0
- package/lib/client/components/admin/FeaturedImageBox.d.ts +21 -0
- package/lib/client/components/admin/FeaturedImageBox.js +24 -0
- package/lib/client/components/admin/MediaGrid.d.ts +23 -0
- package/lib/client/components/admin/MediaGrid.js +69 -0
- package/lib/client/components/admin/MediaPicker.d.ts +17 -0
- package/lib/client/components/admin/MediaPicker.js +61 -0
- package/lib/client/components/admin/Pagination.d.ts +27 -0
- package/lib/client/components/admin/Pagination.js +29 -0
- package/lib/client/components/admin/SnippetPicker.d.ts +27 -0
- package/lib/client/components/admin/SnippetPicker.js +65 -0
- package/lib/client/components/admin/TermPicker.d.ts +52 -0
- package/lib/client/components/admin/TermPicker.js +58 -0
- package/lib/client/contexts/ToastContext.d.ts +12 -0
- package/lib/client/contexts/ToastContext.js +49 -0
- package/lib/client/features.d.ts +11 -0
- package/lib/client/features.js +7 -0
- package/lib/client/hooks/useContentTypes.d.ts +48 -0
- package/lib/client/hooks/useContentTypes.js +48 -0
- package/lib/client/hooks/useMediaLibrary.d.ts +46 -0
- package/lib/client/hooks/useMediaLibrary.js +189 -0
- package/lib/client/hooks/usePostLock.d.ts +32 -0
- package/lib/client/hooks/usePostLock.js +107 -0
- package/lib/client/host/index.d.ts +71 -0
- package/lib/client/host/index.js +58 -0
- package/lib/client/i18n/index.d.ts +79 -0
- package/lib/client/i18n/index.js +177 -0
- package/lib/client/i18n/locales/es/content.d.ts +4 -0
- package/lib/client/i18n/locales/es/content.js +220 -0
- package/lib/client/i18n/locales/es/editor.d.ts +9 -0
- package/lib/client/i18n/locales/es/editor.js +144 -0
- package/lib/client/i18n/locales/es/index.d.ts +8 -0
- package/lib/client/i18n/locales/es/index.js +7 -0
- package/lib/client/i18n/locales/es/layout.d.ts +4 -0
- package/lib/client/i18n/locales/es/layout.js +35 -0
- package/lib/client/i18n/locales/es/people.d.ts +4 -0
- package/lib/client/i18n/locales/es/people.js +187 -0
- package/lib/client/i18n/locales/es/site.d.ts +4 -0
- package/lib/client/i18n/locales/es/site.js +208 -0
- package/lib/client/layouts/AdminLayout.d.ts +7 -0
- package/lib/client/layouts/AdminLayout.js +1046 -0
- package/lib/client/layouts/AppLayout.d.ts +6 -0
- package/lib/client/layouts/AppLayout.js +19 -0
- package/lib/client/layouts/AuthLayout.d.ts +6 -0
- package/lib/client/layouts/AuthLayout.js +14 -0
- package/lib/client/layouts/DocsLayout.d.ts +6 -0
- package/lib/client/layouts/DocsLayout.js +28 -0
- package/lib/client/layouts/RootLayout.d.ts +6 -0
- package/lib/client/layouts/RootLayout.js +11 -0
- package/lib/client/pages/AcceptInvite.d.ts +8 -0
- package/lib/client/pages/AcceptInvite.js +60 -0
- package/lib/client/pages/Auth.d.ts +1 -0
- package/lib/client/pages/Auth.js +40 -0
- package/lib/client/pages/Authentication.d.ts +1 -0
- package/lib/client/pages/Authentication.js +230 -0
- package/lib/client/pages/Content.d.ts +1 -0
- package/lib/client/pages/Content.js +21 -0
- package/lib/client/pages/Database.d.ts +1 -0
- package/lib/client/pages/Database.js +264 -0
- package/lib/client/pages/Extending.d.ts +1 -0
- package/lib/client/pages/Extending.js +28 -0
- package/lib/client/pages/Feed.d.ts +1 -0
- package/lib/client/pages/Feed.js +19 -0
- package/lib/client/pages/FeedPost.d.ts +1 -0
- package/lib/client/pages/FeedPost.js +31 -0
- package/lib/client/pages/ForgotPassword.d.ts +8 -0
- package/lib/client/pages/ForgotPassword.js +38 -0
- package/lib/client/pages/GettingStarted.d.ts +1 -0
- package/lib/client/pages/GettingStarted.js +84 -0
- package/lib/client/pages/Headless.d.ts +1 -0
- package/lib/client/pages/Headless.js +49 -0
- package/lib/client/pages/Home.d.ts +1 -0
- package/lib/client/pages/Home.js +67 -0
- package/lib/client/pages/PostForm.d.ts +1 -0
- package/lib/client/pages/PostForm.js +55 -0
- package/lib/client/pages/Posts.d.ts +1 -0
- package/lib/client/pages/Posts.js +35 -0
- package/lib/client/pages/Profile.d.ts +1 -0
- package/lib/client/pages/Profile.js +153 -0
- package/lib/client/pages/ResetPassword.d.ts +8 -0
- package/lib/client/pages/ResetPassword.js +52 -0
- package/lib/client/pages/Routing.d.ts +1 -0
- package/lib/client/pages/Routing.js +192 -0
- package/lib/client/pages/Storage.d.ts +1 -0
- package/lib/client/pages/Storage.js +54 -0
- package/lib/client/pages/Testing.d.ts +1 -0
- package/lib/client/pages/Testing.js +141 -0
- package/lib/client/pages/Validation.d.ts +1 -0
- package/lib/client/pages/Validation.js +123 -0
- package/lib/client/pages/admin/Categories.d.ts +2 -0
- package/lib/client/pages/admin/Categories.js +75 -0
- package/lib/client/pages/admin/Comments.d.ts +11 -0
- package/lib/client/pages/admin/Comments.js +247 -0
- package/lib/client/pages/admin/ContentTypes.d.ts +2 -0
- package/lib/client/pages/admin/ContentTypes.js +163 -0
- package/lib/client/pages/admin/Dashboard.d.ts +2 -0
- package/lib/client/pages/admin/Dashboard.js +66 -0
- package/lib/client/pages/admin/Health.d.ts +12 -0
- package/lib/client/pages/admin/Health.js +148 -0
- package/lib/client/pages/admin/Media.d.ts +2 -0
- package/lib/client/pages/admin/Media.js +101 -0
- package/lib/client/pages/admin/Navigation.d.ts +9 -0
- package/lib/client/pages/admin/Navigation.js +230 -0
- package/lib/client/pages/admin/Pages.d.ts +2 -0
- package/lib/client/pages/admin/Pages.js +53 -0
- package/lib/client/pages/admin/PostEditor.d.ts +17 -0
- package/lib/client/pages/admin/PostEditor.js +532 -0
- package/lib/client/pages/admin/Posts.d.ts +2 -0
- package/lib/client/pages/admin/Posts.js +152 -0
- package/lib/client/pages/admin/Redirects.d.ts +10 -0
- package/lib/client/pages/admin/Redirects.js +87 -0
- package/lib/client/pages/admin/Settings.d.ts +2 -0
- package/lib/client/pages/admin/Settings.js +111 -0
- package/lib/client/pages/admin/Snippets.d.ts +14 -0
- package/lib/client/pages/admin/Snippets.js +85 -0
- package/lib/client/pages/admin/Tags.d.ts +2 -0
- package/lib/client/pages/admin/Tags.js +74 -0
- package/lib/client/pages/admin/Taxonomies.d.ts +2 -0
- package/lib/client/pages/admin/Taxonomies.js +130 -0
- package/lib/client/pages/admin/Tokens.d.ts +9 -0
- package/lib/client/pages/admin/Tokens.js +260 -0
- package/lib/client/pages/admin/Tools.d.ts +12 -0
- package/lib/client/pages/admin/Tools.js +111 -0
- package/lib/client/pages/admin/Users.d.ts +13 -0
- package/lib/client/pages/admin/Users.js +313 -0
- package/lib/client/pages/api-reference.d.ts +33 -0
- package/lib/client/pages/api-reference.js +198 -0
- package/lib/client/styles.css +37 -0
- package/lib/config.d.ts +24 -0
- package/lib/config.js +39 -0
- package/lib/controllers/AdminController.d.ts +46 -0
- package/lib/controllers/AdminController.js +134 -0
- package/lib/controllers/AuthController.d.ts +15 -0
- package/lib/controllers/AuthController.js +194 -0
- package/lib/controllers/AuthorController.d.ts +17 -0
- package/lib/controllers/AuthorController.js +19 -0
- package/lib/controllers/CategoryController.d.ts +10 -0
- package/lib/controllers/CategoryController.js +88 -0
- package/lib/controllers/CommentController.d.ts +68 -0
- package/lib/controllers/CommentController.js +438 -0
- package/lib/controllers/ContentTypeController.d.ts +24 -0
- package/lib/controllers/ContentTypeController.js +91 -0
- package/lib/controllers/EmailVerificationController.d.ts +33 -0
- package/lib/controllers/EmailVerificationController.js +116 -0
- package/lib/controllers/ExportController.d.ts +15 -0
- package/lib/controllers/ExportController.js +41 -0
- package/lib/controllers/FeedController.d.ts +14 -0
- package/lib/controllers/FeedController.js +246 -0
- package/lib/controllers/HealthController.d.ts +21 -0
- package/lib/controllers/HealthController.js +176 -0
- package/lib/controllers/HomeController.d.ts +12 -0
- package/lib/controllers/HomeController.js +16 -0
- package/lib/controllers/MediaController.d.ts +24 -0
- package/lib/controllers/MediaController.js +189 -0
- package/lib/controllers/NavigationController.d.ts +22 -0
- package/lib/controllers/NavigationController.js +176 -0
- package/lib/controllers/PageController.d.ts +13 -0
- package/lib/controllers/PageController.js +172 -0
- package/lib/controllers/PasskeyController.d.ts +36 -0
- package/lib/controllers/PasskeyController.js +201 -0
- package/lib/controllers/PasswordResetController.d.ts +44 -0
- package/lib/controllers/PasswordResetController.js +160 -0
- package/lib/controllers/PostController.d.ts +51 -0
- package/lib/controllers/PostController.js +538 -0
- package/lib/controllers/PostLockController.d.ts +62 -0
- package/lib/controllers/PostLockController.js +101 -0
- package/lib/controllers/ProfileController.d.ts +13 -0
- package/lib/controllers/ProfileController.js +160 -0
- package/lib/controllers/PublicApiController.d.ts +23 -0
- package/lib/controllers/PublicApiController.js +100 -0
- package/lib/controllers/RedirectController.d.ts +32 -0
- package/lib/controllers/RedirectController.js +95 -0
- package/lib/controllers/SettingsController.d.ts +28 -0
- package/lib/controllers/SettingsController.js +105 -0
- package/lib/controllers/SnippetController.d.ts +27 -0
- package/lib/controllers/SnippetController.js +123 -0
- package/lib/controllers/TagController.d.ts +9 -0
- package/lib/controllers/TagController.js +70 -0
- package/lib/controllers/TaxonomyController.d.ts +24 -0
- package/lib/controllers/TaxonomyController.js +149 -0
- package/lib/controllers/TokenController.d.ts +27 -0
- package/lib/controllers/TokenController.js +83 -0
- package/lib/controllers/TwoFactorController.d.ts +31 -0
- package/lib/controllers/TwoFactorController.js +213 -0
- package/lib/controllers/UserController.d.ts +110 -0
- package/lib/controllers/UserController.js +504 -0
- package/lib/features/analytics/AnalyticsPage.d.ts +11 -0
- package/lib/features/analytics/AnalyticsPage.js +123 -0
- package/lib/features/analytics/admin.d.ts +3 -0
- package/lib/features/analytics/admin.js +9 -0
- package/lib/features/analytics/controller.d.ts +19 -0
- package/lib/features/analytics/controller.js +79 -0
- package/lib/features/analytics/helpers.d.ts +84 -0
- package/lib/features/analytics/helpers.js +181 -0
- package/lib/features/analytics/i18n/es.d.ts +4 -0
- package/lib/features/analytics/i18n/es.js +31 -0
- package/lib/features/analytics/index.d.ts +28 -0
- package/lib/features/analytics/index.js +91 -0
- package/lib/features/analytics/manifest.d.ts +8 -0
- package/lib/features/analytics/manifest.js +18 -0
- package/lib/features/analytics/model.d.ts +130 -0
- package/lib/features/analytics/model.js +206 -0
- package/lib/features/members/Member.d.ts +93 -0
- package/lib/features/members/Member.js +194 -0
- package/lib/features/members/MemberAdminController.d.ts +60 -0
- package/lib/features/members/MemberAdminController.js +262 -0
- package/lib/features/members/MemberController.d.ts +88 -0
- package/lib/features/members/MemberController.js +250 -0
- package/lib/features/members/MembersPage.d.ts +10 -0
- package/lib/features/members/MembersPage.js +216 -0
- package/lib/features/members/PostAccessBox.d.ts +15 -0
- package/lib/features/members/PostAccessBox.js +70 -0
- package/lib/features/members/admin.d.ts +3 -0
- package/lib/features/members/admin.js +12 -0
- package/lib/features/members/csv.d.ts +21 -0
- package/lib/features/members/csv.js +74 -0
- package/lib/features/members/events.d.ts +34 -0
- package/lib/features/members/events.js +34 -0
- package/lib/features/members/i18n/es.d.ts +4 -0
- package/lib/features/members/i18n/es.js +106 -0
- package/lib/features/members/index.d.ts +44 -0
- package/lib/features/members/index.js +106 -0
- package/lib/features/members/manifest.d.ts +8 -0
- package/lib/features/members/manifest.js +18 -0
- package/lib/features/members/middleware.d.ts +42 -0
- package/lib/features/members/middleware.js +74 -0
- package/lib/features/members/newsletter.d.ts +177 -0
- package/lib/features/members/newsletter.js +439 -0
- package/lib/features/members/rate-limits.d.ts +34 -0
- package/lib/features/members/rate-limits.js +50 -0
- package/lib/features/members/request.d.ts +13 -0
- package/lib/features/members/request.js +6 -0
- package/lib/features/members/routes.d.ts +15 -0
- package/lib/features/members/routes.js +59 -0
- package/lib/features/members/session.d.ts +102 -0
- package/lib/features/members/session.js +158 -0
- package/lib/features/members/settings.d.ts +14 -0
- package/lib/features/members/settings.js +23 -0
- package/lib/features/mysendbox/MySendboxSettingsCard.d.ts +7 -0
- package/lib/features/mysendbox/MySendboxSettingsCard.js +48 -0
- package/lib/features/mysendbox/admin.d.ts +3 -0
- package/lib/features/mysendbox/admin.js +9 -0
- package/lib/features/mysendbox/broadcasts.d.ts +61 -0
- package/lib/features/mysendbox/broadcasts.js +124 -0
- package/lib/features/mysendbox/client.d.ts +95 -0
- package/lib/features/mysendbox/client.js +61 -0
- package/lib/features/mysendbox/config.d.ts +27 -0
- package/lib/features/mysendbox/config.js +74 -0
- package/lib/features/mysendbox/contacts.d.ts +121 -0
- package/lib/features/mysendbox/contacts.js +378 -0
- package/lib/features/mysendbox/controller.d.ts +11 -0
- package/lib/features/mysendbox/controller.js +47 -0
- package/lib/features/mysendbox/i18n/es.d.ts +4 -0
- package/lib/features/mysendbox/i18n/es.js +28 -0
- package/lib/features/mysendbox/index.d.ts +18 -0
- package/lib/features/mysendbox/index.js +71 -0
- package/lib/features/mysendbox/manifest.d.ts +7 -0
- package/lib/features/mysendbox/manifest.js +6 -0
- package/lib/features/mysendbox/routes.d.ts +6 -0
- package/lib/features/mysendbox/routes.js +14 -0
- package/lib/features/mysendbox/webhook.d.ts +23 -0
- package/lib/features/mysendbox/webhook.js +104 -0
- package/lib/features/theme/OEmbedController.d.ts +31 -0
- package/lib/features/theme/OEmbedController.js +128 -0
- package/lib/features/theme/ThemeController.d.ts +20 -0
- package/lib/features/theme/ThemeController.js +256 -0
- package/lib/features/theme/ThemeSettingsCard.d.ts +7 -0
- package/lib/features/theme/ThemeSettingsCard.js +12 -0
- package/lib/features/theme/admin.d.ts +3 -0
- package/lib/features/theme/admin.js +9 -0
- package/lib/features/theme/html.d.ts +48 -0
- package/lib/features/theme/html.js +97 -0
- package/lib/features/theme/i18n/es.d.ts +4 -0
- package/lib/features/theme/i18n/es.js +9 -0
- package/lib/features/theme/index.d.ts +11 -0
- package/lib/features/theme/index.js +23 -0
- package/lib/features/theme/manifest.d.ts +7 -0
- package/lib/features/theme/manifest.js +6 -0
- package/lib/features/theme/oembed.d.ts +36 -0
- package/lib/features/theme/oembed.js +58 -0
- package/lib/features/theme/routes.d.ts +17 -0
- package/lib/features/theme/routes.js +54 -0
- package/lib/features/theme/templates.d.ts +103 -0
- package/lib/features/theme/templates.js +283 -0
- package/lib/features.d.ts +15 -0
- package/lib/features.js +6 -0
- package/lib/features.manifest.d.ts +10 -0
- package/lib/features.manifest.js +6 -0
- package/lib/helpers/access.d.ts +62 -0
- package/lib/helpers/access.js +92 -0
- package/lib/helpers/api.d.ts +20 -0
- package/lib/helpers/api.js +44 -0
- package/lib/helpers/comment-guard.d.ts +145 -0
- package/lib/helpers/comment-guard.js +253 -0
- package/lib/helpers/comment-mail.d.ts +53 -0
- package/lib/helpers/comment-mail.js +188 -0
- package/lib/helpers/content-model.d.ts +50 -0
- package/lib/helpers/content-model.js +84 -0
- package/lib/helpers/content-paths.d.ts +107 -0
- package/lib/helpers/content-paths.js +200 -0
- package/lib/helpers/export-data.d.ts +85 -0
- package/lib/helpers/export-data.js +229 -0
- package/lib/helpers/gating.d.ts +53 -0
- package/lib/helpers/gating.js +83 -0
- package/lib/helpers/health.d.ts +91 -0
- package/lib/helpers/health.js +279 -0
- package/lib/helpers/heartbeat.d.ts +35 -0
- package/lib/helpers/heartbeat.js +55 -0
- package/lib/helpers/image-size.d.ts +18 -0
- package/lib/helpers/image-size.js +83 -0
- package/lib/helpers/images.d.ts +29 -0
- package/lib/helpers/images.js +41 -0
- package/lib/helpers/mail-templates.d.ts +11 -0
- package/lib/helpers/mail-templates.js +42 -0
- package/lib/helpers/publish-due.d.ts +28 -0
- package/lib/helpers/publish-due.js +67 -0
- package/lib/helpers/redirects.d.ts +43 -0
- package/lib/helpers/redirects.js +80 -0
- package/lib/helpers/seo-fields.d.ts +13 -0
- package/lib/helpers/seo-fields.js +52 -0
- package/lib/helpers/session.d.ts +30 -0
- package/lib/helpers/session.js +27 -0
- package/lib/helpers/site-settings.d.ts +98 -0
- package/lib/helpers/site-settings.js +232 -0
- package/lib/helpers/site.d.ts +14 -0
- package/lib/helpers/site.js +23 -0
- package/lib/helpers/write-hooks.d.ts +33 -0
- package/lib/helpers/write-hooks.js +37 -0
- package/lib/hooks.d.ts +17 -0
- package/lib/hooks.js +101 -0
- package/lib/host/core-tasks.d.ts +4 -0
- package/lib/host/core-tasks.js +26 -0
- package/lib/host/cron.d.ts +39 -0
- package/lib/host/cron.js +85 -0
- package/lib/host/enabled.d.ts +4 -0
- package/lib/host/enabled.js +40 -0
- package/lib/host/index.d.ts +81 -0
- package/lib/host/index.js +87 -0
- package/lib/host/manifest.d.ts +34 -0
- package/lib/host/manifest.js +7 -0
- package/lib/host/menu.d.ts +18 -0
- package/lib/host/menu.js +15 -0
- package/lib/main.d.ts +1 -0
- package/lib/main.js +24 -0
- package/lib/middleware/api-auth.d.ts +59 -0
- package/lib/middleware/api-auth.js +164 -0
- package/lib/middleware/auth.d.ts +49 -0
- package/lib/middleware/auth.js +112 -0
- package/lib/middleware/cache.d.ts +17 -0
- package/lib/middleware/cache.js +52 -0
- package/lib/middleware/rate-limits.d.ts +199 -0
- package/lib/middleware/rate-limits.js +276 -0
- package/lib/middleware/viewer.d.ts +13 -0
- package/lib/middleware/viewer.js +16 -0
- package/lib/models/Category.d.ts +24 -0
- package/lib/models/Category.js +102 -0
- package/lib/models/Comment.d.ts +120 -0
- package/lib/models/Comment.js +283 -0
- package/lib/models/ContentType.d.ts +142 -0
- package/lib/models/ContentType.js +462 -0
- package/lib/models/Credential.d.ts +21 -0
- package/lib/models/Credential.js +31 -0
- package/lib/models/Media.d.ts +53 -0
- package/lib/models/Media.js +132 -0
- package/lib/models/Menu.d.ts +131 -0
- package/lib/models/Menu.js +312 -0
- package/lib/models/Page.d.ts +55 -0
- package/lib/models/Page.js +218 -0
- package/lib/models/Post.d.ts +136 -0
- package/lib/models/Post.js +406 -0
- package/lib/models/PostLock.d.ts +67 -0
- package/lib/models/PostLock.js +112 -0
- package/lib/models/PostRevision.d.ts +45 -0
- package/lib/models/PostRevision.js +82 -0
- package/lib/models/PublicContent.d.ts +283 -0
- package/lib/models/PublicContent.js +577 -0
- package/lib/models/Redirect.d.ts +123 -0
- package/lib/models/Redirect.js +225 -0
- package/lib/models/Settings.d.ts +61 -0
- package/lib/models/Settings.js +128 -0
- package/lib/models/Snippet.d.ts +36 -0
- package/lib/models/Snippet.js +64 -0
- package/lib/models/Tag.d.ts +23 -0
- package/lib/models/Tag.js +117 -0
- package/lib/models/Taxonomy.d.ts +127 -0
- package/lib/models/Taxonomy.js +321 -0
- package/lib/models/TwoFactor.d.ts +26 -0
- package/lib/models/TwoFactor.js +60 -0
- package/lib/models/User.d.ts +49 -0
- package/lib/models/User.js +128 -0
- package/lib/models/derive.d.ts +69 -0
- package/lib/models/derive.js +81 -0
- package/lib/models/pagination.d.ts +30 -0
- package/lib/models/pagination.js +36 -0
- package/lib/models/visibility.d.ts +31 -0
- package/lib/models/visibility.js +47 -0
- package/lib/routes/App.d.ts +2 -0
- package/lib/routes/App.js +146 -0
- package/lib/routes/api/admin.d.ts +6 -0
- package/lib/routes/api/admin.js +11 -0
- package/lib/routes/api/auth.d.ts +6 -0
- package/lib/routes/api/auth.js +24 -0
- package/lib/routes/api/authors.d.ts +5 -0
- package/lib/routes/api/authors.js +8 -0
- package/lib/routes/api/categories.d.ts +8 -0
- package/lib/routes/api/categories.js +15 -0
- package/lib/routes/api/comments.d.ts +8 -0
- package/lib/routes/api/comments.js +35 -0
- package/lib/routes/api/content-model.d.ts +17 -0
- package/lib/routes/api/content-model.js +67 -0
- package/lib/routes/api/cron.d.ts +6 -0
- package/lib/routes/api/cron.js +9 -0
- package/lib/routes/api/export.d.ts +5 -0
- package/lib/routes/api/export.js +11 -0
- package/lib/routes/api/feed.d.ts +5 -0
- package/lib/routes/api/feed.js +16 -0
- package/lib/routes/api/media.d.ts +8 -0
- package/lib/routes/api/media.js +25 -0
- package/lib/routes/api/navigation.d.ts +12 -0
- package/lib/routes/api/navigation.js +17 -0
- package/lib/routes/api/ops.d.ts +9 -0
- package/lib/routes/api/ops.js +19 -0
- package/lib/routes/api/pages.d.ts +8 -0
- package/lib/routes/api/pages.js +21 -0
- package/lib/routes/api/passkeys.d.ts +7 -0
- package/lib/routes/api/passkeys.js +13 -0
- package/lib/routes/api/posts.d.ts +8 -0
- package/lib/routes/api/posts.js +39 -0
- package/lib/routes/api/profile.d.ts +6 -0
- package/lib/routes/api/profile.js +8 -0
- package/lib/routes/api/redirects.d.ts +12 -0
- package/lib/routes/api/redirects.js +13 -0
- package/lib/routes/api/settings.d.ts +8 -0
- package/lib/routes/api/settings.js +15 -0
- package/lib/routes/api/snippets.d.ts +15 -0
- package/lib/routes/api/snippets.js +16 -0
- package/lib/routes/api/tags.d.ts +8 -0
- package/lib/routes/api/tags.js +14 -0
- package/lib/routes/api/tokens.d.ts +7 -0
- package/lib/routes/api/tokens.js +15 -0
- package/lib/routes/api/two-factor.d.ts +7 -0
- package/lib/routes/api/two-factor.js +15 -0
- package/lib/routes/api/users.d.ts +8 -0
- package/lib/routes/api/users.js +25 -0
- package/lib/routes/api/v1.d.ts +12 -0
- package/lib/routes/api/v1.js +55 -0
- package/lib/routes/api/verification.d.ts +6 -0
- package/lib/routes/api/verification.js +11 -0
- package/lib/server/index.d.ts +24 -0
- package/lib/server/index.js +110 -0
- package/lib/types/index.d.ts +298 -0
- package/lib/types/index.js +1 -0
- package/lib/vite.d.ts +2 -0
- package/lib/vite.js +101 -0
- package/mail/comment-moderation.html +27 -0
- package/mail/comment-moderation.txt +13 -0
- package/mail/comment-reply.html +28 -0
- package/mail/comment-reply.txt +14 -0
- package/mail/invitation.html +25 -0
- package/mail/invitation.txt +11 -0
- package/mail/member-magic-link.html +23 -0
- package/mail/member-magic-link.txt +10 -0
- package/mail/newsletter.html +26 -0
- package/mail/newsletter.txt +13 -0
- package/mail/password-reset.html +26 -0
- package/mail/password-reset.txt +10 -0
- package/mail/verify-email.html +25 -0
- package/mail/verify-email.txt +8 -0
- package/package.json +85 -4
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { auth } from "../../middleware/auth.js";
|
|
2
|
+
import { AuthController } from "../../controllers/AuthController.js";
|
|
3
|
+
import { loginByAddress, loginByAccount, registerLimit } from "../../middleware/rate-limits.js";
|
|
4
|
+
import { PasswordResetController } from "../../controllers/PasswordResetController.js";
|
|
5
|
+
import { passwordResetLimit, tokenRedeemLimit } from "../../middleware/rate-limits.js";
|
|
6
|
+
export default (router) => {
|
|
7
|
+
router.post('/api/auth/register', registerLimit, AuthController.register);
|
|
8
|
+
// Both limits, because they stop different attacks: by address catches one
|
|
9
|
+
// attacker working through many accounts, by account catches many addresses
|
|
10
|
+
// working on one — which is what credential stuffing looks like.
|
|
11
|
+
router.post('/api/auth/login', loginByAddress, loginByAccount, AuthController.login);
|
|
12
|
+
// Through `auth`, so a revoked or disabled session is refused here too —
|
|
13
|
+
// this is what the client asks on load to decide whether it is signed in.
|
|
14
|
+
router.get('/api/user', auth, AuthController.user);
|
|
15
|
+
// Ends every session the account has: tokens carry a version, and this
|
|
16
|
+
// bumps it.
|
|
17
|
+
router.post('/api/auth/logout', auth, AuthController.logout);
|
|
18
|
+
// Forgotten passwords. The request is limited by address here and by mailbox
|
|
19
|
+
// inside the controller — silently, so the answer never depends on whether
|
|
20
|
+
// the account exists. Both stay registered with DISABLE_REGISTRATION and
|
|
21
|
+
// without a public site: they are how an existing account gets back in.
|
|
22
|
+
router.post('/api/auth/forgot-password', passwordResetLimit, PasswordResetController.request);
|
|
23
|
+
router.post('/api/auth/reset-password', tokenRedeemLimit, PasswordResetController.reset);
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AuthorController } from "../../controllers/AuthorController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
4
|
+
export default (router) => {
|
|
5
|
+
// The admin's author menu. Profiles for a reader come from /api/v1/authors,
|
|
6
|
+
// which is a different surface with a different rule about who may read it.
|
|
7
|
+
router.get('/api/authors', auth, requireCapability('post.create'), AuthorController.index);
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (router: Router) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CategoryController } from "../../controllers/CategoryController.js";
|
|
2
|
+
import { authOrToken } from "../../middleware/api-auth.js";
|
|
3
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
4
|
+
export default (router) => {
|
|
5
|
+
// Public routes
|
|
6
|
+
router.get('/api/categories', CategoryController.index);
|
|
7
|
+
router.get('/api/categories/tree', CategoryController.tree);
|
|
8
|
+
router.get('/api/categories/slug/:slug', CategoryController.showBySlug);
|
|
9
|
+
router.get('/api/categories/:id', CategoryController.show);
|
|
10
|
+
// Admin routes: a session, or an API token holding content:write acting as
|
|
11
|
+
// its owner — the capability check after it applies either way.
|
|
12
|
+
router.post('/api/categories', authOrToken('content:write'), requireCapability('category.manage'), CategoryController.store);
|
|
13
|
+
router.put('/api/categories/:id', authOrToken('content:write'), requireCapability('category.manage'), CategoryController.update);
|
|
14
|
+
router.delete('/api/categories/:id', authOrToken('content:write'), requireCapability('category.manage'), CategoryController.destroy);
|
|
15
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (router: Router) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CommentController } from "../../controllers/CommentController.js";
|
|
2
|
+
import { auth, optionalAuth } from "../../middleware/auth.js";
|
|
3
|
+
import { commentLimit, unsubscribeLimit } from "../../middleware/rate-limits.js";
|
|
4
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
5
|
+
export default (router) => {
|
|
6
|
+
// Public routes - get comments for a post
|
|
7
|
+
// optionalAuth so a moderator can ask for the whole thread; everyone else
|
|
8
|
+
// gets the approved comments, without addresses.
|
|
9
|
+
router.get('/api/posts/:postId/comments', optionalAuth, CommentController.byPost);
|
|
10
|
+
// Post comment (optional auth - guests can comment with name/email)
|
|
11
|
+
// optionalAuth so a signed-in commenter posts as themselves. This route
|
|
12
|
+
// never ran any auth, so everyone was a guest and could use any name.
|
|
13
|
+
router.post('/api/posts/:postId/comments', commentLimit, optionalAuth, CommentController.store);
|
|
14
|
+
// The unsubscribe link in a reply notification. No session — the signed
|
|
15
|
+
// token is the authority — and registered before `/api/comments/:id`, which
|
|
16
|
+
// would otherwise claim the path and ask for one. Rate limited, since it is
|
|
17
|
+
// as open as posting.
|
|
18
|
+
router.get('/api/comments/unsubscribe', unsubscribeLimit, CommentController.unsubscribePage);
|
|
19
|
+
router.post('/api/comments/unsubscribe', unsubscribeLimit, CommentController.unsubscribe);
|
|
20
|
+
// Admin routes (authenticated)
|
|
21
|
+
router.get('/api/comments', auth, requireCapability('comment.moderate'), CommentController.index);
|
|
22
|
+
router.get('/api/comments/pending', auth, requireCapability('comment.moderate'), CommentController.pending);
|
|
23
|
+
// The comment settings this workstream owns (blocklist, link limit, who is
|
|
24
|
+
// notified). Readable by moderators; changing them is site configuration.
|
|
25
|
+
// Static paths before `:id`, which matches anything.
|
|
26
|
+
router.get('/api/comments/settings', auth, requireCapability('comment.moderate'), CommentController.settings);
|
|
27
|
+
router.put('/api/comments/settings', auth, requireCapability('settings.manage'), CommentController.updateSettings);
|
|
28
|
+
router.post('/api/comments/bulk', auth, requireCapability('comment.moderate'), CommentController.bulk);
|
|
29
|
+
router.post('/api/comments/empty', auth, requireCapability('comment.moderate'), CommentController.empty);
|
|
30
|
+
router.get('/api/comments/:id', auth, requireCapability('comment.moderate'), CommentController.show);
|
|
31
|
+
router.put('/api/comments/:id', auth, requireCapability('comment.moderate'), CommentController.update);
|
|
32
|
+
router.put('/api/comments/:id/approve', auth, requireCapability('comment.moderate'), CommentController.approve);
|
|
33
|
+
router.put('/api/comments/:id/status', auth, requireCapability('comment.moderate'), CommentController.setStatus);
|
|
34
|
+
router.delete('/api/comments/:id', auth, requireCapability('comment.moderate'), CommentController.destroy);
|
|
35
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Admin API for content types and custom taxonomies.
|
|
9
|
+
*
|
|
10
|
+
* Reads take a session or a `content:write` token, like `/api/posts`: the
|
|
11
|
+
* editor needs a type's fields to render them, and a program writing recipes
|
|
12
|
+
* needs the schema it is writing against. Defining types and taxonomies is
|
|
13
|
+
* `settings.manage` and a person's job (`auth` refuses tokens); managing terms
|
|
14
|
+
* is `category.manage`, as categories are. The public reads are in v1.ts.
|
|
15
|
+
*/
|
|
16
|
+
declare const _default: (router: Router) => void;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { hooks, HOOKS } from '@basicbenframework/core/hooks';
|
|
2
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
3
|
+
import { ContentTypeController } from "../../controllers/ContentTypeController.js";
|
|
4
|
+
import { TaxonomyController } from "../../controllers/TaxonomyController.js";
|
|
5
|
+
import { ContentType } from "../../models/ContentType.js";
|
|
6
|
+
import { auth } from "../../middleware/auth.js";
|
|
7
|
+
import { authOrToken } from "../../middleware/api-auth.js";
|
|
8
|
+
/**
|
|
9
|
+
* Admin API for content types and custom taxonomies.
|
|
10
|
+
*
|
|
11
|
+
* Reads take a session or a `content:write` token, like `/api/posts`: the
|
|
12
|
+
* editor needs a type's fields to render them, and a program writing recipes
|
|
13
|
+
* needs the schema it is writing against. Defining types and taxonomies is
|
|
14
|
+
* `settings.manage` and a person's job (`auth` refuses tokens); managing terms
|
|
15
|
+
* is `category.manage`, as categories are. The public reads are in v1.ts.
|
|
16
|
+
*/
|
|
17
|
+
export default (router) => {
|
|
18
|
+
const read = authOrToken('content:write');
|
|
19
|
+
const manage = [auth, requireCapability('settings.manage')];
|
|
20
|
+
const terms = [authOrToken('content:write'), requireCapability('category.manage')];
|
|
21
|
+
router.get('/api/content-types', read, ContentTypeController.index);
|
|
22
|
+
router.get('/api/content-types/:id', read, ContentTypeController.show);
|
|
23
|
+
router.post('/api/content-types', ...manage, ContentTypeController.store);
|
|
24
|
+
router.put('/api/content-types/:id', ...manage, ContentTypeController.update);
|
|
25
|
+
router.delete('/api/content-types/:id', ...manage, ContentTypeController.destroy);
|
|
26
|
+
router.get('/api/taxonomies', read, TaxonomyController.index);
|
|
27
|
+
router.post('/api/taxonomies', ...manage, TaxonomyController.store);
|
|
28
|
+
router.put('/api/taxonomies/:id', ...manage, TaxonomyController.update);
|
|
29
|
+
router.delete('/api/taxonomies/:id', ...manage, TaxonomyController.destroy);
|
|
30
|
+
router.get('/api/taxonomies/:id/terms', read, TaxonomyController.terms);
|
|
31
|
+
router.post('/api/taxonomies/:id/terms', ...terms, TaxonomyController.storeTerm);
|
|
32
|
+
router.put('/api/terms/:id', ...terms, TaxonomyController.updateTerm);
|
|
33
|
+
router.delete('/api/terms/:id', ...terms, TaxonomyController.destroyTerm);
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* One sidebar entry per custom content type, under Content.
|
|
37
|
+
*
|
|
38
|
+
* Generated from the table rather than hard-coded, so creating a "Recipes"
|
|
39
|
+
* type puts Recipes in the nav for everyone the moment it is saved. Through
|
|
40
|
+
* the `admin.menu` filter AdminController already fires, which is the
|
|
41
|
+
* extension point for exactly this. Each entry lands right after Posts.
|
|
42
|
+
*
|
|
43
|
+
* The paths need the client route `/admin/content/:type` (see the Phase 3
|
|
44
|
+
* report); the static Content types and Taxonomies entries belong in the two
|
|
45
|
+
* hard-coded menus instead, because they never change.
|
|
46
|
+
*
|
|
47
|
+
* A failure here — the table missing before migrations run, say — leaves the
|
|
48
|
+
* menu as it was rather than blanking it.
|
|
49
|
+
*/
|
|
50
|
+
hooks.on(HOOKS.ADMIN_MENU, async (items) => {
|
|
51
|
+
try {
|
|
52
|
+
const custom = (await ContentType.all()).filter((type) => !type.builtin);
|
|
53
|
+
if (!Array.isArray(items) || custom.length === 0)
|
|
54
|
+
return items;
|
|
55
|
+
const entries = custom.map((type) => ({
|
|
56
|
+
path: `/admin/content/${type.key}`,
|
|
57
|
+
label: type.plural_label,
|
|
58
|
+
icon: '🗂️',
|
|
59
|
+
section: 'Content'
|
|
60
|
+
}));
|
|
61
|
+
const at = items.findIndex((item) => item.path === '/admin/posts');
|
|
62
|
+
return at === -1 ? [...items, ...entries] : [...items.slice(0, at + 1), ...entries, ...items.slice(at + 1)];
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return items;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { publishDueEndpoint } from "../../helpers/publish-due.js";
|
|
2
|
+
import { cronTickEndpoint } from "../../host/cron.js";
|
|
3
|
+
/** Endpoints for a platform scheduler. Each checks CRON_SECRET itself. */
|
|
4
|
+
export default (router) => {
|
|
5
|
+
// Everything scheduled, core's and every feature's: the one route a
|
|
6
|
+
// platform cron needs. See src/host/cron.ts.
|
|
7
|
+
router.get('/api/cron/tick', cronTickEndpoint);
|
|
8
|
+
router.get('/api/cron/publish-due', publishDueEndpoint);
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExportController } from "../../controllers/ExportController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { requireSession } from "../../middleware/api-auth.js";
|
|
4
|
+
import { requireRole, ROLES } from '@basicbenframework/core/auth/permissions';
|
|
5
|
+
export default (router) => {
|
|
6
|
+
// Admins only, by role rather than capability: an export carries every
|
|
7
|
+
// user's address and every draft, which is more than any one capability
|
|
8
|
+
// grants. A signed-in session, never an API token — a leaked token should
|
|
9
|
+
// not be a way to download the whole site.
|
|
10
|
+
router.get('/api/export', auth, requireSession, requireRole(ROLES.ADMIN), ExportController.download);
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FeedController } from "../../controllers/FeedController.js";
|
|
2
|
+
export default (router) => {
|
|
3
|
+
// RSS, JSON Feed and the sitemap describe *this* app's public site. With
|
|
4
|
+
// DISABLE_PUBLIC_SITE that site does not exist, so they are not registered:
|
|
5
|
+
// a feed advertising pages that render nothing, and a sitemap inviting
|
|
6
|
+
// search engines to index them, are worse than absent.
|
|
7
|
+
//
|
|
8
|
+
// The content API at /api/v1 is unaffected — a headless consumer reads that,
|
|
9
|
+
// and serving one is the whole point of running in this mode.
|
|
10
|
+
if (process.env.DISABLE_PUBLIC_SITE === 'true')
|
|
11
|
+
return;
|
|
12
|
+
router.get('/feed.xml', FeedController.rss);
|
|
13
|
+
router.get('/feed.json', FeedController.json);
|
|
14
|
+
router.get('/sitemap.xml', FeedController.sitemap);
|
|
15
|
+
router.get('/robots.txt', FeedController.robots);
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (router: Router) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MediaController } from "../../controllers/MediaController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { authOrToken } from "../../middleware/api-auth.js";
|
|
4
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
5
|
+
// The Admin API for media: a session, or an API token holding media:write,
|
|
6
|
+
// acting as its owner — so `media.upload` below is the owner's capability, and
|
|
7
|
+
// a contributor's token can no more upload than the contributor can.
|
|
8
|
+
const mediaWrite = authOrToken('media:write');
|
|
9
|
+
export default (router) => {
|
|
10
|
+
// Browsing the library is for the people who can add to it. A subscriber
|
|
11
|
+
// has a session and no business listing every upload and who made it.
|
|
12
|
+
router.get('/api/media', mediaWrite, requireCapability('media.upload'), MediaController.index);
|
|
13
|
+
router.get('/api/media/stats', auth, requireCapability('media.upload'), MediaController.stats);
|
|
14
|
+
router.get('/api/media/:id', mediaWrite, requireCapability('media.upload'), MediaController.show);
|
|
15
|
+
// Uploads are two steps: sign, then PUT straight to storage, then confirm.
|
|
16
|
+
// The bytes never pass through this server.
|
|
17
|
+
router.post('/api/media/sign', mediaWrite, requireCapability('media.upload'), MediaController.sign);
|
|
18
|
+
router.post('/api/media/confirm', mediaWrite, requireCapability('media.upload'), MediaController.confirm);
|
|
19
|
+
// Ownership is checked in the controller against the row, which is what
|
|
20
|
+
// lets `media.delete.own` mean something.
|
|
21
|
+
router.put('/api/media/:id', mediaWrite, requireCapability('media.upload'), MediaController.update);
|
|
22
|
+
// Deleting a file breaks every post that shows it, and there is no trash to
|
|
23
|
+
// get it back from, so it stays with a signed-in person.
|
|
24
|
+
router.delete('/api/media/:id', auth, MediaController.destroy);
|
|
25
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Admin management of navigation menus. The public read is
|
|
9
|
+
* `/api/v1/navigation`, in v1.ts.
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: (router: Router) => void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NavigationController } from "../../controllers/NavigationController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
4
|
+
/**
|
|
5
|
+
* Admin management of navigation menus. The public read is
|
|
6
|
+
* `/api/v1/navigation`, in v1.ts.
|
|
7
|
+
*/
|
|
8
|
+
export default (router) => {
|
|
9
|
+
router.get('/api/navigation/menus', auth, requireCapability('settings.manage'), NavigationController.index);
|
|
10
|
+
router.post('/api/navigation/menus', auth, requireCapability('settings.manage'), NavigationController.storeMenu);
|
|
11
|
+
router.put('/api/navigation/menus/:id', auth, requireCapability('settings.manage'), NavigationController.updateMenu);
|
|
12
|
+
router.delete('/api/navigation/menus/:id', auth, requireCapability('settings.manage'), NavigationController.destroyMenu);
|
|
13
|
+
router.post('/api/navigation/menus/:id/items', auth, requireCapability('settings.manage'), NavigationController.storeItem);
|
|
14
|
+
router.put('/api/navigation/menus/:id/reorder', auth, requireCapability('settings.manage'), NavigationController.reorder);
|
|
15
|
+
router.put('/api/navigation/items/:id', auth, requireCapability('settings.manage'), NavigationController.updateItem);
|
|
16
|
+
router.delete('/api/navigation/items/:id', auth, requireCapability('settings.manage'), NavigationController.destroyItem);
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Operations: site health and the maintenance cron.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: (router: Router) => void;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HealthController } from "../../controllers/HealthController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { requireSession } from "../../middleware/api-auth.js";
|
|
4
|
+
import { healthActionLimit } from "../../middleware/rate-limits.js";
|
|
5
|
+
import { requireRole, ROLES } from '@basicbenframework/core/auth/permissions';
|
|
6
|
+
/**
|
|
7
|
+
* Operations: site health and the maintenance cron.
|
|
8
|
+
*/
|
|
9
|
+
export default (router) => {
|
|
10
|
+
// Admins only, by role, and a signed-in session rather than an API token —
|
|
11
|
+
// the same rule as the export. The page describes how the deployment is
|
|
12
|
+
// secured, which is a map for whoever holds a leaked token.
|
|
13
|
+
const admin = [auth, requireSession, requireRole(ROLES.ADMIN)];
|
|
14
|
+
router.get('/api/admin/health', ...admin, HealthController.index);
|
|
15
|
+
router.post('/api/admin/health/storage-probe', ...admin, healthActionLimit, HealthController.storageProbe);
|
|
16
|
+
router.post('/api/admin/health/test-email', ...admin, healthActionLimit, HealthController.testEmail);
|
|
17
|
+
// For a platform scheduler; checks CRON_SECRET itself.
|
|
18
|
+
router.get('/api/cron/maintenance', HealthController.maintenance);
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (router: Router) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PageController } from "../../controllers/PageController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { authOrToken } from "../../middleware/api-auth.js";
|
|
4
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
5
|
+
export default (router) => {
|
|
6
|
+
// Public routes
|
|
7
|
+
router.get('/api/pages/published', PageController.published);
|
|
8
|
+
router.get('/api/pages/slug/:slug', PageController.showPublishedBySlug);
|
|
9
|
+
// Admin routes (authenticated)
|
|
10
|
+
router.get('/api/pages', auth, requireCapability('page.edit'), PageController.index);
|
|
11
|
+
router.get('/api/pages/tree', auth, requireCapability('page.edit'), PageController.tree);
|
|
12
|
+
router.get('/api/pages/:id', auth, requireCapability('page.edit'), PageController.show);
|
|
13
|
+
// Creating and editing take an API token with content:write, as posts do
|
|
14
|
+
// (docs/admin-api.md). Delete stays session-only: a page delete is
|
|
15
|
+
// permanent, and no token may destroy content outright.
|
|
16
|
+
router.post('/api/pages', authOrToken('content:write'), requireCapability('page.create'), PageController.store);
|
|
17
|
+
// Before /:id, which would otherwise match `reorder` as an id.
|
|
18
|
+
router.put('/api/pages/reorder', auth, requireCapability('page.edit'), PageController.reorder);
|
|
19
|
+
router.put('/api/pages/:id', authOrToken('content:write'), requireCapability('page.edit'), PageController.update);
|
|
20
|
+
router.delete('/api/pages/:id', auth, requireCapability('page.delete'), PageController.destroy);
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: (router: Router) => void;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PasskeyController } from "../../controllers/PasskeyController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
export default (router) => {
|
|
4
|
+
// Public: the second step of a login, so there is no session yet. It takes
|
|
5
|
+
// the challenge issued after a correct password, so it cannot be used to
|
|
6
|
+
// discover whether an account has passkeys.
|
|
7
|
+
router.post('/api/auth/passkey/options', PasskeyController.authenticateOptions);
|
|
8
|
+
// Managing your own passkeys.
|
|
9
|
+
router.get('/api/auth/passkeys', auth, PasskeyController.list);
|
|
10
|
+
router.post('/api/auth/passkeys/options', auth, PasskeyController.registerOptions);
|
|
11
|
+
router.post('/api/auth/passkeys/verify', auth, PasskeyController.registerVerify);
|
|
12
|
+
router.delete('/api/auth/passkeys/:id', auth, PasskeyController.remove);
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (router: Router) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PostController } from "../../controllers/PostController.js";
|
|
2
|
+
import { PostLockController } from "../../controllers/PostLockController.js";
|
|
3
|
+
import { auth } from "../../middleware/auth.js";
|
|
4
|
+
import { authOrToken, requireSession } from "../../middleware/api-auth.js";
|
|
5
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
6
|
+
// The Admin API. These routes take a session or an API token holding
|
|
7
|
+
// content:write; with a token the request acts as the token's owner, so every
|
|
8
|
+
// capability check below still applies. See docs/admin-api.md. Routes still on
|
|
9
|
+
// plain `auth` (bulk, revisions, restore, locks) are for people in the admin
|
|
10
|
+
// and refuse tokens.
|
|
11
|
+
const contentWrite = authOrToken('content:write');
|
|
12
|
+
export default (router) => {
|
|
13
|
+
// Public feed routes
|
|
14
|
+
router.get('/api/feed', PostController.feed);
|
|
15
|
+
router.get('/api/feed/:id', PostController.feedShow);
|
|
16
|
+
// Authenticated post routes. Reading is here too so a program that writes a
|
|
17
|
+
// post can read its draft back; content:read tokens are for /api/v1.
|
|
18
|
+
router.get('/api/posts', contentWrite, PostController.index);
|
|
19
|
+
// Creating is a capability, not just a session: a subscriber has an account
|
|
20
|
+
// and must not be able to write to the site with it.
|
|
21
|
+
router.post('/api/posts', contentWrite, requireCapability('post.create'), PostController.store);
|
|
22
|
+
// Before the /:id routes, which would otherwise read `bulk` as an id.
|
|
23
|
+
router.post('/api/posts/bulk', auth, PostController.bulk);
|
|
24
|
+
router.get('/api/posts/:id', contentWrite, PostController.show);
|
|
25
|
+
router.post('/api/posts/:id/restore', auth, PostController.restore);
|
|
26
|
+
router.put('/api/posts/:id/autosave', auth, PostController.autosave);
|
|
27
|
+
router.get('/api/posts/:id/revisions', auth, PostController.revisions);
|
|
28
|
+
router.get('/api/posts/:id/revisions/:revisionId', auth, PostController.revision);
|
|
29
|
+
router.post('/api/posts/:id/revisions/:revisionId/restore', auth, PostController.restoreRevision);
|
|
30
|
+
// The editor's soft lock: heartbeat, look, let go. A person's, never a
|
|
31
|
+
// token's — `auth` refuses tokens, and requireSession is the second latch.
|
|
32
|
+
router.get('/api/posts/:id/lock', auth, requireSession, PostLockController.show);
|
|
33
|
+
router.post('/api/posts/:id/lock', auth, requireSession, PostLockController.acquire);
|
|
34
|
+
router.delete('/api/posts/:id/lock', auth, requireSession, PostLockController.release);
|
|
35
|
+
router.put('/api/posts/:id', contentWrite, PostController.update);
|
|
36
|
+
// Moves to the trash; on a post already there, deletes it for good — the
|
|
37
|
+
// second only with a session, which the controller checks.
|
|
38
|
+
router.delete('/api/posts/:id', contentWrite, PostController.destroy);
|
|
39
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ProfileController } from "../../controllers/ProfileController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { accountChangeLimit } from "../../middleware/rate-limits.js";
|
|
4
|
+
export default (router) => {
|
|
5
|
+
router.get('/api/profile', auth, ProfileController.show);
|
|
6
|
+
router.put('/api/profile', auth, accountChangeLimit, ProfileController.update);
|
|
7
|
+
router.put('/api/profile/password', auth, accountChangeLimit, ProfileController.changePassword);
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Admin management of redirects. The public map is `/api/v1/redirects`, in
|
|
9
|
+
* v1.ts; applying it is the front end's job, since the CMS is headless.
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: (router: Router) => void;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RedirectController } from "../../controllers/RedirectController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
4
|
+
/**
|
|
5
|
+
* Admin management of redirects. The public map is `/api/v1/redirects`, in
|
|
6
|
+
* v1.ts; applying it is the front end's job, since the CMS is headless.
|
|
7
|
+
*/
|
|
8
|
+
export default (router) => {
|
|
9
|
+
router.get('/api/redirects', auth, requireCapability('settings.manage'), RedirectController.index);
|
|
10
|
+
router.post('/api/redirects', auth, requireCapability('settings.manage'), RedirectController.store);
|
|
11
|
+
router.put('/api/redirects/:id', auth, requireCapability('settings.manage'), RedirectController.update);
|
|
12
|
+
router.delete('/api/redirects/:id', auth, requireCapability('settings.manage'), RedirectController.destroy);
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (router: Router) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SettingsController } from "../../controllers/SettingsController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
4
|
+
export default (router) => {
|
|
5
|
+
// Public site info
|
|
6
|
+
router.get('/api/site', SettingsController.getSiteInfo);
|
|
7
|
+
// Admin routes (authenticated)
|
|
8
|
+
router.get('/api/settings', auth, requireCapability('settings.manage'), SettingsController.index);
|
|
9
|
+
router.get('/api/settings/group/:group', auth, requireCapability('settings.manage'), SettingsController.byGroup);
|
|
10
|
+
router.get('/api/settings/:key', auth, requireCapability('settings.manage'), SettingsController.get);
|
|
11
|
+
router.put('/api/settings', auth, requireCapability('settings.manage'), SettingsController.update);
|
|
12
|
+
router.put('/api/settings/:key', auth, requireCapability('settings.manage'), SettingsController.set);
|
|
13
|
+
router.delete('/api/settings/:key', auth, requireCapability('settings.manage'), SettingsController.delete);
|
|
14
|
+
router.put('/api/site', auth, requireCapability('settings.manage'), SettingsController.updateSiteInfo);
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Snippets: reusable Markdown for the editor.
|
|
9
|
+
*
|
|
10
|
+
* Session-only. They exist to be inserted while writing in the admin; a
|
|
11
|
+
* program creating posts sends the finished Markdown and has no use for them.
|
|
12
|
+
* Who may use and manage them is decided in the controller, against the row.
|
|
13
|
+
*/
|
|
14
|
+
declare const _default: (router: Router) => void;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SnippetController } from "../../controllers/SnippetController.js";
|
|
2
|
+
import { auth } from "../../middleware/auth.js";
|
|
3
|
+
/**
|
|
4
|
+
* Snippets: reusable Markdown for the editor.
|
|
5
|
+
*
|
|
6
|
+
* Session-only. They exist to be inserted while writing in the admin; a
|
|
7
|
+
* program creating posts sends the finished Markdown and has no use for them.
|
|
8
|
+
* Who may use and manage them is decided in the controller, against the row.
|
|
9
|
+
*/
|
|
10
|
+
export default (router) => {
|
|
11
|
+
router.get('/api/snippets', auth, SnippetController.index);
|
|
12
|
+
router.get('/api/snippets/:id', auth, SnippetController.show);
|
|
13
|
+
router.post('/api/snippets', auth, SnippetController.store);
|
|
14
|
+
router.put('/api/snippets/:id', auth, SnippetController.update);
|
|
15
|
+
router.delete('/api/snippets/:id', auth, SnippetController.destroy);
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
put: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (router: Router) => void;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TagController } from "../../controllers/TagController.js";
|
|
2
|
+
import { authOrToken } from "../../middleware/api-auth.js";
|
|
3
|
+
import { requireCapability } from '@basicbenframework/core/auth/permissions';
|
|
4
|
+
export default (router) => {
|
|
5
|
+
// Public routes
|
|
6
|
+
router.get('/api/tags', TagController.index);
|
|
7
|
+
router.get('/api/tags/slug/:slug', TagController.showBySlug);
|
|
8
|
+
router.get('/api/tags/:id', TagController.show);
|
|
9
|
+
// Admin routes: a session, or an API token holding content:write acting as
|
|
10
|
+
// its owner — the capability check after it applies either way.
|
|
11
|
+
router.post('/api/tags', authOrToken('content:write'), requireCapability('tag.manage'), TagController.store);
|
|
12
|
+
router.put('/api/tags/:id', authOrToken('content:write'), requireCapability('tag.manage'), TagController.update);
|
|
13
|
+
router.delete('/api/tags/:id', authOrToken('content:write'), requireCapability('tag.manage'), TagController.destroy);
|
|
14
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface Router {
|
|
2
|
+
get: (path: string, ...handlers: Function[]) => void;
|
|
3
|
+
post: (path: string, ...handlers: Function[]) => void;
|
|
4
|
+
delete: (path: string, ...handlers: Function[]) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: (router: Router) => void;
|
|
7
|
+
export default _default;
|