UNPKG

contentful-management

Version:
51 lines (50 loc) • 2.03 kB
import type { Except } from 'type-fest'; import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, ExoMetadataProps, ExoQueryFilters, Link } from '../common-types'; import type { ComponentSlotDefinition, ComponentTypeContentProperty, ComponentTypeDesignProperty, DataAssemblyLink, TreeNodeV2 } from './component-type'; export type ExperienceTemplateSys = { id: string; type: 'ExperienceTemplate'; version: number; space: Link<'Space'>; environment: Link<'Environment'>; fieldStatus?: Record<string, Record<string, 'draft' | 'published' | 'changed'>>; publishedAt?: string; publishedVersion?: number; publishedCounter?: number; firstPublishedAt?: string; publishedBy?: Link<'User'> | Link<'AppDefinition'>; variant?: string; variantType?: string; variantDimension?: string; createdAt: string; createdBy: Link<'User'>; updatedAt: string; updatedBy: Link<'User'>; }; export type ExperienceTemplateProps = { sys: ExperienceTemplateSys; name: string; description: string; contentProperties: ComponentTypeContentProperty[]; designProperties: ComponentTypeDesignProperty[]; /** * `null` marks a coded template (no tree); `[]` is a composed template with an empty tree. * The Content Management API requires this field on create and update, so always send it. */ componentTree?: TreeNodeV2[] | null; slots?: ComponentSlotDefinition[]; metadata?: ExoMetadataProps; dataAssemblies?: DataAssemblyLink[]; }; export type CreateExperienceTemplateProps = Except<ExperienceTemplateProps, 'sys'>; export type UpsertExperienceTemplateProps = Except<ExperienceTemplateProps, 'sys'> & { sys: { id: string; type: 'ExperienceTemplate'; version?: number; }; }; export type ExperienceTemplateQueryOptions = CursorPaginationParams & ExoQueryFilters & { order?: string; }; export type ExperienceTemplateCollection = ExoCursorPaginatedCollectionProp<ExperienceTemplateProps>;