/** * TypeScript interfaces and enums for sfdmu-mcp. * All types mirror the SFDMU schema entities from data-model.md. * All instances are ephemeral (per-request in-memory only — no persistence). */ export declare enum SfdmuOperation { Insert = "Insert", Update = "Update", Upsert = "Upsert", Readonly = "Readonly", Delete = "Delete", DeleteSource = "DeleteSource", DeleteHierarchy = "DeleteHierarchy", HardDelete = "HardDelete" } export interface MappingItem { sourceField: string; targetField: string; } export interface MockField { name: string; pattern: string; excludeFieldsFromUpdate?: string[]; } export interface AddonManifestDefinition { module: string; args?: Record; } export interface PolymorphicLookup { name: string; objectType: string; } export interface ScriptOrg { name: string; orgUserName?: string; instanceUrl?: string; accessToken?: string; } export interface OrgContext { /** SF CLI org alias if set, otherwise the username */ alias: string; /** Authenticated Salesforce username */ username: string; /** Org instance URL (trailing slash stripped) */ instanceUrl: string; /** true for sandbox and scratch orgs; false for production and Developer Edition */ isSandbox: boolean; /** API version used for this connection (e.g., "62.0") */ apiVersion: string; /** SF CLI connected status (e.g., "Connected") */ connectedStatus: string; /** ISO 8601 timestamp when this context was resolved */ resolvedAt: string; } export interface ScriptObject { query: string; name?: string; operation: SfdmuOperation; externalId?: string; excludedFields?: string[]; excludedFromUpdateFields?: string[]; fieldMapping?: MappingItem[]; mockFields?: MockField[]; sourceRecordsFilter?: string; targetRecordsFilter?: string; deleteQuery?: string; master?: boolean; updateWithMockData?: boolean; deleteOldData?: boolean; hardDelete?: boolean; useQueryAll?: boolean; skipRecordsComparison?: boolean; alwaysUseRestApi?: boolean; beforeAddons?: AddonManifestDefinition[]; afterAddons?: AddonManifestDefinition[]; beforeUpdateAddons?: AddonManifestDefinition[]; afterUpdateAddons?: AddonManifestDefinition[]; polymorphicLookups?: PolymorphicLookup[]; } export interface ScriptObjectSet { objects: ScriptObject[]; orgsData?: ScriptOrg[]; } export interface ExportConfig { orgs?: ScriptOrg[]; objects?: ScriptObject[]; objectSets?: ScriptObjectSet[]; concurrencyMode?: 'Serial' | 'Parallel'; bulkThreshold?: number; queryBulkApiThreshold?: number; bulkApiVersion?: string | number; bulkApiV1BatchSize?: number; restApiBatchSize?: number; allOrNone?: boolean; apiVersion?: string; simulationMode?: boolean; validateCSVFilesOnly?: boolean; createTargetCSVFiles?: boolean; allowFieldTruncation?: boolean; keepObjectOrderWhileExecute?: boolean; beforeAddons?: AddonManifestDefinition[]; afterAddons?: AddonManifestDefinition[]; } export interface DependencyEdge { parent: string; child: string; fieldName: string; required: boolean; } export interface CircularReference { cycle: string[]; suggestion: string; } export interface UnresolvedLookup { childObject: string; fieldName: string; referencedObject: string; reason: 'not_in_plan' | 'not_in_org'; } export interface DependencyGraph { orderedObjects: string[]; edges: DependencyEdge[]; circularReferences?: CircularReference[]; unresolvedLookups?: UnresolvedLookup[]; totalCount: number; hasMore: boolean; } export declare enum ConflictReason { FieldMissingOnTarget = "field_missing_on_target", TypeMismatch = "type_mismatch", LengthMismatch = "length_mismatch", PicklistValueMissing = "picklist_value_missing", SObjectMissingOnTarget = "sobject_missing_on_target" } export interface FieldConflict { sObject: string; fieldName: string; severity: 'blocking' | 'warning'; sourceType?: string; targetType?: string; reason: ConflictReason; remediation: string; } export interface ConflictReport { sourceOrg: string; targetOrg: string; checkedAt: string; safeToMigrate: boolean; blockingConflicts: FieldConflict[]; warnings: FieldConflict[]; compatibleObjects: string[]; totalCount: number; hasMore: boolean; offset: number; } export declare enum PreflightErrorCode { MissingExternalId = "missing_external_id", MissingParentObject = "missing_parent_object", InvalidSOQL = "invalid_soql", OrgAuthFailed = "org_auth_failed", FieldNotFound = "field_not_found", SchemaValidationFailed = "schema_validation_failed" } export interface PreflightError { sObject?: string; fieldName?: string; code: PreflightErrorCode; message: string; remediation: string; } export interface ObjectPreflightReport { sObject: string; query: string; operation: SfdmuOperation; estimatedRecordCount: number; externalIdField?: string; externalIdPresent?: boolean; } export interface PreflightReport { exportConfig: ExportConfig; sourceOrg: string; analysedAt: string; safeToExecute: boolean; totalEstimatedRecords: number; objectReports: ObjectPreflightReport[]; blockingErrors: PreflightError[]; warnings: PreflightError[]; totalCount: number; hasMore: boolean; offset: number; } export interface RecordDiff { externalId: string; presentInSource: boolean; presentInTarget: boolean; } export interface ObjectComparisonResult { sObject: string; sourceCount: number; targetCount: number; status: 'matched' | 'diverged' | 'not_in_target' | 'not_in_source'; delta: number; sampleDivergentRecords?: RecordDiff[]; } export interface OrgComparisonSnapshot { sourceOrg: string; targetOrg: string; comparedAt: string; objects: ObjectComparisonResult[]; summary: { matched: number; diverged: number; notInTarget: number; }; totalCount: number; hasMore: boolean; offset: number; } export interface IntentObject { name: string; operation: SfdmuOperation; externalId?: string; query?: string; excludeFields?: string[]; fieldMapping?: MappingItem[]; } export interface ParsedIntent { sourceOrg: string; targetOrg: string; objects: IntentObject[]; globalSettings?: { concurrencyMode?: 'Serial' | 'Parallel'; bulkThreshold?: number; apiVersion?: string; allOrNone?: boolean; allowFieldTruncation?: boolean; }; } export interface ToolVersionInfo { installed: boolean; version?: string; installUrl?: string; installCommand?: string; } export interface PrerequisiteCheckResult { ready: boolean; sfCli: ToolVersionInfo; sfdmuPlugin: ToolVersionInfo; missingItems: string[]; checkedAt: string; } export interface MigrationResult { /** Overall outcome of the migration run. */ status: 'completed' | 'partial' | 'failed'; /** sObject names that were fully processed before any failure. */ processedObjects: string[]; /** The sObject that caused the failure, if any. */ failedObject: string | undefined; /** Number of records successfully written to the target org. */ recordsWritten: number; /** Exit code returned by `sf sfdmu run`. */ sfdmuExitCode: number; /** Sanitised SFDMU stdout + stderr combined log (credentials stripped). */ rawLog: string; } export interface OrgCredentials { instanceUrl: string; accessToken: string; apiVersion: string; } export interface SFFieldDescribe { name: string; type: string; length?: number; precision?: number; scale?: number; nillable: boolean; externalId: boolean; referenceTo?: string[]; relationshipName?: string | null; updateable: boolean; createable: boolean; picklistValues?: Array<{ value: string; active: boolean; }>; } export interface SFDescribeResult { name: string; fields: SFFieldDescribe[]; queryable: boolean; } export interface SFQueryResult> { totalSize: number; done: boolean; records: T[]; } export interface ClarificationItem { field: string; sObject: string; message: string; } /** Internal type produced by intent-parser.ts; not exposed in tool output. */ export interface ParsedObjectCandidate { rawToken: string; normalised: string; confidence: 'quoted' | 'camelcase' | 'trigger-word' | 'heuristic'; isCustomObject: boolean; } /** Input to sfdmu_plan_migration tool. */ export interface MigrationIntent { intent: string; sourceOrg?: string; targetOrg?: string; operationOverride?: SfdmuOperation; globalSettings?: ParsedIntent['globalSettings']; } /** Output of migration-planner service / sfdmu_plan_migration tool. */ export interface MigrationPlanResult { success: boolean; exportConfig?: ExportConfig; assumptions: string[]; resolvedObjects: string[]; skippedObjects: string[]; clarificationRequired?: ClarificationItem[]; mode: 'online' | 'offline'; } //# sourceMappingURL=types.d.ts.map