sdk/StudioCMSVirtualCache
StudioCMSVirtualCache
'Read the “', StudioCMSVirtualCache, '” section'Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:35
The StudioCMSVirtualCache
class provides caching utilities for the StudioCMS SDK.
It supports caching for site configurations, versions, and page data.
Classdesc
'Read the “', Classdesc, '” section'This class handles caching operations for the StudioCMS SDK, including fetching, updating, and clearing cache entries for site configurations, versions, and page data.
The configuration for the cache.
The StudioCMS SDK instance.
Constructors
'Read the “', Constructors, '” section'new StudioCMSVirtualCache()
'Read the “', new StudioCMSVirtualCache(), '” section'new StudioCMSVirtualCache(cacheConfig: { enabled: boolean; lifetime: number; }, sdkCore: { addPageToFolderTree: (tree: FolderNode[], folderId: string, newPage: FolderNode) => FolderNode[]; AUTH: { oAuth: { create: (data: { provider: string; providerUserId: string; userId: string; }) => Promise<{ provider: string; providerUserId: string; userId: string; }>; delete: (userId: string, provider: string) => Promise<DeletionResponse>; searchProvidersForId: (providerId: string, userId: string) => Promise< | undefined | { provider: string; providerUserId: string; userId: string; }>; }; permission: { currentStatus: (userId: string) => Promise< | undefined | { rank: string; user: string; }>; }; session: { create: (data: { expiresAt: Date; id: string; userId: string; }) => Promise<{ expiresAt: Date; id: string; userId: string; }>; delete: (sessionId: string) => Promise<DeletionResponse>; sessionWithUser: (sessionId: string) => Promise<{ session: { expiresAt: Date; id: string; userId: string; }; user: { avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }; }[]>; update: (sessionId: string, newDate: Date) => Promise<{ expiresAt: Date; id: string; userId: string; }[]>; }; user: { create: (newUserData: { avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }, rank?: "visitor" | "editor" | "admin" | "owner") => Promise<{ avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }>; ghost: { create: () => Promise<any>; get: () => Promise<any>; verifyExists: () => Promise<boolean>; }; searchUsersForUsernameOrEmail: (username: string, email: string) => Promise<{ emailSearch: { avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }[]; usernameSearch: { avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }[]; }>; update: (userId: string, userData: Partial) => Promise<{ avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }>; }; }; buildFolderTree: () => Promise<FolderNode[]>; clearUserReferences: (userId: string) => Promise<boolean>; collectCategories: (categoryIds: number[]) => Promise<{ description: string; id: number; meta: unknown; name: string; parent: null | number; slug: string; }[]>; collectPageData: (page: { 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; }, tree: FolderNode[]) => Promise<CombinedPageData>; collectTags: (tagIds: number[]) => Promise<{ description: string; id: number; meta: unknown; name: string; slug: string; }[]>; collectUserData: (user: { avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }) => Promise<CombinedUserData>; combineRanks: (rank: string, users: SingleRank[]) => CombinedRank[]; db: any; DELETE: { categories: (id: number) => Promise<DeletionResponse>; diffTracking: (id: string) => Promise<DeletionResponse>; folder: (id: string) => Promise<DeletionResponse>; page: (id: string) => Promise<DeletionResponse>; pageContent: (id: string) => Promise<DeletionResponse>; pageContentLang: (id: string, lang: string) => Promise<DeletionResponse>; permissions: (userId: string) => Promise<DeletionResponse>; tags: (id: number) => Promise<DeletionResponse>; user: (id: string) => Promise<DeletionResponse>; }; diffTracking: { clear: (pageId: string) => Promise<void>; get: { byPageId: { all: (pageId: string) => Promise<any>; latest: (pageId: string, count: number) => Promise<any>; }; byUserId: { all: (userId: string) => Promise<any>; latest: (userId: string, count: number) => Promise<any>; }; single: (id: string) => Promise<any>; withHtml: (id: string, options?: any) => Promise<any>; }; insert: (userId: string, pageId: string, data: { content: { end: string; start: string; }; metaData: { 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; }>; }; }, diffLength: number) => Promise<any>; revertToDiff: (id: string, type: "content" | "data" | "both") => Promise<any>; }; findNodeById: (tree: FolderNode[], id: string) => null | FolderNode; findNodeByPath: (tree: FolderNode[], path: string[]) => null | FolderNode; findNodesAlongPath: (tree: FolderNode[], path: string[]) => FolderNode[]; generateRandomIDNumber: (length: number) => number; generateRandomPassword: (length: number) => string; generateToken: (userId: string) => string; GET: { database: { config: () => Promise< | undefined | { defaultOgImage: null | string; description: string; diffPerPage: number; enableDiffs: boolean; gridItems: unknown; id: number; loginPageBackground: string; loginPageCustomImage: null | string; siteIcon: null | string; title: string; }>; folders: () => Promise<{ id: string; name: string; parent: null | string; }[]>; pages: (includeDrafts: boolean, tree?: FolderNode[]) => Promise<CombinedPageData[]>; users: () => Promise<CombinedUserData[]>; }; databaseEntry: { folder: (id: string) => Promise< | undefined | { id: string; name: string; parent: null | string; }>; pages: { byId: (id: string, tree?: FolderNode[]) => Promise< | undefined | CombinedPageData>; bySlug: (slug: string, tree?: FolderNode[]) => Promise< | undefined | CombinedPageData>; }; users: { byEmail: (email: string) => Promise< | undefined | CombinedUserData>; byId: (id: string) => Promise< | undefined | CombinedUserData>; byUsername: (username: string) => Promise< | undefined | CombinedUserData>; }; }; databaseTable: { diffTracking: () => Promise<any>; oAuthAccounts: () => Promise<any>; pageContent: () => Promise<any>; pageData: () => Promise<any>; pageDataCategories: () => Promise<any>; pageDataTags: () => Promise<any>; pageFolderStructure: () => Promise<any>; permissions: () => Promise<any>; sessionTable: () => Promise<any>; siteConfig: () => Promise<any>; users: () => Promise<any>; }; packagePages: (packageName: string, tree?: FolderNode[]) => Promise<CombinedPageData[]>; permissionsLists: { admins: () => Promise<SingleRank[]>; all: () => Promise<CombinedRank[]>; editors: () => Promise<SingleRank[]>; owners: () => Promise<SingleRank[]>; visitors: () => Promise<SingleRank[]>; }; }; getAvailableFolders: () => Promise<FolderListItem[]>; getFullPath: (tree: FolderNode[], path: string[]) => string[]; INIT: { ghostUser: () => Promise<{ avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }>; siteConfig: (config: { defaultOgImage: null | string; description: string; diffPerPage: number; enableDiffs: boolean; gridItems: unknown; id: number; loginPageBackground: string; loginPageCustomImage: null | string; siteIcon: null | string; title: string; }) => Promise<{ defaultOgImage: null | string; description: string; diffPerPage: number; enableDiffs: boolean; gridItems: unknown; id: number; loginPageBackground: string; loginPageCustomImage: null | string; siteIcon: null | string; title: string; }>; }; parseIdNumberArray: (ids: unknown) => number[]; parseIdStringArray: (ids: unknown) => string[]; POST: { databaseEntries: { categories: (data: { description: string; id: number; meta: unknown; name: string; parent: null | number; slug: string; }[]) => Promise<PageDataCategoriesInsertResponse[]>; pages: (pages: MultiPageInsert) => Promise<void>; permissions: (data: { rank: string; user: string; }[]) => Promise<{ rank: string; user: string; }[]>; tags: (data: { description: string; id: number; meta: unknown; name: string; slug: string; }[]) => Promise<PageDataTagsInsertResponse[]>; }; databaseEntry: { categories: (category: { description: string; id: number; meta: unknown; name: string; parent: null | number; slug: string; }) => Promise<any>; diffTracking: (diff: { diff: null | string; id: string; pageContentStart: string; pageId: string; pageMetaData: unknown; timestamp: null | Date; userId: string; }) => Promise<{ diff: null | string; id: string; pageContentStart: string; pageId: string; pageMetaData: unknown; timestamp: null | Date; userId: string; }[]>; folder: (folder: { id: string; name: string; parent: null | string; }) => Promise<{ id: string; name: string; parent: null | string; }[]>; pageContent: (pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }) => Promise<PageContentReturnId[]>; pages: (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; }, pageContent: CombinedInsertContent) => Promise<addDatabaseEntryInsertPage>; permissions: (userId: string, rank: string) => Promise<{ rank: string; user: string; }[]>; tags: (tag: { description: string; id: number; meta: unknown; name: string; slug: string; }) => Promise<PageDataTagsInsertResponse[]>; }; }; resetTokenBucket: { check: (token: string) => Promise<boolean>; delete: (userId: string) => Promise<void>; new: (userId: string) => Promise<any>; }; REST_API: { tokens: { delete: (userId: string, tokenId: string) => Promise<void>; get: (userId: string) => Promise<any>; new: (userId: string, description: string) => Promise<any>; verify: (key: string) => Promise< | false | { key: any; rank: any; userId: any; }>; }; }; testToken: (token: string) => any; UPDATE: { categories: (data: { description: string; id: number; meta: unknown; name: string; parent: null | number; slug: string; }) => Promise<{ description: string; id: number; meta: unknown; name: string; parent: null | number; slug: string; }>; folder: (data: { id: string; name: string; parent: null | string; }) => Promise<{ id: string; name: string; parent: null | string; }>; page: (data: { 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; }) => Promise<{ 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; }>; pageContent: (data: { content: null | string; contentId: string; contentLang: string; id: string; }) => Promise<{ content: null | string; contentId: string; contentLang: string; id: string; }>; permissions: (data: { rank: string; user: string; }) => Promise<{ rank: string; user: string; }>; siteConfig: (data: { defaultOgImage: null | string; description: string; diffPerPage: number; enableDiffs: boolean; gridItems: unknown; id: number; loginPageBackground: string; loginPageCustomImage: null | string; siteIcon: null | string; title: string; }) => Promise<{ defaultOgImage: null | string; description: string; diffPerPage: number; enableDiffs: boolean; gridItems: unknown; id: number; loginPageBackground: string; loginPageCustomImage: null | string; siteIcon: null | string; title: string; }>; tags: (data: { description: string; id: number; meta: unknown; name: string; slug: string; }) => Promise<{ description: string; id: number; meta: unknown; name: string; slug: string; }>; }; verifyRank: (users: { avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }[], permissions: { rank: string; user: string; }[], rank: string) => SingleRank[]; }): StudioCMSVirtualCache
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:103
Parameters
'Read the “', Parameters, '” section'cacheConfig
'Read the “', cacheConfig, '” section'boolean
= ...
Cache Enabled
Default
true
number
= ...
Cache Lifetime
{number}{unit}
- e.g. ‘5m’ for 5 minutes or ‘1h’ for 1 hour
Default
'5m'
addPageToFolderTree
'Read the “', addPageToFolderTree, '” section'(tree
: FolderNode
[], folderId
: string
, newPage
: FolderNode
) => FolderNode
[]
{
oAuth
: {
create
: (data
: {
provider
: string
;
providerUserId
: string
;
userId
: string
;
}) => Promise
<{
provider
: string
;
providerUserId
: string
;
userId
: string
;
}>;
delete
: (userId
: string
, provider
: string
) => Promise
<DeletionResponse
>;
searchProvidersForId
: (providerId
: string
, userId
: string
) => Promise
<
| undefined
| {
provider
: string
;
providerUserId
: string
;
userId
: string
;
}>;
};
permission
: {
currentStatus
: (userId
: string
) => Promise
<
| undefined
| {
rank
: string
;
user
: string
;
}>;
};
session
: {
create
: (data
: {
expiresAt
: Date
;
id
: string
;
userId
: string
;
}) => Promise
<{
expiresAt
: Date
;
id
: string
;
userId
: string
;
}>;
delete
: (sessionId
: string
) => Promise
<DeletionResponse
>;
sessionWithUser
: (sessionId
: string
) => Promise
<{
session
: {
expiresAt
: Date
;
id
: string
;
userId
: string
;
};
user
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
};
}[]>;
update
: (sessionId
: string
, newDate
: Date
) => Promise
<{
expiresAt
: Date
;
id
: string
;
userId
: string
;
}[]>;
};
user
: {
create
: (newUserData
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}, rank
?: "visitor"
| "editor"
| "admin"
| "owner"
) => Promise
<{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}>;
ghost
: {
create
: () => Promise
<any
>;
get
: () => Promise
<any
>;
verifyExists
: () => Promise
<boolean
>;
};
searchUsersForUsernameOrEmail
: (username
: string
, email
: string
) => Promise
<{
emailSearch
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}[];
usernameSearch
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}[];
}>;
update
: (userId
: string
, userData
: Partial
) => Promise
<{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}>;
};
}
AUTH.oAuth
'Read the “', AUTH.oAuth, '” section'{
create
: (data
: {
provider
: string
;
providerUserId
: string
;
userId
: string
;
}) => Promise
<{
provider
: string
;
providerUserId
: string
;
userId
: string
;
}>;
delete
: (userId
: string
, provider
: string
) => Promise
<DeletionResponse
>;
searchProvidersForId
: (providerId
: string
, userId
: string
) => Promise
<
| undefined
| {
provider
: string
;
providerUserId
: string
;
userId
: string
;
}>;
} = ...
Provides various methods to create, delete, and search for OAuth accounts in the StudioCMS database.
AUTH.oAuth.create
'Read the “', AUTH.oAuth.create, '” section'(data
: {
provider
: string
;
providerUserId
: string
;
userId
: string
;
}) => Promise
<{
provider
: string
;
providerUserId
: string
;
userId
: string
;
}> = ...
Creates a new OAuth account in the database.
Throws
If an error occurs while creating the OAuth account.
AUTH.oAuth.delete
'Read the “', AUTH.oAuth.delete, '” section'(userId
: string
, provider
: string
) => Promise
<DeletionResponse
> = ...
Deletes an OAuth account from the database.
Throws
If an error occurs while deleting the OAuth account.
AUTH.oAuth.searchProvidersForId
'Read the “', AUTH.oAuth.searchProvidersForId, '” section'(providerId
: string
, userId
: string
) => Promise
<
| undefined
| {
provider
: string
;
providerUserId
: string
;
userId
: string
;
}> = ...
Searches for OAuth accounts based on the provider ID and user ID.
Throws
If an error occurs while searching for the OAuth account.
AUTH.permission
'Read the “', AUTH.permission, '” section'{
currentStatus
: (userId
: string
) => Promise
<
| undefined
| {
rank
: string
;
user
: string
;
}>;
} = ...
Provides various methods to get and update permissions for users in the StudioCMS database.
AUTH.permission.currentStatus
'Read the “', AUTH.permission.currentStatus, '” section'(userId
: string
) => Promise
<
| undefined
| {
rank
: string
;
user
: string
;
}> = ...
Checks the current status of a user’s permissions.
AUTH.session
'Read the “', AUTH.session, '” section'{
create
: (data
: {
expiresAt
: Date
;
id
: string
;
userId
: string
;
}) => Promise
<{
expiresAt
: Date
;
id
: string
;
userId
: string
;
}>;
delete
: (sessionId
: string
) => Promise
<DeletionResponse
>;
sessionWithUser
: (sessionId
: string
) => Promise
<{
session
: {
expiresAt
: Date
;
id
: string
;
userId
: string
;
};
user
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
};
}[]>;
update
: (sessionId
: string
, newDate
: Date
) => Promise
<{
expiresAt
: Date
;
id
: string
;
userId
: string
;
}[]>;
} = ...
Provides various methods to create, delete, and update sessions in the StudioCMS database.
AUTH.session.create
'Read the “', AUTH.session.create, '” section'(data
: {
expiresAt
: Date
;
id
: string
;
userId
: string
;
}) => Promise
<{
expiresAt
: Date
;
id
: string
;
userId
: string
;
}> = ...
Creates a new session in the database.
Throws
If an error occurs while creating the session.
AUTH.session.delete
'Read the “', AUTH.session.delete, '” section'(sessionId
: string
) => Promise
<DeletionResponse
> = ...
Deletes a session from the database.
Throws
If an error occurs while deleting the session.
AUTH.session.sessionWithUser
'Read the “', AUTH.session.sessionWithUser, '” section'(sessionId
: string
) => Promise
<{
session
: {
expiresAt
: Date
;
id
: string
;
userId
: string
;
};
user
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
};
}[]> = ...
Gets a session with the associated user.
Throws
If an error occurs while getting the session with the user.
AUTH.session.update
'Read the “', AUTH.session.update, '” section'(sessionId
: string
, newDate
: Date
) => Promise
<{
expiresAt
: Date
;
id
: string
;
userId
: string
;
}[]> = ...
Updates the expiration date of a session.
Throws
If an error occurs while updating the session.
AUTH.user
'Read the “', AUTH.user, '” section'{
create
: (newUserData
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}, rank
?: "visitor"
| "editor"
| "admin"
| "owner"
) => Promise
<{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}>;
ghost
: {
create
: () => Promise
<any
>;
get
: () => Promise
<any
>;
verifyExists
: () => Promise
<boolean
>;
};
searchUsersForUsernameOrEmail
: (username
: string
, email
: string
) => Promise
<{
emailSearch
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}[];
usernameSearch
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}[];
}>;
update
: (userId
: string
, userData
: Partial
) => Promise
<{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}>;
} = ...
Provides various methods to create, update, and search for users in the StudioCMS database.
AUTH.user.create
'Read the “', AUTH.user.create, '” section'(newUserData
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}, rank
?: "visitor"
| "editor"
| "admin"
| "owner"
) => Promise
<{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}> = ...
Creates a new user in the database.
Throws
If an error occurs while creating the user.
AUTH.user.ghost
'Read the “', AUTH.user.ghost, '” section'{
create
: () => Promise
<any
>;
get
: () => Promise
<any
>;
verifyExists
: () => Promise
<boolean
>;
} = ...
Ghost user utilities.
AUTH.user.ghost.create
'Read the “', AUTH.user.ghost.create, '” section'() => Promise
<any
> = ...
Creates the ghost user in the database.
Throws
If an error occurs while creating the ghost user.
AUTH.user.ghost.get
'Read the “', AUTH.user.ghost.get, '” section'() => Promise
<any
> = ...
Gets the ghost user from the database.
Throws
If an error occurs while getting the ghost user.
AUTH.user.ghost.verifyExists
'Read the “', AUTH.user.ghost.verifyExists, '” section'() => Promise
<boolean
> = ...
Verifies if the ghost user exists in the database.
Throws
If an error occurs while verifying the ghost user.
AUTH.user.searchUsersForUsernameOrEmail
'Read the “', AUTH.user.searchUsersForUsernameOrEmail, '” section'(username
: string
, email
: string
) => Promise
<{
emailSearch
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}[];
usernameSearch
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}[];
}> = ...
Searches for users based on the provided username or email.
Throws
If an error occurs while searching for the username or email.
AUTH.user.update
'Read the “', AUTH.user.update, '” section'(userId
: string
, userData
: Partial
) => Promise
<{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}> = ...
Updates a user in the database.
Throws
If an error occurs while updating the user.
buildFolderTree
'Read the “', buildFolderTree, '” section'() => Promise
<FolderNode
[]>
clearUserReferences
'Read the “', clearUserReferences, '” section'(userId
: string
) => Promise
<boolean
>
collectCategories
'Read the “', collectCategories, '” section'(categoryIds
: number
[]) => Promise
<{
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}[]>
collectPageData
'Read the “', collectPageData, '” section'(page
: {
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
;
}, tree
: FolderNode
[]) => Promise
<CombinedPageData
>
collectTags
'Read the “', collectTags, '” section'(tagIds
: number
[]) => Promise
<{
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}[]>
collectUserData
'Read the “', collectUserData, '” section'(user
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}) => Promise
<CombinedUserData
>
combineRanks
'Read the “', combineRanks, '” section'(rank
: string
, users
: SingleRank
[]) => CombinedRank
[]
any
{
categories
: (id
: number
) => Promise
<DeletionResponse
>;
diffTracking
: (id
: string
) => Promise
<DeletionResponse
>;
folder
: (id
: string
) => Promise
<DeletionResponse
>;
page
: (id
: string
) => Promise
<DeletionResponse
>;
pageContent
: (id
: string
) => Promise
<DeletionResponse
>;
pageContentLang
: (id
: string
, lang
: string
) => Promise
<DeletionResponse
>;
permissions
: (userId
: string
) => Promise
<DeletionResponse
>;
tags
: (id
: number
) => Promise
<DeletionResponse
>;
user
: (id
: string
) => Promise
<DeletionResponse
>;
}
DELETE.categories
'Read the “', DELETE.categories, '” section'(id
: number
) => Promise
<DeletionResponse
> = ...
Deletes a category from the database.
Throws
If an error occurs while deleting the category.
DELETE.diffTracking
'Read the “', DELETE.diffTracking, '” section'(id
: string
) => Promise
<DeletionResponse
> = ...
Deletes a site configuration from the database.
Throws
If an error occurs while deleting the site configuration.
DELETE.folder
'Read the “', DELETE.folder, '” section'(id
: string
) => Promise
<DeletionResponse
> = ...
Deletes a folder from the database.
Throws
If an error occurs while deleting the folder.
DELETE.page
'Read the “', DELETE.page, '” section'(id
: string
) => Promise
<DeletionResponse
> = ...
Deletes a page from the database.
Throws
If an error occurs while deleting the page.
DELETE.pageContent
'Read the “', DELETE.pageContent, '” section'(id
: string
) => Promise
<DeletionResponse
> = ...
Deletes a page content from the database.
Throws
If an error occurs while deleting the page content.
DELETE.pageContentLang
'Read the “', DELETE.pageContentLang, '” section'(id
: string
, lang
: string
) => Promise
<DeletionResponse
> = ...
Deletes a page content lang from the database.
Throws
If an error occurs while deleting the page content lang.
DELETE.permissions
'Read the “', DELETE.permissions, '” section'(userId
: string
) => Promise
<DeletionResponse
> = ...
Deletes a permission from the database.
Throws
If an error occurs while deleting the permission.
DELETE.tags
'Read the “', DELETE.tags, '” section'(id
: number
) => Promise
<DeletionResponse
> = ...
Deletes a tag from the database.
Throws
If an error occurs while deleting the tag.
DELETE.user
'Read the “', DELETE.user, '” section'(id
: string
) => Promise
<DeletionResponse
> = ...
Deletes a user from the database.
Throws
If an error occurs while deleting the user.
diffTracking
'Read the “', diffTracking, '” section'{
clear
: (pageId
: string
) => Promise
<void
>;
get
: {
byPageId
: {
all
: (pageId
: string
) => Promise
<any
>;
latest
: (pageId
: string
, count
: number
) => Promise
<any
>;
};
byUserId
: {
all
: (userId
: string
) => Promise
<any
>;
latest
: (userId
: string
, count
: number
) => Promise
<any
>;
};
single
: (id
: string
) => Promise
<any
>;
withHtml
: (id
: string
, options
?: any
) => Promise
<any
>;
};
insert
: (userId
: string
, pageId
: string
, data
: {
content
: {
end
: string
;
start
: string
;
};
metaData
: {
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
;
}>;
};
}, diffLength
: number
) => Promise
<any
>;
revertToDiff
: (id
: string
, type
: "content"
| "data"
| "both"
) => Promise
<any
>;
}
diffTracking.clear
'Read the “', diffTracking.clear, '” section'(pageId
: string
) => Promise
<void
> = ...
diffTracking.get
'Read the “', diffTracking.get, '” section'{
byPageId
: {
all
: (pageId
: string
) => Promise
<any
>;
latest
: (pageId
: string
, count
: number
) => Promise
<any
>;
};
byUserId
: {
all
: (userId
: string
) => Promise
<any
>;
latest
: (userId
: string
, count
: number
) => Promise
<any
>;
};
single
: (id
: string
) => Promise
<any
>;
withHtml
: (id
: string
, options
?: any
) => Promise
<any
>;
} = ...
diffTracking.get.byPageId
'Read the “', diffTracking.get.byPageId, '” section'{
all
: (pageId
: string
) => Promise
<any
>;
latest
: (pageId
: string
, count
: number
) => Promise
<any
>;
} = ...
diffTracking.get.byPageId.all
'Read the “', diffTracking.get.byPageId.all, '” section'(pageId
: string
) => Promise
<any
> = ...
diffTracking.get.byPageId.latest
'Read the “', diffTracking.get.byPageId.latest, '” section'(pageId
: string
, count
: number
) => Promise
<any
> = ...
diffTracking.get.byUserId
'Read the “', diffTracking.get.byUserId, '” section'{
all
: (userId
: string
) => Promise
<any
>;
latest
: (userId
: string
, count
: number
) => Promise
<any
>;
} = ...
diffTracking.get.byUserId.all
'Read the “', diffTracking.get.byUserId.all, '” section'(userId
: string
) => Promise
<any
> = ...
diffTracking.get.byUserId.latest
'Read the “', diffTracking.get.byUserId.latest, '” section'(userId
: string
, count
: number
) => Promise
<any
> = ...
diffTracking.get.single
'Read the “', diffTracking.get.single, '” section'(id
: string
) => Promise
<any
> = ...
diffTracking.get.withHtml
'Read the “', diffTracking.get.withHtml, '” section'(id
: string
, options
?: any
) => Promise
<any
> = ...
diffTracking.insert
'Read the “', diffTracking.insert, '” section'(userId
: string
, pageId
: string
, data
: {
content
: {
end
: string
;
start
: string
;
};
metaData
: {
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
;
}>;
};
}, diffLength
: number
) => Promise
<any
> = ...
diffTracking.revertToDiff
'Read the “', diffTracking.revertToDiff, '” section'(id
: string
, type
: "content"
| "data"
| "both"
) => Promise
<any
> = ...
findNodeById
'Read the “', findNodeById, '” section'(tree
: FolderNode
[], id
: string
) => null
| FolderNode
findNodeByPath
'Read the “', findNodeByPath, '” section'(tree
: FolderNode
[], path
: string
[]) => null
| FolderNode
findNodesAlongPath
'Read the “', findNodesAlongPath, '” section'(tree
: FolderNode
[], path
: string
[]) => FolderNode
[]
generateRandomIDNumber
'Read the “', generateRandomIDNumber, '” section'(length
: number
) => number
generateRandomPassword
'Read the “', generateRandomPassword, '” section'(length
: number
) => string
generateToken
'Read the “', generateToken, '” section'(userId
: string
) => string
{
database
: {
config
: () => Promise
<
| undefined
| {
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}>;
folders
: () => Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}[]>;
pages
: (includeDrafts
: boolean
, tree
?: FolderNode
[]) => Promise
<CombinedPageData
[]>;
users
: () => Promise
<CombinedUserData
[]>;
};
databaseEntry
: {
folder
: (id
: string
) => Promise
<
| undefined
| {
id
: string
;
name
: string
;
parent
: null
| string
;
}>;
pages
: {
byId
: (id
: string
, tree
?: FolderNode
[]) => Promise
<
| undefined
| CombinedPageData
>;
bySlug
: (slug
: string
, tree
?: FolderNode
[]) => Promise
<
| undefined
| CombinedPageData
>;
};
users
: {
byEmail
: (email
: string
) => Promise
<
| undefined
| CombinedUserData
>;
byId
: (id
: string
) => Promise
<
| undefined
| CombinedUserData
>;
byUsername
: (username
: string
) => Promise
<
| undefined
| CombinedUserData
>;
};
};
databaseTable
: {
diffTracking
: () => Promise
<any
>;
oAuthAccounts
: () => Promise
<any
>;
pageContent
: () => Promise
<any
>;
pageData
: () => Promise
<any
>;
pageDataCategories
: () => Promise
<any
>;
pageDataTags
: () => Promise
<any
>;
pageFolderStructure
: () => Promise
<any
>;
permissions
: () => Promise
<any
>;
sessionTable
: () => Promise
<any
>;
siteConfig
: () => Promise
<any
>;
users
: () => Promise
<any
>;
};
packagePages
: (packageName
: string
, tree
?: FolderNode
[]) => Promise
<CombinedPageData
[]>;
permissionsLists
: {
admins
: () => Promise
<SingleRank
[]>;
all
: () => Promise
<CombinedRank
[]>;
editors
: () => Promise
<SingleRank
[]>;
owners
: () => Promise
<SingleRank
[]>;
visitors
: () => Promise
<SingleRank
[]>;
};
}
GET.database
'Read the “', GET.database, '” section'{
config
: () => Promise
<
| undefined
| {
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}>;
folders
: () => Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}[]>;
pages
: (includeDrafts
: boolean
, tree
?: FolderNode
[]) => Promise
<CombinedPageData
[]>;
users
: () => Promise
<CombinedUserData
[]>;
} = ...
Retrieves data from the database
GET.database.config
'Read the “', GET.database.config, '” section'() => Promise
<
| undefined
| {
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}> = ...
Retrieves the site configuration from the database.
Throws
If an error occurs while getting the site configuration.
GET.database.folders
'Read the “', GET.database.folders, '” section'() => Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}[]> = ...
GET.database.pages
'Read the “', GET.database.pages, '” section'(includeDrafts
: boolean
, tree
?: FolderNode
[]) => Promise
<CombinedPageData
[]> = ...
Retrieves all pages from the database.
Throws
If an error occurs while getting the pages.
GET.database.users
'Read the “', GET.database.users, '” section'() => Promise
<CombinedUserData
[]> = ...
Retrieves all users from the database.
Throws
If an error occurs while getting the users.
GET.databaseEntry
'Read the “', GET.databaseEntry, '” section'{
folder
: (id
: string
) => Promise
<
| undefined
| {
id
: string
;
name
: string
;
parent
: null
| string
;
}>;
pages
: {
byId
: (id
: string
, tree
?: FolderNode
[]) => Promise
<
| undefined
| CombinedPageData
>;
bySlug
: (slug
: string
, tree
?: FolderNode
[]) => Promise
<
| undefined
| CombinedPageData
>;
};
users
: {
byEmail
: (email
: string
) => Promise
<
| undefined
| CombinedUserData
>;
byId
: (id
: string
) => Promise
<
| undefined
| CombinedUserData
>;
byUsername
: (username
: string
) => Promise
<
| undefined
| CombinedUserData
>;
};
} = ...
Retrieves data from the database by ID.
GET.databaseEntry.folder
'Read the “', GET.databaseEntry.folder, '” section'(id
: string
) => Promise
<
| undefined
| {
id
: string
;
name
: string
;
parent
: null
| string
;
}> = ...
GET.databaseEntry.pages
'Read the “', GET.databaseEntry.pages, '” section'{
byId
: (id
: string
, tree
?: FolderNode
[]) => Promise
<
| undefined
| CombinedPageData
>;
bySlug
: (slug
: string
, tree
?: FolderNode
[]) => Promise
<
| undefined
| CombinedPageData
>;
} = ...
Retrieves a page from the database
GET.databaseEntry.pages.byId
'Read the “', GET.databaseEntry.pages.byId, '” section'(id
: string
, tree
?: FolderNode
[]) => Promise
<
| undefined
| CombinedPageData
> = ...
Retrieves a page by ID.
Throws
If an error occurs while getting the page.
GET.databaseEntry.pages.bySlug
'Read the “', GET.databaseEntry.pages.bySlug, '” section'(slug
: string
, tree
?: FolderNode
[]) => Promise
<
| undefined
| CombinedPageData
> = ...
Retrieves a page by slug.
Throws
If an error occurs while getting the page.
GET.databaseEntry.users
'Read the “', GET.databaseEntry.users, '” section'{
byEmail
: (email
: string
) => Promise
<
| undefined
| CombinedUserData
>;
byId
: (id
: string
) => Promise
<
| undefined
| CombinedUserData
>;
byUsername
: (username
: string
) => Promise
<
| undefined
| CombinedUserData
>;
} = ...
Retrieves a user from the database
GET.databaseEntry.users.byEmail
'Read the “', GET.databaseEntry.users.byEmail, '” section'(email
: string
) => Promise
<
| undefined
| CombinedUserData
> = ...
Retrieves a user by email.
Throws
If an error occurs while getting the user.
GET.databaseEntry.users.byId
'Read the “', GET.databaseEntry.users.byId, '” section'(id
: string
) => Promise
<
| undefined
| CombinedUserData
> = ...
Retrieves a user by ID.
Throws
If an error occurs while getting the user.
GET.databaseEntry.users.byUsername
'Read the “', GET.databaseEntry.users.byUsername, '” section'(username
: string
) => Promise
<
| undefined
| CombinedUserData
> = ...
Retrieves a user by username.
Throws
If an error occurs while getting the user.
GET.databaseTable
'Read the “', GET.databaseTable, '” section'{
diffTracking
: () => Promise
<any
>;
oAuthAccounts
: () => Promise
<any
>;
pageContent
: () => Promise
<any
>;
pageData
: () => Promise
<any
>;
pageDataCategories
: () => Promise
<any
>;
pageDataTags
: () => Promise
<any
>;
pageFolderStructure
: () => Promise
<any
>;
permissions
: () => Promise
<any
>;
sessionTable
: () => Promise
<any
>;
siteConfig
: () => Promise
<any
>;
users
: () => Promise
<any
>;
} = ...
Retrieves data from the database tables without any additional processing.
GET.databaseTable.diffTracking
'Read the “', GET.databaseTable.diffTracking, '” section'() => Promise
<any
> = ...
Retrieves all data from the diff tracking table.
Throws
If an error occurs while getting the diff tracking data.
GET.databaseTable.oAuthAccounts
'Read the “', GET.databaseTable.oAuthAccounts, '” section'() => Promise
<any
> = ...
Retrieves all data from the OAuth accounts table.
Throws
If an error occurs while getting the OAuth accounts.
GET.databaseTable.pageContent
'Read the “', GET.databaseTable.pageContent, '” section'() => Promise
<any
> = ...
Retrieves all data from the page content table.
Throws
If an error occurs while getting the page content.
GET.databaseTable.pageData
'Read the “', GET.databaseTable.pageData, '” section'() => Promise
<any
> = ...
Retrieves all data from the page data table.
Throws
If an error occurs while getting the pages.
GET.databaseTable.pageDataCategories
'Read the “', GET.databaseTable.pageDataCategories, '” section'() => Promise
<any
> = ...
Retrieves all data from the page data categories table.
Throws
If an error occurs while getting the page data categories.
GET.databaseTable.pageDataTags
'Read the “', GET.databaseTable.pageDataTags, '” section'() => Promise
<any
> = ...
Retrieves all data from the page data tags table.
Throws
If an error occurs while getting the page data tags.
GET.databaseTable.pageFolderStructure
'Read the “', GET.databaseTable.pageFolderStructure, '” section'() => Promise
<any
> = ...
Retrieves all data from the page folder structure table.
Throws
If an error occurs while getting the page folder structure data.
GET.databaseTable.permissions
'Read the “', GET.databaseTable.permissions, '” section'() => Promise
<any
> = ...
Retrieves all data from the permissions table.
Throws
If an error occurs while getting the permissions.
GET.databaseTable.sessionTable
'Read the “', GET.databaseTable.sessionTable, '” section'() => Promise
<any
> = ...
Retrieves all data from the session table.
Throws
If an error occurs while getting the sessions.
GET.databaseTable.siteConfig
'Read the “', GET.databaseTable.siteConfig, '” section'() => Promise
<any
> = ...
Retrieves all data from the site config table.
Throws
If an error occurs while getting the site configuration.
GET.databaseTable.users
'Read the “', GET.databaseTable.users, '” section'() => Promise
<any
> = ...
Retrieves all data from the users table.
Throws
If an error occurs while getting the users.
GET.packagePages
'Read the “', GET.packagePages, '” section'(packageName
: string
, tree
?: FolderNode
[]) => Promise
<CombinedPageData
[]> = ...
Retrieves data from the database by package.
GET.permissionsLists
'Read the “', GET.permissionsLists, '” section'{
admins
: () => Promise
<SingleRank
[]>;
all
: () => Promise
<CombinedRank
[]>;
editors
: () => Promise
<SingleRank
[]>;
owners
: () => Promise
<SingleRank
[]>;
visitors
: () => Promise
<SingleRank
[]>;
} = ...
Retrieve Permission Lists
GET.permissionsLists.admins
'Read the “', GET.permissionsLists.admins, '” section'() => Promise
<SingleRank
[]> = ...
Retrieves all admins in the database.
Throws
If an error occurs while getting the admins.
GET.permissionsLists.all
'Read the “', GET.permissionsLists.all, '” section'() => Promise
<CombinedRank
[]> = ...
Retrieves all permissions for users in the database.
Throws
If an error occurs while getting the permissions.
GET.permissionsLists.editors
'Read the “', GET.permissionsLists.editors, '” section'() => Promise
<SingleRank
[]> = ...
Retrieves all editors in the database.
Throws
If an error occurs while getting the editors.
GET.permissionsLists.owners
'Read the “', GET.permissionsLists.owners, '” section'() => Promise
<SingleRank
[]> = ...
Retrieves all owners in the database.
Throws
If an error occurs while getting the owners.
GET.permissionsLists.visitors
'Read the “', GET.permissionsLists.visitors, '” section'() => Promise
<SingleRank
[]> = ...
Retrieves all visitors in the database.
Throws
If an error occurs while getting the visitors.
getAvailableFolders
'Read the “', getAvailableFolders, '” section'() => Promise
<FolderListItem
[]>
getFullPath
'Read the “', getFullPath, '” section'(tree
: FolderNode
[], path
: string
[]) => string
[]
{
ghostUser
: () => Promise
<{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}>;
siteConfig
: (config
: {
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}) => Promise
<{
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}>;
}
INIT.ghostUser
'Read the “', INIT.ghostUser, '” section'() => Promise
<{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}> = ...
Initializes the StudioCMS Ghost User.
The ghost user is a default user that is used to perform actions on behalf of the system as well as to replace deleted users.
Throws
If an error occurs while creating the ghost user.
INIT.siteConfig
'Read the “', INIT.siteConfig, '” section'(config
: {
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}) => Promise
<{
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}> = ...
Initializes the StudioCMS SiteConfig table with the provided configuration.
Throws
If an error occurs while creating the site configuration.
parseIdNumberArray
'Read the “', parseIdNumberArray, '” section'(ids
: unknown
) => number
[]
parseIdStringArray
'Read the “', parseIdStringArray, '” section'(ids
: unknown
) => string
[]
{
databaseEntries
: {
categories
: (data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}[]) => Promise
<PageDataCategoriesInsertResponse
[]>;
pages
: (pages
: MultiPageInsert
) => Promise
<void
>;
permissions
: (data
: {
rank
: string
;
user
: string
;
}[]) => Promise
<{
rank
: string
;
user
: string
;
}[]>;
tags
: (data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}[]) => Promise
<PageDataTagsInsertResponse
[]>;
};
databaseEntry
: {
categories
: (category
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}) => Promise
<any
>;
diffTracking
: (diff
: {
diff
: null
| string
;
id
: string
;
pageContentStart
: string
;
pageId
: string
;
pageMetaData
: unknown
;
timestamp
: null
| Date
;
userId
: string
;
}) => Promise
<{
diff
: null
| string
;
id
: string
;
pageContentStart
: string
;
pageId
: string
;
pageMetaData
: unknown
;
timestamp
: null
| Date
;
userId
: string
;
}[]>;
folder
: (folder
: {
id
: string
;
name
: string
;
parent
: null
| string
;
}) => Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}[]>;
pageContent
: (pageContent
: {
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}) => Promise
<PageContentReturnId
[]>;
pages
: (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
;
}, pageContent
: CombinedInsertContent
) => Promise
<addDatabaseEntryInsertPage
>;
permissions
: (userId
: string
, rank
: string
) => Promise
<{
rank
: string
;
user
: string
;
}[]>;
tags
: (tag
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}) => Promise
<PageDataTagsInsertResponse
[]>;
};
}
POST.databaseEntries
'Read the “', POST.databaseEntries, '” section'{
categories
: (data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}[]) => Promise
<PageDataCategoriesInsertResponse
[]>;
pages
: (pages
: MultiPageInsert
) => Promise
<void
>;
permissions
: (data
: {
rank
: string
;
user
: string
;
}[]) => Promise
<{
rank
: string
;
user
: string
;
}[]>;
tags
: (data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}[]) => Promise
<PageDataTagsInsertResponse
[]>;
} = ...
Inserts data into the database by Array of Entries
POST.databaseEntries.categories
'Read the “', POST.databaseEntries.categories, '” section'(data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}[]) => Promise
<PageDataCategoriesInsertResponse
[]> = ...
Inserts multiple categories into the database.
Throws
If an error occurs while inserting the categories.
POST.databaseEntries.pages
'Read the “', POST.databaseEntries.pages, '” section'(pages
: MultiPageInsert
) => Promise
<void
> = ...
Inserts multiple pages into the database.
Throws
If an error occurs while inserting the pages.
POST.databaseEntries.permissions
'Read the “', POST.databaseEntries.permissions, '” section'(data
: {
rank
: string
;
user
: string
;
}[]) => Promise
<{
rank
: string
;
user
: string
;
}[]> = ...
Inserts multiple permissions into the database.
Throws
If an error occurs while inserting the permissions.
POST.databaseEntries.tags
'Read the “', POST.databaseEntries.tags, '” section'(data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}[]) => Promise
<PageDataTagsInsertResponse
[]> = ...
Inserts multiple tags into the database.
Throws
If an error occurs while inserting the tags.
POST.databaseEntry
'Read the “', POST.databaseEntry, '” section'{
categories
: (category
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}) => Promise
<any
>;
diffTracking
: (diff
: {
diff
: null
| string
;
id
: string
;
pageContentStart
: string
;
pageId
: string
;
pageMetaData
: unknown
;
timestamp
: null
| Date
;
userId
: string
;
}) => Promise
<{
diff
: null
| string
;
id
: string
;
pageContentStart
: string
;
pageId
: string
;
pageMetaData
: unknown
;
timestamp
: null
| Date
;
userId
: string
;
}[]>;
folder
: (folder
: {
id
: string
;
name
: string
;
parent
: null
| string
;
}) => Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}[]>;
pageContent
: (pageContent
: {
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}) => Promise
<PageContentReturnId
[]>;
pages
: (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
;
}, pageContent
: CombinedInsertContent
) => Promise
<addDatabaseEntryInsertPage
>;
permissions
: (userId
: string
, rank
: string
) => Promise
<{
rank
: string
;
user
: string
;
}[]>;
tags
: (tag
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}) => Promise
<PageDataTagsInsertResponse
[]>;
} = ...
Inserts data into the database by Entry
POST.databaseEntry.categories
'Read the “', POST.databaseEntry.categories, '” section'(category
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}) => Promise
<any
> = ...
Inserts a new category into the database.
Throws
If an error occurs while inserting the category.
POST.databaseEntry.diffTracking
'Read the “', POST.databaseEntry.diffTracking, '” section'(diff
: {
diff
: null
| string
;
id
: string
;
pageContentStart
: string
;
pageId
: string
;
pageMetaData
: unknown
;
timestamp
: null
| Date
;
userId
: string
;
}) => Promise
<{
diff
: null
| string
;
id
: string
;
pageContentStart
: string
;
pageId
: string
;
pageMetaData
: unknown
;
timestamp
: null
| Date
;
userId
: string
;
}[]> = ...
Inserts a new diff tracking entry into the database.
Throws
If an error occurs while inserting the diff tracking entry.
POST.databaseEntry.folder
'Read the “', POST.databaseEntry.folder, '” section'(folder
: {
id
: string
;
name
: string
;
parent
: null
| string
;
}) => Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}[]> = ...
Inserts a new folder into the database.
Throws
If an error occurs while inserting the folder.
POST.databaseEntry.pageContent
'Read the “', POST.databaseEntry.pageContent, '” section'(pageContent
: {
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}) => Promise
<PageContentReturnId
[]> = ...
Inserts new page content into the database.
Throws
If an error occurs while inserting the page content.
POST.databaseEntry.pages
'Read the “', POST.databaseEntry.pages, '” section'(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
;
}, pageContent
: CombinedInsertContent
) => Promise
<addDatabaseEntryInsertPage
> = ...
Insert a new page into the database.
Throws
If an error occurs while inserting the page.
POST.databaseEntry.permissions
'Read the “', POST.databaseEntry.permissions, '” section'(userId
: string
, rank
: string
) => Promise
<{
rank
: string
;
user
: string
;
}[]> = ...
Inserts a new permission into the database.
Throws
If an error occurs while inserting the permission.
POST.databaseEntry.tags
'Read the “', POST.databaseEntry.tags, '” section'(tag
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}) => Promise
<PageDataTagsInsertResponse
[]> = ...
Inserts a new tag into the database.
Throws
If an error occurs while inserting the tag.
resetTokenBucket
'Read the “', resetTokenBucket, '” section'{
check
: (token
: string
) => Promise
<boolean
>;
delete
: (userId
: string
) => Promise
<void
>;
new
: (userId
: string
) => Promise
<any
>;
}
resetTokenBucket.check
'Read the “', resetTokenBucket.check, '” section'(token
: string
) => Promise
<boolean
> = ...
resetTokenBucket.delete
'Read the “', resetTokenBucket.delete, '” section'(userId
: string
) => Promise
<void
> = ...
resetTokenBucket.new
'Read the “', resetTokenBucket.new, '” section'(userId
: string
) => Promise
<any
> = ...
{
tokens
: {
delete
: (userId
: string
, tokenId
: string
) => Promise
<void
>;
get
: (userId
: string
) => Promise
<any
>;
new
: (userId
: string
, description
: string
) => Promise
<any
>;
verify
: (key
: string
) => Promise
<
| false
| {
key
: any
;
rank
: any
;
userId
: any
;
}>;
};
}
REST_API.tokens
'Read the “', REST_API.tokens, '” section'{
delete
: (userId
: string
, tokenId
: string
) => Promise
<void
>;
get
: (userId
: string
) => Promise
<any
>;
new
: (userId
: string
, description
: string
) => Promise
<any
>;
verify
: (key
: string
) => Promise
<
| false
| {
key
: any
;
rank
: any
;
userId
: any
;
}>;
} = ...
REST_API.tokens.delete
'Read the “', REST_API.tokens.delete, '” section'(userId
: string
, tokenId
: string
) => Promise
<void
> = ...
REST_API.tokens.get
'Read the “', REST_API.tokens.get, '” section'(userId
: string
) => Promise
<any
> = ...
REST_API.tokens.new
'Read the “', REST_API.tokens.new, '” section'(userId
: string
, description
: string
) => Promise
<any
> = ...
REST_API.tokens.verify
'Read the “', REST_API.tokens.verify, '” section'(key
: string
) => Promise
<
| false
| {
key
: any
;
rank
: any
;
userId
: any
;
}> = ...
testToken
'Read the “', testToken, '” section'(token
: string
) => any
{
categories
: (data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}) => Promise
<{
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}>;
folder
: (data
: {
id
: string
;
name
: string
;
parent
: null
| string
;
}) => Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}>;
page
: (data
: {
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
;
}) => Promise
<{
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
;
}>;
pageContent
: (data
: {
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}) => Promise
<{
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}>;
permissions
: (data
: {
rank
: string
;
user
: string
;
}) => Promise
<{
rank
: string
;
user
: string
;
}>;
siteConfig
: (data
: {
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}) => Promise
<{
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}>;
tags
: (data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}) => Promise
<{
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}>;
}
UPDATE.categories
'Read the “', UPDATE.categories, '” section'(data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}) => Promise
<{
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
parent
: null
| number
;
slug
: string
;
}> = ...
Updates a category in the database.
Throws
If an error occurs while updating the category.
UPDATE.folder
'Read the “', UPDATE.folder, '” section'(data
: {
id
: string
;
name
: string
;
parent
: null
| string
;
}) => Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}> = ...
UPDATE.page
'Read the “', UPDATE.page, '” section'(data
: {
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
;
}) => Promise
<{
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
;
}> = ...
Updates a page in the database.
Throws
If an error occurs while updating the page.
UPDATE.pageContent
'Read the “', UPDATE.pageContent, '” section'(data
: {
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}) => Promise
<{
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}> = ...
Updates a page content in the database.
Throws
If an error occurs while updating the page content.
UPDATE.permissions
'Read the “', UPDATE.permissions, '” section'(data
: {
rank
: string
;
user
: string
;
}) => Promise
<{
rank
: string
;
user
: string
;
}> = ...
Updates a permission in the database.
Throws
If an error occurs while updating the permission.
UPDATE.siteConfig
'Read the “', UPDATE.siteConfig, '” section'(data
: {
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}) => Promise
<{
defaultOgImage
: null
| string
;
description
: string
;
diffPerPage
: number
;
enableDiffs
: boolean
;
gridItems
: unknown
;
id
: number
;
loginPageBackground
: string
;
loginPageCustomImage
: null
| string
;
siteIcon
: null
| string
;
title
: string
;
}> = ...
Updates a site configuration in the database.
Throws
If an error occurs while updating the site configuration.
UPDATE.tags
'Read the “', UPDATE.tags, '” section'(data
: {
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}) => Promise
<{
description
: string
;
id
: number
;
meta
: unknown
;
name
: string
;
slug
: string
;
}> = ...
Updates a tag in the database.
Throws
If an error occurs while updating the tag.
verifyRank
'Read the “', verifyRank, '” section'(users
: {
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
id
: string
;
name
: string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}[], permissions
: {
rank
: string
;
user
: string
;
}[], rank
: string
) => SingleRank
[]
Properties
'Read the “', Properties, '” section'cacheModule
'Read the “', cacheModule, '” section'cacheModule: { CLEAR: { folderList: () => void; folderTree: () => void; latestVersion: () => void; page: { byId: (id: string) => void; bySlug: (slug: string) => void; }; pages: () => void; }; db: any; GET: { folder: (id: string) => Promise< | undefined | { id: string; name: string; parent: null | string; }>; folderList: () => Promise<FolderListCacheObject>; folderTree: () => Promise<FolderTreeCacheObject>; latestVersion: () => Promise<VersionCacheObject>; page: { byId: (id: string) => Promise<PageDataCacheObject>; bySlug: (slug: string) => Promise<PageDataCacheObject>; }; pageFolderTree: (includeDrafts?: boolean) => Promise<FolderTreeCacheObject>; pages: (includeDrafts?: boolean) => Promise<PageDataCacheObject[]>; siteConfig: () => Promise<SiteConfigCacheObject>; }; UPDATE: { folder: (data: { id: string; name: string; parent: null | string; }) => Promise<{ id: string; name: string; parent: null | string; }>; folderList: () => Promise<FolderListCacheObject>; folderTree: () => Promise<FolderTreeCacheObject>; latestVersion: () => Promise<VersionCacheObject>; page: { byId: (id: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; }; }) => Promise<PageDataCacheObject>; bySlug: (slug: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; }; }) => Promise<PageDataCacheObject>; }; siteConfig: (data: SiteConfig) => Promise<SiteConfigCacheObject>; };};
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:55
CLEAR: { folderList: () => void; folderTree: () => void; latestVersion: () => void; page: { byId: (id: string) => void; bySlug: (slug: string) => void; }; pages: () => void;};
CLEAR.folderList()
'Read the “', CLEAR.folderList(), '” section'folderList: () => void;
void
CLEAR.folderTree()
'Read the “', CLEAR.folderTree(), '” section'folderTree: () => void;
void
CLEAR.latestVersion()
'Read the “', CLEAR.latestVersion(), '” section'latestVersion: () => void;
void
CLEAR.page
'Read the “', CLEAR.page, '” section'page: { byId: (id: string) => void; bySlug: (slug: string) => void;};
CLEAR.page.byId()
'Read the “', CLEAR.page.byId(), '” section'byId: (id: string) => void;
Parameters
'Read the “', Parameters, '” section'string
void
CLEAR.page.bySlug()
'Read the “', CLEAR.page.bySlug(), '” section'bySlug: (slug: string) => void;
Parameters
'Read the “', Parameters, '” section'string
void
CLEAR.pages()
'Read the “', CLEAR.pages(), '” section'pages: () => void;
void
db: any;
GET: { folder: (id: string) => Promise< | undefined | { id: string; name: string; parent: null | string; }>; folderList: () => Promise<FolderListCacheObject>; folderTree: () => Promise<FolderTreeCacheObject>; latestVersion: () => Promise<VersionCacheObject>; page: { byId: (id: string) => Promise<PageDataCacheObject>; bySlug: (slug: string) => Promise<PageDataCacheObject>; }; pageFolderTree: (includeDrafts?: boolean) => Promise<FolderTreeCacheObject>; pages: (includeDrafts?: boolean) => Promise<PageDataCacheObject[]>; siteConfig: () => Promise<SiteConfigCacheObject>;};
GET.folder()
'Read the “', GET.folder(), '” section'folder: (id: string) => Promise< | undefined | { id: string; name: string; parent: null | string;}>;
Parameters
'Read the “', Parameters, '” section'string
Promise
<
| undefined
| {
id
: string
;
name
: string
;
parent
: null
| string
;
}>
GET.folderList()
'Read the “', GET.folderList(), '” section'folderList: () => Promise<FolderListCacheObject>;
Promise
<FolderListCacheObject
>
GET.folderTree()
'Read the “', GET.folderTree(), '” section'folderTree: () => Promise<FolderTreeCacheObject>;
Promise
<FolderTreeCacheObject
>
GET.latestVersion()
'Read the “', GET.latestVersion(), '” section'latestVersion: () => Promise<VersionCacheObject>;
Promise
<VersionCacheObject
>
page: { byId: (id: string) => Promise<PageDataCacheObject>; bySlug: (slug: string) => Promise<PageDataCacheObject>;};
GET.page.byId()
'Read the “', GET.page.byId(), '” section'byId: (id: string) => Promise<PageDataCacheObject>;
Parameters
'Read the “', Parameters, '” section'string
Promise
<PageDataCacheObject
>
GET.page.bySlug()
'Read the “', GET.page.bySlug(), '” section'bySlug: (slug: string) => Promise<PageDataCacheObject>;
Parameters
'Read the “', Parameters, '” section'string
Promise
<PageDataCacheObject
>
GET.pageFolderTree()
'Read the “', GET.pageFolderTree(), '” section'pageFolderTree: (includeDrafts?: boolean) => Promise<FolderTreeCacheObject>;
Parameters
'Read the “', Parameters, '” section'includeDrafts?
'Read the “', includeDrafts?, '” section'boolean
Promise
<FolderTreeCacheObject
>
GET.pages()
'Read the “', GET.pages(), '” section'pages: (includeDrafts?: boolean) => Promise<PageDataCacheObject[]>;
Parameters
'Read the “', Parameters, '” section'includeDrafts?
'Read the “', includeDrafts?, '” section'boolean
Promise
<PageDataCacheObject
[]>
GET.siteConfig()
'Read the “', GET.siteConfig(), '” section'siteConfig: () => Promise<SiteConfigCacheObject>;
Promise
<SiteConfigCacheObject
>
UPDATE: { folder: (data: { id: string; name: string; parent: null | string; }) => Promise<{ id: string; name: string; parent: null | string; }>; folderList: () => Promise<FolderListCacheObject>; folderTree: () => Promise<FolderTreeCacheObject>; latestVersion: () => Promise<VersionCacheObject>; page: { byId: (id: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; }; }) => Promise<PageDataCacheObject>; bySlug: (slug: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; }; }) => Promise<PageDataCacheObject>; }; siteConfig: (data: SiteConfig) => Promise<SiteConfigCacheObject>;};
UPDATE.folder()
'Read the “', UPDATE.folder(), '” section'folder: (data: { id: string; name: string; parent: null | string; }) => Promise<{ id: string; name: string; parent: null | string;}>;
Parameters
'Read the “', Parameters, '” section'string
string
null
| string
Promise
<{
id
: string
;
name
: string
;
parent
: null
| string
;
}>
UPDATE.folderList()
'Read the “', UPDATE.folderList(), '” section'folderList: () => Promise<FolderListCacheObject>;
Promise
<FolderListCacheObject
>
UPDATE.folderTree()
'Read the “', UPDATE.folderTree(), '” section'folderTree: () => Promise<FolderTreeCacheObject>;
Promise
<FolderTreeCacheObject
>
UPDATE.latestVersion()
'Read the “', UPDATE.latestVersion(), '” section'latestVersion: () => Promise<VersionCacheObject>;
Promise
<VersionCacheObject
>
UPDATE.page
'Read the “', UPDATE.page, '” section'page: { byId: (id: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; }; }) => Promise<PageDataCacheObject>; bySlug: (slug: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; }; }) => Promise<PageDataCacheObject>;};
UPDATE.page.byId()
'Read the “', UPDATE.page.byId(), '” section'byId: (id: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; };}) => Promise<PageDataCacheObject>;
Parameters
'Read the “', Parameters, '” section'string
pageContent
'Read the “', pageContent, '” section'{
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}
pageContent.content
'Read the “', pageContent.content, '” section'null
| string
pageContent.contentId
'Read the “', pageContent.contentId, '” section'string
pageContent.contentLang
'Read the “', pageContent.contentLang, '” section'string
pageContent.id
'Read the “', pageContent.id, '” section'string
{
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
;
}
pageData.authorId
'Read the “', pageData.authorId, '” section'null
| string
pageData.categories
'Read the “', pageData.categories, '” section'unknown
pageData.contentLang
'Read the “', pageData.contentLang, '” section'string
pageData.contributorIds
'Read the “', pageData.contributorIds, '” section'unknown
pageData.description
'Read the “', pageData.description, '” section'string
pageData.draft
'Read the “', pageData.draft, '” section'null
| boolean
pageData.heroImage
'Read the “', pageData.heroImage, '” section'string
pageData.id
'Read the “', pageData.id, '” section'string
pageData.package
'Read the “', pageData.package, '” section'string
pageData.parentFolder
'Read the “', pageData.parentFolder, '” section'null
| string
pageData.publishedAt
'Read the “', pageData.publishedAt, '” section'Date
pageData.showAuthor
'Read the “', pageData.showAuthor, '” section'null
| boolean
pageData.showContributors
'Read the “', pageData.showContributors, '” section'null
| boolean
pageData.showOnNav
'Read the “', pageData.showOnNav, '” section'boolean
pageData.slug
'Read the “', pageData.slug, '” section'string
pageData.tags
'Read the “', pageData.tags, '” section'unknown
pageData.title
'Read the “', pageData.title, '” section'string
pageData.updatedAt
'Read the “', pageData.updatedAt, '” section'null
| Date
Promise
<PageDataCacheObject
>
UPDATE.page.bySlug()
'Read the “', UPDATE.page.bySlug(), '” section'bySlug: (slug: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; };}) => Promise<PageDataCacheObject>;
Parameters
'Read the “', Parameters, '” section'string
pageContent
'Read the “', pageContent, '” section'{
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}
pageContent.content
'Read the “', pageContent.content, '” section'null
| string
pageContent.contentId
'Read the “', pageContent.contentId, '” section'string
pageContent.contentLang
'Read the “', pageContent.contentLang, '” section'string
pageContent.id
'Read the “', pageContent.id, '” section'string
{
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
;
}
pageData.authorId
'Read the “', pageData.authorId, '” section'null
| string
pageData.categories
'Read the “', pageData.categories, '” section'unknown
pageData.contentLang
'Read the “', pageData.contentLang, '” section'string
pageData.contributorIds
'Read the “', pageData.contributorIds, '” section'unknown
pageData.description
'Read the “', pageData.description, '” section'string
pageData.draft
'Read the “', pageData.draft, '” section'null
| boolean
pageData.heroImage
'Read the “', pageData.heroImage, '” section'string
pageData.id
'Read the “', pageData.id, '” section'string
pageData.package
'Read the “', pageData.package, '” section'string
pageData.parentFolder
'Read the “', pageData.parentFolder, '” section'null
| string
pageData.publishedAt
'Read the “', pageData.publishedAt, '” section'Date
pageData.showAuthor
'Read the “', pageData.showAuthor, '” section'null
| boolean
pageData.showContributors
'Read the “', pageData.showContributors, '” section'null
| boolean
pageData.showOnNav
'Read the “', pageData.showOnNav, '” section'boolean
pageData.slug
'Read the “', pageData.slug, '” section'string
pageData.tags
'Read the “', pageData.tags, '” section'unknown
pageData.title
'Read the “', pageData.title, '” section'string
pageData.updatedAt
'Read the “', pageData.updatedAt, '” section'null
| Date
Promise
<PageDataCacheObject
>
UPDATE.siteConfig()
'Read the “', UPDATE.siteConfig(), '” section'siteConfig: (data: SiteConfig) => Promise<SiteConfigCacheObject>;
Parameters
'Read the “', Parameters, '” section'Promise
<SiteConfigCacheObject
>
clearAllPages()
'Read the “', clearAllPages(), '” section'clearAllPages(): void
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:700
Clear all pages from the cache
void
void
clearFolderList()
'Read the “', clearFolderList(), '” section'clearFolderList(): void
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:306
void
clearFolderTree()
'Read the “', clearFolderTree(), '” section'clearFolderTree(): void
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:471
Clears the folder tree from the cache.
void
clearPageById()
'Read the “', clearPageById(), '” section'clearPageById(id: string): void
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:650
Clear a page from the cache by its ID
Parameters
'Read the “', Parameters, '” section'string
The ID of the page
void
void
clearPageBySlug()
'Read the “', clearPageBySlug(), '” section'clearPageBySlug(slug: string): void
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:670
Clear a page from the cache by its slug and package
Parameters
'Read the “', Parameters, '” section'string
The slug of the page
void
void
clearVersion()
'Read the “', clearVersion(), '” section'clearVersion(): void
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:548
Clears the current version from the cache.
This method removes all entries associated with the current version from the cache, effectively resetting it.
void
getAllPages()
'Read the “', getAllPages(), '” section'getAllPages(includeDrafts: boolean): Promise<PageDataCacheObject[]>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:725
Retrieves all pages from the cache or the database.
Parameters
'Read the “', Parameters, '” section'includeDrafts
'Read the “', includeDrafts, '” section'boolean
= false
Promise
<PageDataCacheObject
[]>
A promise that resolves to an array of page data cache objects.
If the cache is empty and could not be updated, or if the cache is expired and could not be updated.
- If caching is disabled, the data is retrieved directly from the database.
- If the cache is empty, the data is retrieved from the database and stored in the cache.
- If the cache contains data, it checks for expired entries and updates them from the database if necessary.
getFolderList()
'Read the “', getFolderList(), '” section'getFolderList(): Promise<FolderListCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:258
Promise
<FolderListCacheObject
>
getFolderTree()
'Read the “', getFolderTree(), '” section'getFolderTree(): Promise<FolderTreeCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:325
Retrieves the folder tree from the cache or the database.
Promise
<FolderTreeCacheObject
>
A promise that resolves to the folder tree.
If the folder tree is not found in the database or if there is an error fetching the folder tree.
getPageById()
'Read the “', getPageById(), '” section'getPageById(id: string): Promise<PageDataCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:785
Retrieves a page by its ID, either from the cache or the database.
Parameters
'Read the “', Parameters, '” section'string
The ID of the page to retrieve.
Promise
<PageDataCacheObject
>
- A promise that resolves to the page data.
- Throws an error if the page is not found in the database or if there is an error fetching the page.
getPageBySlug()
'Read the “', getPageBySlug(), '” section'getPageBySlug(slug: string): Promise<PageDataCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:832
Retrieves a page by its slug from the cache or database.
Parameters
'Read the “', Parameters, '” section'string
The slug of the page to retrieve.
Promise
<PageDataCacheObject
>
A promise that resolves to the page data.
If the page is not found in the database or if there is an error fetching the page.
getPageFolderTree()
'Read the “', getPageFolderTree(), '” section'getPageFolderTree(includeDrafts: boolean): Promise<FolderTreeCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:363
Retrieves the folder tree from the cache or the database.
Parameters
'Read the “', Parameters, '” section'includeDrafts
'Read the “', includeDrafts, '” section'boolean
= false
Promise
<FolderTreeCacheObject
>
A promise that resolves to the folder tree.
If the folder tree is not found in the database or if there is an error fetching the folder tree.
getSiteConfig()
'Read the “', getSiteConfig(), '” section'getSiteConfig(): Promise<SiteConfigCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:573
Retrieves the site configuration from the cache or database.
If caching is disabled, it fetches the site configuration directly from the database. If caching is enabled, it first checks the cache for the site configuration. If the cache is expired or not found, it fetches the site configuration from the database, updates the cache, and returns the configuration.
Promise
<SiteConfigCacheObject
>
A promise that resolves to the site configuration object.
If the site configuration is not found in the database.
getVersion()
'Read the “', getVersion(), '” section'getVersion(): Promise<VersionCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:491
Retrieves the version information from the cache or fetches the latest version from NPM if the cache is disabled or expired.
Promise
<VersionCacheObject
>
A promise that resolves to the version information object.
updateFolderList()
'Read the “', updateFolderList(), '” section'updateFolderList(): Promise<FolderListCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:290
Promise
<FolderListCacheObject
>
updateFolderTree()
'Read the “', updateFolderTree(), '” section'updateFolderTree(): Promise<FolderTreeCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:452
Updates the folder tree in the cache and database.
Promise
<FolderTreeCacheObject
>
A promise that resolves to the updated folder tree.
If there is an error updating the folder tree.
updatePageById()
'Read the “', updatePageById(), '” section'updatePageById(id: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; };}): Promise<PageDataCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:882
Updates a page by its ID with the provided data.
Parameters
'Read the “', Parameters, '” section'string
The ID of the page to update.
An object containing the page data and page content to update.
pageContent
'Read the “', pageContent, '” section'{
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}
The content of the page to update.
pageContent.content
'Read the “', pageContent.content, '” section'null
| string
pageContent.contentId
'Read the “', pageContent.contentId, '” section'string
pageContent.contentLang
'Read the “', pageContent.contentLang, '” section'string
pageContent.id
'Read the “', pageContent.id, '” section'string
{
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
;
}
The data of the page to update.
pageData.authorId
'Read the “', pageData.authorId, '” section'null
| string
pageData.categories
'Read the “', pageData.categories, '” section'unknown
pageData.contentLang
'Read the “', pageData.contentLang, '” section'string
pageData.contributorIds
'Read the “', pageData.contributorIds, '” section'unknown
pageData.description
'Read the “', pageData.description, '” section'string
pageData.draft
'Read the “', pageData.draft, '” section'null
| boolean
pageData.heroImage
'Read the “', pageData.heroImage, '” section'string
pageData.id
'Read the “', pageData.id, '” section'string
pageData.package
'Read the “', pageData.package, '” section'string
pageData.parentFolder
'Read the “', pageData.parentFolder, '” section'null
| string
pageData.publishedAt
'Read the “', pageData.publishedAt, '” section'Date
pageData.showAuthor
'Read the “', pageData.showAuthor, '” section'null
| boolean
pageData.showContributors
'Read the “', pageData.showContributors, '” section'null
| boolean
pageData.showOnNav
'Read the “', pageData.showOnNav, '” section'boolean
pageData.slug
'Read the “', pageData.slug, '” section'string
pageData.tags
'Read the “', pageData.tags, '” section'unknown
pageData.title
'Read the “', pageData.title, '” section'string
pageData.updatedAt
'Read the “', pageData.updatedAt, '” section'null
| Date
Promise
<PageDataCacheObject
>
A promise that resolves to the updated page data cache object.
If the page is not found in the database or if there is an error updating the page.
updatePageBySlug()
'Read the “', updatePageBySlug(), '” section'updatePageBySlug(slug: string, data: { pageContent: { content: null | string; contentId: string; contentLang: string; id: string; }; 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; };}): Promise<PageDataCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:940
Updates a page by its slug and package name.
Parameters
'Read the “', Parameters, '” section'string
The slug of the page to update.
An object containing the page data and page content to update.
pageContent
'Read the “', pageContent, '” section'{
content
: null
| string
;
contentId
: string
;
contentLang
: string
;
id
: string
;
}
The content of the page to update.
pageContent.content
'Read the “', pageContent.content, '” section'null
| string
pageContent.contentId
'Read the “', pageContent.contentId, '” section'string
pageContent.contentLang
'Read the “', pageContent.contentLang, '” section'string
pageContent.id
'Read the “', pageContent.id, '” section'string
{
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
;
}
The data of the page to update.
pageData.authorId
'Read the “', pageData.authorId, '” section'null
| string
pageData.categories
'Read the “', pageData.categories, '” section'unknown
pageData.contentLang
'Read the “', pageData.contentLang, '” section'string
pageData.contributorIds
'Read the “', pageData.contributorIds, '” section'unknown
pageData.description
'Read the “', pageData.description, '” section'string
pageData.draft
'Read the “', pageData.draft, '” section'null
| boolean
pageData.heroImage
'Read the “', pageData.heroImage, '” section'string
pageData.id
'Read the “', pageData.id, '” section'string
pageData.package
'Read the “', pageData.package, '” section'string
pageData.parentFolder
'Read the “', pageData.parentFolder, '” section'null
| string
pageData.publishedAt
'Read the “', pageData.publishedAt, '” section'Date
pageData.showAuthor
'Read the “', pageData.showAuthor, '” section'null
| boolean
pageData.showContributors
'Read the “', pageData.showContributors, '” section'null
| boolean
pageData.showOnNav
'Read the “', pageData.showOnNav, '” section'boolean
pageData.slug
'Read the “', pageData.slug, '” section'string
pageData.tags
'Read the “', pageData.tags, '” section'unknown
pageData.title
'Read the “', pageData.title, '” section'string
pageData.updatedAt
'Read the “', pageData.updatedAt, '” section'null
| Date
Promise
<PageDataCacheObject
>
A promise that resolves to the updated page data cache object.
If the page is not found in the cache or database, or if there is an error updating the page.
updateSiteConfig()
'Read the “', updateSiteConfig(), '” section'updateSiteConfig(data: SiteConfig): Promise<SiteConfigCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:614
Updates the site configuration in the database and cache.
Parameters
'Read the “', Parameters, '” section'The new site configuration data to be updated.
Promise
<SiteConfigCacheObject
>
A promise that resolves to the updated site configuration cache object.
If the updated data could not be retrieved from the database.
updateVersion()
'Read the “', updateVersion(), '” section'updateVersion(): Promise<VersionCacheObject>
Defined in: studiocms/packages/studiocms/src/sdk/StudioCMSVirtualCache.ts:524
Updates the version cache with the latest version from NPM.
Promise
<VersionCacheObject
>
A promise that resolves to the new version cache object.
If there is an issue retrieving the latest version from NPM.
References
'Read the “', References, '” section'Renames and re-exports StudioCMSVirtualCache