@vtex/client-cms
Version:
A client to fetch data from VTEX CMS.
59 lines (58 loc) • 1.39 kB
TypeScript
export interface Options {
tenant: string;
builder?: string;
workspace?: string;
host?: string;
}
export interface Section {
name: string;
data: unknown;
}
export declare 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 declare type ContentPage = {
hasNextPage: boolean;
totalItems: number;
data: ContentData[];
} & Record<string, unknown>;
export declare type LocatorOptions = {
releaseId: string;
versionId?: never;
} | {
releaseId?: never;
versionId: string;
};
export declare type Locator = {
documentId: string;
contentType: string;
} & LocatorOptions;
export declare type Pagination = {
page: number;
perPage: number;
};
export interface ContentTypeOptions extends Pagination {
filters: Record<string, string>;
}