import { Component, ContentType } from 'contensis-core-api'; import { ContentTypeFields } from './ContentTypeFieldBuilder'; import { IContensisContext, MigrateContentModel, MigrateStatus, ModelDependencies } from '../models'; import { FormContentType, FormProperties } from '../models/FormContentTypeManagement'; import ContensisRepository from '../repositories/ContensisRepository'; /** * Build a complete content type specifically for the target repository, providing * context of source and target repositories we can check each field in the * given source content type for any dependencies and set a two-pass loading status * if any dependencies do not exist * * Output the content type as JSON for loading into the Management API using the `toJSON` method */ export declare class ContentTypeBuilder implements MigrateContentModel { #private; contensis: ContensisRepository; source: ContensisRepository; resource: T; context: IContensisContext; confirmationRules: FormProperties['confirmationRules']; defaultParentNodeId?: string; dependencies: ModelDependencies['dependencies']; dependencyOf: ModelDependencies['dependencyOf']; existing?: T; fields: ContentTypeFields; status: MigrateStatus; error?: MappedError; diff?: string; /** * [defaultId, originalId] */ private _defaults; /** * [rejectedId, existingId] * when we have opted to use an existing default and we might not * need to migrate the default entry after all */ private _rejectedDefaults; private _requireSecondPass; /** * returns [defaultId, originalId][] * a list of defaults to migrate with the resource model */ get defaults(): [string, string][]; /** * returns [rejectedId, existingId][] * when we have opted to use an existing default and we might not * neeed to migrate the default entry after all */ get rejectedDefaults(): [string, string][]; get requireSecondPass(): boolean; private shouldPublish; constructor(contensis: ContensisRepository, source: ContensisRepository, resource: T, { dependencies, dependencyOf }: ModelDependencies); isContentType: () => this is ContentTypeBuilder; get id(): string; get versionNo(): string | undefined; /** * Iterate over built content type fields and return a the content type as JSON * @returns content type as JSON */ toJSON: (opts?: { firstPass: boolean; }) => T; /** * Check we have the available requisites to process this content type */ /** * Iterate all fields in the content type taking the values from the source content type * adding each field to the built content type fields */ build: () => void; /** * Check the resource for update status */ checkStatus: () => MigrateStatus; }