(state: MigrationStateSnapshot, d: any)
| 71 | } |
| 72 | |
| 73 | export function applyMigrationItemToState(state: MigrationStateSnapshot, d: any): void { |
| 74 | if (d.status === "stored") state.stored++; |
| 75 | else if (d.status === "skipped" || d.status === "duplicate") state.skipped++; |
| 76 | else if (d.status === "merged") state.merged++; |
| 77 | else if (d.status === "error") state.errors++; |
| 78 | |
| 79 | if (Array.isArray(d.stepFailures)) { |
| 80 | for (const step of d.stepFailures) { |
| 81 | if (step === "summarization") state.stepFailures.summarization++; |
| 82 | else if (step === "dedup") state.stepFailures.dedup++; |
| 83 | else if (step === "embedding") state.stepFailures.embedding++; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | state.processed = d.index ?? state.processed + 1; |
| 88 | state.total = d.total ?? state.total; |
| 89 | state.lastItem = d; |
| 90 | state.success = computeMigrationSuccess(state); |
| 91 | } |
| 92 | |
| 93 | export interface ViewerBranding { |
| 94 | title?: string; |
no test coverage detected