@vtex/client-cms
Version:
A client to fetch data from VTEX CMS.
72 lines (61 loc) • 1.23 kB
text/typescript
export interface Options {
tenant: string
builder?: string
workspace?: string
host?: string
}
export interface Section {
name: string
data: unknown
}
export type ContentData = {
id: string
name: string
status: string
type: string
sections: Section[]
children?: string[]
parent?: string
} & LocatorOptions &
Record<string, unknown>
export interface ContentType {
id: string
name: string
configurationSchemaSets: ConfigurationSchemaSet[]
}
export interface ConfigurationSchemaSet {
name: string
configurations: SchemaConfiguration[]
}
export interface SchemaConfiguration {
name: string
schema: unknown
}
export interface ContentTypes {
contentTypes: ContentType[]
}
export type ContentPage = {
hasNextPage: boolean
totalItems: number
data: ContentData[]
} & Record<string, unknown>
export type LocatorOptions =
| {
releaseId: string
versionId?: never
}
| {
releaseId?: never
versionId: string
}
export type Locator = {
documentId: string
contentType: string
} & LocatorOptions
export type Pagination = {
page: number
perPage: number
}
export interface ContentTypeOptions extends Pagination {
filters: Record<string, string>
}