import { ApiServiceBase } from '@elsikora/nestjs-crud-automator'; import { IConfigOptions } from '../../../shared/interface/config'; import { IConfigMigration, IConfigMigrationDefinition } from './interface'; import { CrudConfigService } from '../config.service'; import { OnModuleInit } from '@nestjs/common'; import { DataSource, EntityManager } from 'typeorm'; /** * Service responsible for coordinating and tracking execution of migrations. * @see {@link https://elsikora.com/docs/nestjs-crud-config/migration-system | Migration System} * @see {@link https://elsikora.com/docs/nestjs-crud-config/api-reference/classes/config-migration-service | API Reference - ConfigMigrationService} */ export declare class ConfigMigrationService implements OnModuleInit { private readonly dataSource; private readonly options; private readonly configService; private readonly LOGGER; private readonly MIGRATION_SERVICE; constructor(dataSource: DataSource, options: IConfigOptions, configService: CrudConfigService, migrationService: ApiServiceBase); /** * Cleans up failed migrations * @param {string} [migrationName] - Optional migration name to clean up * @returns {Promise} Promise that resolves when cleanup is complete */ cleanupFailedMigrations(migrationName?: string): Promise; /** * Cleans up stuck migrations (running for too long) * @param {number} [timeoutMinutes] - Minutes after which a RUNNING migration is considered stuck * @returns {Promise} Promise that resolves when cleanup is complete */ cleanupStuckMigrations(timeoutMinutes?: number): Promise; /** * Executes pending migrations * @param {Array} migrations - Array of migration definitions * @param {boolean} [useTransaction] - Whether to use the named crud-config-migrations owner; defaults to true * @param {EntityManager} [ownerManager] - Existing active Automator owner manager; requires useTransaction * @returns {Promise} Promise that resolves when all migrations are executed */ executeMigrations(migrations: Array, useTransaction?: boolean, ownerManager?: EntityManager): Promise; /** * Gets list of executed migration names * @returns {Promise} Promise that resolves to list of executed migration names */ getExecutedMigrationList(): Promise>; /** * Gets list of executed migrations * @returns {Promise} Promise that resolves to list of executed migrations */ getExecutedMigrations(): Promise>; /** * Checks if a migration has been executed * @param {string} migrationName - The name of the migration to check * @returns {Promise} Promise that resolves to true if migration is executed */ isMigrationExecuted(migrationName: string): Promise; onModuleInit(): void; /** * Rolls back a migration inside the named owner or a supplied active Automator owner * @param {string} migrationName - The name of the migration to roll back * @param {Array} migrations - Array of migration definitions * @param {EntityManager} [ownerManager] - Existing active Automator owner manager * @returns {Promise} Promise that resolves when rollback is complete */ rollbackMigration(migrationName: string, migrations: Array, ownerManager?: EntityManager): Promise; private executePendingMigrations; private executeRollback; /** * Executes a single migration * @param {IConfigMigrationDefinition} migration - Migration definition * @param {EntityManager} [transactionalEntityManager] - Optional transaction manager * @returns {Promise} Promise that resolves when migration is executed */ private executeSingleMigration; private runWithOwnerManager; /** * Validates migrations for duplicates and naming issues * @param {Array} migrations - Array of migration definitions */ private validateMigrations; }