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,359 +1,350 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParseResult } from "effect";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
2
3
|
import { availableTranslationFileKeys } from "../../virtuals/i18n/v-files.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import {
|
|
5
|
+
AstroComponentSchema,
|
|
6
|
+
SanitizeOptionsSchema,
|
|
7
|
+
UIIconListSchema
|
|
8
|
+
} from "../external-schemas.js";
|
|
9
|
+
const I18nLabelSchema = Schema.transformOrFail(
|
|
10
|
+
Schema.Record({
|
|
11
|
+
key: Schema.String,
|
|
12
|
+
value: Schema.String
|
|
13
|
+
}),
|
|
14
|
+
Schema.Record({
|
|
15
|
+
key: Schema.String,
|
|
16
|
+
value: Schema.String
|
|
17
|
+
}),
|
|
18
|
+
{
|
|
19
|
+
strict: true,
|
|
20
|
+
decode: (input, _options, ast) => {
|
|
21
|
+
if (typeof input !== "object" || input === null) {
|
|
22
|
+
return ParseResult.fail(new ParseResult.Type(ast, input, "Expected an object"));
|
|
23
|
+
}
|
|
24
|
+
const result = {};
|
|
25
|
+
for (const key in input) {
|
|
26
|
+
if (typeof input[key] !== "string") {
|
|
27
|
+
return ParseResult.fail(
|
|
28
|
+
new ParseResult.Type(ast, input[key], `Expected value for key '${key}' to be a string`)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
result[key] = input[key];
|
|
32
|
+
}
|
|
33
|
+
const unknown = Object.keys(result).filter((k) => !availableTranslationFileKeys.includes(k));
|
|
34
|
+
if (unknown.length > 0) {
|
|
35
|
+
return ParseResult.fail(
|
|
36
|
+
new ParseResult.Type(
|
|
37
|
+
ast,
|
|
38
|
+
input,
|
|
39
|
+
`Unknown/Unsupported translation keys: ${unknown.join(", ")}
|
|
40
|
+
|
|
41
|
+
Supported keys are: ${availableTranslationFileKeys.join(", ")}`
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return ParseResult.succeed(result);
|
|
46
|
+
},
|
|
47
|
+
encode: (input) => ParseResult.succeed(input)
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
const StudioCMSColorwaySchema = Schema.Literal(
|
|
8
51
|
"primary",
|
|
9
52
|
"success",
|
|
10
53
|
"warning",
|
|
11
54
|
"danger",
|
|
12
55
|
"info",
|
|
13
56
|
"mono"
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The label of the field displayed in the form
|
|
22
|
-
*/
|
|
23
|
-
label: z.string(),
|
|
24
|
-
/**
|
|
25
|
-
* Is the field required
|
|
26
|
-
*/
|
|
27
|
-
required: z.boolean().optional(),
|
|
28
|
-
/**
|
|
29
|
-
* Is the field read only (disabled)
|
|
30
|
-
*/
|
|
31
|
-
readOnly: z.boolean().optional()
|
|
32
|
-
});
|
|
33
|
-
const SupportsColorSchema = BaseFieldSchema.extend({
|
|
34
|
-
color: StudioCMSColorway.optional()
|
|
35
|
-
});
|
|
36
|
-
const SupportsPlaceHolderSchema = BaseFieldSchema.extend({
|
|
37
|
-
placeholder: z.string().optional()
|
|
38
|
-
});
|
|
39
|
-
const CheckboxFieldSchema = SupportsColorSchema.extend({
|
|
40
|
-
input: z.literal("checkbox"),
|
|
41
|
-
defaultChecked: z.boolean().optional(),
|
|
42
|
-
size: z.enum(["sm", "md", "lg"]).optional()
|
|
43
|
-
});
|
|
44
|
-
const TextInputFieldSchema = SupportsPlaceHolderSchema.extend({
|
|
45
|
-
input: z.literal("input"),
|
|
46
|
-
type: z.enum(["text", "password", "email", "number", "tel", "url", "search"]).optional(),
|
|
47
|
-
defaultValue: z.string().optional()
|
|
48
|
-
});
|
|
49
|
-
const TextAreaFieldSchema = SupportsPlaceHolderSchema.extend({
|
|
50
|
-
input: z.literal("textarea"),
|
|
51
|
-
defaultValue: z.string().optional()
|
|
57
|
+
);
|
|
58
|
+
const StudioCMSSizeSchema = Schema.Literal("sm", "md", "lg");
|
|
59
|
+
const SharedOptionsSchemaItem = Schema.Struct({
|
|
60
|
+
label: Schema.String,
|
|
61
|
+
value: Schema.String,
|
|
62
|
+
disabled: Schema.optional(Schema.Boolean)
|
|
52
63
|
});
|
|
53
|
-
const SharedOptionsSchema =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
const SharedOptionsSchema = Schema.mutable(Schema.Array(SharedOptionsSchemaItem));
|
|
65
|
+
const StudioCMSPermissionsSchema = Schema.Literal(
|
|
66
|
+
"owner",
|
|
67
|
+
"admin",
|
|
68
|
+
"editor",
|
|
69
|
+
"visitor",
|
|
70
|
+
"none"
|
|
59
71
|
);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
class BaseFieldSchema extends Schema.Class("BaseFieldSchema")({
|
|
73
|
+
name: Schema.String,
|
|
74
|
+
label: Schema.String,
|
|
75
|
+
required: Schema.optional(Schema.Boolean),
|
|
76
|
+
readOnly: Schema.optional(Schema.Boolean)
|
|
77
|
+
}) {
|
|
78
|
+
}
|
|
79
|
+
class SupportsColorwaySchema extends BaseFieldSchema.extend(
|
|
80
|
+
"SupportsColorwaySchema"
|
|
81
|
+
)({
|
|
82
|
+
color: Schema.optional(StudioCMSColorwaySchema)
|
|
83
|
+
}) {
|
|
84
|
+
}
|
|
85
|
+
class SupportsPlaceHolderSchema extends BaseFieldSchema.extend(
|
|
86
|
+
"SupportsPlaceHolderSchema"
|
|
87
|
+
)({
|
|
88
|
+
placeholder: Schema.optional(Schema.String)
|
|
89
|
+
}) {
|
|
90
|
+
}
|
|
91
|
+
class CheckboxFieldSchema extends SupportsColorwaySchema.extend(
|
|
92
|
+
"CheckboxFieldSchema"
|
|
93
|
+
)({
|
|
94
|
+
input: Schema.Literal("checkbox"),
|
|
95
|
+
defaultChecked: Schema.optional(Schema.Boolean),
|
|
96
|
+
size: Schema.optional(StudioCMSSizeSchema)
|
|
97
|
+
}) {
|
|
98
|
+
}
|
|
99
|
+
class TextInputFieldSchema extends SupportsPlaceHolderSchema.extend(
|
|
100
|
+
"TextInputFieldSchema"
|
|
101
|
+
)({
|
|
102
|
+
input: Schema.Literal("input"),
|
|
103
|
+
type: Schema.optional(
|
|
104
|
+
Schema.Literal("text", "password", "email", "number", "tel", "url", "search")
|
|
105
|
+
),
|
|
106
|
+
defaultValue: Schema.optional(Schema.String)
|
|
107
|
+
}) {
|
|
108
|
+
}
|
|
109
|
+
class TextAreaFieldSchema extends SupportsPlaceHolderSchema.extend(
|
|
110
|
+
"TextAreaFieldSchema"
|
|
111
|
+
)({
|
|
112
|
+
input: Schema.Literal("textarea"),
|
|
113
|
+
defaultValue: Schema.optional(Schema.String)
|
|
114
|
+
}) {
|
|
115
|
+
}
|
|
116
|
+
class RadioGroupFieldSchema extends SupportsColorwaySchema.extend(
|
|
117
|
+
"RadioGroupFieldSchema"
|
|
118
|
+
)({
|
|
119
|
+
input: Schema.Literal("radio"),
|
|
120
|
+
direction: Schema.optional(Schema.Literal("horizontal", "vertical")),
|
|
121
|
+
defaultValue: Schema.optional(Schema.String),
|
|
64
122
|
options: SharedOptionsSchema
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
123
|
+
}) {
|
|
124
|
+
}
|
|
125
|
+
class SelectFieldSchema extends SupportsColorwaySchema.extend(
|
|
126
|
+
"SelectFieldSchema"
|
|
127
|
+
)({
|
|
128
|
+
input: Schema.Literal("select"),
|
|
129
|
+
type: Schema.optional(Schema.Literal("basic", "search")),
|
|
130
|
+
defaultValue: Schema.optional(Schema.String),
|
|
70
131
|
options: SharedOptionsSchema
|
|
71
|
-
})
|
|
72
|
-
|
|
132
|
+
}) {
|
|
133
|
+
}
|
|
134
|
+
const FieldSchema = Schema.Union(
|
|
73
135
|
CheckboxFieldSchema,
|
|
74
136
|
TextInputFieldSchema,
|
|
75
137
|
TextAreaFieldSchema,
|
|
76
138
|
RadioGroupFieldSchema,
|
|
77
139
|
SelectFieldSchema
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
input:
|
|
81
|
-
alignCenter:
|
|
82
|
-
gapSize:
|
|
83
|
-
fields:
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
const SettingsFieldSchema =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
140
|
+
);
|
|
141
|
+
class RowFieldSchema extends BaseFieldSchema.extend("RowFieldSchema")({
|
|
142
|
+
input: Schema.Literal("row"),
|
|
143
|
+
alignCenter: Schema.optional(Schema.Boolean),
|
|
144
|
+
gapSize: Schema.optional(StudioCMSSizeSchema),
|
|
145
|
+
fields: Schema.Array(FieldSchema)
|
|
146
|
+
}) {
|
|
147
|
+
}
|
|
148
|
+
const SettingsFieldSchema = Schema.Union(FieldSchema, RowFieldSchema);
|
|
149
|
+
class BaseDashboardPagePropsSchema extends Schema.Class(
|
|
150
|
+
"BaseDashboardPagePropsSchema"
|
|
151
|
+
)({
|
|
152
|
+
title: I18nLabelSchema,
|
|
153
|
+
description: Schema.String,
|
|
154
|
+
route: Schema.String,
|
|
155
|
+
icon: Schema.optionalWith(UIIconListSchema, {
|
|
156
|
+
default: () => "heroicons:cube-transparent"
|
|
157
|
+
}),
|
|
158
|
+
requiredPermissions: Schema.optionalWith(StudioCMSPermissionsSchema, {
|
|
159
|
+
default: () => "none"
|
|
160
|
+
}),
|
|
161
|
+
pageActionsComponent: Schema.optional(Schema.String),
|
|
162
|
+
pageBodyComponent: Schema.String
|
|
163
|
+
}) {
|
|
164
|
+
}
|
|
165
|
+
class AvailableBaseSchema extends BaseDashboardPagePropsSchema.extend(
|
|
166
|
+
"AvailableBaseSchema"
|
|
167
|
+
)({
|
|
168
|
+
slug: Schema.String
|
|
169
|
+
}) {
|
|
170
|
+
}
|
|
171
|
+
class FinalBaseSchema extends AvailableBaseSchema.extend("FinalBaseSchema")(
|
|
172
|
+
{
|
|
173
|
+
components: Schema.Struct({
|
|
174
|
+
PageActionsComponent: Schema.optional(AstroComponentSchema),
|
|
175
|
+
PageBodyComponent: AstroComponentSchema,
|
|
176
|
+
InnerSidebarComponent: Schema.optional(AstroComponentSchema)
|
|
177
|
+
})
|
|
94
178
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
InnerSidebarComponent: AstroComponentSchema.optional()
|
|
147
|
-
})
|
|
148
|
-
});
|
|
149
|
-
const SingleSidebarSchema = BaseDashboardPagePropsSchema.extend({
|
|
150
|
-
/**
|
|
151
|
-
* The sidebar layout
|
|
152
|
-
*/
|
|
153
|
-
sidebar: z.literal("single")
|
|
154
|
-
});
|
|
155
|
-
const AvailableSingleSchema = AvailableBaseSchema.extend({
|
|
156
|
-
/**
|
|
157
|
-
* The sidebar layout
|
|
158
|
-
*/
|
|
159
|
-
sidebar: z.literal("single")
|
|
160
|
-
});
|
|
161
|
-
const FinalSingleSchema = FinalBaseSchema.extend({
|
|
162
|
-
/**
|
|
163
|
-
* The sidebar layout
|
|
164
|
-
*/
|
|
165
|
-
sidebar: z.literal("single")
|
|
166
|
-
});
|
|
167
|
-
const DoubleSidebarSchema = BaseDashboardPagePropsSchema.extend({
|
|
168
|
-
/**
|
|
169
|
-
* The sidebar layout
|
|
170
|
-
*/
|
|
171
|
-
sidebar: z.literal("double"),
|
|
172
|
-
/**
|
|
173
|
-
* The component to render in the inner sidebar
|
|
174
|
-
*/
|
|
175
|
-
innerSidebarComponent: z.string()
|
|
176
|
-
});
|
|
177
|
-
const AvailableDoubleSchema = AvailableBaseSchema.extend({
|
|
178
|
-
/**
|
|
179
|
-
* The sidebar layout
|
|
180
|
-
*/
|
|
181
|
-
sidebar: z.literal("double"),
|
|
182
|
-
/**
|
|
183
|
-
* The component to render in the inner sidebar
|
|
184
|
-
*/
|
|
185
|
-
innerSidebarComponent: z.string()
|
|
186
|
-
});
|
|
187
|
-
const FinalDoubleSchema = FinalBaseSchema.extend({
|
|
188
|
-
/**
|
|
189
|
-
* The sidebar layout
|
|
190
|
-
*/
|
|
191
|
-
sidebar: z.literal("double"),
|
|
192
|
-
/**
|
|
193
|
-
* The component to render in the inner sidebar
|
|
194
|
-
*/
|
|
195
|
-
innerSidebarComponent: z.string()
|
|
196
|
-
});
|
|
197
|
-
const DashboardPageSchema = z.union([SingleSidebarSchema, DoubleSidebarSchema]);
|
|
198
|
-
const AvailableDashboardBaseSchema = z.union([AvailableSingleSchema, AvailableDoubleSchema]);
|
|
199
|
-
const FinalDashboardBaseSchema = z.union([FinalSingleSchema, FinalDoubleSchema]);
|
|
200
|
-
const AvailableDashboardPagesSchema = z.object({
|
|
201
|
-
/**
|
|
202
|
-
* Available dashboard pages for users
|
|
203
|
-
*/
|
|
204
|
-
user: z.array(AvailableDashboardBaseSchema).optional(),
|
|
205
|
-
/**
|
|
206
|
-
* Available dashboard pages for admins
|
|
207
|
-
*/
|
|
208
|
-
admin: z.array(AvailableDashboardBaseSchema).optional()
|
|
209
|
-
});
|
|
210
|
-
const SettingsPageSchema = z.object({
|
|
211
|
-
/**
|
|
212
|
-
* Fields according to specification
|
|
213
|
-
*/
|
|
214
|
-
fields: z.array(SettingsFieldSchema),
|
|
215
|
-
/**
|
|
216
|
-
* The endpoint for the settings
|
|
217
|
-
*
|
|
218
|
-
* Should export a APIRoute named `onSave` that runs when the settings page is saved
|
|
219
|
-
*/
|
|
220
|
-
endpoint: z.string()
|
|
221
|
-
}).optional();
|
|
222
|
-
const FrontendNavigationLinksSchema = z.array(
|
|
223
|
-
z.object({
|
|
224
|
-
/**
|
|
225
|
-
* Display label for the link
|
|
226
|
-
*/
|
|
227
|
-
label: z.string(),
|
|
228
|
-
/**
|
|
229
|
-
* URL to link to
|
|
230
|
-
*/
|
|
231
|
-
href: z.string()
|
|
179
|
+
) {
|
|
180
|
+
}
|
|
181
|
+
class SingleSidebarSchema extends BaseDashboardPagePropsSchema.extend(
|
|
182
|
+
"SingleSidebarSchema"
|
|
183
|
+
)({
|
|
184
|
+
sidebar: Schema.Literal("single")
|
|
185
|
+
}) {
|
|
186
|
+
}
|
|
187
|
+
class AvailableSingleSchema extends AvailableBaseSchema.extend(
|
|
188
|
+
"AvailableSingleSchema"
|
|
189
|
+
)({
|
|
190
|
+
sidebar: Schema.Literal("single")
|
|
191
|
+
}) {
|
|
192
|
+
}
|
|
193
|
+
class FinalSingleSchema extends FinalBaseSchema.extend(
|
|
194
|
+
"FinalSingleSchema"
|
|
195
|
+
)({
|
|
196
|
+
sidebar: Schema.Literal("single")
|
|
197
|
+
}) {
|
|
198
|
+
}
|
|
199
|
+
class DoubleSidebarSchema extends BaseDashboardPagePropsSchema.extend(
|
|
200
|
+
"DoubleSidebarSchema"
|
|
201
|
+
)({
|
|
202
|
+
sidebar: Schema.Literal("double"),
|
|
203
|
+
innerSidebarComponent: Schema.String
|
|
204
|
+
}) {
|
|
205
|
+
}
|
|
206
|
+
class AvailableDoubleSchema extends AvailableBaseSchema.extend(
|
|
207
|
+
"AvailableDoubleSchema"
|
|
208
|
+
)({
|
|
209
|
+
sidebar: Schema.Literal("double"),
|
|
210
|
+
innerSidebarComponent: Schema.String
|
|
211
|
+
}) {
|
|
212
|
+
}
|
|
213
|
+
class FinalDoubleSchema extends FinalBaseSchema.extend(
|
|
214
|
+
"FinalDoubleSchema"
|
|
215
|
+
)({
|
|
216
|
+
sidebar: Schema.Literal("double"),
|
|
217
|
+
innerSidebarComponent: Schema.String
|
|
218
|
+
}) {
|
|
219
|
+
}
|
|
220
|
+
const DashboardPageSchema = Schema.Union(SingleSidebarSchema, DoubleSidebarSchema);
|
|
221
|
+
const AvailableDashboardBaseSchema = Schema.Union(
|
|
222
|
+
AvailableSingleSchema,
|
|
223
|
+
AvailableDoubleSchema
|
|
224
|
+
);
|
|
225
|
+
const FinalDashboardBaseSchema = Schema.Union(FinalSingleSchema, FinalDoubleSchema);
|
|
226
|
+
const AvailableDashboardPagesSchema = Schema.mutable(
|
|
227
|
+
Schema.Struct({
|
|
228
|
+
user: Schema.optional(Schema.mutable(Schema.Array(AvailableDashboardBaseSchema))),
|
|
229
|
+
admin: Schema.optional(Schema.mutable(Schema.Array(AvailableDashboardBaseSchema)))
|
|
232
230
|
})
|
|
233
|
-
)
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
*/
|
|
239
|
-
label: z.string(),
|
|
240
|
-
/**
|
|
241
|
-
* Identifier that is saved in the database
|
|
242
|
-
* @example
|
|
243
|
-
* // Single page type per plugin
|
|
244
|
-
* 'studiocms'
|
|
245
|
-
* '@studiocms/blog'
|
|
246
|
-
* // Multiple page types per plugin (Use unique identifiers for each type to avoid conflicts)
|
|
247
|
-
* '@mystudiocms/plugin:pageType1'
|
|
248
|
-
* '@mystudiocms/plugin:pageType2'
|
|
249
|
-
* '@mystudiocms/plugin:pageType3'
|
|
250
|
-
* '@mystudiocms/plugin:pageType4'
|
|
251
|
-
*/
|
|
252
|
-
identifier: z.string(),
|
|
253
|
-
/**
|
|
254
|
-
* Description that is shown below the "Page Content" header if this type is selected
|
|
255
|
-
*/
|
|
256
|
-
description: z.string().optional(),
|
|
257
|
-
/**
|
|
258
|
-
* The path to the actual component that is displayed for the page content
|
|
259
|
-
*
|
|
260
|
-
* Component should have a `content` prop that is a string to be able to display current content.
|
|
261
|
-
*
|
|
262
|
-
* **NOTE:** If you storing a single string in the database, you can use the form name `page-content` for the content output. and it will be stored in the normal `content` field in the database.
|
|
263
|
-
* You can also use the apiEndpoints to create custom endpoints for the page type.
|
|
264
|
-
*
|
|
265
|
-
* @example
|
|
266
|
-
* ```ts
|
|
267
|
-
* import { createResolver } from 'astro-integration-kit';
|
|
268
|
-
* const { resolve } = createResolver(import.meta.url)
|
|
269
|
-
*
|
|
270
|
-
* {
|
|
271
|
-
* pageContentComponent: resolve('./components/MyContentEditor.astro'),
|
|
272
|
-
* }
|
|
273
|
-
* ```
|
|
274
|
-
*/
|
|
275
|
-
pageContentComponent: z.string().optional(),
|
|
276
|
-
/**
|
|
277
|
-
* The path to the file that contains the default exported object with the `PluginRenderer` interface.
|
|
278
|
-
*
|
|
279
|
-
* This is used to render the content on the frontend.
|
|
280
|
-
*
|
|
281
|
-
* ```ts
|
|
282
|
-
* import { createResolver } from 'astro-integration-kit';
|
|
283
|
-
* const { resolve } = createResolver(import.meta.url);
|
|
284
|
-
*
|
|
285
|
-
* {
|
|
286
|
-
* rendererComponent: resolve('./renderers/MyRenderer.ts'),
|
|
287
|
-
* }
|
|
288
|
-
* ```
|
|
289
|
-
*
|
|
290
|
-
* with the following export in `MyRenderer.ts`:
|
|
291
|
-
* ```ts
|
|
292
|
-
* import type { PluginRenderer } from 'studiocms/types';
|
|
293
|
-
*
|
|
294
|
-
* const MyRenderer: PluginRenderer = {
|
|
295
|
-
* name: 'my-renderer',
|
|
296
|
-
* sanitizeOpts: {
|
|
297
|
-
* // ultrahtml sanitize options
|
|
298
|
-
* },
|
|
299
|
-
* renderer: async (content) => {
|
|
300
|
-
* // Custom rendering logic here
|
|
301
|
-
* return `<div class="my-rendered-content">${content}</div>`;
|
|
302
|
-
* },
|
|
303
|
-
* };
|
|
304
|
-
*
|
|
305
|
-
* export default MyRenderer;
|
|
306
|
-
* ```
|
|
307
|
-
*/
|
|
308
|
-
rendererComponent: z.string().optional(),
|
|
309
|
-
/**
|
|
310
|
-
* Fields that are shown in the page metadata tab when creating or editing a page of this type
|
|
311
|
-
*/
|
|
312
|
-
fields: z.array(SettingsFieldSchema).optional(),
|
|
313
|
-
/**
|
|
314
|
-
* API Endpoint file for the page type
|
|
315
|
-
*
|
|
316
|
-
* API endpoints are used to create, edit, and delete pages of this type,
|
|
317
|
-
* endpoints will be provided the full Astro APIContext from the Astro APIRoute.
|
|
318
|
-
*
|
|
319
|
-
* File should export at least one of the following:
|
|
320
|
-
* - `onCreate`
|
|
321
|
-
* - `onEdit`
|
|
322
|
-
* - `onDelete`
|
|
323
|
-
*
|
|
324
|
-
* @example
|
|
325
|
-
* ```ts
|
|
326
|
-
* // my-plugin.ts
|
|
327
|
-
* import { createResolver } from 'astro-integration-kit';
|
|
328
|
-
* const { resolve } = createResolver(import.meta.url)
|
|
329
|
-
*
|
|
330
|
-
* {
|
|
331
|
-
* apiEndpoint: resolve('./api/pageTypeApi.ts'),
|
|
332
|
-
* }
|
|
333
|
-
*
|
|
334
|
-
* // api/pageTypeApi.ts
|
|
335
|
-
* import { PluginAPIRoute } from 'studiocms/plugins';
|
|
336
|
-
*
|
|
337
|
-
* export const onCreate: PluginAPIRoute<'onCreate'> = async ({ AstroCtx, pageData }) => {
|
|
338
|
-
* // Custom logic here
|
|
339
|
-
* return new Response();
|
|
340
|
-
* }
|
|
341
|
-
* ```
|
|
342
|
-
*/
|
|
343
|
-
apiEndpoint: z.string().optional()
|
|
231
|
+
);
|
|
232
|
+
const SettingsPageSchema = Schema.optional(
|
|
233
|
+
Schema.Struct({
|
|
234
|
+
fields: Schema.Array(SettingsFieldSchema),
|
|
235
|
+
endpoint: Schema.String
|
|
344
236
|
})
|
|
345
|
-
)
|
|
237
|
+
);
|
|
238
|
+
const FrontendNavigationLinksSchema = Schema.optional(
|
|
239
|
+
Schema.Array(
|
|
240
|
+
Schema.Struct({
|
|
241
|
+
label: Schema.String,
|
|
242
|
+
href: Schema.String
|
|
243
|
+
})
|
|
244
|
+
)
|
|
245
|
+
);
|
|
246
|
+
const PageTypesSchema = Schema.optional(
|
|
247
|
+
Schema.Array(
|
|
248
|
+
Schema.Struct({
|
|
249
|
+
label: Schema.String,
|
|
250
|
+
identifier: Schema.String,
|
|
251
|
+
description: Schema.optional(Schema.String),
|
|
252
|
+
pageContentComponent: Schema.optional(Schema.String),
|
|
253
|
+
rendererComponent: Schema.optional(Schema.String),
|
|
254
|
+
fields: Schema.optional(Schema.Array(SettingsFieldSchema)),
|
|
255
|
+
apiEndpoint: Schema.optional(Schema.String)
|
|
256
|
+
})
|
|
257
|
+
)
|
|
258
|
+
);
|
|
259
|
+
class GridItemInputBaseSchema extends Schema.Class(
|
|
260
|
+
"GridItemInputBaseSchema"
|
|
261
|
+
)({
|
|
262
|
+
name: Schema.String,
|
|
263
|
+
span: Schema.Literal(1, 2, 3),
|
|
264
|
+
variant: Schema.Literal("default", "filled"),
|
|
265
|
+
requiresPermission: Schema.optional(Schema.Literal("owner", "admin", "editor", "visitor")),
|
|
266
|
+
header: Schema.optional(
|
|
267
|
+
Schema.Struct({
|
|
268
|
+
title: Schema.String,
|
|
269
|
+
icon: Schema.optional(UIIconListSchema)
|
|
270
|
+
})
|
|
271
|
+
)
|
|
272
|
+
}) {
|
|
273
|
+
}
|
|
274
|
+
class GridItemInputSchema extends GridItemInputBaseSchema.extend(
|
|
275
|
+
"GridItemInputSchema"
|
|
276
|
+
)({
|
|
277
|
+
body: Schema.optional(
|
|
278
|
+
Schema.Struct({
|
|
279
|
+
html: Schema.String,
|
|
280
|
+
components: Schema.optional(
|
|
281
|
+
Schema.Record({
|
|
282
|
+
key: Schema.String,
|
|
283
|
+
value: Schema.String
|
|
284
|
+
})
|
|
285
|
+
),
|
|
286
|
+
sanitizeOpts: Schema.optional(SanitizeOptionsSchema)
|
|
287
|
+
})
|
|
288
|
+
)
|
|
289
|
+
}) {
|
|
290
|
+
}
|
|
291
|
+
class GridItemUsableSchema extends GridItemInputBaseSchema.extend(
|
|
292
|
+
"GridItemUsableSchema"
|
|
293
|
+
)({
|
|
294
|
+
body: Schema.optional(
|
|
295
|
+
Schema.Struct({
|
|
296
|
+
html: Schema.String,
|
|
297
|
+
components: Schema.optional(
|
|
298
|
+
Schema.Record({
|
|
299
|
+
key: Schema.String,
|
|
300
|
+
value: Schema.Any
|
|
301
|
+
})
|
|
302
|
+
),
|
|
303
|
+
sanitizeOpts: Schema.optional(SanitizeOptionsSchema)
|
|
304
|
+
})
|
|
305
|
+
)
|
|
306
|
+
}) {
|
|
307
|
+
}
|
|
308
|
+
class GridItemSchema extends GridItemUsableSchema.extend("GridItemSchema")({
|
|
309
|
+
enabled: Schema.Boolean
|
|
310
|
+
}) {
|
|
311
|
+
}
|
|
346
312
|
export {
|
|
313
|
+
AvailableBaseSchema,
|
|
347
314
|
AvailableDashboardBaseSchema,
|
|
348
315
|
AvailableDashboardPagesSchema,
|
|
316
|
+
AvailableDoubleSchema,
|
|
317
|
+
AvailableSingleSchema,
|
|
318
|
+
BaseDashboardPagePropsSchema,
|
|
319
|
+
BaseFieldSchema,
|
|
320
|
+
CheckboxFieldSchema,
|
|
349
321
|
DashboardPageSchema,
|
|
322
|
+
DoubleSidebarSchema,
|
|
350
323
|
FieldSchema,
|
|
324
|
+
FinalBaseSchema,
|
|
351
325
|
FinalDashboardBaseSchema,
|
|
326
|
+
FinalDoubleSchema,
|
|
327
|
+
FinalSingleSchema,
|
|
352
328
|
FrontendNavigationLinksSchema,
|
|
329
|
+
GridItemInputBaseSchema,
|
|
330
|
+
GridItemInputSchema,
|
|
331
|
+
GridItemSchema,
|
|
332
|
+
GridItemUsableSchema,
|
|
333
|
+
I18nLabelSchema,
|
|
353
334
|
PageTypesSchema,
|
|
335
|
+
RadioGroupFieldSchema,
|
|
336
|
+
RowFieldSchema,
|
|
337
|
+
SelectFieldSchema,
|
|
354
338
|
SettingsFieldSchema,
|
|
355
339
|
SettingsPageSchema,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
340
|
+
SharedOptionsSchema,
|
|
341
|
+
SharedOptionsSchemaItem,
|
|
342
|
+
SingleSidebarSchema,
|
|
343
|
+
StudioCMSColorwaySchema,
|
|
344
|
+
StudioCMSPermissionsSchema,
|
|
345
|
+
StudioCMSSizeSchema,
|
|
346
|
+
SupportsColorwaySchema,
|
|
347
|
+
SupportsPlaceHolderSchema,
|
|
348
|
+
TextAreaFieldSchema,
|
|
349
|
+
TextInputFieldSchema
|
|
359
350
|
};
|