import { MigrationClient } from '../migration-client'; import { SchemaDiffOutput, RecordWithCollection, Snapshot, StrictSchemaDiffOutput } from './interfaces'; import { ConfigService, SnapshotHooks } from '../config'; import { Logger, LoggerService } from '../logger'; interface FiltrableSnapshot { collections: RecordWithCollection[]; fields: RecordWithCollection[]; relations: RecordWithCollection[]; } export declare class SnapshotClient { protected readonly migrationClient: MigrationClient; protected readonly dumpPath: string; protected readonly splitFiles: boolean; protected readonly force: boolean; protected readonly prettyDiff: boolean; protected readonly logger: Logger; protected readonly hooks: SnapshotHooks; protected readonly sortJson: boolean; protected readonly ignoredCollection = "directus_sync_id_map"; constructor(config: ConfigService, loggerService: LoggerService, migrationClient: MigrationClient); /** * Save the snapshot locally */ pull(): Promise; /** * Apply the snapshot from the dump files. */ push(): Promise; /** * Diff the snapshot from the dump file. */ diff(): Promise; /** * Get the snapshot from the Directus instance. */ getSnapshot(): Promise; /** * Remove some items from the snapshot or diff, directus_sync collection for example */ protected removeIgnoredCollection(input: T): T; /** * Save the data to the dump file. The data is passed through the data transformer. * Returns the number of saved items. */ protected saveData(data: Snapshot): number; /** * Decompose the snapshot into a collection of files. */ protected decomposeData(data: Snapshot): { path: string; content: unknown; }[]; /** * Get the suffix that should be added to the field name in order to avoid conflicts. */ protected getSuffix(baseName: string, existing: Set): string; /** * Get the diff from Directus instance * From Directus 11.4.1, the diff is not returned if there are no changes. */ protected diffSnapshot(): Promise; protected hasDiff(diff: SchemaDiffOutput | null | undefined): diff is StrictSchemaDiffOutput; /** * Load the snapshot from the dump file or the decomposed files. */ protected loadData(): Snapshot; } export {};