UNPKG

contentful-management

Version:
48 lines (47 loc) 1.76 kB
import type { Except } from 'type-fest'; import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, ExoMetadataProps, ExoQueryFilters, Link } from '../common-types'; import type { ComponentTypeContentProperty, ComponentTypeDesignProperty, ComponentTypeSlotDefinition, ComponentTypeViewport, DataAssemblyLink, TreeNode } from './component-type'; export type TemplateSys = { id: string; type: 'Template'; 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 TemplateProps = { sys: TemplateSys; name: string; description: string; viewports: ComponentTypeViewport[]; contentProperties: ComponentTypeContentProperty[]; designProperties: ComponentTypeDesignProperty[]; componentTree?: TreeNode[]; slots?: ComponentTypeSlotDefinition[]; metadata?: ExoMetadataProps; dataAssemblies?: DataAssemblyLink[]; }; export type CreateTemplateProps = Except<TemplateProps, 'sys'>; export type UpsertTemplateProps = Except<TemplateProps, 'sys'> & { sys: { id: string; type: 'Template'; version?: number; }; }; export type TemplateQueryOptions = CursorPaginationParams & ExoQueryFilters & { order?: string; }; export type TemplateCollection = ExoCursorPaginatedCollectionProp<TemplateProps>;