studiocms 0.1.0-beta.7 → 0.1.0-beta.8
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/CHANGELOG.md +473 -0
- package/LICENSE +1 -1
- package/README.md +17 -10
- package/auth.d.ts +405 -0
- package/core.d.ts +225 -0
- package/custom-renderers/index.ts +4 -0
- package/custom-renderers/markdocRenderers/markdocReact-components/MarkDocReactRenderer.tsx +8 -0
- package/custom-renderers/markdocRenderers/markdocReact-components/MarkDocReactWrapper.astro +13 -0
- package/custom-renderers/markdocRenderers/markdocReact.ts +56 -0
- package/dist/cli/cmds/get-turso.d.ts +1 -0
- package/dist/cli/cmds/get-turso.js +10 -0
- package/dist/cli/cmds/init/index.d.ts +4 -0
- package/dist/cli/cmds/init/index.js +52 -0
- package/dist/cli/cmds/init/steps/data/studiocmsEnv.d.ts +3 -0
- package/dist/cli/cmds/init/steps/data/studiocmsEnv.js +71 -0
- package/dist/cli/cmds/init/steps/envBuilder.d.ts +21 -0
- package/dist/cli/cmds/init/steps/envBuilder.js +368 -0
- package/dist/cli/cmds/init/steps/nextSteps.d.ts +2 -0
- package/dist/cli/cmds/init/steps/nextSteps.js +38 -0
- package/dist/cli/cmds/init.d.ts +1 -0
- package/dist/cli/cmds/init.js +4 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +9 -0
- package/dist/cli/lib/commander.d.ts +39 -0
- package/dist/cli/lib/commander.js +87 -0
- package/dist/cli/lib/context.d.ts +28 -0
- package/dist/cli/lib/context.js +55 -0
- package/dist/cli/lib/pathUtil.d.ts +5 -0
- package/dist/cli/lib/pathUtil.js +14 -0
- package/dist/cli/lib/runExternal.d.ts +20 -0
- package/dist/cli/lib/runExternal.js +40 -0
- package/dist/cli/lib/seasonal.d.ts +5 -0
- package/dist/cli/lib/seasonal.js +88 -0
- package/dist/cli/lib/utils.d.ts +55 -0
- package/dist/cli/lib/utils.js +310 -0
- package/dist/cli/shared/intro.d.ts +2 -0
- package/dist/cli/shared/intro.js +24 -0
- package/dist/components/DefaultEditor.astro +138 -0
- package/dist/components/FormattedDate.astro +12 -0
- package/dist/components/Generator.astro +7 -0
- package/dist/components/Renderer.astro +13 -0
- package/dist/components/auth/OAuthButton.astro +21 -0
- package/dist/components/auth/OAuthButtonStack.astro +19 -0
- package/dist/components/auth/StaticAuthCheck.astro +20 -0
- package/dist/components/auth/StudioCMSLogoSVG.astro +13 -0
- package/dist/components/auth/oAuthButtonProviders.d.ts +8 -0
- package/dist/components/auth/oAuthButtonProviders.js +35 -0
- package/dist/components/dashboard/AstroCodeDiffsScript.astro +25 -0
- package/dist/components/dashboard/BaseHead.astro +41 -0
- package/dist/components/dashboard/Code.astro +23 -0
- package/dist/components/dashboard/DashboardPageHeader.astro +60 -0
- package/dist/components/dashboard/DoubleSidebar.astro +26 -0
- package/dist/components/dashboard/Footer.astro +16 -0
- package/dist/components/dashboard/MainSidebarContent.astro +124 -0
- package/dist/components/dashboard/PageHeader.astro +52 -0
- package/dist/components/dashboard/SidebarLink.astro +61 -0
- package/dist/components/dashboard/SidebarModals.astro +6 -0
- package/dist/components/dashboard/SidebarPluginLink.astro +45 -0
- package/dist/components/dashboard/SingleSidebar.astro +23 -0
- package/dist/components/dashboard/StudioCMSLogo.astro +12 -0
- package/dist/components/dashboard/ThemeManager.astro +53 -0
- package/dist/components/dashboard/component-scripts/TinyMDE.astro +6 -0
- package/dist/components/dashboard/component-scripts/dateTimeListener.d.ts +1 -0
- package/dist/components/dashboard/component-scripts/dateTimeListener.js +14 -0
- package/dist/components/dashboard/component-scripts/dateWithTimeAndZone.d.ts +1 -0
- package/dist/components/dashboard/component-scripts/dateWithTimeAndZone.js +12 -0
- package/dist/components/dashboard/component-scripts/makeClientRoutable.d.ts +1 -0
- package/dist/components/dashboard/component-scripts/makeClientRoutable.js +9 -0
- package/dist/components/dashboard/component-scripts/timeAgo.d.ts +1 -0
- package/dist/components/dashboard/component-scripts/timeAgo.js +21 -0
- package/dist/components/dashboard/islands/LoginChecker.astro +52 -0
- package/dist/components/dashboard/islands/configuration/ConfigForm.astro +272 -0
- package/dist/components/dashboard/islands/configuration/LightVsDark.astro +67 -0
- package/dist/components/dashboard/islands/content-mgmt/CreateFolder.astro +91 -0
- package/dist/components/dashboard/islands/content-mgmt/CreatePage.astro +332 -0
- package/dist/components/dashboard/islands/content-mgmt/EditFolder.astro +112 -0
- package/dist/components/dashboard/islands/content-mgmt/EditPage.astro +388 -0
- package/dist/components/dashboard/islands/content-mgmt/InnerSidebarElement.astro +230 -0
- package/dist/components/dashboard/islands/content-mgmt/PageHeader.astro +387 -0
- package/dist/components/dashboard/islands/content-mgmt/PageList.astro +49 -0
- package/dist/components/dashboard/islands/content-mgmt/PluginFields.astro +29 -0
- package/dist/components/dashboard/islands/content-mgmt/TreeRenderer.astro +75 -0
- package/dist/components/dashboard/islands/content-mgmt/TreeSidebarFolder.astro +53 -0
- package/dist/components/dashboard/islands/content-mgmt/TreeSidebarLink.astro +51 -0
- package/dist/components/dashboard/islands/content-mgmt/runtime.d.ts +10 -0
- package/dist/components/dashboard/islands/content-mgmt/runtime.js +33 -0
- package/dist/components/dashboard/islands/content-mgmt/shared.d.ts +27 -0
- package/dist/components/dashboard/islands/content-mgmt/shared.js +31 -0
- package/dist/components/dashboard/islands/dashboard/DashboardGrid.astro +39 -0
- package/dist/components/dashboard/islands/dashboard/DashboardGridItem.astro +34 -0
- package/dist/components/dashboard/islands/dashboard/Test.astro +5 -0
- package/dist/components/dashboard/islands/dashboard/UserName.astro +6 -0
- package/dist/components/dashboard/islands/dashboard/shared.d.ts +2 -0
- package/dist/components/dashboard/islands/dashboard/shared.js +0 -0
- package/dist/components/dashboard/islands/plugins/SettingsRenderer.astro +29 -0
- package/dist/components/dashboard/islands/profile/APITokens.astro +267 -0
- package/dist/components/dashboard/islands/profile/BasicInfo.astro +107 -0
- package/dist/components/dashboard/islands/profile/BasicInfoFallback.astro +43 -0
- package/dist/components/dashboard/islands/profile/SocialSignin.astro +151 -0
- package/dist/components/dashboard/islands/profile/SocialSigninFallback.astro +83 -0
- package/dist/components/dashboard/islands/profile/UpdatePassword.astro +137 -0
- package/dist/components/dashboard/islands/profile/UpdatePasswordFallback.astro +47 -0
- package/dist/components/dashboard/islands/profile/oAuthButtonProviders.d.ts +8 -0
- package/dist/components/dashboard/islands/profile/oAuthButtonProviders.js +35 -0
- package/dist/components/dashboard/islands/sidebar/Admin.astro +103 -0
- package/dist/components/dashboard/islands/sidebar/Editor.astro +18 -0
- package/dist/components/dashboard/islands/sidebar/UserAccount.astro +23 -0
- package/dist/components/dashboard/islands/sidebar/VersionCheck.astro +127 -0
- package/dist/components/dashboard/islands/sidebar/VersionCheckChangelog.astro +107 -0
- package/dist/components/dashboard/islands/user-mgmt/InnerSidebarElement.astro +298 -0
- package/dist/components/dashboard/islands/user-mgmt/RankCheck.astro +49 -0
- package/dist/components/dashboard/islands/user-mgmt/SocialSignin.astro +88 -0
- package/dist/components/dashboard/islands/user-mgmt/UserListItem.astro +60 -0
- package/dist/components/dashboard/sidebar-modals/UserManagementModals.astro +103 -0
- package/dist/components/dashboard/sidebar-modals/VersionModal.astro +267 -0
- package/dist/components/dashboard/sidebarConfig.d.ts +31 -0
- package/dist/components/dashboard/sidebarConfig.js +90 -0
- package/dist/components/default-grid-items/Recently-created-pages.astro +91 -0
- package/dist/components/default-grid-items/Recently-signed-up.astro +71 -0
- package/dist/components/default-grid-items/Recently-updated-pages.astro +96 -0
- package/dist/components/default-grid-items/Totals.astro +107 -0
- package/dist/components/default-grid-items/utils.d.ts +17 -0
- package/dist/components/default-grid-items/utils.js +26 -0
- package/dist/components/image/CustomImage.astro +90 -0
- package/dist/components/user-quick-tools.d.ts +42 -0
- package/dist/components/user-quick-tools.js +312 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +4 -0
- package/dist/consts.d.ts +61 -0
- package/dist/consts.js +39 -0
- package/dist/db/config.d.ts +4 -0
- package/dist/db/config.js +6 -0
- package/dist/db/tables.js +168 -0
- package/dist/errors.d.ts +19 -0
- package/dist/errors.js +11 -0
- package/dist/index.d.ts +152 -0
- package/dist/index.js +1177 -0
- package/dist/layouts/auth/AuthLayout.astro +74 -0
- package/dist/layouts/auth/FallbackCanvas.astro +123 -0
- package/dist/layouts/auth/ThemeManager.astro +53 -0
- package/dist/layouts/auth/ThreeCanvasLoader.astro +18 -0
- package/dist/layouts/dashboard/Layout.astro +64 -0
- package/dist/lib/auth/encryption.d.ts +30 -0
- package/dist/lib/auth/encryption.js +39 -0
- package/dist/lib/auth/password.d.ts +27 -0
- package/dist/lib/auth/password.js +42 -0
- package/dist/lib/auth/rate-limit.d.ts +136 -0
- package/dist/lib/auth/rate-limit.js +214 -0
- package/dist/lib/auth/session.d.ts +85 -0
- package/dist/lib/auth/session.js +93 -0
- package/dist/lib/auth/types.d.ts +83 -0
- package/dist/lib/auth/types.js +0 -0
- package/dist/lib/auth/user.d.ts +148 -0
- package/dist/lib/auth/user.js +133 -0
- package/dist/lib/dashboardGrid.d.ts +119 -0
- package/dist/lib/dashboardGrid.js +0 -0
- package/dist/lib/dynamic-sitemap/index.d.ts +42 -0
- package/dist/lib/dynamic-sitemap/index.js +45 -0
- package/dist/lib/dynamic-sitemap/sitemap-index.xml.d.ts +8 -0
- package/dist/lib/dynamic-sitemap/sitemap-index.xml.js +20 -0
- package/dist/lib/dynamic-sitemap/sitemap-index.xml.ts +45 -0
- package/dist/lib/head.d.ts +9 -0
- package/dist/lib/head.js +65 -0
- package/dist/lib/headDefaults.d.ts +18 -0
- package/dist/lib/headDefaults.js +75 -0
- package/dist/lib/i18n/LanguageSelector.astro +103 -0
- package/dist/lib/i18n/config.d.ts +16 -0
- package/dist/lib/i18n/config.js +8 -0
- package/dist/lib/i18n/index.d.ts +228 -0
- package/dist/lib/i18n/index.js +63 -0
- package/dist/lib/i18n/translations/de.json +43 -0
- package/dist/lib/i18n/translations/en-us.json +63 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.js +7 -0
- package/dist/lib/jsonUtils.d.ts +2 -0
- package/dist/lib/jsonUtils.js +11 -0
- package/dist/lib/makeAPIRoute.d.ts +45 -0
- package/dist/lib/makeAPIRoute.js +16 -0
- package/dist/lib/makePublicRoute.d.ts +7 -0
- package/dist/lib/makePublicRoute.js +6 -0
- package/dist/lib/pathGenerators.d.ts +20 -0
- package/dist/lib/pathGenerators.js +66 -0
- package/dist/lib/plugins/dashboard-pages.d.ts +71 -0
- package/dist/lib/plugins/dashboard-pages.js +11 -0
- package/dist/lib/plugins/frontend-navigation.d.ts +18 -0
- package/dist/lib/plugins/frontend-navigation.js +39 -0
- package/dist/lib/plugins/index.d.ts +2 -0
- package/dist/lib/plugins/index.js +2 -0
- package/dist/lib/removeLeadingTrailingSlashes.d.ts +7 -0
- package/dist/lib/removeLeadingTrailingSlashes.js +13 -0
- package/dist/lib/renderer/astro-remark.d.ts +13 -0
- package/dist/lib/renderer/astro-remark.js +11 -0
- package/dist/lib/renderer/contentRenderer.d.ts +13 -0
- package/dist/lib/renderer/contentRenderer.js +31 -0
- package/dist/lib/renderer/errors.d.ts +5 -0
- package/dist/lib/renderer/errors.js +25 -0
- package/dist/lib/renderer/markdoc-renderers/markdocHTML.d.ts +3 -0
- package/dist/lib/renderer/markdoc-renderers/markdocHTML.js +14 -0
- package/dist/lib/renderer/markdoc-renderers/markdocReactStatic.d.ts +3 -0
- package/dist/lib/renderer/markdoc-renderers/markdocReactStatic.js +14 -0
- package/dist/lib/renderer/markdoc.d.ts +11 -0
- package/dist/lib/renderer/markdoc.js +28 -0
- package/dist/lib/renderer/mdx.d.ts +10 -0
- package/dist/lib/renderer/mdx.js +37 -0
- package/dist/lib/renderer/runtime.d.ts +8 -0
- package/dist/lib/renderer/runtime.js +30 -0
- package/dist/lib/renderer/shared.d.ts +15 -0
- package/dist/lib/renderer/shared.js +13 -0
- package/dist/lib/renderer/studiocms.d.ts +11 -0
- package/dist/lib/renderer/studiocms.js +22 -0
- package/dist/lib/renderer/types.d.ts +12 -0
- package/dist/lib/renderer/types.js +0 -0
- package/dist/lib/robots/core.d.ts +24 -0
- package/dist/lib/robots/core.js +187 -0
- package/dist/lib/robots/index.d.ts +11 -0
- package/dist/lib/robots/index.js +47 -0
- package/dist/lib/robots/types.d.ts +185 -0
- package/dist/lib/robots/types.js +0 -0
- package/dist/lib/robots/utils.d.ts +22 -0
- package/dist/lib/robots/utils.js +22 -0
- package/dist/lib/routeMap.d.ts +257 -0
- package/dist/lib/routeMap.js +249 -0
- package/dist/lib/urlGen.d.ts +11 -0
- package/dist/lib/urlGen.js +26 -0
- package/dist/lib/webVitals/checkForWebVitalsPlugin.d.ts +18 -0
- package/dist/lib/webVitals/checkForWebVitalsPlugin.js +82 -0
- package/dist/lib/webVitals/consts.d.ts +240 -0
- package/dist/lib/webVitals/consts.js +40 -0
- package/dist/lib/webVitals/dashboard-grid-items/CoreVitals.astro +66 -0
- package/dist/lib/webVitals/dashboard-grid-items/MetricCard.astro +24 -0
- package/dist/lib/webVitals/dashboard-grid-items/SummaryCard.astro +56 -0
- package/dist/lib/webVitals/dashboard-grid-items/metric.css +103 -0
- package/dist/lib/webVitals/dashboard-grid-items/shared.d.ts +29 -0
- package/dist/lib/webVitals/dashboard-grid-items/shared.js +35 -0
- package/dist/lib/webVitals/pages/analytics/body.astro +186 -0
- package/dist/lib/webVitals/pages/analytics/header.astro +42 -0
- package/dist/lib/webVitals/schemas.d.ts +78 -0
- package/dist/lib/webVitals/schemas.js +37 -0
- package/dist/lib/webVitals/types.d.ts +156 -0
- package/dist/lib/webVitals/types.js +0 -0
- package/dist/lib/webVitals/utils/buildDataObject.d.ts +8 -0
- package/dist/lib/webVitals/utils/buildDataObject.js +28 -0
- package/dist/lib/webVitals/utils/buildPageRouteDataObject.d.ts +15 -0
- package/dist/lib/webVitals/utils/buildPageRouteDataObject.js +70 -0
- package/dist/lib/webVitals/utils/buildPerPageDataObject.d.ts +23 -0
- package/dist/lib/webVitals/utils/buildPerPageDataObject.js +209 -0
- package/dist/lib/webVitals/utils/checkDate.d.ts +5 -0
- package/dist/lib/webVitals/utils/checkDate.js +19 -0
- package/dist/lib/webVitals/utils/webVitalsUtils.d.ts +24 -0
- package/dist/lib/webVitals/utils/webVitalsUtils.js +234 -0
- package/dist/lib/webVitals/webVital.d.ts +20 -0
- package/dist/lib/webVitals/webVital.js +40 -0
- package/dist/lib/webVitals/webVitalsRouteSummary.d.ts +19 -0
- package/dist/lib/webVitals/webVitalsRouteSummary.js +59 -0
- package/dist/lib/webVitals/webVitalsSummary.d.ts +19 -0
- package/dist/lib/webVitals/webVitalsSummary.js +49 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/plugins.js +6 -0
- package/dist/routes/api/render.astro +25 -0
- package/dist/routes/auth/api/auth0/callback.d.ts +4 -0
- package/dist/routes/auth/api/auth0/callback.js +117 -0
- package/dist/routes/auth/api/auth0/index.d.ts +4 -0
- package/dist/routes/auth/api/auth0/index.js +36 -0
- package/dist/routes/auth/api/auth0/shared.d.ts +13 -0
- package/dist/routes/auth/api/auth0/shared.js +24 -0
- package/dist/routes/auth/api/discord/callback.d.ts +4 -0
- package/dist/routes/auth/api/discord/callback.js +112 -0
- package/dist/routes/auth/api/discord/index.d.ts +4 -0
- package/dist/routes/auth/api/discord/index.js +36 -0
- package/dist/routes/auth/api/discord/shared.d.ts +12 -0
- package/dist/routes/auth/api/discord/shared.js +17 -0
- package/dist/routes/auth/api/github/callback.d.ts +4 -0
- package/dist/routes/auth/api/github/callback.js +112 -0
- package/dist/routes/auth/api/github/index.d.ts +4 -0
- package/dist/routes/auth/api/github/index.js +36 -0
- package/dist/routes/auth/api/github/shared.d.ts +13 -0
- package/dist/routes/auth/api/github/shared.js +14 -0
- package/dist/routes/auth/api/google/callback.d.ts +4 -0
- package/dist/routes/auth/api/google/callback.js +115 -0
- package/dist/routes/auth/api/google/index.d.ts +4 -0
- package/dist/routes/auth/api/google/index.js +38 -0
- package/dist/routes/auth/api/google/shared.d.ts +12 -0
- package/dist/routes/auth/api/google/shared.js +19 -0
- package/dist/routes/auth/api/login.d.ts +4 -0
- package/dist/routes/auth/api/login.js +46 -0
- package/dist/routes/auth/api/logout.d.ts +5 -0
- package/dist/routes/auth/api/logout.js +55 -0
- package/dist/routes/auth/api/register.d.ts +4 -0
- package/dist/routes/auth/api/register.js +64 -0
- package/dist/routes/auth/api/shared.d.ts +2 -0
- package/dist/routes/auth/api/shared.js +21 -0
- package/dist/routes/auth/login.astro +67 -0
- package/dist/routes/auth/logout.astro +28 -0
- package/dist/routes/auth/signup.astro +70 -0
- package/dist/routes/dashboard/[...pluginPage].astro +88 -0
- package/dist/routes/dashboard/configuration.astro +27 -0
- package/dist/routes/dashboard/content-management/createfolder.astro +56 -0
- package/dist/routes/dashboard/content-management/createpage.astro +59 -0
- package/dist/routes/dashboard/content-management/diff.astro +100 -0
- package/dist/routes/dashboard/content-management/editfolder.astro +40 -0
- package/dist/routes/dashboard/content-management/editpage.astro +44 -0
- package/dist/routes/dashboard/content-management/index.astro +57 -0
- package/dist/routes/dashboard/index.astro +24 -0
- package/dist/routes/dashboard/password-reset.astro +169 -0
- package/dist/routes/dashboard/plugins/[plugin].astro +60 -0
- package/dist/routes/dashboard/profile.astro +57 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/api-tokens.d.ts +5 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/api-tokens.js +90 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/config.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/config.js +63 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/content/folder.d.ts +6 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/content/folder.js +121 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/content/page.d.ts +6 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/content/page.js +257 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-reset-link.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-reset-link.js +59 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-user-invite.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-user-invite.js +105 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-user.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/create-user.js +100 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/partials/Editor.astro +61 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/partials/LiveRender.astro +30 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/partials/UserListItems.astro +39 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/plugins/[plugin].d.ts +2 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/plugins/[plugin].js +32 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/profile.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/profile.js +130 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/reset-password.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/reset-password.js +105 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/search-list.d.ts +4 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/search-list.js +55 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/users.d.ts +5 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/users.js +92 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/verify-session.d.ts +2 -0
- package/dist/routes/dashboard/studiocms_api/dashboard/verify-session.js +72 -0
- package/dist/routes/dashboard/user-management/edit.astro +593 -0
- package/dist/routes/dashboard/user-management/index.astro +67 -0
- package/dist/routes/error-pages/404.astro +35 -0
- package/dist/routes/firstTimeSetupRoutes/1-start.astro +253 -0
- package/dist/routes/firstTimeSetupRoutes/2-next.astro +208 -0
- package/dist/routes/firstTimeSetupRoutes/3-done.astro +95 -0
- package/dist/routes/firstTimeSetupRoutes/api/step-1.d.ts +2 -0
- package/dist/routes/firstTimeSetupRoutes/api/step-1.js +126 -0
- package/dist/routes/firstTimeSetupRoutes/api/step-2.d.ts +2 -0
- package/dist/routes/firstTimeSetupRoutes/api/step-2.js +110 -0
- package/dist/routes/firstTimeSetupRoutes/components/Layout.astro +41 -0
- package/dist/routes/firstTimeSetupRoutes/components/PageHeader.astro +60 -0
- package/dist/routes/firstTimeSetupRoutes/components/TabItem.astro +44 -0
- package/dist/routes/firstTimeSetupRoutes/components/Tabs.astro +170 -0
- package/dist/routes/firstTimeSetupRoutes/snippets/opt1-astro.config.diff +14 -0
- package/dist/routes/firstTimeSetupRoutes/snippets/opt2-astro.config.diff +9 -0
- package/dist/routes/firstTimeSetupRoutes/snippets/opt2-studiocms.config.diff +5 -0
- package/dist/routes/rest/utils/auth-token.d.ts +17 -0
- package/dist/routes/rest/utils/auth-token.js +31 -0
- package/dist/routes/rest/v1/folders/[id].d.ts +6 -0
- package/dist/routes/rest/v1/folders/[id].js +106 -0
- package/dist/routes/rest/v1/folders/index.d.ts +5 -0
- package/dist/routes/rest/v1/folders/index.js +88 -0
- package/dist/routes/rest/v1/pages/[id]/history/[diffid].d.ts +4 -0
- package/dist/routes/rest/v1/pages/[id]/history/[diffid].js +55 -0
- package/dist/routes/rest/v1/pages/[id]/history/index.d.ts +4 -0
- package/dist/routes/rest/v1/pages/[id]/history/index.js +61 -0
- package/dist/routes/rest/v1/pages/[id]/index.d.ts +6 -0
- package/dist/routes/rest/v1/pages/[id]/index.js +165 -0
- package/dist/routes/rest/v1/pages/index.d.ts +5 -0
- package/dist/routes/rest/v1/pages/index.js +113 -0
- package/dist/routes/rest/v1/public/folders/[id].d.ts +4 -0
- package/dist/routes/rest/v1/public/folders/[id].js +43 -0
- package/dist/routes/rest/v1/public/folders/index.d.ts +4 -0
- package/dist/routes/rest/v1/public/folders/index.js +49 -0
- package/dist/routes/rest/v1/public/pages/[id].d.ts +4 -0
- package/dist/routes/rest/v1/public/pages/[id].js +46 -0
- package/dist/routes/rest/v1/public/pages/index.d.ts +4 -0
- package/dist/routes/rest/v1/public/pages/index.js +61 -0
- package/dist/routes/rest/v1/settings/index.d.ts +5 -0
- package/dist/routes/rest/v1/settings/index.js +75 -0
- package/dist/routes/rest/v1/users/[id].d.ts +6 -0
- package/dist/routes/rest/v1/users/[id].js +212 -0
- package/dist/routes/rest/v1/users/index.d.ts +5 -0
- package/dist/routes/rest/v1/users/index.js +138 -0
- package/dist/routes/sdk/fallback-list-pages.json.d.ts +2 -0
- package/dist/routes/sdk/fallback-list-pages.json.js +19 -0
- package/dist/routes/sdk/fallback-list-pages.json.ts +22 -0
- package/dist/routes/sdk/full-changelog.json.d.ts +16 -0
- package/dist/routes/sdk/full-changelog.json.js +170 -0
- package/dist/routes/sdk/full-changelog.json.ts +224 -0
- package/dist/routes/sdk/list-pages.d.ts +4 -0
- package/dist/routes/sdk/list-pages.js +34 -0
- package/dist/routes/sdk/update-latest-version-cache.d.ts +4 -0
- package/dist/routes/sdk/update-latest-version-cache.js +41 -0
- package/dist/runtime/AstroComponentProxy.d.ts +29 -0
- package/dist/runtime/AstroComponentProxy.js +47 -0
- package/dist/runtime/decoder/decode-codepoint.d.ts +18 -0
- package/dist/runtime/decoder/decode-codepoint.js +58 -0
- package/dist/runtime/decoder/decode-data-html.d.ts +1 -0
- package/dist/runtime/decoder/decode-data-html.js +7 -0
- package/dist/runtime/decoder/decode-data-xml.d.ts +1 -0
- package/dist/runtime/decoder/decode-data-xml.js +7 -0
- package/dist/runtime/decoder/index.d.ts +34 -0
- package/dist/runtime/decoder/index.js +18 -0
- package/dist/runtime/decoder/util.d.ts +208 -0
- package/dist/runtime/decoder/util.js +415 -0
- package/dist/schemas/config/auth.d.ts +175 -0
- package/dist/schemas/config/auth.js +65 -0
- package/dist/schemas/config/componentoverrides.d.ts +17 -0
- package/dist/schemas/config/componentoverrides.js +14 -0
- package/dist/schemas/config/dashboard.d.ts +154 -0
- package/dist/schemas/config/dashboard.js +59 -0
- package/dist/schemas/config/defaultFrontend.d.ts +125 -0
- package/dist/schemas/config/defaultFrontend.js +57 -0
- package/dist/schemas/config/developer.d.ts +15 -0
- package/dist/schemas/config/developer.js +14 -0
- package/dist/schemas/config/imageService.d.ts +13 -0
- package/dist/schemas/config/imageService.js +12 -0
- package/dist/schemas/config/index.d.ts +1153 -0
- package/dist/schemas/config/index.js +95 -0
- package/dist/schemas/config/integrations.d.ts +14 -0
- package/dist/schemas/config/integrations.js +12 -0
- package/dist/schemas/config/markdoc.d.ts +172 -0
- package/dist/schemas/config/markdoc.js +68 -0
- package/dist/schemas/config/mdx.d.ts +455 -0
- package/dist/schemas/config/mdx.js +71 -0
- package/dist/schemas/config/rendererConfig.d.ts +659 -0
- package/dist/schemas/config/rendererConfig.js +51 -0
- package/dist/schemas/config/sdk.d.ts +167 -0
- package/dist/schemas/config/sdk.js +85 -0
- package/dist/schemas/config/studiocms-markdown-remark.d.ts +292 -0
- package/dist/schemas/config/studiocms-markdown-remark.js +63 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/plugins/index.d.ts +7373 -0
- package/dist/schemas/plugins/index.js +192 -0
- package/dist/schemas/plugins/shared.d.ts +1752 -0
- package/dist/schemas/plugins/shared.js +221 -0
- package/dist/scripts/formListener.d.ts +16 -0
- package/dist/scripts/formListener.js +46 -0
- package/dist/scripts/three.d.ts +1 -0
- package/dist/scripts/three.js +277 -0
- package/dist/scripts/utils/fitModelToViewport.d.ts +8 -0
- package/dist/scripts/utils/fitModelToViewport.js +19 -0
- package/dist/sdk/StudioCMSVirtualCache.d.ts +283 -0
- package/dist/sdk/StudioCMSVirtualCache.js +685 -0
- package/dist/sdk/cache.d.ts +11 -0
- package/dist/sdk/cache.js +12 -0
- package/dist/sdk/core.d.ts +865 -0
- package/dist/sdk/core.js +1966 -0
- package/dist/sdk/errors.d.ts +21 -0
- package/dist/sdk/errors.js +11 -0
- package/dist/sdk/index.d.ts +371 -0
- package/dist/sdk/index.js +8 -0
- package/dist/sdk/lib/foldertree.d.ts +50 -0
- package/dist/sdk/lib/foldertree.js +123 -0
- package/dist/sdk/lib/generators.d.ts +30 -0
- package/dist/sdk/lib/generators.js +25 -0
- package/dist/sdk/lib/packages.d.ts +8 -0
- package/dist/sdk/lib/packages.js +14 -0
- package/dist/sdk/lib/parsers.d.ts +14 -0
- package/dist/sdk/lib/parsers.js +10 -0
- package/dist/sdk/lib/users.d.ts +19 -0
- package/dist/sdk/lib/users.js +26 -0
- package/dist/sdk/tables.d.ts +1198 -0
- package/dist/sdk/tables.js +55 -0
- package/dist/sdk/types/index.d.ts +175 -0
- package/dist/sdk/types/index.js +0 -0
- package/dist/sdk/types/tableDefs.d.ts +75 -0
- package/dist/sdk/types/tableDefs.js +0 -0
- package/dist/sdk/types/tsAlias.d.ts +155 -0
- package/dist/sdk/types/tsAlias.js +0 -0
- package/dist/sdk/utils/db.d.ts +5 -0
- package/dist/sdk/utils/db.js +15 -0
- package/dist/stubs/auth-lib.d.ts +2 -0
- package/dist/stubs/auth-lib.js +519 -0
- package/dist/stubs/auth-scripts.d.ts +2 -0
- package/dist/stubs/auth-scripts.js +29 -0
- package/dist/stubs/auth-utils.d.ts +2 -0
- package/dist/stubs/auth-utils.js +36 -0
- package/dist/stubs/changelog.d.ts +2 -0
- package/dist/stubs/changelog.js +16 -0
- package/dist/stubs/components.d.ts +2 -0
- package/dist/stubs/components.js +67 -0
- package/dist/stubs/core.d.ts +2 -0
- package/dist/stubs/core.js +49 -0
- package/dist/stubs/i18n-dts.d.ts +2 -0
- package/dist/stubs/i18n-dts.js +117 -0
- package/dist/stubs/images.d.ts +1 -0
- package/dist/stubs/images.js +30 -0
- package/dist/stubs/index.d.ts +1 -0
- package/dist/stubs/index.js +40 -0
- package/dist/stubs/lib.d.ts +2 -0
- package/dist/stubs/lib.js +123 -0
- package/dist/stubs/plugins.d.ts +2 -0
- package/dist/stubs/plugins.js +60 -0
- package/dist/stubs/proxy.d.ts +2 -0
- package/dist/stubs/proxy.js +40 -0
- package/dist/stubs/renderer-config.d.ts +2 -0
- package/dist/stubs/renderer-config.js +18 -0
- package/dist/stubs/renderer-markdownConfig.d.ts +2 -0
- package/dist/stubs/renderer-markdownConfig.js +17 -0
- package/dist/stubs/renderer.d.ts +2 -0
- package/dist/stubs/renderer.js +44 -0
- package/dist/stubs/sdk.d.ts +2 -0
- package/dist/stubs/sdk.js +202 -0
- package/dist/stubs/webVitals.d.ts +2 -0
- package/dist/stubs/webVitals.js +40 -0
- package/dist/styles/404.css +47 -0
- package/dist/styles/SyntaxFont.woff2 +0 -0
- package/dist/styles/authlayout.css +138 -0
- package/dist/styles/dashboard-base.css +493 -0
- package/dist/styles/dashboard-code.css +33 -0
- package/dist/styles/dashboard-diff.css +389 -0
- package/dist/styles/dashboard-tiny-mde.css +224 -0
- package/dist/styles/md-remark-callouts/github.css +56 -0
- package/dist/styles/md-remark-callouts/obsidian.css +66 -0
- package/dist/styles/md-remark-callouts/vitepress.css +58 -0
- package/dist/styles/md-remark-headings.css +48 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.js +0 -0
- package/dist/utils/addAPIRoutes.d.ts +9 -0
- package/dist/utils/addAPIRoutes.js +33 -0
- package/dist/utils/addIntegrationArray.d.ts +24 -0
- package/dist/utils/addIntegrationArray.js +11 -0
- package/dist/utils/addIntegrationArrayWithCheck.d.ts +11 -0
- package/dist/utils/addIntegrationArrayWithCheck.js +24 -0
- package/dist/utils/astroConfigCheck.d.ts +8 -0
- package/dist/utils/astroConfigCheck.js +31 -0
- package/dist/utils/astroEnvConfig.d.ts +45 -0
- package/dist/utils/astroEnvConfig.js +9 -0
- package/dist/utils/authEnvCheck.d.ts +38 -0
- package/dist/utils/authEnvCheck.js +82 -0
- package/dist/utils/changelog.d.ts +1 -0
- package/dist/utils/changelog.js +53 -0
- package/dist/utils/changelogLoader.d.ts +15 -0
- package/dist/utils/changelogLoader.js +104 -0
- package/dist/utils/checkENV.d.ts +27 -0
- package/dist/utils/checkENV.js +115 -0
- package/dist/utils/configManager.d.ts +22 -0
- package/dist/utils/configManager.js +98 -0
- package/dist/utils/configResolver.d.ts +283 -0
- package/dist/utils/configResolver.js +105 -0
- package/dist/utils/defineStudioCMSConfig.d.ts +165 -0
- package/dist/utils/defineStudioCMSConfig.js +6 -0
- package/dist/utils/getLabelForPermissionLevel.d.ts +2 -0
- package/dist/utils/getLabelForPermissionLevel.js +17 -0
- package/dist/utils/injectRouteArray.d.ts +19 -0
- package/dist/utils/injectRouteArray.js +75 -0
- package/dist/utils/integrationLogger.d.ts +7 -0
- package/dist/utils/integrationLogger.js +18 -0
- package/dist/utils/integrations.d.ts +4 -0
- package/dist/utils/integrations.js +32 -0
- package/dist/utils/isDashboardRoute.d.ts +7 -0
- package/dist/utils/isDashboardRoute.js +10 -0
- package/dist/utils/loginBackgrounds/studiocms-blobs-dark.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-blobs-light.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-blocks-dark.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-blocks-light.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-curves-dark.png +0 -0
- package/dist/utils/loginBackgrounds/studiocms-curves-light.png +0 -0
- package/dist/utils/makePageTitle.d.ts +3 -0
- package/dist/utils/makePageTitle.js +7 -0
- package/dist/utils/pageListPackageLabel.d.ts +4 -0
- package/dist/utils/pageListPackageLabel.js +12 -0
- package/dist/utils/readJson.d.ts +1 -0
- package/dist/utils/readJson.js +7 -0
- package/dist/utils/routeBuilder.d.ts +18 -0
- package/dist/utils/routeBuilder.js +96 -0
- package/dist/utils/safeString.d.ts +1 -0
- package/dist/utils/safeString.js +6 -0
- package/dist/utils/simpleResponse.d.ts +1 -0
- package/dist/utils/simpleResponse.js +29 -0
- package/dist/utils/validImages.d.ts +13 -0
- package/dist/utils/validImages.js +39 -0
- package/dist/virtual.d.js +0 -0
- package/dist/virtual.d.ts +5 -0
- package/package.json +180 -59
- package/renderer.d.ts +25 -0
- package/static/studiocms-resources/auth/studiocms-logo.glb +0 -0
- package/static/studiocms-resources/core/favicon-dark.png +0 -0
- package/static/studiocms-resources/core/favicon-light.png +0 -0
- package/static/studiocms-resources/core/favicon.svg +15 -0
- package/studiocms-cli.mjs +13 -0
- package/ui.d.ts +291 -0
- package/src/blog/index.ts +0 -35
- package/src/index.ts +0 -25
- package/src/integration.ts +0 -130
- package/src/updateCheck.ts +0 -51
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
const permissionRanksMap = {
|
|
2
|
+
owner: ["owner"],
|
|
3
|
+
admin: ["owner", "admin"],
|
|
4
|
+
editor: ["owner", "admin", "editor"],
|
|
5
|
+
visitor: ["owner", "admin", "editor", "visitor"],
|
|
6
|
+
unknown: ["owner", "admin", "editor", "visitor", "unknown"]
|
|
7
|
+
};
|
|
8
|
+
function verifyUserPermissionLevel(permissionLevel, requiredPermission) {
|
|
9
|
+
return permissionRanksMap[requiredPermission].includes(permissionLevel);
|
|
10
|
+
}
|
|
11
|
+
class UserQuickTools extends HTMLElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.attachShadow({ mode: "open" });
|
|
15
|
+
}
|
|
16
|
+
async connectedCallback() {
|
|
17
|
+
const data = await this.getSession();
|
|
18
|
+
if (!data || !data.isLoggedIn) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (window.location.pathname.includes(data.routes.dashboardIndex)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
this.render(data.user, data.permissionLevel, data.routes);
|
|
25
|
+
const shadow = this.shadowRoot;
|
|
26
|
+
if (!shadow) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const cornerMenu = shadow.querySelector(".cornerMenu");
|
|
30
|
+
const menu_overlay = shadow.querySelector(".menu_overlay");
|
|
31
|
+
if (!cornerMenu || !menu_overlay) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
let menuOpened = false;
|
|
35
|
+
cornerMenu.addEventListener("click", () => {
|
|
36
|
+
if (menuOpened) {
|
|
37
|
+
cornerMenu.classList.remove("menuOpened");
|
|
38
|
+
menu_overlay.classList.remove("menuOpened");
|
|
39
|
+
menuOpened = false;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
cornerMenu.classList.add("menuOpened");
|
|
43
|
+
menu_overlay.classList.add("menuOpened");
|
|
44
|
+
menuOpened = true;
|
|
45
|
+
menu_overlay.addEventListener("click", () => {
|
|
46
|
+
if (!menuOpened) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
cornerMenu.classList.remove("menuOpened");
|
|
50
|
+
menu_overlay.classList.remove("menuOpened");
|
|
51
|
+
menuOpened = false;
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
const targetNode = document.documentElement;
|
|
55
|
+
const config = {
|
|
56
|
+
attributes: true,
|
|
57
|
+
attributeOldValue: true
|
|
58
|
+
};
|
|
59
|
+
const mutationObserverCallback = (mutationsList) => {
|
|
60
|
+
for (const mutation of mutationsList) {
|
|
61
|
+
if (mutation.type === "attributes") {
|
|
62
|
+
if (targetNode.getAttribute("data-theme") === "light") {
|
|
63
|
+
cornerMenu.dataset.theme = "light";
|
|
64
|
+
} else {
|
|
65
|
+
cornerMenu.dataset.theme = "dark";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const observer = new MutationObserver(mutationObserverCallback);
|
|
71
|
+
observer.observe(targetNode, config);
|
|
72
|
+
}
|
|
73
|
+
render(user, permissionLevel, routes) {
|
|
74
|
+
const menuItems = [
|
|
75
|
+
{
|
|
76
|
+
name: "Logout",
|
|
77
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15m-3 0-3-3m0 0 3-3m-3 3H15" /></svg> ',
|
|
78
|
+
href: routes.logout,
|
|
79
|
+
permission: "visitor"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "Profile",
|
|
83
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z" /></svg>',
|
|
84
|
+
href: routes.userProfile,
|
|
85
|
+
permission: "visitor"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "Dashboard",
|
|
89
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 0 1-1.125-1.125v-3.75ZM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-8.25ZM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-2.25Z" /></svg>',
|
|
90
|
+
href: routes.dashboardIndex,
|
|
91
|
+
permission: "editor"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "Edit",
|
|
95
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" /></svg>',
|
|
96
|
+
href: routes.contentManagement,
|
|
97
|
+
permission: "editor"
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
const shadowDOM = this.shadowRoot;
|
|
101
|
+
if (!shadowDOM) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const menu_overlay = document.createElement("div");
|
|
105
|
+
menu_overlay.classList.add("menu_overlay");
|
|
106
|
+
shadowDOM.appendChild(menu_overlay);
|
|
107
|
+
const menu = document.createElement("div");
|
|
108
|
+
menu.classList.add("cornerMenu");
|
|
109
|
+
menu.dataset.theme = document.documentElement.dataset.theme ?? "dark";
|
|
110
|
+
menuItems.forEach((menuItem, index) => {
|
|
111
|
+
if (!verifyUserPermissionLevel(permissionLevel, menuItem.permission)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
menu.appendChild(this.generateMenuItem(menuItem, index + 1));
|
|
115
|
+
});
|
|
116
|
+
const userAvatar = document.createElement("img");
|
|
117
|
+
userAvatar.src = user.avatar ?? "https://seccdn.libravatar.org/static/img/mm/80.png";
|
|
118
|
+
userAvatar.alt = `${user.name} - ${permissionLevel.charAt(0).toUpperCase() + permissionLevel.slice(1)}`;
|
|
119
|
+
userAvatar.title = `${user.name} - ${permissionLevel.charAt(0).toUpperCase() + permissionLevel.slice(1)}`;
|
|
120
|
+
userAvatar.setAttribute("width", "32");
|
|
121
|
+
userAvatar.setAttribute("height", "32");
|
|
122
|
+
userAvatar.setAttribute("aria-hidden", "true");
|
|
123
|
+
userAvatar.style.borderRadius = "50%";
|
|
124
|
+
userAvatar.style.width = "100%";
|
|
125
|
+
userAvatar.style.height = "100%";
|
|
126
|
+
userAvatar.style.objectFit = "cover";
|
|
127
|
+
userAvatar.classList.add("avatar");
|
|
128
|
+
menu.appendChild(userAvatar);
|
|
129
|
+
shadowDOM.appendChild(menu);
|
|
130
|
+
shadowDOM.innerHTML += `
|
|
131
|
+
<style>
|
|
132
|
+
:host {
|
|
133
|
+
--border: 240 5% 17%;
|
|
134
|
+
--background-base: 0 0% 6%;
|
|
135
|
+
--background-step-1: 0 0% 8%;
|
|
136
|
+
--background-step-2: 0 0% 10%;
|
|
137
|
+
--background-step-3: 0 0% 14%;
|
|
138
|
+
--primary-base: 259 83% 73%;
|
|
139
|
+
--success-base: 142 71% 46%;
|
|
140
|
+
--warning-base: 48 96% 53%;
|
|
141
|
+
--danger-base: 339 97% 31%;
|
|
142
|
+
--info-base: 217 92% 52%;
|
|
143
|
+
|
|
144
|
+
--light: 70;
|
|
145
|
+
/* the threshold at which colors are considered "light." Range: integers from 0 to 100,
|
|
146
|
+
recommended 50 - 70 */
|
|
147
|
+
--threshold: 50;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
[data-theme="light"] {
|
|
151
|
+
--border: 263 5% 68%;
|
|
152
|
+
--background-base: 0 0% 97%;
|
|
153
|
+
--background-step-1: 0 0% 90%;
|
|
154
|
+
--background-step-2: 0 0% 85%;
|
|
155
|
+
--background-step-3: 0 0% 80%;
|
|
156
|
+
--primary-base: 259 85% 61%;
|
|
157
|
+
--success-base: 142 59% 47%;
|
|
158
|
+
--warning-base: 48 92% 46%;
|
|
159
|
+
--danger-base: 339 97% 31%;
|
|
160
|
+
--info-base: 217 92% 52%;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.menu_overlay {
|
|
164
|
+
display: none;
|
|
165
|
+
position: fixed;
|
|
166
|
+
background: rgba(0,0,0,0.4);
|
|
167
|
+
top: 0%;
|
|
168
|
+
left: 0%;
|
|
169
|
+
width: 100%;
|
|
170
|
+
height: 100%;
|
|
171
|
+
z-index: 500;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.menuOpened.menu_overlay {
|
|
175
|
+
display: block;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.cornerMenu {
|
|
179
|
+
width: 50px;
|
|
180
|
+
height: 50px;
|
|
181
|
+
position: fixed;
|
|
182
|
+
right: 25px;
|
|
183
|
+
bottom: 25px;
|
|
184
|
+
background: hsl(var(--background-step-1));
|
|
185
|
+
box-shadow: 0px 3px 7px 0px rgba(0, 0, 0, 0.3);
|
|
186
|
+
border-radius: 50%;
|
|
187
|
+
border: 1px solid hsl(var(--border));
|
|
188
|
+
text-align: center;
|
|
189
|
+
line-height: 54px;
|
|
190
|
+
color: #fff;
|
|
191
|
+
font-size: 22px;
|
|
192
|
+
z-index: 600;
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.cornerMenu .avatar {
|
|
197
|
+
z-index: 700;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.menu {
|
|
201
|
+
/* Any lightness value below the threshold will result in white, any above will result in black */
|
|
202
|
+
--switch: calc((var(--light) - var(--threshold)) * -100%);
|
|
203
|
+
color: hsl(0, 0%, var(--switch));
|
|
204
|
+
width: 32px;
|
|
205
|
+
height: 32px;
|
|
206
|
+
position: absolute;
|
|
207
|
+
background-color: hsl(var(--background-step-2));
|
|
208
|
+
box-shadow: 0px 3px 7px 0px rgba(0, 0, 0, 0.10);
|
|
209
|
+
border-radius: 50%;
|
|
210
|
+
text-align: center;
|
|
211
|
+
line-height: 42px;
|
|
212
|
+
font-size: 16px;
|
|
213
|
+
top: -5px;
|
|
214
|
+
right: 0;
|
|
215
|
+
left: -5px;
|
|
216
|
+
margin: auto;
|
|
217
|
+
transform: translate(0, 0);
|
|
218
|
+
opacity: 0;
|
|
219
|
+
z-index: 550;
|
|
220
|
+
transition: all .4s ease-in-out;
|
|
221
|
+
padding: 8px;
|
|
222
|
+
border: 1px solid hsl(var(--border));
|
|
223
|
+
user-select: none;
|
|
224
|
+
pointer-events: none;
|
|
225
|
+
display: flex;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
align-items: center;
|
|
228
|
+
|
|
229
|
+
svg {
|
|
230
|
+
width: 24px;
|
|
231
|
+
height: 24px;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.menuOpened .menu {
|
|
236
|
+
right: 0;
|
|
237
|
+
opacity: 1;
|
|
238
|
+
transition: transform .3s ease, opacity .3s ease, background-color .15s ease;
|
|
239
|
+
pointer-events: all;
|
|
240
|
+
user-select: all;
|
|
241
|
+
cursor: pointer;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.menuOpened .menu:hover {
|
|
245
|
+
background-color: hsl(var(--background-step-3));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.menuOpened .menu1 {
|
|
249
|
+
transform: translate(-105px, 20px);
|
|
250
|
+
transition-delay: 0s;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.menuOpened .menu2 {
|
|
254
|
+
transform: translate(-78px, -33px);
|
|
255
|
+
transition-delay: .05s;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.menuOpened .menu3 {
|
|
259
|
+
transform: translate(-38px, -76px);
|
|
260
|
+
transition-delay: .1s;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.menuOpened .menu4 {
|
|
264
|
+
transform: translate(18px, -99px);
|
|
265
|
+
transition-delay: .15s;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.menu.logout {
|
|
269
|
+
color: hsl(var(--danger-base));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.menu.profile {
|
|
273
|
+
color: hsl(var(--primary-base));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.menu.dashboard {
|
|
277
|
+
color: hsl(var(--success-base));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.menu.edit {
|
|
281
|
+
color: hsl(var(--warning-base));
|
|
282
|
+
}
|
|
283
|
+
</style>
|
|
284
|
+
`;
|
|
285
|
+
}
|
|
286
|
+
generateMenuItem(menuItem, index) {
|
|
287
|
+
const menuItemElement = document.createElement("a");
|
|
288
|
+
menuItemElement.classList.add("menu");
|
|
289
|
+
menuItemElement.classList.add(`menu${index}`);
|
|
290
|
+
menuItemElement.classList.add(menuItem.name.toLowerCase());
|
|
291
|
+
menuItemElement.title = menuItem.name;
|
|
292
|
+
menuItemElement.innerHTML = menuItem.svg;
|
|
293
|
+
menuItemElement.href = menuItem.href;
|
|
294
|
+
return menuItemElement;
|
|
295
|
+
}
|
|
296
|
+
async getSession() {
|
|
297
|
+
const userResponse = await fetch("/studiocms_api/dashboard/verify-session", {
|
|
298
|
+
method: "POST"
|
|
299
|
+
});
|
|
300
|
+
if (!userResponse.ok) {
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
const data = await userResponse.json();
|
|
304
|
+
return data;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
308
|
+
document.body.appendChild(document.createElement("user-quick-tools"));
|
|
309
|
+
if (!customElements.get("user-quick-tools")) {
|
|
310
|
+
customElements.define("user-quick-tools", UserQuickTools);
|
|
311
|
+
}
|
|
312
|
+
});
|
package/dist/config.d.ts
ADDED
package/dist/config.js
ADDED
package/dist/consts.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { TimeString } from './schemas/config/sdk.js';
|
|
2
|
+
/**
|
|
3
|
+
* StudioCMS Site Config Table Entry ID
|
|
4
|
+
*/
|
|
5
|
+
export declare const CMSSiteConfigId: number;
|
|
6
|
+
/**
|
|
7
|
+
* The default lifetime for cached items.
|
|
8
|
+
* This value is used to determine how long an item should remain in the cache before it is considered expired.
|
|
9
|
+
* This value is used in ./schemas/config/sdk.ts to set the default cache lifetime.
|
|
10
|
+
*/
|
|
11
|
+
export declare const defaultCacheLifeTime: TimeString;
|
|
12
|
+
/**
|
|
13
|
+
* The default lifetime for cached items in milliseconds.
|
|
14
|
+
* This value is used to determine how long an item should remain in the cache before it is considered expired.
|
|
15
|
+
*/
|
|
16
|
+
export declare const versionCacheLifetime: number;
|
|
17
|
+
/**
|
|
18
|
+
* Current REST API Versions
|
|
19
|
+
*/
|
|
20
|
+
export declare const currentRESTAPIVersions: readonly ["v1"];
|
|
21
|
+
/**
|
|
22
|
+
* Current REST API Versions Type
|
|
23
|
+
*/
|
|
24
|
+
export type CurrentRESTAPIVersions = (typeof currentRESTAPIVersions)[number];
|
|
25
|
+
/**
|
|
26
|
+
* REST API Directory
|
|
27
|
+
*/
|
|
28
|
+
export declare const routesDir: {
|
|
29
|
+
fts: (file: string) => string;
|
|
30
|
+
dashRoute: (file: string) => string;
|
|
31
|
+
dashApi: (file: string) => string;
|
|
32
|
+
errors: (file: string) => string;
|
|
33
|
+
v1Rest: (file: string) => string;
|
|
34
|
+
sdk: (file: string) => string;
|
|
35
|
+
api: (file: string) => string;
|
|
36
|
+
authPage: (file: string) => string;
|
|
37
|
+
authAPI: (file: string) => string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* StudioCMS Social Links Type
|
|
41
|
+
*/
|
|
42
|
+
export type StudioCMSSocials = {
|
|
43
|
+
github: string;
|
|
44
|
+
githubLicense: string;
|
|
45
|
+
githubContributors: string;
|
|
46
|
+
discord: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* StudioCMS Social Links
|
|
50
|
+
*/
|
|
51
|
+
export declare const studioCMSSocials: StudioCMSSocials;
|
|
52
|
+
/**
|
|
53
|
+
* Default values for a "ghost" user in StudioCMS.
|
|
54
|
+
* This user represents a deleted user in the system.
|
|
55
|
+
*/
|
|
56
|
+
export declare const GhostUserDefaults: {
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
username: string;
|
|
60
|
+
avatar: string;
|
|
61
|
+
};
|
package/dist/consts.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createResolver } from "astro-integration-kit";
|
|
2
|
+
const { resolve } = createResolver(import.meta.url);
|
|
3
|
+
const CMSSiteConfigId = 1;
|
|
4
|
+
const defaultCacheLifeTime = "5m";
|
|
5
|
+
const versionCacheLifetime = 1e3 * 60 * 60 * 24 * 7;
|
|
6
|
+
const currentRESTAPIVersions = ["v1"];
|
|
7
|
+
const _rest_dir = (version) => (file) => resolve(`./routes/rest/${version}/${file}`);
|
|
8
|
+
const routesDir = {
|
|
9
|
+
fts: (file) => resolve(`./routes/firstTimeSetupRoutes/${file}`),
|
|
10
|
+
dashRoute: (file) => resolve(`./routes/dashboard/${file}`),
|
|
11
|
+
dashApi: (file) => resolve(`./routes/dashboard/studiocms_api/dashboard/${file}`),
|
|
12
|
+
errors: (file) => resolve(`./routes/error-pages/${file}`),
|
|
13
|
+
v1Rest: (file) => _rest_dir("v1")(file),
|
|
14
|
+
sdk: (file) => resolve(`./routes/sdk/${file}`),
|
|
15
|
+
api: (file) => resolve(`./routes/api/${file}`),
|
|
16
|
+
authPage: (file) => resolve(`./routes/auth/${file}`),
|
|
17
|
+
authAPI: (file) => resolve(`./routes/auth/api/${file}`)
|
|
18
|
+
};
|
|
19
|
+
const studioCMSSocials = {
|
|
20
|
+
github: "https://github.com/withstudiocms/studiocms",
|
|
21
|
+
githubLicense: "https://github.com/withstudiocms/studiocms?tab=MIT-1-ov-file#readme",
|
|
22
|
+
githubContributors: "https://github.com/withstudiocms/studiocms/graphs/contributors",
|
|
23
|
+
discord: "https://chat.studiocms.dev"
|
|
24
|
+
};
|
|
25
|
+
const GhostUserDefaults = {
|
|
26
|
+
id: "_StudioCMS_Ghost_User_",
|
|
27
|
+
name: "Ghost (deleted user)",
|
|
28
|
+
username: "studiocms_ghost_user",
|
|
29
|
+
avatar: "https://seccdn.libravatar.org/static/img/mm/80.png"
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
CMSSiteConfigId,
|
|
33
|
+
GhostUserDefaults,
|
|
34
|
+
currentRESTAPIVersions,
|
|
35
|
+
defaultCacheLifeTime,
|
|
36
|
+
routesDir,
|
|
37
|
+
studioCMSSocials,
|
|
38
|
+
versionCacheLifetime
|
|
39
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { NOW, column, defineTable } from "astro:db";
|
|
2
|
+
const StudioCMSUsers = defineTable({
|
|
3
|
+
columns: {
|
|
4
|
+
id: column.text({ primaryKey: true }),
|
|
5
|
+
url: column.text({ optional: true }),
|
|
6
|
+
name: column.text(),
|
|
7
|
+
email: column.text({ unique: true, optional: true }),
|
|
8
|
+
avatar: column.text({
|
|
9
|
+
optional: true,
|
|
10
|
+
default: "https://seccdn.libravatar.org/static/img/mm/80.png"
|
|
11
|
+
}),
|
|
12
|
+
username: column.text(),
|
|
13
|
+
password: column.text({ optional: true }),
|
|
14
|
+
updatedAt: column.date({ default: NOW, optional: true }),
|
|
15
|
+
createdAt: column.date({ default: NOW, optional: true })
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const StudioCMSAPIKeys = defineTable({
|
|
19
|
+
columns: {
|
|
20
|
+
id: column.text({ primaryKey: true }),
|
|
21
|
+
userId: column.text({ references: () => StudioCMSUsers.columns.id }),
|
|
22
|
+
key: column.text(),
|
|
23
|
+
creationDate: column.date({ default: NOW }),
|
|
24
|
+
description: column.text({ optional: true })
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const StudioCMSUserResetTokens = defineTable({
|
|
28
|
+
columns: {
|
|
29
|
+
id: column.text({ primaryKey: true }),
|
|
30
|
+
userId: column.text({ references: () => StudioCMSUsers.columns.id }),
|
|
31
|
+
token: column.text()
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const StudioCMSOAuthAccounts = defineTable({
|
|
35
|
+
columns: {
|
|
36
|
+
provider: column.text(),
|
|
37
|
+
// github, google, discord, auth0
|
|
38
|
+
providerUserId: column.text({ primaryKey: true }),
|
|
39
|
+
userId: column.text({ references: () => StudioCMSUsers.columns.id })
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const StudioCMSSessionTable = defineTable({
|
|
43
|
+
columns: {
|
|
44
|
+
id: column.text({ primaryKey: true }),
|
|
45
|
+
userId: column.text({ references: () => StudioCMSUsers.columns.id, optional: false }),
|
|
46
|
+
expiresAt: column.date()
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const StudioCMSPermissions = defineTable({
|
|
50
|
+
columns: {
|
|
51
|
+
user: column.text({ references: () => StudioCMSUsers.columns.id }),
|
|
52
|
+
rank: column.text()
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const StudioCMSPageFolderStructure = defineTable({
|
|
56
|
+
columns: {
|
|
57
|
+
id: column.text({ primaryKey: true }),
|
|
58
|
+
name: column.text(),
|
|
59
|
+
parent: column.text({ optional: true })
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const StudioCMSPageData = defineTable({
|
|
63
|
+
columns: {
|
|
64
|
+
id: column.text({ primaryKey: true }),
|
|
65
|
+
package: column.text({ default: "studiocms" }),
|
|
66
|
+
title: column.text(),
|
|
67
|
+
description: column.text(),
|
|
68
|
+
showOnNav: column.boolean({ default: false }),
|
|
69
|
+
publishedAt: column.date({ default: NOW }),
|
|
70
|
+
updatedAt: column.date({ optional: true }),
|
|
71
|
+
slug: column.text(),
|
|
72
|
+
contentLang: column.text({ default: "default" }),
|
|
73
|
+
heroImage: column.text({
|
|
74
|
+
default: "https://images.unsplash.com/photo-1707343843982-f8275f3994c5?q=80&w=1032&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
|
75
|
+
}),
|
|
76
|
+
categories: column.json({ default: [], optional: true }),
|
|
77
|
+
tags: column.json({ default: [], optional: true }),
|
|
78
|
+
authorId: column.text({ optional: true }),
|
|
79
|
+
contributorIds: column.json({ default: [], optional: true }),
|
|
80
|
+
showAuthor: column.boolean({ default: false, optional: true }),
|
|
81
|
+
showContributors: column.boolean({ default: false, optional: true }),
|
|
82
|
+
parentFolder: column.text({ optional: true }),
|
|
83
|
+
draft: column.boolean({ optional: true })
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const StudioCMSDiffTracking = defineTable({
|
|
87
|
+
columns: {
|
|
88
|
+
id: column.text({ primaryKey: true }),
|
|
89
|
+
userId: column.text({ references: () => StudioCMSUsers.columns.id }),
|
|
90
|
+
pageId: column.text({ references: () => StudioCMSPageData.columns.id }),
|
|
91
|
+
timestamp: column.date({ default: NOW, optional: true }),
|
|
92
|
+
pageMetaData: column.json({ default: {}, optional: true }),
|
|
93
|
+
pageContentStart: column.text({ multiline: true }),
|
|
94
|
+
diff: column.text({ multiline: true, optional: true })
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const StudioCMSPageDataTags = defineTable({
|
|
98
|
+
columns: {
|
|
99
|
+
id: column.number({ primaryKey: true }),
|
|
100
|
+
description: column.text(),
|
|
101
|
+
name: column.text(),
|
|
102
|
+
slug: column.text(),
|
|
103
|
+
meta: column.json({ default: {} })
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const StudioCMSPageDataCategories = defineTable({
|
|
107
|
+
columns: {
|
|
108
|
+
id: column.number({ primaryKey: true }),
|
|
109
|
+
parent: column.number({ optional: true }),
|
|
110
|
+
description: column.text(),
|
|
111
|
+
name: column.text(),
|
|
112
|
+
slug: column.text(),
|
|
113
|
+
meta: column.json({ default: {} })
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const StudioCMSPageContent = defineTable({
|
|
117
|
+
columns: {
|
|
118
|
+
id: column.text({ primaryKey: true }),
|
|
119
|
+
contentId: column.text({ references: () => StudioCMSPageData.columns.id }),
|
|
120
|
+
contentLang: column.text({ default: "default" }),
|
|
121
|
+
content: column.text({ multiline: true, optional: true })
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
const StudioCMSSiteConfig = defineTable({
|
|
125
|
+
columns: {
|
|
126
|
+
id: column.number({ primaryKey: true }),
|
|
127
|
+
title: column.text(),
|
|
128
|
+
description: column.text(),
|
|
129
|
+
defaultOgImage: column.text({ optional: true }),
|
|
130
|
+
siteIcon: column.text({ optional: true }),
|
|
131
|
+
loginPageBackground: column.text({ default: "studiocms-curves" }),
|
|
132
|
+
loginPageCustomImage: column.text({ optional: true }),
|
|
133
|
+
enableDiffs: column.boolean({ default: false }),
|
|
134
|
+
diffPerPage: column.number({ default: 10 }),
|
|
135
|
+
gridItems: column.json({ default: [] })
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
const tables = {
|
|
139
|
+
StudioCMSPageContent,
|
|
140
|
+
StudioCMSPageData,
|
|
141
|
+
StudioCMSPageDataCategories,
|
|
142
|
+
StudioCMSPageDataTags,
|
|
143
|
+
StudioCMSPermissions,
|
|
144
|
+
StudioCMSSessionTable,
|
|
145
|
+
StudioCMSSiteConfig,
|
|
146
|
+
StudioCMSUsers,
|
|
147
|
+
StudioCMSOAuthAccounts,
|
|
148
|
+
StudioCMSDiffTracking,
|
|
149
|
+
StudioCMSPageFolderStructure,
|
|
150
|
+
StudioCMSUserResetTokens,
|
|
151
|
+
StudioCMSAPIKeys
|
|
152
|
+
};
|
|
153
|
+
export {
|
|
154
|
+
StudioCMSAPIKeys,
|
|
155
|
+
StudioCMSDiffTracking,
|
|
156
|
+
StudioCMSOAuthAccounts,
|
|
157
|
+
StudioCMSPageContent,
|
|
158
|
+
StudioCMSPageData,
|
|
159
|
+
StudioCMSPageDataCategories,
|
|
160
|
+
StudioCMSPageDataTags,
|
|
161
|
+
StudioCMSPageFolderStructure,
|
|
162
|
+
StudioCMSPermissions,
|
|
163
|
+
StudioCMSSessionTable,
|
|
164
|
+
StudioCMSSiteConfig,
|
|
165
|
+
StudioCMSUserResetTokens,
|
|
166
|
+
StudioCMSUsers,
|
|
167
|
+
tables
|
|
168
|
+
};
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AstroError } from 'astro/errors';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error specific to the StudioCMS SDK.
|
|
4
|
+
* This class extends the `AstroError` class to provide additional context
|
|
5
|
+
* and functionality for errors occurring within the StudioCMS SDK.
|
|
6
|
+
*
|
|
7
|
+
* @extends {AstroError}
|
|
8
|
+
*/
|
|
9
|
+
export declare class StudioCMSError extends AstroError {
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents an error specific to the core functionality of StudioCMS.
|
|
14
|
+
* This class extends the `StudioCMSError` class and overrides the `name` property
|
|
15
|
+
* to provide a more specific error name.
|
|
16
|
+
*/
|
|
17
|
+
export declare class StudioCMSCoreError extends StudioCMSError {
|
|
18
|
+
name: string;
|
|
19
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AstroError } from "astro/errors";
|
|
2
|
+
class StudioCMSError extends AstroError {
|
|
3
|
+
name = "StudioCMS Error";
|
|
4
|
+
}
|
|
5
|
+
class StudioCMSCoreError extends StudioCMSError {
|
|
6
|
+
name = "StudioCMS Core Error";
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
StudioCMSCoreError,
|
|
10
|
+
StudioCMSError
|
|
11
|
+
};
|