( _db: Database, designId: string, filePath: string, content: string, )
| 491 | } |
| 492 | |
| 493 | export function upsertDesignFile( |
| 494 | _db: Database, |
| 495 | designId: string, |
| 496 | filePath: string, |
| 497 | content: string, |
| 498 | ): DesignFile { |
| 499 | const normalizedPath = normalizeDesignFilePath(filePath); |
| 500 | const now = nowIso(); |
| 501 | touchDesignActivity(_db, designId, now); |
| 502 | return { |
| 503 | schemaVersion: 1, |
| 504 | id: `${designId}:${normalizedPath}`, |
| 505 | designId, |
| 506 | path: normalizedPath, |
| 507 | content, |
| 508 | createdAt: now, |
| 509 | updatedAt: now, |
| 510 | }; |
| 511 | } |
| 512 | |
| 513 | function rowToDiagnosticEvent(row: DiagnosticEventRow): DiagnosticEventRow { |
| 514 | return { |
no test coverage detected