import type { CrudStoreItemsModel } from '../stores/types/CrudStoreModel'; export interface Redirect { id: string; from: string; to: Link; created: Date; modified: Date; startDate: Date; endDate: Date | null; hasDynamicValueTags: boolean; isPermanent: boolean; toComposedUrl: string; description?: string; } export interface RedirectInfo { pageId?: string; pageTitle?: string; url: string; displayUrl: string; } interface Link { text?: string; noFollow: boolean; targetIsBlank: boolean; url?: string; page?: string; } export interface ApiResponse { $type: string; } export interface Page extends ApiResponse { id: string; title: string; language: string; translationSetId: string; url: string; path: string; // should be deprecated, use .url instead name: string; itemName: string; parentId: string | null; isChild: boolean; allowNew: boolean; created: string; createdBy: string; modified: string; modifiedBy: string; children: Page[]; } export interface VersionedPage extends Page { versions: Version[]; } export interface PublishedPage { pageId: string; publishedVersionId: string; } export interface Folder { pageId: string; publishedVersionId: string; } export interface Schema { properties: { [key: string]: SchemaProperty }; oneOf: SchemaItem[]; } export interface SchemaItem { type: string; title?: string; properties: { [key: string]: SchemaProperty }; isPublishable?: boolean; isSortable: boolean; isSingleton?: boolean; isTranslatable?: boolean; preventCreate?: boolean; preventDelete?: boolean; preventDepublish?: boolean; preventMove?: boolean; preventRename?: boolean; order: number; sortColumn: string; } export interface NamedSchemaItems { [key: string]: SchemaItem; } export interface SchemaProperty { type?: string; format?: string; title?: string; description?: string; order: number; maxLength: number; required?: boolean; isHidden?: boolean; isDisplayTitle?: boolean; isReadOnly?: boolean; enum?: { [key: string]: any }; items?: { [key: string]: any }; options?: { [key: string]: any }[]; messages?: { [key: string]: string }; placeholder?: string; default?: string; } export interface SchemaImage { id: SchemaProperty; variantId?: SchemaProperty; } export interface Enum { key: string; value: number; displayName?: string; } export interface BaseCreatePagePayload { [key: string]: string; name: string; parentId: string; language: string; } export interface CreatePagePayload extends BaseCreatePagePayload { version: string; } export interface CreatePageFromCopyPayload extends BaseCreatePagePayload { sourceVersionId: string; } export interface CreateTranslatedPagePayload extends BaseCreatePagePayload { sourceVersionId: string; translationsSetId: string; } export interface PagePayload { page: Page; } export interface MovePagePayload extends PagePayload { newParentId: string; createRedirect: boolean; } export interface RenamePagePayload extends PagePayload { name: string; createRedirect: boolean; } export interface Version extends ApiResponse { id: string; name: string | null; metaTitle: string; metaDescription: string | null; isPublishedOrSchedule: boolean; metaFollow: boolean; metaIndex: boolean; showAsOneSection: boolean; showPostFix: boolean; created: string; modified: string; publishDate: string | null; depublishDate: string | null; page: Page; pageId: string; } export interface ScheduleTimeObject { hours: number; minutes: number; } export interface RecurringSchedule { id: string; cmsPageVersionId: string; recurrenceStartTime: ScheduleTimeObject; recurrenceEndTime: ScheduleTimeObject; selectedDay: string; } export interface Asset { $type: string; alt: string | null; altTranslations: AltTranslation[]; translationSetId?: string | null; language?: string | null; blobstoreUrl: string; contentType: string; created: string; createdOn: string; height: number; id: string; imageUrl: string; isDeleted: boolean; modified: string; previewData: string; size: number; sourceId: string; title: string; width: number; centerPoint?: CenterPoint; variants: AssetVariant[]; hasDynamicValueTags?: boolean; tagIds: AssetTag[]; } export interface AltTranslation { $type: string; language: string; alt: string | null; } export interface CenterPoint { $type: string; x: number; y: number; } export interface AssetVariant { $type: string; id: string; name: string; fixedAspectRatio: number; isUnTouched: boolean; isDefaultVariant: boolean; crop: { $type: string; x: number; y: number; width: number; height: number; }; } export interface AssetTag { id: string; title: string; } export interface AddAssetTagsRequest { assetIds: string[]; tagIds: string[]; } export enum AssetTypeFilter { All, Image, PDF, Zip, Other } export enum AssetSortField { DateCreated, DateModified, Title } export enum AssetSortOrder { Ascending, Descending } export interface DynamicValueTag { $type: string; created: string; default: string; description: string; hasDynamicValueTags: boolean; id: string; modified: string; text: string; } export interface SaveCrudItemPayload { id: string; item: CrudStoreItemsModel; } export interface CreateCrudItemPayload { item: CrudStoreItemsModel; } export interface UpdateCrudItemPayload { id: string; item: CrudStoreItemsModel; } export interface CopyCrudItemPayload { id: string; } export interface PublishCrudItemPayload { id: string; item: CrudStoreItemsModel; action: 'publish' | 'depublish'; } export interface DeleteCrudItemPayload { id: string; } export interface SearchCrudItemPayload { query?: string; languageFilter?: string; page?: number; sort?: string; disableLoading?: boolean; } export interface SearchResponse { $type: string; items: T[]; currentPage: number; totalPages: number; fromRecord: number; toRecord: number; totalQueryItems: number; hasMoreResults: boolean; totalItemsEntireSet: number; } export interface PageReference { pageVersionId: string; path: string; } export interface PageReferenceInfo { $type: string; isSafeToDepublishOrDelete: boolean; pageReferences: PageReference[]; }