Saltearse al contenido

schemas/plugins

Esta página aún no está disponible en tu idioma.

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:292^

Interface representing the base hooks for plugins in the StudioCMS system.

studiocms:astro:config: PluginHook<{
addIntegrations: (...args: [AstroIntegration | AstroIntegration[]]) => void;
logger: AstroIntegrationLogger;
}>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:293^

studiocms:config:setup: PluginHook<{
logger: AstroIntegrationLogger;
setAuthService: (...args: [{
oAuthProvider: {
endpointPath: string;
formattedName: string;
name: string;
requiredEnvVariables: string[];
svg: string;
};
}]) => void;
setDashboard: (...args: [{
dashboardGridItems: GridItemInput[];
dashboardPages: {
admin: (
| {
description: ...;
icon: ...;
pageActionsComponent: ...;
pageBodyComponent: ...;
requiredPermissions: ...;
route: ...;
sidebar: ...;
title: ...;
}
| {
description: ...;
icon: ...;
innerSidebarComponent: ...;
pageActionsComponent: ...;
pageBodyComponent: ...;
requiredPermissions: ...;
route: ...;
sidebar: ...;
title: ...;
})[];
user: (
| {
description: ...;
icon: ...;
pageActionsComponent: ...;
pageBodyComponent: ...;
requiredPermissions: ...;
route: ...;
sidebar: ...;
title: ...;
}
| {
description: ...;
icon: ...;
innerSidebarComponent: ...;
pageActionsComponent: ...;
pageBodyComponent: ...;
requiredPermissions: ...;
route: ...;
sidebar: ...;
title: ...;
})[];
};
settingsPage: {
endpoint: string;
fields: (
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultChecked: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
size: ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "input";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultValue: ... | ...;
direction: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ...;
}
| {
alignCenter: ... | ... | ...;
fields: ...[];
gapSize: ... | ... | ... | ...;
input: "row";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
})[];
};
}]) => void;
setFrontend: (...args: [{
frontendNavigationLinks: {
href: string;
label: string;
}[];
}]) => void;
setImageService: (...args: [{
imageService: {
identifier: string;
servicePath: string | URL;
};
}]) => void;
setRendering: (...args: [{
pageTypes: {
apiEndpoint: string;
description: string;
fields: (... | ... | ... | ... | ... | ...)[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}[];
}]) => void;
setSitemap: (...args: [{
sitemaps: {
pluginName: string;
sitemapXMLEndpointPath: string | URL;
}[];
triggerSitemap: boolean;
}]) => void;
}>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:294^


Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:297^

hooks: {
studiocms:astro:config: PluginHook<{
addIntegrations: (...args: [AstroIntegration | AstroIntegration[]]) => void;
logger: AstroIntegrationLogger;
}>;
studiocms:config:setup: PluginHook<{
logger: AstroIntegrationLogger;
setAuthService: (...args: [{
oAuthProvider: {
endpointPath: string;
formattedName: string;
name: string;
requiredEnvVariables: ...[];
svg: string;
};
}]) => void;
setDashboard: (...args: [{
dashboardGridItems: GridItemInput[];
dashboardPages: {
admin: ... | ...;
user: ... | ...;
};
settingsPage: {
endpoint: string;
fields: ...[];
};
}]) => void;
setFrontend: (...args: [{
frontendNavigationLinks: {
href: ...;
label: ...;
}[];
}]) => void;
setImageService: (...args: [{
imageService: {
identifier: string;
servicePath: ... | ...;
};
}]) => void;
setRendering: (...args: [{
pageTypes: {
apiEndpoint: ...;
description: ...;
fields: ...;
identifier: ...;
label: ...;
pageContentComponent: ...;
rendererComponent: ...;
}[];
}]) => void;
setSitemap: (...args: [{
sitemaps: {
pluginName: ...;
sitemapXMLEndpointPath: ...;
}[];
triggerSitemap: boolean;
}]) => void;
}>;
} & Partial<Record<string, unknown>>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:323^

optional studiocms:astro:config: PluginHook<{
addIntegrations: (...args: [AstroIntegration | AstroIntegration[]]) => void;
logger: AstroIntegrationLogger;
}>;
optional studiocms:config:setup: PluginHook<{
logger: AstroIntegrationLogger;
setAuthService: (...args: [{
oAuthProvider: {
endpointPath: string;
formattedName: string;
name: string;
requiredEnvVariables: ...[];
svg: string;
};
}]) => void;
setDashboard: (...args: [{
dashboardGridItems: GridItemInput[];
dashboardPages: {
admin: ... | ...;
user: ... | ...;
};
settingsPage: {
endpoint: string;
fields: ...[];
};
}]) => void;
setFrontend: (...args: [{
frontendNavigationLinks: {
href: ...;
label: ...;
}[];
}]) => void;
setImageService: (...args: [{
imageService: {
identifier: string;
servicePath: ... | ...;
};
}]) => void;
setRendering: (...args: [{
pageTypes: {
apiEndpoint: ...;
description: ...;
fields: ...;
identifier: ...;
label: ...;
pageContentComponent: ...;
rendererComponent: ...;
}[];
}]) => void;
setSitemap: (...args: [{
sitemaps: {
pluginName: ...;
sitemapXMLEndpointPath: ...;
}[];
triggerSitemap: boolean;
}]) => void;
}>;

identifier: string;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:301^

The identifier of the plugin, usually the package name.

name: string;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:305^

The name of the plugin, displayed in the StudioCMS Dashboard.

optional requires: string[];

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:322^

List of plugins that this plugin requires to function correctly. This is used to ensure that all required plugins are loaded before this plugin. If any required plugin is not found, this plugin will not be loaded. This is an optional field.

["@studiocms/plugin-example", "@studiocms/plugin-another-example"]

studiocmsMinimumVersion: string;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:314^

The minimum version of StudioCMS required for this plugin to function correctly. This is used to ensure compatibility between the plugin and the StudioCMS core. It should be a semantic version string (e.g., “1.0.0”). If the plugin is not compatible with the current version of StudioCMS, it should not be loaded. This is a required field.

"1.0.0"

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:285^

optional studiocms:plugins: PluginHook<{
exposePlugins: (...args: [
| undefined
| StudioCMSPlugin[]]) => void;
}>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:286^

type HookParameters<Hook, Fn> = Fn extends (...args: any) => any ? Parameters<Fn>[0] : never;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:328^

Hook extends keyof StudioCMSPlugin["hooks"]

Fn = StudioCMSPlugin["hooks"][Hook]


type ImageServiceExtraProps = {
alt: string;
height: number;
width: number;
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:355^

alt: string;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:356^

height: number;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:358^

width: number;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:357^


type SafePluginListItemType = z.infer<typeof SafePluginListItemSchema>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:334^


type SafePluginListType = z.infer<typeof SafePluginListSchema>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:335^


type StudioCMSImageService = (src: string, props: ImageServiceExtraProps) => string | Promise<string>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:361^

string

ImageServiceExtraProps

string | Promise<string>

const SafePluginListItemSchema: ZodObject<{
frontendNavigationLinks: ZodOptional<ZodOptional<ZodArray<ZodObject<{
href: ZodString;
label: ZodString;
}, "strip", ZodTypeAny, {
href: string;
label: string;
}, {
href: string;
label: string;
}>, "many">>>;
identifier: ZodString;
name: ZodString;
pageTypes: ZodOptional<ZodOptional<ZodArray<ZodObject<{
apiEndpoint: ZodOptional<ZodString>;
description: ZodOptional<ZodString>;
fields: ZodOptional<ZodArray<ZodUnion<[..., ...]>, "many">>;
identifier: ZodString;
label: ZodString;
pageContentComponent: ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>;
rendererComponent: ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>;
}, "strip", ZodTypeAny, {
apiEndpoint: string;
description: string;
fields: (
| {
color: ...;
defaultChecked: ...;
input: ...;
label: ...;
name: ...;
readOnly: ...;
required: ...;
size: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
placeholder: ...;
readOnly: ...;
required: ...;
type: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
placeholder: ...;
readOnly: ...;
required: ...;
}
| {
color: ...;
defaultValue: ...;
direction: ...;
input: ...;
label: ...;
name: ...;
options: ...;
readOnly: ...;
required: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
options: ...;
placeholder: ...;
readOnly: ...;
required: ...;
type: ...;
}
| {
alignCenter: ...;
fields: ...;
gapSize: ...;
input: ...;
label: ...;
name: ...;
readOnly: ...;
required: ...;
})[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}, {
apiEndpoint: string;
description: string;
fields: (
| {
color: ...;
defaultChecked: ...;
input: ...;
label: ...;
name: ...;
readOnly: ...;
required: ...;
size: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
placeholder: ...;
readOnly: ...;
required: ...;
type: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
placeholder: ...;
readOnly: ...;
required: ...;
}
| {
color: ...;
defaultValue: ...;
direction: ...;
input: ...;
label: ...;
name: ...;
options: ...;
readOnly: ...;
required: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
options: ...;
placeholder: ...;
readOnly: ...;
required: ...;
type: ...;
}
| {
alignCenter: ...;
fields: ...;
gapSize: ...;
input: ...;
label: ...;
name: ...;
readOnly: ...;
required: ...;
})[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}>, "many">>>;
settingsPage: ZodOptional<ZodOptional<ZodObject<{
endpoint: ZodString;
fields: ZodArray<ZodUnion<[ZodUnion<[..., ..., ..., ..., ...]>, ZodObject<... & ..., "strip", ZodTypeAny, {
alignCenter: ...;
fields: ...;
gapSize: ...;
input: ...;
label: ...;
name: ...;
readOnly: ...;
required: ...;
}, {
alignCenter: ...;
fields: ...;
gapSize: ...;
input: ...;
label: ...;
name: ...;
readOnly: ...;
required: ...;
}>]>, "many">;
}, "strip", ZodTypeAny, {
endpoint: string;
fields: (
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked: boolean;
input: "checkbox";
label: string;
name: string;
readOnly: boolean;
required: boolean;
size: "sm" | "md" | "lg";
}
| {
defaultValue: string;
input: "input";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
type: "number" | "password" | "text" | "email" | "tel" | "url" | "search";
}
| {
defaultValue: string;
input: "textarea";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
}
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue: string;
direction: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled: ...;
label: ...;
value: ...;
}[];
readOnly: boolean;
required: boolean;
}
| {
defaultValue: string;
input: "select";
label: string;
name: string;
options: {
disabled: ...;
label: ...;
value: ...;
}[];
placeholder: string;
readOnly: boolean;
required: boolean;
type: "search" | "basic";
}
| {
alignCenter: boolean;
fields: (... | ... | ... | ... | ...)[];
gapSize: "sm" | "md" | "lg";
input: "row";
label: string;
name: string;
readOnly: boolean;
required: boolean;
})[];
}, {
endpoint: string;
fields: (
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked: boolean;
input: "checkbox";
label: string;
name: string;
readOnly: boolean;
required: boolean;
size: "sm" | "md" | "lg";
}
| {
defaultValue: string;
input: "input";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
type: "number" | "password" | "text" | "email" | "tel" | "url" | "search";
}
| {
defaultValue: string;
input: "textarea";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
}
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue: string;
direction: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled: ...;
label: ...;
value: ...;
}[];
readOnly: boolean;
required: boolean;
}
| {
defaultValue: string;
input: "select";
label: string;
name: string;
options: {
disabled: ...;
label: ...;
value: ...;
}[];
placeholder: string;
readOnly: boolean;
required: boolean;
type: "search" | "basic";
}
| {
alignCenter: boolean;
fields: (... | ... | ... | ... | ...)[];
gapSize: "sm" | "md" | "lg";
input: "row";
label: string;
name: string;
readOnly: boolean;
required: boolean;
})[];
}>>>;
}, "strip", ZodTypeAny, {
frontendNavigationLinks: {
href: string;
label: string;
}[];
identifier: string;
name: string;
pageTypes: {
apiEndpoint: string;
description: string;
fields: (
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked: boolean;
input: "checkbox";
label: string;
name: string;
readOnly: boolean;
required: boolean;
size: "sm" | "md" | "lg";
}
| {
defaultValue: string;
input: "input";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
type: "number" | "password" | "text" | "email" | "tel" | "url" | "search";
}
| {
defaultValue: string;
input: "textarea";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
}
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue: string;
direction: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled: ...;
label: ...;
value: ...;
}[];
readOnly: boolean;
required: boolean;
}
| {
defaultValue: string;
input: "select";
label: string;
name: string;
options: {
disabled: ...;
label: ...;
value: ...;
}[];
placeholder: string;
readOnly: boolean;
required: boolean;
type: "search" | "basic";
}
| {
alignCenter: boolean;
fields: (... | ... | ... | ... | ...)[];
gapSize: "sm" | "md" | "lg";
input: "row";
label: string;
name: string;
readOnly: boolean;
required: boolean;
})[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}[];
settingsPage: {
endpoint: string;
fields: (
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked: boolean;
input: "checkbox";
label: string;
name: string;
readOnly: boolean;
required: boolean;
size: "sm" | "md" | "lg";
}
| {
defaultValue: string;
input: "input";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
type: "number" | "password" | "text" | "email" | "tel" | "url" | "search";
}
| {
defaultValue: string;
input: "textarea";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
}
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue: string;
direction: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled: boolean;
label: string;
value: string;
}[];
readOnly: boolean;
required: boolean;
}
| {
defaultValue: string;
input: "select";
label: string;
name: string;
options: {
disabled: boolean;
label: string;
value: string;
}[];
placeholder: string;
readOnly: boolean;
required: boolean;
type: "search" | "basic";
}
| {
alignCenter: boolean;
fields: (
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultChecked: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
size: ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "input";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultValue: ... | ...;
direction: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ...;
})[];
gapSize: "sm" | "md" | "lg";
input: "row";
label: string;
name: string;
readOnly: boolean;
required: boolean;
})[];
};
}, {
frontendNavigationLinks: {
href: string;
label: string;
}[];
identifier: string;
name: string;
pageTypes: {
apiEndpoint: string;
description: string;
fields: (
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked: boolean;
input: "checkbox";
label: string;
name: string;
readOnly: boolean;
required: boolean;
size: "sm" | "md" | "lg";
}
| {
defaultValue: string;
input: "input";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
type: "number" | "password" | "text" | "email" | "tel" | "url" | "search";
}
| {
defaultValue: string;
input: "textarea";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
}
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue: string;
direction: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled: ...;
label: ...;
value: ...;
}[];
readOnly: boolean;
required: boolean;
}
| {
defaultValue: string;
input: "select";
label: string;
name: string;
options: {
disabled: ...;
label: ...;
value: ...;
}[];
placeholder: string;
readOnly: boolean;
required: boolean;
type: "search" | "basic";
}
| {
alignCenter: boolean;
fields: (... | ... | ... | ... | ...)[];
gapSize: "sm" | "md" | "lg";
input: "row";
label: string;
name: string;
readOnly: boolean;
required: boolean;
})[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}[];
settingsPage: {
endpoint: string;
fields: (
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked: boolean;
input: "checkbox";
label: string;
name: string;
readOnly: boolean;
required: boolean;
size: "sm" | "md" | "lg";
}
| {
defaultValue: string;
input: "input";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
type: "number" | "password" | "text" | "email" | "tel" | "url" | "search";
}
| {
defaultValue: string;
input: "textarea";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
}
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue: string;
direction: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled: boolean;
label: string;
value: string;
}[];
readOnly: boolean;
required: boolean;
}
| {
defaultValue: string;
input: "select";
label: string;
name: string;
options: {
disabled: boolean;
label: string;
value: string;
}[];
placeholder: string;
readOnly: boolean;
required: boolean;
type: "search" | "basic";
}
| {
alignCenter: boolean;
fields: (
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultChecked: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
size: ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "input";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultValue: ... | ...;
direction: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ...;
})[];
gapSize: "sm" | "md" | "lg";
input: "row";
label: string;
name: string;
readOnly: boolean;
required: boolean;
})[];
};
}>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:66^

A schema for a safe plugin list item in StudioCMS. This schema omits certain properties from the StudioCMSPluginSchema:

  • integration
  • studiocmsMinimumVersion
  • sitemaps
  • dashboardGridItems
  • triggerSitemap

These properties are excluded to ensure that the plugin list item schema only includes the necessary and safe properties for use in the application.


const SafePluginListSchema: ZodArray<ZodObject<{
frontendNavigationLinks: ZodOptional<ZodOptional<ZodArray<ZodObject<{
href: ZodString;
label: ZodString;
}, "strip", ZodTypeAny, {
href: string;
label: string;
}, {
href: string;
label: string;
}>, "many">>>;
identifier: ZodString;
name: ZodString;
pageTypes: ZodOptional<ZodOptional<ZodArray<ZodObject<{
apiEndpoint: ZodOptional<ZodString>;
description: ZodOptional<ZodString>;
fields: ZodOptional<ZodArray<ZodUnion<...>, "many">>;
identifier: ZodString;
label: ZodString;
pageContentComponent: ZodOptional<ZodUnion<[..., ...]>>;
rendererComponent: ZodOptional<ZodUnion<[..., ...]>>;
}, "strip", ZodTypeAny, {
apiEndpoint: string;
description: string;
fields: (... | ... | ... | ... | ... | ...)[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}, {
apiEndpoint: string;
description: string;
fields: (... | ... | ... | ... | ... | ...)[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}>, "many">>>;
settingsPage: ZodOptional<ZodOptional<ZodObject<{
endpoint: ZodString;
fields: ZodArray<ZodUnion<[ZodUnion<...>, ZodObject<..., ..., ..., ..., ...>]>, "many">;
}, "strip", ZodTypeAny, {
endpoint: string;
fields: (
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultChecked: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
size: ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "input";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultValue: ... | ...;
direction: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ...;
}
| {
alignCenter: ... | ... | ...;
fields: ...[];
gapSize: ... | ... | ... | ...;
input: "row";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
})[];
}, {
endpoint: string;
fields: (
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultChecked: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
size: ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "input";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultValue: ... | ...;
direction: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ...;
}
| {
alignCenter: ... | ... | ...;
fields: ...[];
gapSize: ... | ... | ... | ...;
input: "row";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
})[];
}>>>;
}, "strip", ZodTypeAny, {
frontendNavigationLinks: {
href: string;
label: string;
}[];
identifier: string;
name: string;
pageTypes: {
apiEndpoint: string;
description: string;
fields: (
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultChecked: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
size: ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "input";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultValue: ... | ...;
direction: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ...;
}
| {
alignCenter: ... | ... | ...;
fields: ...[];
gapSize: ... | ... | ... | ...;
input: "row";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
})[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}[];
settingsPage: {
endpoint: string;
fields: (
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked: boolean;
input: "checkbox";
label: string;
name: string;
readOnly: boolean;
required: boolean;
size: "sm" | "md" | "lg";
}
| {
defaultValue: string;
input: "input";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
type: "number" | "password" | "text" | "email" | "tel" | "url" | "search";
}
| {
defaultValue: string;
input: "textarea";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
}
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue: string;
direction: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled: ... | ... | ...;
label: string;
value: string;
}[];
readOnly: boolean;
required: boolean;
}
| {
defaultValue: string;
input: "select";
label: string;
name: string;
options: {
disabled: ... | ... | ...;
label: string;
value: string;
}[];
placeholder: string;
readOnly: boolean;
required: boolean;
type: "search" | "basic";
}
| {
alignCenter: boolean;
fields: (
| {
color: ...;
defaultChecked: ...;
input: ...;
label: ...;
name: ...;
readOnly: ...;
required: ...;
size: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
placeholder: ...;
readOnly: ...;
required: ...;
type: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
placeholder: ...;
readOnly: ...;
required: ...;
}
| {
color: ...;
defaultValue: ...;
direction: ...;
input: ...;
label: ...;
name: ...;
options: ...;
readOnly: ...;
required: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
options: ...;
placeholder: ...;
readOnly: ...;
required: ...;
type: ...;
})[];
gapSize: "sm" | "md" | "lg";
input: "row";
label: string;
name: string;
readOnly: boolean;
required: boolean;
})[];
};
}, {
frontendNavigationLinks: {
href: string;
label: string;
}[];
identifier: string;
name: string;
pageTypes: {
apiEndpoint: string;
description: string;
fields: (
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultChecked: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
size: ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "input";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultValue: ... | ...;
direction: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ...;
}
| {
alignCenter: ... | ... | ...;
fields: ...[];
gapSize: ... | ... | ... | ...;
input: "row";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
})[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}[];
settingsPage: {
endpoint: string;
fields: (
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked: boolean;
input: "checkbox";
label: string;
name: string;
readOnly: boolean;
required: boolean;
size: "sm" | "md" | "lg";
}
| {
defaultValue: string;
input: "input";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
type: "number" | "password" | "text" | "email" | "tel" | "url" | "search";
}
| {
defaultValue: string;
input: "textarea";
label: string;
name: string;
placeholder: string;
readOnly: boolean;
required: boolean;
}
| {
color: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue: string;
direction: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled: ... | ... | ...;
label: string;
value: string;
}[];
readOnly: boolean;
required: boolean;
}
| {
defaultValue: string;
input: "select";
label: string;
name: string;
options: {
disabled: ... | ... | ...;
label: string;
value: string;
}[];
placeholder: string;
readOnly: boolean;
required: boolean;
type: "search" | "basic";
}
| {
alignCenter: boolean;
fields: (
| {
color: ...;
defaultChecked: ...;
input: ...;
label: ...;
name: ...;
readOnly: ...;
required: ...;
size: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
placeholder: ...;
readOnly: ...;
required: ...;
type: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
placeholder: ...;
readOnly: ...;
required: ...;
}
| {
color: ...;
defaultValue: ...;
direction: ...;
input: ...;
label: ...;
name: ...;
options: ...;
readOnly: ...;
required: ...;
}
| {
defaultValue: ...;
input: ...;
label: ...;
name: ...;
options: ...;
placeholder: ...;
readOnly: ...;
required: ...;
type: ...;
})[];
gapSize: "sm" | "md" | "lg";
input: "row";
label: string;
name: string;
readOnly: boolean;
required: boolean;
})[];
};
}>, "many">;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:93^


const StudioCMSSanitizeOptionsSchema: ZodOptional<ZodObject<{
allowAttributes: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
allowComments: ZodOptional<ZodBoolean>;
allowComponents: ZodOptional<ZodBoolean>;
allowCustomElements: ZodOptional<ZodBoolean>;
allowElements: ZodOptional<ZodArray<ZodString, "many">>;
blockElements: ZodOptional<ZodArray<ZodString, "many">>;
dropAttributes: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
dropElements: ZodOptional<ZodArray<ZodString, "many">>;
}, "strip", ZodTypeAny, {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
}, {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
}>>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:29^

Schema for options used to sanitize HTML content in StudioCMS.

This schema defines the configuration for controlling which elements and attributes are allowed, blocked, or dropped during the sanitization process. It also provides options for handling components, custom elements, and comments.

function definePlugin(options: StudioCMSPlugin): StudioCMSPlugin

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:351^

Defines a plugin for StudioCMS.

StudioCMSPlugin

The configuration options for the plugin.

StudioCMSPlugin

The plugin configuration.

Re-exports AvailableDashboardPages


Re-exports DashboardPage


Re-exports FinalDashboardPage


Re-exports SettingsField


Re-exports StudioCMSColorway