/** * @nahisaho/yata-scale - Migration Helper * * Helps migrate from yata-local to yata-scale */ import { type Result } from 'neverthrow'; import type { Entity, Relationship, YataScaleConfig } from './types.js'; import { InitializationError } from './errors.js'; /** * Migration progress */ export interface MigrationProgress { readonly totalEntities: number; readonly migratedEntities: number; readonly totalRelationships: number; readonly migratedRelationships: number; readonly errors: string[]; readonly startTime: Date; readonly currentPhase: 'entities' | 'relationships' | 'indexes' | 'complete'; } /** * Migration options */ export interface MigrationOptions { readonly batchSize?: number; readonly validateData?: boolean; readonly preserveIds?: boolean; readonly onProgress?: (progress: MigrationProgress) => void; } /** * Source data provider */ export interface DataSource { getEntities(): AsyncGenerator; getRelationships(): AsyncGenerator; getEntityCount(): Promise; getRelationshipCount(): Promise; } /** * Target data sink */ export interface DataSink { putEntity(entity: Entity): Promise; putRelationship(relationship: Relationship): Promise; flush(): Promise; } /** * Migration helper for transitioning to yata-scale */ export declare class MigrationHelper { private readonly batchSize; private progress; constructor(options?: MigrationOptions); /** * Migrate data from source to target */ migrate(source: DataSource, sink: DataSink, options?: MigrationOptions): Promise>; /** * Migrate entities */ private migrateEntities; /** * Migrate relationships */ private migrateRelationships; /** * Process a batch */ private processBatch; /** * Validate entity */ private validateEntity; /** * Validate relationship */ private validateRelationship; /** * Get current progress */ getProgress(): MigrationProgress; /** * Get migration percentage */ getPercentage(): number; /** * Generate configuration for yata-scale based on data */ static generateConfig(entityCount: number, relationshipCount: number): Partial; } //# sourceMappingURL=MigrationHelper.d.ts.map