studiocms 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -0
- package/dist/cli/add/index.d.ts +2 -2
- package/dist/cli/add/index.js +4 -3
- package/dist/cli/add/npm-utils.d.ts +6 -6
- package/dist/cli/add/tryToInstallPlugins.d.ts +1 -1
- package/dist/cli/add/tryToInstallPlugins.js +6 -5
- package/dist/cli/add/updateStudioCMSConfig.d.ts +1 -1
- package/dist/cli/add/updateStudioCMSConfig.js +3 -4
- package/dist/cli/add/validatePlugins.d.ts +1 -2
- package/dist/cli/add/validatePlugins.js +15 -9
- package/dist/cli/crypto/genJWT/index.d.ts +1 -1
- package/dist/cli/crypto/genJWT/index.js +8 -9
- package/dist/cli/crypto/index.d.ts +1 -1
- package/dist/cli/init/steps/env.js +14 -4
- package/dist/cli/init/steps/next.d.ts +1 -1
- package/dist/cli/init/steps/next.js +6 -5
- package/dist/cli/migrator/index.d.ts +1 -1
- package/dist/cli/migrator/index.js +2 -2
- package/dist/cli/users/index.d.ts +1 -1
- package/dist/cli/users/shared.js +2 -2
- package/dist/cli/users/steps/createUsers.js +7 -7
- package/dist/cli/users/steps/modifyUsers.js +2 -2
- package/dist/cli/users/steps/next.d.ts +1 -1
- package/dist/cli/utils/checkRequiredEnvVars.js +2 -2
- package/dist/cli/utils/context.d.ts +2 -4
- package/dist/cli/utils/context.js +1 -3
- package/dist/cli/utils/getCliDbClient.d.ts +1 -1
- package/dist/cli/utils/intro.d.ts +1 -1
- package/dist/cli/utils/loadConfig.d.ts +54 -49
- package/dist/cli/utils/loadConfig.js +5 -8
- package/dist/cli/utils/logger.js +3 -3
- package/dist/cli/utils/user-utils.d.ts +1 -1
- package/dist/cli/utils/user-utils.js +4 -3
- package/dist/client/apiClient.d.ts +4923 -0
- package/dist/client/apiClient.js +72 -0
- package/dist/config.d.ts +1734 -1
- package/dist/consts.d.ts +5 -5
- package/dist/consts.js +3 -2
- package/dist/db/plugins.d.ts +1 -1
- package/dist/db/plugins.js +5 -8
- package/dist/handlers/frontend/routes.d.ts +4 -18
- package/dist/handlers/frontend/routes.js +13 -152
- package/dist/handlers/frontend/types.d.ts +1 -1
- package/dist/handlers/frontend/utils.js +0 -18
- package/dist/handlers/pluginHandler.d.ts +34 -257
- package/dist/handlers/pluginHandler.js +92 -46
- package/dist/handlers/routeHandler.js +32 -11
- package/dist/handlers/setupDbStudio.d.ts +3 -1
- package/dist/handlers/setupDbStudio.js +19 -10
- package/dist/handlers/storage-manager/core/effectify-astro-context.d.ts +25 -0
- package/dist/handlers/storage-manager/core/effectify-astro-context.js +78 -0
- package/dist/handlers/storage-manager/no-op.d.ts +2 -2
- package/dist/handlers/storage-manager/no-op.js +2 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +10 -20
- package/dist/integrations/robots/index.d.ts +2 -2
- package/dist/integrations/robots/index.js +1 -3
- package/dist/integrations/robots/schema.d.ts +102 -273
- package/dist/integrations/robots/schema.js +220 -209
- package/dist/plugins/analytics/assets/schemas.d.ts +14 -9
- package/dist/plugins/analytics/assets/schemas.js +25 -17
- package/dist/plugins/analytics/db-client.d.ts +1 -1
- package/dist/plugins/analytics/index.d.ts +823 -3
- package/dist/plugins/analytics/index.js +4 -5
- package/dist/plugins/analytics/schemas.d.ts +54 -62
- package/dist/plugins/analytics/schemas.js +64 -13
- package/dist/plugins/analytics/table.d.ts +1 -1
- package/dist/plugins.d.ts +0 -1
- package/dist/schemas/config/api.d.ts +17 -0
- package/dist/schemas/config/api.js +14 -0
- package/dist/schemas/config/auth.d.ts +55 -59
- package/dist/schemas/config/auth.js +34 -11
- package/dist/schemas/config/dashboard.d.ts +43 -79
- package/dist/schemas/config/dashboard.js +43 -12
- package/dist/schemas/config/db.d.ts +15 -17
- package/dist/schemas/config/db.js +13 -5
- package/dist/schemas/config/developer.d.ts +33 -45
- package/dist/schemas/config/developer.js +22 -5
- package/dist/schemas/config/index.d.ts +398 -521
- package/dist/schemas/config/index.js +115 -57
- package/dist/schemas/config/sdk.d.ts +50 -196
- package/dist/schemas/config/sdk.js +61 -73
- package/dist/schemas/custom.d.ts +40 -0
- package/dist/schemas/custom.js +41 -0
- package/dist/schemas/external-schemas.d.ts +171 -0
- package/dist/schemas/external-schemas.js +179 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/plugins/i18n.d.ts +59 -39
- package/dist/schemas/plugins/i18n.js +42 -5
- package/dist/schemas/plugins/index.d.ts +7126 -10296
- package/dist/schemas/plugins/index.js +260 -276
- package/dist/schemas/plugins/shared.d.ts +1293 -3718
- package/dist/schemas/plugins/shared.js +320 -329
- package/dist/test-utils.d.ts +15 -4
- package/dist/test-utils.js +27 -11
- package/dist/toolbar/db-viewer/db-shared-types.d.ts +6 -6
- package/dist/toolbar/db-viewer/studio/connection.d.ts +8 -4
- package/dist/toolbar/db-viewer/studio/connection.js +2 -28
- package/dist/toolbar/db-viewer/studio/env/libsql.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/libsql.js +17 -0
- package/dist/toolbar/db-viewer/studio/env/mysql.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/mysql.js +23 -0
- package/dist/toolbar/db-viewer/studio/env/postgres.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/postgres.js +23 -0
- package/dist/toolbar/db-viewer/studio/index.js +20 -56
- package/dist/toolbar/db-viewer/studio/type.d.ts +1 -2
- package/dist/toolbar/db-viewer/studio/virtual-connection/libsql.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/libsql.js +24 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/mysql.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/mysql.js +9 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/postgres.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/postgres.js +9 -0
- package/dist/toolbar/db-viewer/viewer.js +20 -21
- package/dist/types.d.ts +30 -0
- package/dist/utils/effects/smtp.d.ts +1 -1
- package/dist/utils/lang-helper.d.ts +10 -2
- package/dist/virtual.d.ts +35 -28
- package/dist/virtuals/auth/core.d.ts +5 -5
- package/dist/virtuals/auth/verify-email.d.ts +6 -6
- package/dist/virtuals/components/Generator.astro +2 -2
- package/dist/virtuals/components/Renderer.astro +9 -1
- package/dist/virtuals/components/renderFn.d.ts +3 -1
- package/dist/virtuals/components/renderFn.js +18 -0
- package/dist/virtuals/lib/headDefaults.d.ts +4 -2
- package/dist/virtuals/lib/headDefaults.js +0 -2
- package/dist/virtuals/lib/routeMap.d.ts +0 -12
- package/dist/virtuals/lib/routeMap.js +2 -14
- package/dist/virtuals/mailer/index.d.ts +3 -3
- package/dist/virtuals/notifier/index.d.ts +5 -5
- package/dist/virtuals/plugins/dashboard-pages.d.ts +2 -64
- package/dist/virtuals/scripts/StorageFileBrowser.d.ts +1 -172
- package/dist/virtuals/scripts/StorageFileBrowser.js +216 -119
- package/dist/virtuals/template-engine/index.d.ts +4 -4
- package/frontend/components/dashboard/configuration/ConfigForm.astro +218 -110
- package/frontend/components/dashboard/content-mgmt/ContentSearch.astro +21 -22
- package/frontend/components/dashboard/content-mgmt/CreateFolder.astro +66 -54
- package/frontend/components/dashboard/content-mgmt/CreatePage.astro +58 -104
- package/frontend/components/dashboard/content-mgmt/EditFolder.astro +65 -67
- package/frontend/components/dashboard/content-mgmt/EditPage.astro +86 -134
- package/frontend/components/dashboard/content-mgmt/InnerSidebarElement.astro +0 -1
- package/frontend/components/dashboard/content-mgmt/PageHeader.astro +33 -52
- package/frontend/components/dashboard/content-mgmt/PageTypeHandler.astro +2 -2
- package/frontend/components/dashboard/profile/APITokens.astro +219 -158
- package/frontend/components/dashboard/profile/BasicInfo.astro +165 -106
- package/frontend/components/dashboard/profile/Notifications.astro +27 -18
- package/frontend/components/dashboard/profile/UpdatePassword.astro +134 -94
- package/frontend/components/dashboard/sidebar/VersionCheck.astro +31 -16
- package/frontend/components/dashboard/sidebar/VersionCheckChangelog.astro +18 -11
- package/frontend/components/dashboard/sidebar-modals/VersionModal.astro +2 -2
- package/frontend/components/dashboard/smtp-config/TemplateEditor.astro +14 -14
- package/frontend/components/dashboard/taxonomy/InnerSidebarElement.astro +0 -1
- package/frontend/components/dashboard/taxonomy/MetaContainer.astro +0 -2
- package/frontend/components/dashboard/taxonomy/PageHeader.astro +16 -24
- package/frontend/components/dashboard/taxonomy/TaxonomySearch.astro +23 -27
- package/frontend/components/dashboard/user-mgmt/InnerSidebarElement.astro +111 -104
- package/frontend/components/dashboard/user-mgmt/UserListItem.astro +9 -22
- package/frontend/components/dashboard/user-mgmt/UserListItems.astro +18 -0
- package/frontend/components/first-time-setup/snippets/{opt2-studiocms.config.diff → studiocms.config.diff} +1 -0
- package/frontend/components/shared/Code.astro +1 -4
- package/frontend/components/shared/DynamicSettingsRenderer.astro +1 -1
- package/frontend/components/shared/SSRUser.astro +2 -4
- package/frontend/components/shared/foldertree/FolderTreeNode.astro +0 -6
- package/frontend/components/shared/storage-manager/StorageCopyOutput.astro +0 -1
- package/frontend/components/shared/taxonomy/TaxonomyTreeNode.astro +0 -6
- package/frontend/layouts/DashboardLayout.astro +1 -10
- package/frontend/layouts/TaxonomyLayout.astro +0 -1
- package/frontend/middleware/index.ts +102 -61
- package/frontend/pages/404.astro +5 -9
- package/frontend/pages/[dashboard]/[...pluginPage].astro +10 -1
- package/frontend/pages/[dashboard]/configuration.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/createfolder.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/createpage.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/diff.astro +39 -14
- package/frontend/pages/[dashboard]/content-management/editfolder.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/editpage.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/index.astro +10 -1
- package/frontend/pages/[dashboard]/index.astro +10 -1
- package/frontend/pages/[dashboard]/login.astro +86 -25
- package/frontend/pages/[dashboard]/password-reset.astro +22 -16
- package/frontend/pages/[dashboard]/plugins/[plugin].astro +10 -1
- package/frontend/pages/[dashboard]/profile.astro +10 -1
- package/frontend/pages/[dashboard]/signup.astro +153 -52
- package/frontend/pages/[dashboard]/smtp-configuration.astro +77 -75
- package/frontend/pages/[dashboard]/system-management.astro +10 -1
- package/frontend/pages/[dashboard]/taxonomy/categories.astro +30 -41
- package/frontend/pages/[dashboard]/taxonomy/index.astro +10 -0
- package/frontend/pages/[dashboard]/taxonomy/tags.astro +33 -43
- package/frontend/pages/[dashboard]/unverified-email.astro +29 -21
- package/frontend/pages/[dashboard]/user-management/edit.astro +170 -90
- package/frontend/pages/[dashboard]/user-management/index.astro +10 -1
- package/frontend/pages/studiocms_api/[...all].ts +106 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/auth.ts +26 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/changelog.ts +147 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/db-studio-driver.ts +46 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/parseLogLevel.ts +27 -0
- package/frontend/pages/studiocms_api/_handlers/auth/auth.ts +459 -0
- package/frontend/pages/studiocms_api/_handlers/auth/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/auth/oauth.ts +91 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/_shared.ts +57 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/apiTokens.ts +134 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/config.ts +64 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/content.ts +741 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/create.ts +480 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/emailNotifications.ts +49 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/index.ts +45 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/mailer.ts +136 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/plugins.ts +80 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/profile.ts +275 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/resetPassword.ts +140 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/search.ts +63 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/taxonomy.ts +285 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/templates.ts +75 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/users.ts +312 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/verifyEndpoints.ts +307 -0
- package/frontend/pages/studiocms_api/_handlers/integration/dbStudio.ts +98 -0
- package/frontend/pages/studiocms_api/_handlers/integration/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/integration/storageManager.ts +107 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/index.ts +8 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/_shared.ts +41 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/public.ts +195 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/secure.ts +1726 -0
- package/frontend/pages/studiocms_api/_handlers/sdk.ts +129 -0
- package/frontend/pages/studiocms_api/_middleware/astroLocals.ts +36 -0
- package/frontend/pages/studiocms_api/_middleware/restApi.ts +56 -0
- package/frontend/pages/studiocms_api/integrations/[...all].ts +8 -0
- package/frontend/scripts/formdata.ts +219 -0
- package/frontend/setup-pages/3-done.astro +4 -20
- package/frontend/setup-pages/studiocms_api/dashboard/step-2.ts +3 -6
- package/frontend/styles/dashboard-base.css +0 -1
- package/frontend/web-vitals/endpoint.ts +2 -1
- package/package.json +35 -31
- package/dist/global.d.ts +0 -9
- package/frontend/components/dashboard/LoginChecker.astro +0 -68
- package/frontend/components/dashboard/user-mgmt/RankCheck.astro +0 -57
- package/frontend/components/first-time-setup/snippets/opt1-astro.config.diff +0 -14
- package/frontend/components/first-time-setup/snippets/opt2-astro.config.diff +0 -9
- package/frontend/middleware/_authmap.ts +0 -63
- package/frontend/pages/studiocms_api/auth/[path].ts +0 -390
- package/frontend/pages/studiocms_api/auth/[provider]/[...id].ts +0 -64
- package/frontend/pages/studiocms_api/auth/[provider]/_effects/index.ts +0 -101
- package/frontend/pages/studiocms_api/auth/_shared.ts +0 -52
- package/frontend/pages/studiocms_api/dashboard/api-tokens.ts +0 -115
- package/frontend/pages/studiocms_api/dashboard/config.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/content/diff.ts +0 -73
- package/frontend/pages/studiocms_api/dashboard/content/folder.ts +0 -220
- package/frontend/pages/studiocms_api/dashboard/content/page.ts +0 -359
- package/frontend/pages/studiocms_api/dashboard/create-reset-link.ts +0 -77
- package/frontend/pages/studiocms_api/dashboard/create-user-invite.ts +0 -231
- package/frontend/pages/studiocms_api/dashboard/create-user.ts +0 -186
- package/frontend/pages/studiocms_api/dashboard/email-notification-settings-site.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/mailer/check-email.ts +0 -75
- package/frontend/pages/studiocms_api/dashboard/mailer/config.ts +0 -136
- package/frontend/pages/studiocms_api/dashboard/plugins/[plugin].ts +0 -80
- package/frontend/pages/studiocms_api/dashboard/profile.ts +0 -245
- package/frontend/pages/studiocms_api/dashboard/resend-verify-email.ts +0 -77
- package/frontend/pages/studiocms_api/dashboard/reset-password.ts +0 -124
- package/frontend/pages/studiocms_api/dashboard/search-list.ts +0 -59
- package/frontend/pages/studiocms_api/dashboard/taxonomy-search.ts +0 -47
- package/frontend/pages/studiocms_api/dashboard/taxonomy.ts +0 -230
- package/frontend/pages/studiocms_api/dashboard/templates.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/update-user-notifications.ts +0 -86
- package/frontend/pages/studiocms_api/dashboard/users.ts +0 -236
- package/frontend/pages/studiocms_api/dashboard/verify-email.ts +0 -83
- package/frontend/pages/studiocms_api/dashboard/verify-session.ts +0 -187
- package/frontend/pages/studiocms_api/integrations/[type]/[...id].ts +0 -15
- package/frontend/pages/studiocms_api/integrations/[type]/_routes/db-studio.ts +0 -173
- package/frontend/pages/studiocms_api/integrations/[type]/_routes/storage.ts +0 -88
- package/frontend/pages/studiocms_api/partials/editor.astro +0 -74
- package/frontend/pages/studiocms_api/partials/render.astro +0 -39
- package/frontend/pages/studiocms_api/partials/user-list-items.astro +0 -43
- package/frontend/pages/studiocms_api/rest/utils/auth-token.ts +0 -59
- package/frontend/pages/studiocms_api/rest/v1/[type]/[...id].ts +0 -23
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/categories.ts +0 -267
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/folders.ts +0 -283
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/pages.ts +0 -505
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/settings.ts +0 -100
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/tags.ts +0 -229
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/users.ts +0 -553
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/[...id].ts +0 -19
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/categories.ts +0 -74
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/folders.ts +0 -85
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/pages.ts +0 -103
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/tags.ts +0 -67
- package/frontend/pages/studiocms_api/sdk/[...path].ts +0 -97
- package/frontend/pages/studiocms_api/sdk/utils/changelog.ts +0 -119
- package/frontend/scripts/auth/formListener.ts +0 -81
- package/frontend/scripts/formdata-utils.ts +0 -116
- package/frontend/utils/build-partial-schema.ts +0 -46
- package/frontend/utils/errors.ts +0 -6
- package/frontend/utils/param-extractor.ts +0 -83
- package/frontend/utils/rest-router.ts +0 -444
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { runEffect } from "@withstudiocms/effect";
|
|
2
2
|
import createPathResolver from "@withstudiocms/internal_helpers/pathResolver";
|
|
3
3
|
import { addVirtualImports } from "astro-integration-kit";
|
|
4
|
-
import { KyselyTableManager } from "
|
|
5
|
-
import { buildTranslations, loadJsTranslations } from "
|
|
6
|
-
import { definePlugin } from "
|
|
4
|
+
import { KyselyTableManager } from "../../db/plugins";
|
|
5
|
+
import { buildTranslations, loadJsTranslations } from "../../plugins";
|
|
6
|
+
import { definePlugin } from "../../schemas";
|
|
7
7
|
import { WEB_VITALS_ENDPOINT_PATH } from "./consts.js";
|
|
8
8
|
import { getAnalyticsDbClient } from "./db-client.js";
|
|
9
9
|
import { StudioCMSMetricTableDefinition } from "./table.js";
|
|
@@ -40,7 +40,6 @@ const webVitalsIntegration = () => {
|
|
|
40
40
|
const studioCMSAnalyticsPlugin = (opts) => definePlugin({
|
|
41
41
|
name: "Web Vitals (built-in)",
|
|
42
42
|
identifier: pkgName,
|
|
43
|
-
studiocmsMinimumVersion: opts.version,
|
|
44
43
|
hooks: {
|
|
45
44
|
"studiocms:astro-config": async ({ addIntegrations }) => {
|
|
46
45
|
const dbClient = await runEffect(getAnalyticsDbClient(opts.driverDialect));
|
|
@@ -51,7 +50,7 @@ const studioCMSAnalyticsPlugin = (opts) => definePlugin({
|
|
|
51
50
|
await tableManager.initialize();
|
|
52
51
|
addIntegrations(webVitalsIntegration());
|
|
53
52
|
},
|
|
54
|
-
"studiocms:dashboard": ({ setDashboard }) => {
|
|
53
|
+
"studiocms:dashboard": async ({ setDashboard }) => {
|
|
55
54
|
setDashboard({
|
|
56
55
|
translations,
|
|
57
56
|
dashboardGridItems: [
|
|
@@ -1,65 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
id:
|
|
22
|
-
|
|
23
|
-
rating: "good"
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for validating and transforming client-submitted web performance metric ratings. The input must be one of the following strings: 'good', 'needs-improvement', or 'poor'. This schema ensures that only valid rating values are accepted and provides a clear definition of the expected values for the rating field in client-submitted data.
|
|
4
|
+
*/
|
|
5
|
+
export declare const RatingSchema: Schema.Literal<["good", "needs-improvement", "poor"]>;
|
|
6
|
+
/**
|
|
7
|
+
* Schema for validating and transforming client-submitted web performance metric types. The input must be one of the following strings: 'CLS', 'INP', 'LCP', 'FCP', or 'TTFB'. This schema ensures that only valid metric types are accepted and provides a clear definition of the expected values for the metric type field in client-submitted data.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MetricTypeSchema: Schema.Literal<["CLS", "INP", "LCP", "FCP", "TTFB"]>;
|
|
10
|
+
/**
|
|
11
|
+
* Schema for validating and transforming client-submitted web performance metric IDs. The input must be a string matching the pattern `v5-<13 digits>-<13 digits>`. The schema transforms the ID by removing the last 5 digits of the first numeric segment to reduce data resolution while maintaining uniqueness. This transformation helps to balance the need for unique identifiers with privacy considerations by reducing the granularity of the data.
|
|
12
|
+
*/
|
|
13
|
+
export declare const MetricIdSchema: Schema.transformOrFail<typeof Schema.String, typeof Schema.String, never>;
|
|
14
|
+
/**
|
|
15
|
+
* Schema representing a client-submitted web performance metric, including its type, value, and associated metadata.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ClientMetricSchema: Schema.Struct<{
|
|
18
|
+
pathname: typeof Schema.String;
|
|
19
|
+
route: typeof Schema.String;
|
|
20
|
+
name: Schema.Literal<["CLS", "INP", "LCP", "FCP", "TTFB"]>;
|
|
21
|
+
id: Schema.transformOrFail<typeof Schema.String, typeof Schema.String, never>;
|
|
22
|
+
value: Schema.refine<number, typeof Schema.Number>;
|
|
23
|
+
rating: Schema.Literal<["good", "needs-improvement", "poor"]>;
|
|
24
24
|
}>;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
value: number
|
|
35
|
-
|
|
36
|
-
route: string;
|
|
37
|
-
id: string;
|
|
38
|
-
pathname: string;
|
|
39
|
-
rating: "good" | "needs-improvement" | "poor";
|
|
40
|
-
}, {
|
|
41
|
-
value: number;
|
|
42
|
-
name: "CLS" | "INP" | "LCP" | "FCP" | "TTFB";
|
|
43
|
-
route: string;
|
|
44
|
-
id: string;
|
|
45
|
-
pathname: string;
|
|
46
|
-
rating: "good" | "needs-improvement" | "poor";
|
|
47
|
-
}>, {
|
|
48
|
-
timestamp: Date;
|
|
49
|
-
value: number;
|
|
50
|
-
name: "CLS" | "INP" | "LCP" | "FCP" | "TTFB";
|
|
51
|
-
route: string;
|
|
52
|
-
id: string;
|
|
53
|
-
pathname: string;
|
|
54
|
-
rating: "good" | "needs-improvement" | "poor";
|
|
55
|
-
}, {
|
|
56
|
-
value: number;
|
|
57
|
-
name: "CLS" | "INP" | "LCP" | "FCP" | "TTFB";
|
|
58
|
-
route: string;
|
|
59
|
-
id: string;
|
|
60
|
-
pathname: string;
|
|
61
|
-
rating: "good" | "needs-improvement" | "poor";
|
|
25
|
+
/**
|
|
26
|
+
* Schema for server-stored metrics, which includes all fields from the client-submitted metric along with a timestamp. The timestamp is generated on the server to indicate when the metric was processed, and the ID is transformed to reduce data resolution while maintaining uniqueness.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ServerMetricSchemaBase: Schema.Struct<{
|
|
29
|
+
timestamp: typeof Schema.DateFromSelf;
|
|
30
|
+
pathname: typeof Schema.String;
|
|
31
|
+
route: typeof Schema.String;
|
|
32
|
+
name: Schema.Literal<["CLS", "INP", "LCP", "FCP", "TTFB"]>;
|
|
33
|
+
id: Schema.transformOrFail<typeof Schema.String, typeof Schema.String, never>;
|
|
34
|
+
value: Schema.refine<number, typeof Schema.Number>;
|
|
35
|
+
rating: Schema.Literal<["good", "needs-improvement", "poor"]>;
|
|
62
36
|
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Schema for server-stored metrics, which includes all fields from the client-submitted metric along with a timestamp. The timestamp is generated on the server to indicate when the metric was processed, and the ID is transformed to reduce data resolution while maintaining uniqueness.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ServerMetricSchema: Schema.transform<Schema.Struct<{
|
|
41
|
+
pathname: typeof Schema.String;
|
|
42
|
+
route: typeof Schema.String;
|
|
43
|
+
name: Schema.Literal<["CLS", "INP", "LCP", "FCP", "TTFB"]>;
|
|
44
|
+
id: Schema.transformOrFail<typeof Schema.String, typeof Schema.String, never>;
|
|
45
|
+
value: Schema.refine<number, typeof Schema.Number>;
|
|
46
|
+
rating: Schema.Literal<["good", "needs-improvement", "poor"]>;
|
|
47
|
+
}>, Schema.Struct<{
|
|
48
|
+
timestamp: typeof Schema.DateFromSelf;
|
|
49
|
+
pathname: typeof Schema.String;
|
|
50
|
+
route: typeof Schema.String;
|
|
51
|
+
name: Schema.Literal<["CLS", "INP", "LCP", "FCP", "TTFB"]>;
|
|
52
|
+
id: Schema.transformOrFail<typeof Schema.String, typeof Schema.String, never>;
|
|
53
|
+
value: Schema.refine<number, typeof Schema.Number>;
|
|
54
|
+
rating: Schema.Literal<["good", "needs-improvement", "poor"]>;
|
|
55
|
+
}>>;
|
|
63
56
|
/** Type representing the shape of client-submitted metrics. */
|
|
64
|
-
export type ClientMetric =
|
|
65
|
-
export {};
|
|
57
|
+
export type ClientMetric = typeof ClientMetricSchema.Type;
|
|
@@ -1,20 +1,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ParseResult } from "effect";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
const RatingSchema = Schema.Literal("good", "needs-improvement", "poor");
|
|
4
|
+
const MetricTypeSchema = Schema.Literal("CLS", "INP", "LCP", "FCP", "TTFB");
|
|
5
|
+
const MetricIdSchema = Schema.transformOrFail(Schema.String, Schema.String, {
|
|
6
|
+
strict: true,
|
|
7
|
+
decode: (input, _options, ast) => {
|
|
8
|
+
if (typeof input !== "string") {
|
|
9
|
+
return ParseResult.fail(new ParseResult.Type(ast, input, "Expected a string for Metric ID"));
|
|
10
|
+
}
|
|
11
|
+
const regex = /^v5-\d{13}-\d{13}$/;
|
|
12
|
+
if (!regex.test(input)) {
|
|
13
|
+
return ParseResult.fail(
|
|
14
|
+
new ParseResult.Type(
|
|
15
|
+
ast,
|
|
16
|
+
input,
|
|
17
|
+
"Metric ID must match the pattern v5-<13 digits>-<13 digits>"
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
const transformedId = input.replace(/^(v5-\d{8})\d{5}(-\d{13})$/, "$1$2");
|
|
22
|
+
return ParseResult.succeed(transformedId);
|
|
23
|
+
},
|
|
24
|
+
encode: (input) => ParseResult.succeed(input)
|
|
25
|
+
}).annotations({
|
|
26
|
+
title: "Metric ID",
|
|
27
|
+
identifier: "MetricId",
|
|
28
|
+
description: "A `web-vitals` generated ID, transformed to reduce data resolution."
|
|
29
|
+
});
|
|
30
|
+
const ClientMetricSchema = Schema.Struct({
|
|
31
|
+
pathname: Schema.String,
|
|
32
|
+
route: Schema.String,
|
|
8
33
|
name: MetricTypeSchema,
|
|
9
34
|
id: MetricIdSchema,
|
|
10
|
-
value:
|
|
35
|
+
value: Schema.Number.pipe(Schema.greaterThan(0)).annotations({
|
|
36
|
+
description: "The value of the metric, must be a non-negative number."
|
|
37
|
+
}),
|
|
11
38
|
rating: RatingSchema
|
|
39
|
+
}).annotations({
|
|
40
|
+
title: "Client Metric",
|
|
41
|
+
identifier: "ClientMetric",
|
|
42
|
+
description: "Schema representing a client-submitted web performance metric, including its type, value, and associated metadata."
|
|
43
|
+
});
|
|
44
|
+
const ServerMetricSchemaBase = Schema.Struct({
|
|
45
|
+
...ClientMetricSchema.fields,
|
|
46
|
+
timestamp: Schema.DateFromSelf
|
|
47
|
+
}).annotations({
|
|
48
|
+
title: "Server Metric",
|
|
49
|
+
identifier: "ServerMetric",
|
|
50
|
+
description: "Schema representing a server-stored web performance metric, including all client-submitted fields and a timestamp indicating when the metric was processed."
|
|
12
51
|
});
|
|
13
|
-
const ServerMetricSchema =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
52
|
+
const ServerMetricSchema = Schema.transform(ClientMetricSchema, ServerMetricSchemaBase, {
|
|
53
|
+
strict: true,
|
|
54
|
+
decode: (input) => {
|
|
55
|
+
const timestamp = /* @__PURE__ */ new Date();
|
|
56
|
+
timestamp.setMinutes(0, 0, 0);
|
|
57
|
+
return { ...input, timestamp };
|
|
58
|
+
},
|
|
59
|
+
encode: (input) => {
|
|
60
|
+
const { timestamp, ...rest } = input;
|
|
61
|
+
return rest;
|
|
62
|
+
}
|
|
17
63
|
});
|
|
18
64
|
export {
|
|
19
|
-
|
|
65
|
+
ClientMetricSchema,
|
|
66
|
+
MetricIdSchema,
|
|
67
|
+
MetricTypeSchema,
|
|
68
|
+
RatingSchema,
|
|
69
|
+
ServerMetricSchema,
|
|
70
|
+
ServerMetricSchemaBase
|
|
20
71
|
};
|
|
@@ -32,8 +32,8 @@ export declare const StudioCMSMetricDBSchema: Schema.Struct<{
|
|
|
32
32
|
*/
|
|
33
33
|
declare const StudioCMSMetricDBSchemaEncoded: {
|
|
34
34
|
readonly StudioCMSMetric: {
|
|
35
|
-
readonly value: number;
|
|
36
35
|
readonly name: "CLS" | "INP" | "LCP" | "FCP" | "TTFB";
|
|
36
|
+
readonly value: number;
|
|
37
37
|
readonly route: string;
|
|
38
38
|
readonly id: string;
|
|
39
39
|
readonly timestamp: import("kysely").ColumnType<string, string, string>;
|
package/dist/plugins.d.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for the API configuration, which includes settings for enabling or disabling the API documentation.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ApiConfigSchema: Schema.Struct<{
|
|
6
|
+
apiDocs: Schema.optionalWith<typeof Schema.Boolean, {
|
|
7
|
+
default: () => true;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Type for the API configuration.
|
|
12
|
+
*/
|
|
13
|
+
export type ApiConfig = typeof ApiConfigSchema.Encoded;
|
|
14
|
+
/**
|
|
15
|
+
* Resolved type for the API configuration.
|
|
16
|
+
*/
|
|
17
|
+
export type ApiConfigResolved = typeof ApiConfigSchema.Type;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import { BooleanDefaultTrue } from "../custom.js";
|
|
3
|
+
const ApiConfigSchema = Schema.Struct({
|
|
4
|
+
apiDocs: BooleanDefaultTrue.annotations({
|
|
5
|
+
description: "API Documentation - Allows enabling or disabling of the API documentation. These docs will be available at the /studiocms_api/docs route and provide an interactive interface for exploring the API specifications and endpoints. Disabling this option will hide the documentation route, which is recommended in production environments for security reasons."
|
|
6
|
+
})
|
|
7
|
+
}).annotations({
|
|
8
|
+
title: "API Configuration",
|
|
9
|
+
description: "API Configuration - Configure the API settings for the dashboard",
|
|
10
|
+
identifier: "ApiConfig"
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
ApiConfigSchema
|
|
14
|
+
};
|
|
@@ -1,64 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for the username and password authentication provider configuration.
|
|
4
|
+
*/
|
|
5
|
+
export declare const UsernameAndPasswordConfigSchema: Schema.Struct<{
|
|
6
|
+
allowUserRegistration: Schema.optionalWith<typeof Schema.Boolean, {
|
|
7
|
+
default: () => true;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Schema for the authentication providers configuration.
|
|
12
|
+
*/
|
|
13
|
+
export declare const AuthProvidersConfigSchema: Schema.Struct<{
|
|
14
|
+
usernameAndPassword: Schema.optionalWith<typeof Schema.Boolean, {
|
|
15
|
+
default: () => true;
|
|
16
|
+
}>;
|
|
17
|
+
usernameAndPasswordConfig: Schema.optionalWith<Schema.Schema<{
|
|
18
|
+
readonly allowUserRegistration: boolean;
|
|
19
|
+
}, {
|
|
20
|
+
readonly allowUserRegistration?: boolean | undefined;
|
|
21
|
+
}, never>, {
|
|
22
|
+
default: () => {
|
|
23
|
+
readonly allowUserRegistration: boolean;
|
|
17
24
|
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
enabled
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
providers:
|
|
28
|
-
usernameAndPassword:
|
|
29
|
-
usernameAndPasswordConfig:
|
|
30
|
-
allowUserRegistration:
|
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
allowUserRegistration: boolean;
|
|
33
|
-
}, {
|
|
34
|
-
allowUserRegistration?: boolean | undefined;
|
|
35
|
-
}>>>;
|
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
|
37
|
-
usernameAndPassword: boolean;
|
|
38
|
-
usernameAndPasswordConfig: {
|
|
39
|
-
allowUserRegistration: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Schema for the authentication configuration.
|
|
29
|
+
*/
|
|
30
|
+
export declare const AuthConfigSchema: Schema.Struct<{
|
|
31
|
+
enabled: Schema.optionalWith<typeof Schema.Boolean, {
|
|
32
|
+
default: () => true;
|
|
33
|
+
}>;
|
|
34
|
+
providers: Schema.optionalWith<Schema.Schema<{
|
|
35
|
+
readonly usernameAndPassword: boolean;
|
|
36
|
+
readonly usernameAndPasswordConfig: {
|
|
37
|
+
readonly allowUserRegistration: boolean;
|
|
40
38
|
};
|
|
41
39
|
}, {
|
|
42
|
-
usernameAndPassword?: boolean | undefined;
|
|
43
|
-
usernameAndPasswordConfig?: {
|
|
44
|
-
allowUserRegistration?: boolean | undefined;
|
|
40
|
+
readonly usernameAndPassword?: boolean | undefined;
|
|
41
|
+
readonly usernameAndPasswordConfig?: {
|
|
42
|
+
readonly allowUserRegistration?: boolean | undefined;
|
|
45
43
|
} | undefined;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
usernameAndPasswordConfig: {
|
|
53
|
-
allowUserRegistration: boolean;
|
|
44
|
+
}, never>, {
|
|
45
|
+
default: () => {
|
|
46
|
+
readonly usernameAndPassword: boolean;
|
|
47
|
+
readonly usernameAndPasswordConfig: {
|
|
48
|
+
readonly allowUserRegistration: boolean;
|
|
49
|
+
};
|
|
54
50
|
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Type for the authentication configuration.
|
|
55
|
+
*/
|
|
56
|
+
export type AuthConfig = typeof AuthConfigSchema.Encoded;
|
|
57
|
+
/**
|
|
58
|
+
* Resolved type for the authentication configuration.
|
|
59
|
+
*/
|
|
60
|
+
export type AuthConfigResolved = typeof AuthConfigSchema.Type;
|
|
@@ -1,13 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import { BooleanDefaultTrue, OptionalWithDefaults } from "../custom.js";
|
|
3
|
+
const UsernameAndPasswordConfigSchema = Schema.Struct({
|
|
4
|
+
allowUserRegistration: BooleanDefaultTrue.annotations({
|
|
5
|
+
description: "Allow User Registration - Allows users to register an account"
|
|
6
|
+
})
|
|
7
|
+
}).annotations({
|
|
8
|
+
title: "Username and Password Auth Provider Configuration",
|
|
9
|
+
description: "Username and Password Auth Provider Configuration",
|
|
10
|
+
identifier: "UsernameAndPasswordConfig"
|
|
11
|
+
});
|
|
12
|
+
const AuthProvidersConfigSchema = Schema.Struct({
|
|
13
|
+
usernameAndPassword: BooleanDefaultTrue.annotations({
|
|
14
|
+
description: "Username and Password Auth Provider"
|
|
15
|
+
}),
|
|
16
|
+
usernameAndPasswordConfig: OptionalWithDefaults(UsernameAndPasswordConfigSchema, {})
|
|
17
|
+
}).annotations({
|
|
18
|
+
title: "Auth Providers",
|
|
19
|
+
description: "Auth Providers - Allows enabling or disabling of the Authentication Providers",
|
|
20
|
+
identifier: "AuthProvidersConfig"
|
|
21
|
+
});
|
|
22
|
+
const AuthConfigSchema = Schema.Struct({
|
|
23
|
+
enabled: BooleanDefaultTrue.annotations({
|
|
24
|
+
description: "Auth Enabled - Allows enabling or disabling of the Authentication Configuration"
|
|
25
|
+
}),
|
|
26
|
+
providers: OptionalWithDefaults(AuthProvidersConfigSchema, {})
|
|
27
|
+
}).annotations({
|
|
28
|
+
title: "Authentication Configuration",
|
|
29
|
+
description: "Authentication Configuration",
|
|
30
|
+
identifier: "AuthConfig"
|
|
31
|
+
});
|
|
11
32
|
export {
|
|
12
|
-
|
|
33
|
+
AuthConfigSchema,
|
|
34
|
+
AuthProvidersConfigSchema,
|
|
35
|
+
UsernameAndPasswordConfigSchema
|
|
13
36
|
};
|
|
@@ -1,80 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* OPTIONAL - This allows the user to enable or disable the version check for the dashboard
|
|
30
|
-
*
|
|
31
|
-
* This will check for the latest version of StudioCMS and notify the user
|
|
32
|
-
* if there is a new version available.
|
|
33
|
-
*
|
|
34
|
-
* @default true
|
|
35
|
-
*/
|
|
36
|
-
versionCheck?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* OPTIONAL - This allows the user to configure security settings for the dashboard
|
|
39
|
-
*/
|
|
40
|
-
security?: {
|
|
41
|
-
/**
|
|
42
|
-
* OPTIONAL - This allows the user to hide generator tags in the HTML output of the dashboard
|
|
43
|
-
*
|
|
44
|
-
* @default false
|
|
45
|
-
*/
|
|
46
|
-
hideGeneratorTags?: boolean;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export declare const dashboardConfigSchema: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
50
|
-
dashboardEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
51
|
-
inject404Route: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
52
|
-
faviconURL: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
53
|
-
dashboardRouteOverride: z.ZodOptional<z.ZodString>;
|
|
54
|
-
versionCheck: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
55
|
-
security: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
56
|
-
hideGeneratorTags: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
57
|
-
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
hideGeneratorTags: boolean;
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
/**
|
|
3
|
+
* Schema for the security configuration of the dashboard.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SecurityConfigSchema: Schema.Struct<{
|
|
6
|
+
hideGeneratorTags: Schema.optionalWith<typeof Schema.Boolean, {
|
|
7
|
+
default: () => false;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Schema for the dashboard configuration.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DashboardConfigSchema: Schema.Struct<{
|
|
14
|
+
dashboardEnabled: Schema.optionalWith<typeof Schema.Boolean, {
|
|
15
|
+
default: () => true;
|
|
16
|
+
}>;
|
|
17
|
+
inject404Route: Schema.optionalWith<typeof Schema.Boolean, {
|
|
18
|
+
default: () => true;
|
|
19
|
+
}>;
|
|
20
|
+
faviconURL: Schema.optionalWith<typeof Schema.NonEmptyTrimmedString, {
|
|
21
|
+
default: () => string;
|
|
22
|
+
}>;
|
|
23
|
+
dashboardRouteOverride: Schema.optional<typeof Schema.String>;
|
|
24
|
+
versionCheck: Schema.optionalWith<typeof Schema.Boolean, {
|
|
25
|
+
default: () => true;
|
|
26
|
+
}>;
|
|
27
|
+
security: Schema.optionalWith<Schema.Schema<{
|
|
28
|
+
readonly hideGeneratorTags: boolean;
|
|
59
29
|
}, {
|
|
60
|
-
hideGeneratorTags?: boolean | undefined;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
dashboardRouteOverride?: string | undefined;
|
|
76
|
-
versionCheck?: boolean | undefined;
|
|
77
|
-
security?: {
|
|
78
|
-
hideGeneratorTags?: boolean | undefined;
|
|
79
|
-
} | undefined;
|
|
80
|
-
}>>>;
|
|
30
|
+
readonly hideGeneratorTags?: boolean | undefined;
|
|
31
|
+
}, never>, {
|
|
32
|
+
default: () => {
|
|
33
|
+
readonly hideGeneratorTags: boolean;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Type for the dashboard configuration.
|
|
39
|
+
*/
|
|
40
|
+
export type DashboardConfig = typeof DashboardConfigSchema.Encoded;
|
|
41
|
+
/**
|
|
42
|
+
* Resolved type for the dashboard configuration.
|
|
43
|
+
*/
|
|
44
|
+
export type DashboardConfigResolved = typeof DashboardConfigSchema.Type;
|
|
@@ -1,14 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import {
|
|
3
|
+
BooleanDefaultFalse,
|
|
4
|
+
BooleanDefaultTrue,
|
|
5
|
+
OptionalWithDefaults,
|
|
6
|
+
StringWithDefault
|
|
7
|
+
} from "../custom.js";
|
|
8
|
+
const SecurityConfigSchema = Schema.Struct({
|
|
9
|
+
hideGeneratorTags: BooleanDefaultFalse.annotations({
|
|
10
|
+
description: "Hide Generator Tags - Hides generator tags in the HTML output of the dashboard"
|
|
11
|
+
})
|
|
12
|
+
}).annotations({
|
|
13
|
+
title: "Dashboard Security Configuration",
|
|
14
|
+
description: "Configuration options related to the security of the dashboard",
|
|
15
|
+
identifier: "DashboardSecurityConfig"
|
|
16
|
+
});
|
|
17
|
+
const DashboardConfigSchema = Schema.Struct({
|
|
18
|
+
dashboardEnabled: BooleanDefaultTrue.annotations({
|
|
19
|
+
description: "Dashboard Enabled - Allows enabling or disabling of the dashboard"
|
|
20
|
+
}),
|
|
21
|
+
inject404Route: BooleanDefaultTrue.annotations({
|
|
22
|
+
description: "Inject 404 Route - Allows injecting a 404 route for the dashboard"
|
|
23
|
+
}),
|
|
24
|
+
faviconURL: StringWithDefault("/favicon.svg").annotations({
|
|
25
|
+
description: "Favicon URL - Allows overriding the default Favicon URL to a custom URL"
|
|
26
|
+
}),
|
|
27
|
+
dashboardRouteOverride: Schema.optional(Schema.String).annotations({
|
|
28
|
+
description: "Dashboard Route Override - Allows overriding the default dashboard route to a custom route",
|
|
29
|
+
usage: "The default route is `dashboard` without any `/` or `\\` characters. If you want to override the route to `/admin` you would set this value to `admin`"
|
|
30
|
+
}),
|
|
31
|
+
versionCheck: BooleanDefaultTrue.annotations({
|
|
32
|
+
description: "Version Check - Allows enabling or disabling of the version check for the dashboard"
|
|
33
|
+
}),
|
|
34
|
+
security: OptionalWithDefaults(SecurityConfigSchema, {}).annotations({
|
|
35
|
+
description: "Security Configuration - Allows configuring security settings for the dashboard"
|
|
36
|
+
})
|
|
37
|
+
}).annotations({
|
|
38
|
+
title: "Dashboard Configuration",
|
|
39
|
+
description: "Configuration options related to the dashboard",
|
|
40
|
+
identifier: "DashboardConfig"
|
|
41
|
+
});
|
|
12
42
|
export {
|
|
13
|
-
|
|
43
|
+
DashboardConfigSchema,
|
|
44
|
+
SecurityConfigSchema
|
|
14
45
|
};
|