sdk/types
Interfaces
Section titled “Interfaces”BaseCacheObject
Section titled “BaseCacheObject”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:319^
Represents a base cache object with a timestamp of the last cache update.
Extended by
Section titled “Extended by”PageDataCacheObject
MetaOnlyPageDataCacheObject
SiteConfigCacheObject
VersionCacheObject
FolderTreeCacheObject
FolderListCacheObject
PluginDataCacheObject
Properties
Section titled “Properties”lastCacheUpdate
Section titled “lastCacheUpdate”lastCacheUpdate: Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:320^
CombinedPageData
Section titled “CombinedPageData”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:442^
Represents the combined data for a page, extending the stripped page data.
CombinedPageData
Extends
Section titled “Extends”Properties
Section titled “Properties”authorData
Section titled “authorData”authorData: | undefined | { avatar: null | string; createdAt: null | Date; email: null | string; emailVerified: boolean; id: string; name: string; notifications: null | string; password: null | string; updatedAt: null | Date; url: null | string; username: string;};
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:449^
authorId
Section titled “authorId”authorId: null | string;
Inherited from
Section titled “Inherited from”PageDataStripped.authorId
categories
Section titled “categories”categories: { description: string; id: number; meta: unknown; name: string; parent: null | number; slug: string; }[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:444^
An array of categories selected for the page.
description
Section titled “description”description: string;
id: number;
meta: unknown;
name: string;
parent
Section titled “parent”parent: null | number;
slug: string;
contentLang
Section titled “contentLang”contentLang: string;
Inherited from
Section titled “Inherited from”PageDataStripped.contentLang
contributorIds
Section titled “contributorIds”contributorIds: string[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:443^
An array of contributor IDs associated with the page.
contributorsData
Section titled “contributorsData”contributorsData: { avatar: null | string; createdAt: null | Date; email: null | string; emailVerified: boolean; id: string; name: string; notifications: null | string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:450^
avatar
Section titled “avatar”avatar: null | string;
createdAt
Section titled “createdAt”createdAt: null | Date;
email: null | string;
emailVerified
Section titled “emailVerified”emailVerified: boolean;
id: string;
name: string;
notifications
Section titled “notifications”notifications: null | string;
password
Section titled “password”password: null | string;
updatedAt
Section titled “updatedAt”updatedAt: null | Date;
url: null | string;
username
Section titled “username”username: string;
defaultContent
Section titled “defaultContent”defaultContent: | undefined | { content: null | string; contentId: string; contentLang: string; id: string;};
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:447^
description
Section titled “description”description: string;
Inherited from
Section titled “Inherited from”PageDataStripped.description
draft: null | boolean;
Inherited from
Section titled “Inherited from”PageDataStripped.draft
heroImage
Section titled “heroImage”heroImage: string;
Inherited from
Section titled “Inherited from”PageDataStripped.heroImage
id: string;
Inherited from
Section titled “Inherited from”PageDataStripped.id
multiLangContent
Section titled “multiLangContent”multiLangContent: { content: null | string; contentId: string; contentLang: string; id: string; }[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:446^
content
Section titled “content”content: null | string;
contentId
Section titled “contentId”contentId: string;
contentLang
Section titled “contentLang”contentLang: string;
id: string;
package
Section titled “package”package: string;
Inherited from
Section titled “Inherited from”PageDataStripped.package
parentFolder
Section titled “parentFolder”parentFolder: null | string;
Inherited from
Section titled “Inherited from”PageDataStripped.parentFolder
publishedAt
Section titled “publishedAt”publishedAt: Date;
Inherited from
Section titled “Inherited from”PageDataStripped.publishedAt
showAuthor
Section titled “showAuthor”showAuthor: null | boolean;
Inherited from
Section titled “Inherited from”PageDataStripped.showAuthor
showContributors
Section titled “showContributors”showContributors: null | boolean;
Inherited from
Section titled “Inherited from”PageDataStripped.showContributors
showOnNav
Section titled “showOnNav”showOnNav: boolean;
Inherited from
Section titled “Inherited from”PageDataStripped.showOnNav
slug: string;
Inherited from
Section titled “Inherited from”PageDataStripped.slug
tags: { description: string; id: number; meta: unknown; name: string; slug: string; }[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:445^
An array of tags selected for the page.
description
Section titled “description”description: string;
id: number;
meta: unknown;
name: string;
slug: string;
title: string;
Inherited from
Section titled “Inherited from”PageDataStripped.title
updatedAt
Section titled “updatedAt”updatedAt: null | Date;
Inherited from
Section titled “Inherited from”PageDataStripped.updatedAt
urlRoute
Section titled “urlRoute”urlRoute: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:448^
CombinedUserData
Section titled “CombinedUserData”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:426^
Interface representing combined user data.
This interface extends tsUsersSelect
and includes additional properties
for OAuth data and permissions data.
CombinedUserData
Extends
Section titled “Extends”Properties
Section titled “Properties”avatar
Section titled “avatar”avatar: null | string;
Inherited from
Section titled “Inherited from”tsUsersSelect.avatar
createdAt
Section titled “createdAt”createdAt: null | Date;
Inherited from
Section titled “Inherited from”tsUsersSelect.createdAt
email: null | string;
Inherited from
Section titled “Inherited from”tsUsersSelect.email
emailVerified
Section titled “emailVerified”emailVerified: boolean;
Inherited from
Section titled “Inherited from”tsUsersSelect.emailVerified
id: string;
Inherited from
Section titled “Inherited from”tsUsersSelect.id
name: string;
Inherited from
Section titled “Inherited from”tsUsersSelect.name
notifications
Section titled “notifications”notifications: null | string;
Inherited from
Section titled “Inherited from”tsUsersSelect.notifications
oAuthData
Section titled “oAuthData”oAuthData: | undefined | { provider: string; providerUserId: string; userId: string; }[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:427^
An array of OAuth account data or undefined.
password
Section titled “password”password: null | string;
Inherited from
Section titled “Inherited from”tsUsersSelect.password
permissionsData
Section titled “permissionsData”permissionsData: | undefined | { rank: string; user: string;};
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:428^
Permissions data or undefined.
updatedAt
Section titled “updatedAt”updatedAt: null | Date;
Inherited from
Section titled “Inherited from”tsUsersSelect.updatedAt
url: null | string;
Inherited from
Section titled “Inherited from”tsUsersSelect.url
username
Section titled “username”username: string;
Inherited from
Section titled “Inherited from”tsUsersSelect.username
DeletionResponse
Section titled “DeletionResponse”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:459^
Interface representing the response received after a deletion operation.
Properties
Section titled “Properties”message
Section titled “message”message: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:461^
A message providing additional information about the deletion operation.
status
Section titled “status”status: "success" | "error";
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:460^
The status of the deletion operation.
diffItem
Section titled “diffItem”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:240^
Represents a single difference item for a page, including metadata and content changes.
Properties
Section titled “Properties”diff: null | string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:247^
The difference content as a string, or null if not available.
id: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:241^
Unique identifier for the diff item.
pageContentStart
Section titled “pageContentStart”pageContentStart: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:246^
The initial content of the page before the diff.
pageId
Section titled “pageId”pageId: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:243^
Identifier of the page associated with the diff.
pageMetaData
Section titled “pageMetaData”pageMetaData: unknown;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:245^
Metadata associated with the page; type is unknown.
timestamp
Section titled “timestamp”timestamp: null | Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:244^
The date and time when the diff was created, or null if not set.
userId
Section titled “userId”userId: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:242^
Identifier of the user who made the change.
diffReturn
Section titled “diffReturn”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:260^
Represents the result of a diff operation, extending diffItem but replacing the pageMetaData
property.
Remarks
Section titled “Remarks”The pageMetaData
property contains the starting and ending states of page metadata,
each represented as a partial selection of tsPageDataSelect.
- diffItem
- tsPageDataSelect
Extends
Section titled “Extends”Omit
<diffItem
,"pageMetaData"
>
Properties
Section titled “Properties”diff: null | string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:247^
Inherited from
Section titled “Inherited from”Omit.diff
id: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:241^
Inherited from
Section titled “Inherited from”Omit.id
pageContentStart
Section titled “pageContentStart”pageContentStart: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:246^
Inherited from
Section titled “Inherited from”Omit.pageContentStart
pageId
Section titled “pageId”pageId: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:243^
Inherited from
Section titled “Inherited from”Omit.pageId
pageMetaData
Section titled “pageMetaData”pageMetaData: { end: Partial<{ authorId: null | string; categories: unknown; contentLang: string; contributorIds: unknown; description: string; draft: null | boolean; heroImage: string; id: string; package: string; parentFolder: null | string; publishedAt: Date; showAuthor: null | boolean; showContributors: null | boolean; showOnNav: boolean; slug: string; tags: unknown; title: string; updatedAt: null | Date; }>; start: Partial<{ authorId: null | string; categories: unknown; contentLang: string; contributorIds: unknown; description: string; draft: null | boolean; heroImage: string; id: string; package: string; parentFolder: null | string; publishedAt: Date; showAuthor: null | boolean; showContributors: null | boolean; showOnNav: boolean; slug: string; tags: unknown; title: string; updatedAt: null | Date; }>;};
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:261^
end: Partial<{ authorId: null | string; categories: unknown; contentLang: string; contributorIds: unknown; description: string; draft: null | boolean; heroImage: string; id: string; package: string; parentFolder: null | string; publishedAt: Date; showAuthor: null | boolean; showContributors: null | boolean; showOnNav: boolean; slug: string; tags: unknown; title: string; updatedAt: null | Date;}>;
start: Partial<{ authorId: null | string; categories: unknown; contentLang: string; contributorIds: unknown; description: string; draft: null | boolean; heroImage: string; id: string; package: string; parentFolder: null | string; publishedAt: Date; showAuthor: null | boolean; showContributors: null | boolean; showOnNav: boolean; slug: string; tags: unknown; title: string; updatedAt: null | Date;}>;
timestamp
Section titled “timestamp”timestamp: null | Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:244^
Inherited from
Section titled “Inherited from”Omit.timestamp
userId
Section titled “userId”userId: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:242^
Inherited from
Section titled “Inherited from”Omit.userId
EffectSchemaValidator<E>
Section titled “EffectSchemaValidator<E>”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:94^
Interface representing a validator for an effect schema.
Type Param
Section titled “Type Param”The type of the value that the schema validates.
Type Parameters
Section titled “Type Parameters”E
extends Schema.Struct
<any
>
Properties
Section titled “Properties”effectSchema
Section titled “effectSchema”effectSchema: E;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:95^
The schema used for validation, which takes a value of type T
and returns either a ParseError
or never
.
FolderListCacheObject
Section titled “FolderListCacheObject”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:395^
Represents a cache object for folder list data. Extends the BaseCacheObject interface.
FolderListCacheObject
Extends
Section titled “Extends”Properties
Section titled “Properties”data: FolderListItem[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:396^
The folder list data to be cached.
lastCacheUpdate
Section titled “lastCacheUpdate”lastCacheUpdate: Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:320^
Inherited from
Section titled “Inherited from”BaseCacheObject
.lastCacheUpdate
FolderListItem
Section titled “FolderListItem”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:300^
Represents a folder item in a list, including its unique identifier, name, and optional parent folder.
Properties
Section titled “Properties”id: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:301^
The unique identifier for the folder.
name: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:302^
The display name of the folder.
parent?
Section titled “parent?”optional parent: null | string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:303^
The identifier of the parent folder, or null
if the folder is at the root level.
FolderNode
Section titled “FolderNode”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:285^
Represents a node in a folder structure, which may contain child nodes and page data.
Properties
Section titled “Properties”children
Section titled “children”children: FolderNode[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:290^
Array of child folder nodes.
id: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:286^
Unique identifier for the folder node.
name: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:287^
Name of the folder node.
page: boolean;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:288^
Indicates whether this node represents a page.
pageData
Section titled “pageData”pageData: | null | CombinedPageData;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:289^
Data associated with the page, or null
if not applicable.
FolderTreeCacheObject
Section titled “FolderTreeCacheObject”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:382^
Represents a cache object for folder tree data. Extends the BaseCacheObject interface.
FolderTreeCacheObject
Extends
Section titled “Extends”Properties
Section titled “Properties”data: FolderNode[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:383^
The folder tree data to be cached.
lastCacheUpdate
Section titled “lastCacheUpdate”lastCacheUpdate: Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:320^
Inherited from
Section titled “Inherited from”BaseCacheObject
.lastCacheUpdate
JSONValidatorFn<T>
Section titled “JSONValidatorFn<T>”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:82^
Represents a JSON validator function for a specific type.
Type Parameters
Section titled “Type Parameters”T
The type that the validator function checks for.
Properties
Section titled “Properties”jsonFn()
Section titled “jsonFn()”jsonFn: (data: unknown) => data is T;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:83^
A type guard function that determines if the provided data is of type T.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”data is T
MetaOnlyPageDataCacheObject
Section titled “MetaOnlyPageDataCacheObject”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:345^
Represents a cache object for page data. Extends the BaseCacheObject interface.
MetaOnlyPageDataCacheObject
Extends
Section titled “Extends”Properties
Section titled “Properties”data: MetaOnlyPageData;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:346^
The combined page data to be cached.
lastCacheUpdate
Section titled “lastCacheUpdate”lastCacheUpdate: Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:320^
Inherited from
Section titled “Inherited from”BaseCacheObject
.lastCacheUpdate
PageDataCacheObject
Section titled “PageDataCacheObject”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:332^
Represents a cache object for page data. Extends the BaseCacheObject interface.
PageDataCacheObject
Extends
Section titled “Extends”Properties
Section titled “Properties”data: CombinedPageData;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:333^
The combined page data to be cached.
lastCacheUpdate
Section titled “lastCacheUpdate”lastCacheUpdate: Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:320^
Inherited from
Section titled “Inherited from”BaseCacheObject
.lastCacheUpdate
PageInsert
Section titled “PageInsert”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:467^
Represents the data required to insert a new page.
Properties
Section titled “Properties”pageContent
Section titled “pageContent”pageContent: CombinedInsertContent;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:469^
pageData
Section titled “pageData”pageData: { authorId: null | string; categories: unknown; contentLang: string; contributorIds: unknown; description: string; draft: null | boolean; heroImage: string; id: string; package: string; parentFolder: null | string; publishedAt: Date; showAuthor: null | boolean; showContributors: null | boolean; showOnNav: boolean; slug: string; tags: unknown; title: string; updatedAt: null | Date;};
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:468^
authorId
Section titled “authorId”authorId: null | string;
categories
Section titled “categories”categories: unknown;
contentLang
Section titled “contentLang”contentLang: string;
contributorIds
Section titled “contributorIds”contributorIds: unknown;
description
Section titled “description”description: string;
draft: null | boolean;
heroImage
Section titled “heroImage”heroImage: string;
id: string;
package
Section titled “package”package: string;
parentFolder
Section titled “parentFolder”parentFolder: null | string;
publishedAt
Section titled “publishedAt”publishedAt: Date;
showAuthor
Section titled “showAuthor”showAuthor: null | boolean;
showContributors
Section titled “showContributors”showContributors: null | boolean;
showOnNav
Section titled “showOnNav”showOnNav: boolean;
slug: string;
tags: unknown;
title: string;
updatedAt
Section titled “updatedAt”updatedAt: null | Date;
PluginDataCacheObject
Section titled “PluginDataCacheObject”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:399^
Represents a base cache object with a timestamp of the last cache update.
Extends
Section titled “Extends”Properties
Section titled “Properties”data: { data: unknown; id: string;};
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:400^
data: unknown;
id: string;
lastCacheUpdate
Section titled “lastCacheUpdate”lastCacheUpdate: Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:320^
Inherited from
Section titled “Inherited from”BaseCacheObject
.lastCacheUpdate
PluginDataEntry<T>
Section titled “PluginDataEntry<T>”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:72^
Represents a plugin data entry with a strongly-typed data
property.
Extends
Section titled “Extends”Omit
<tsPluginDataSelect
,"data"
>
Type Parameters
Section titled “Type Parameters”T
extends object
The type of the data
property.
Properties
Section titled “Properties”data: T;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:73^
The plugin-specific data payload.
id: string;
Inherited from
Section titled “Inherited from”Omit.id
SiteConfigCacheObject
Section titled “SiteConfigCacheObject”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:358^
Represents a cache object for site configuration. Extends the BaseCacheObject interface.
SiteConfigCacheObject
Extends
Section titled “Extends”Properties
Section titled “Properties”data: SiteConfig;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:359^
The site configuration data.
lastCacheUpdate
Section titled “lastCacheUpdate”lastCacheUpdate: Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:320^
Inherited from
Section titled “Inherited from”BaseCacheObject
.lastCacheUpdate
UsePluginDataOpts<T>
Section titled “UsePluginDataOpts<T>”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:49^
Options for using plugin data, extending the base options with an entry identifier.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”T
extends Schema.Struct
<Schema.Struct.Fields
> | object
The type of the plugin data object.
Properties
Section titled “Properties”entryId
Section titled “entryId”entryId: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:51^
The unique identifier for the entry associated with the plugin data.
optional Type: T;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:37^
An optional type definition for the data.
Inherited from
Section titled “Inherited from”validator?
Section titled “validator?”optional validator: ValidatorOptions<T>;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:38^
Optional validator options for the data type.
Inherited from
Section titled “Inherited from”UsePluginDataOptsBase
.validator
UsePluginDataOptsBase<T>
Section titled “UsePluginDataOptsBase<T>”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:36^
Base options for using plugin data.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”T
extends Schema.Struct
<Schema.Struct.Fields
> | object
The type of the data object.
Properties
Section titled “Properties”optional Type: T;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:37^
An optional type definition for the data.
validator?
Section titled “validator?”optional validator: ValidatorOptions<T>;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:38^
Optional validator options for the data type.
VersionCacheObject
Section titled “VersionCacheObject”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:369^
Represents a cache object that includes version information.
Extends
Section titled “Extends”Properties
Section titled “Properties”lastCacheUpdate
Section titled “lastCacheUpdate”lastCacheUpdate: Date;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:320^
Inherited from
Section titled “Inherited from”BaseCacheObject
.lastCacheUpdate
version
Section titled “version”version: string;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:370^
The version of the cache object.
ZodValidator<T>
Section titled “ZodValidator<T>”Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:104^
Interface representing a validator that uses a Zod schema to validate data of type T
.
Type Parameters
Section titled “Type Parameters”T
The type of data to be validated.
Properties
Section titled “Properties”zodSchema
Section titled “zodSchema”zodSchema: ZodType<T>;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:105^
The Zod schema instance used for validation.
Type Aliases
Section titled “Type Aliases”addDatabaseEntryInsertPage
Section titled “addDatabaseEntryInsertPage”type addDatabaseEntryInsertPage = { pageContent: PageContentReturnId[]; pageData: PageDataReturnId[];};
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:409^
Represents the structure for adding a database entry for a page.
Properties
Section titled “Properties”pageContent
Section titled “pageContent”pageContent: PageContentReturnId[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:411^
An array of page content objects with return IDs.
pageData
Section titled “pageData”pageData: PageDataReturnId[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:410^
An array of page data objects with return IDs.
AstroDBVirtualModule
Section titled “AstroDBVirtualModule”type AstroDBVirtualModule = __module;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:311^
Represents the type of the virtual module imported from ‘astro:db’. This type can be used to reference the shape and exports of the Astro DB virtual module within TypeScript code, enabling type-safe interactions with its API.
CacheMap<K, V>
Section titled “CacheMap<K, V>”type CacheMap<K, V> = ReadonlyMap<K, V> & Map<K, V>;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:186^
Represents a cache map that combines the immutability of ReadonlyMap
with the mutability of Map
.
Type Parameters
Section titled “Type Parameters”K
The type of keys in the map.
V
The type of values in the map.
Remarks
Section titled “Remarks”This type allows both read-only and mutable operations on the map, which can be useful for scenarios where you need to enforce read-only access in some contexts while allowing mutation in others.
DiffReturnType<T>
Section titled “DiffReturnType<T>”type DiffReturnType<T> = T extends diffItem ? diffReturn : diffReturn[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:274^
Determines the return type based on whether the generic type T
extends diffItem
.
If T
extends diffItem
, returns diffReturn
; otherwise, returns an array of diffReturn
.
Type Parameters
Section titled “Type Parameters”T
The type to check against diffItem
.
Returns
Section titled “Returns”diffReturn
if T
extends diffItem
, otherwise diffReturn[]
.
MetaOnlyPageData
Section titled “MetaOnlyPageData”type MetaOnlyPageData = Omit<CombinedPageData, "multiLangContent" | "defaultContent">;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:204^
Represents page data containing only metadata fields, excluding multilingual and default content.
This type omits the multiLangContent
and defaultContent
properties from CombinedPageData
.
MultiPageInsert
Section titled “MultiPageInsert”type MultiPageInsert = PageInsert[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:475^
Represents an array of PageInsert objects.
PageDataCacheReturnType<T>
Section titled “PageDataCacheReturnType<T>”type PageDataCacheReturnType<T> = T extends PageDataCacheObject ? MetaOnlyPageDataCacheObject : MetaOnlyPageDataCacheObject[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:225^
Determines the return type for page data cache operations based on the input type.
If the generic type T
extends PageDataCacheObject
, the return type is MetaOnlyPageDataCacheObject
.
Otherwise, the return type is an array of MetaOnlyPageDataCacheObject
.
Type Parameters
Section titled “Type Parameters”T
The type to check against PageDataCacheObject
.
PageDataReturnType<T>
Section titled “PageDataReturnType<T>”type PageDataReturnType<T> = T extends CombinedPageData ? MetaOnlyPageData : MetaOnlyPageData[];
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:213^
Conditional type that returns either MetaOnlyPageData
or an array of MetaOnlyPageData
based on whether the generic type T
extends CombinedPageData
.
Type Parameters
Section titled “Type Parameters”T
The type to check against CombinedPageData
.
Returns
Section titled “Returns”If T
extends CombinedPageData
, returns MetaOnlyPageData
; otherwise, returns MetaOnlyPageData[]
.
PaginateInput
Section titled “PaginateInput”type PaginateInput = { limit: number; offset: number;};
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:194^
Input parameters for paginated queries.
Properties
Section titled “Properties”limit: number;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:195^
The maximum number of items to return.
offset
Section titled “offset”offset: number;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:196^
The number of items to skip before starting to collect the result set.
UserPluginDataOptsImplementation<T>
Section titled “UserPluginDataOptsImplementation<T>”type UserPluginDataOptsImplementation<T> = Partial<UsePluginDataOpts<T>>;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:61^
Represents a partial implementation of the UsePluginDataOpts
type for a given object type T
.
This type is useful when you want to provide only a subset of the properties defined in UsePluginDataOpts<T>
.
Type Parameters
Section titled “Type Parameters”T
extends Schema.Struct
<Schema.Struct.Fields
> | object
The object type for which the plugin data options are defined.
ValidatorOptions<T>
Section titled “ValidatorOptions<T>”type ValidatorOptions<T> = T extends Schema.Struct<any> ? EffectSchemaValidator<T> : | JSONValidatorFn<T>| ZodValidator<T>;
Defined in: studiocms/packages/studiocms/src/sdk/types/index.ts:172^
Represents the available validator options for a given type T
.
This type is a union of supported validator types:
JSONValidatorFn<T>
: A function-based JSON validator for typeT
.EffectSchemaValidator<T>
: A validator using the Effect schema for typeT
.ZodValidator<T>
: A validator using the Zod schema for typeT
.
Type Parameters
Section titled “Type Parameters”T
extends Schema.Struct
<any
> | object
The type to be validated.
Example
Section titled “Example”// The Interface for a User typeinterface User { id: number; name: string; email: string;}
// Example of defining a JSON validator Fn for a User typeconst userValidator: ValidatorOptions<User> = { jsonFn: (data: unknown): data is User => { return ( typeof data === 'object' && data !== null && 'id' in data && 'name' in data && 'email' in data && typeof (data as any).id === 'number' && typeof (data as any).name === 'string' && typeof (data as any).email === 'string' ); }};
// Example of defining an Effect schema validator for a User typeimport { Schema } from 'studiocms/effect';
const userEffectSchema = Schema.Struct({ id: Schema.Number, name: Schema.String, email: Schema.String});
type UserEffectSchema = (typeof userEffectSchema)['Type'];type UserEffectSchemaFields = (typeof userEffectSchema)['fields'];
const userEffectValidator: ValidatorOptions<UserEffectSchema, UserEffectSchemaFields> = { effectSchema: userEffectSchema};
// Example of defining a Zod validator for a User typeimport { z } from 'astro/zod';
const userZodValidator: ValidatorOptions<User> = { zodSchema: z.object({ id: z.number(), name: z.string(), email: z.string() })};
References
Section titled “References”AvailableLists
Section titled “AvailableLists”Re-exports AvailableLists
CacheConfig
Section titled “CacheConfig”Re-exports CacheConfig
CombinedInsertContent
Section titled “CombinedInsertContent”Re-exports CombinedInsertContent
CombinedRank
Section titled “CombinedRank”Re-exports CombinedRank
DatabaseTables
Section titled “DatabaseTables”Re-exports DatabaseTables
PageContentReturnId
Section titled “PageContentReturnId”Re-exports PageContentReturnId
PageDataCategoriesInsertResponse
Section titled “PageDataCategoriesInsertResponse”Re-exports PageDataCategoriesInsertResponse
PageDataReturnId
Section titled “PageDataReturnId”Re-exports PageDataReturnId
PageDataStripped
Section titled “PageDataStripped”Re-exports PageDataStripped
PageDataTagsInsertResponse
Section titled “PageDataTagsInsertResponse”Re-exports PageDataTagsInsertResponse
ProcessedCacheConfig
Section titled “ProcessedCacheConfig”Re-exports ProcessedCacheConfig
ProcessedSDKConfig
Section titled “ProcessedSDKConfig”Re-exports ProcessedSDKConfig
SingleRank
Section titled “SingleRank”Re-exports SingleRank
SiteConfig
Section titled “SiteConfig”Re-exports SiteConfig
tsDiffTrackingInsert
Section titled “tsDiffTrackingInsert”Re-exports tsDiffTrackingInsert
tsDiffTrackingSelect
Section titled “tsDiffTrackingSelect”Re-exports tsDiffTrackingSelect
tsEmailVerificationTokensInsert
Section titled “tsEmailVerificationTokensInsert”Re-exports tsEmailVerificationTokensInsert
tsEmailVerificationTokensSelect
Section titled “tsEmailVerificationTokensSelect”Re-exports tsEmailVerificationTokensSelect
tsNotificationSettingsInsert
Section titled “tsNotificationSettingsInsert”Re-exports tsNotificationSettingsInsert
tsNotificationSettingsSelect
Section titled “tsNotificationSettingsSelect”Re-exports tsNotificationSettingsSelect
tsOAuthAccountsInsert
Section titled “tsOAuthAccountsInsert”Re-exports tsOAuthAccountsInsert
tsOAuthAccountsSelect
Section titled “tsOAuthAccountsSelect”Re-exports tsOAuthAccountsSelect
tsPageContentInsert
Section titled “tsPageContentInsert”Re-exports tsPageContentInsert
tsPageContentSelect
Section titled “tsPageContentSelect”Re-exports tsPageContentSelect
tsPageDataCategoriesInsert
Section titled “tsPageDataCategoriesInsert”Re-exports tsPageDataCategoriesInsert
tsPageDataCategoriesSelect
Section titled “tsPageDataCategoriesSelect”Re-exports tsPageDataCategoriesSelect
tsPageDataInsert
Section titled “tsPageDataInsert”Re-exports tsPageDataInsert
tsPageDataSelect
Section titled “tsPageDataSelect”Re-exports tsPageDataSelect
tsPageDataTagsInsert
Section titled “tsPageDataTagsInsert”Re-exports tsPageDataTagsInsert
tsPageDataTagsSelect
Section titled “tsPageDataTagsSelect”Re-exports tsPageDataTagsSelect
tsPageFolderInsert
Section titled “tsPageFolderInsert”Re-exports tsPageFolderInsert
tsPageFolderSelect
Section titled “tsPageFolderSelect”Re-exports tsPageFolderSelect
tsPermissionsInsert
Section titled “tsPermissionsInsert”Re-exports tsPermissionsInsert
tsPermissionsSelect
Section titled “tsPermissionsSelect”Re-exports tsPermissionsSelect
tsPluginDataInsert
Section titled “tsPluginDataInsert”Re-exports tsPluginDataInsert
tsPluginDataSelect
Section titled “tsPluginDataSelect”Re-exports tsPluginDataSelect
tsSessionTableInsert
Section titled “tsSessionTableInsert”Re-exports tsSessionTableInsert
tsSessionTableSelect
Section titled “tsSessionTableSelect”Re-exports tsSessionTableSelect
tsSiteConfigInsert
Section titled “tsSiteConfigInsert”Re-exports tsSiteConfigInsert
tsSiteConfigSelect
Section titled “tsSiteConfigSelect”Re-exports tsSiteConfigSelect
tsUserResetTokensInsert
Section titled “tsUserResetTokensInsert”Re-exports tsUserResetTokensInsert
tsUserResetTokensSelect
Section titled “tsUserResetTokensSelect”Re-exports tsUserResetTokensSelect
tsUsersInsert
Section titled “tsUsersInsert”Re-exports tsUsersInsert
tsUsersSelect
Section titled “tsUsersSelect”Re-exports tsUsersSelect
tsUsersUpdate
Section titled “tsUsersUpdate”Re-exports tsUsersUpdate