import { Component, ContentType } from 'contensis-core-api'; import { Entry, TagGroup } from 'contensis-management-api'; import { AssetEntryBuilder } from './AssetEntryBuilder'; import { IEntryFields } from './EntryFieldBuilder'; import { MigrateEntryModel, MigrateModelsEntityResult, MigrateStatus, Model, NulledEntry } from '../models'; import { EntryDependencyMeta, EntryDependencyOrigin } from '../models/EntryDependencies'; import ContensisRepository from '../repositories/ContensisRepository'; import ContentTypeHelper from '../util/content-type/ContentTypeHelper'; /** * Build a complete entry specifically for the target repository, providing * context of source and target repositories we can check each field in the * given source entry for any dependencies and set a two-pass loading status * if any dependencies do not exist * * Output the entry as JSON for loading into the Management API using the `toJSON` method */ export declare class EntryBuilder implements MigrateEntryModel { contensis: ContensisRepository; source: ContensisRepository; contentType?: ContentType; sourceContentType?: ContentType; contentTypeHelper: ContentTypeHelper; contentTypes: ContentType[]; components: Component[]; tagGroups: TagGroup[]; dependencies: EntryDependencyMeta[]; dependencyOf: EntryDependencyOrigin[]; existing?: Entry; model?: Model; sourceEntry: Entry; fields: IEntryFields; status: MigrateStatus; result?: keyof MigrateModelsEntityResult; error?: MappedError; diff?: string; unmappedFields: IEntryFields; /** log any issues with building the entry */ warnings: string[]; private sysId?; protected isStubContentType: boolean; private _requireSecondPass; /** * a good indicator that the entry is being created for a * default entry in a model migration */ get builtContentType(): import("./ContentTypeBuilder").ContentTypeBuilder | undefined; get contentTypeId(): string | undefined; get entryTitle(): any; get id(): string; set id(val: string); get isPublished(): boolean | undefined; get originalId(): string; get requireSecondPass(): boolean; /** * We might be creating an entry for a content type that * does not yet exist but is part of this migration instance */ get willContentTypeExist(): boolean | undefined; constructor(contensis: ContensisRepository, source: ContensisRepository, sourceEntry: Entry); /** * Assert if the EntryBuilder instance is of AssetEntryBuilder type */ isAsset: () => this is AssetEntryBuilder; init: () => void; /** * Iterate over built entry fields and return a the entry as JSON * @returns entry as JSON */ toJSON(opts?: { firstPass: boolean; }): Entry; /** * Check we have the content models available to process this entry */ validate: () => void; /** * Iterate all fields in the content type taking the values from the source entry * adding each field to the built entry fields */ build: () => void; /** * Create a new sys object for the entry based on the source sys */ buildSysObject: () => { isPublished: boolean; availableLanguages?: string[] | undefined; contentTypeId?: string | undefined; dataFormat?: string | undefined; id?: string | undefined; language?: string | undefined; owner?: string | undefined; metadata?: { [key: string]: any; } | undefined; projectId?: string | undefined; slug?: string | undefined; translationState?: string | undefined; unavailableLanguages?: string[] | undefined; uri?: string | undefined; version?: import("contensis-core-api").VersionInfo | undefined; workflow?: import("contensis-management-api").Workflow | undefined; }; /** * Add sys.metadata fingerprint to built entries */ mapEntryMetadata: (entry: Entry, source?: ContensisRepository) => void; shouldPublish: (source: Entry, target: Entry) => boolean | undefined; /** * Check the entry for update status */ checkStatus: () => MigrateStatus; /** * Set Contensis controlled fields to null before doing a diff as these will always be different */ nullFields(e: Entry): NulledEntry; }