import PQueue from 'p-queue'; import { ContentType, Component } from 'contensis-core-api'; import ModelGenerationService from './ModelGenerationService'; import { MigrateRequest } from '../models/Operations'; import ContensisRepository from '../repositories/ContensisRepository'; declare class MigratortronBaseService { sourceRepo: ContensisRepository; private syncRepos; targetRepos: { [projectId: string]: ContensisRepository; }; ignoreErrors: boolean; isPreview: boolean; isHydrated: boolean; modeling: ModelGenerationService; noCache: boolean; opName: string; payload: MigrateRequest; queue: PQueue; readOnlyFields: boolean; transformGuids: boolean; zenQL?: string; errors: { [id: string]: MappedError[]; }; get errorCount(): number; get source(): ContensisRepository; get sync(): { [projectId: string]: ContensisRepository; }; get targets(): { [projectId: string]: ContensisRepository; }; constructor(payload: MigrateRequest, preview: boolean); /** * Get the project, components and content types from Management API * for all source and target repos, generating models and finding dependencies. * The returned lists are added to each repo and are not filtered by supplied ids as * the data will be required for comparison operations in model generation * and entries migration services which we also instantiate here and attach to each repo * effectively extending the usable scope of the repos. * @param ids ids of content types and/or components to filter the return values by * @param withModels setting this to false will not fetch and generate content models for target repos * @returns object containing arrays of components and contentTypes optionally filtered by supplied ids */ HydrateContensisRepositories: (assets?: (string | ContentType | Component)[], withModels?: boolean) => Promise<{ components: Component[]; contentTypes: ContentType[]; } | undefined>; /** * Get all content types and components so we can get a complete picture * of the project * @param assets */ GetSourceRepo: (resourceIds?: string[], assets?: (ContentType | Component)[]) => Promise; GetTargetRepos: (withModels?: boolean) => Promise; AddError: (id: string, error: AppError | undefined, arr?: { [id: string]: MappedError[]; }) => MappedError; } export default MigratortronBaseService;