| 33 | type Row = typeof ProjectTable.$inferSelect |
| 34 | |
| 35 | export function fromRow(row: Row): Info { |
| 36 | const icon = |
| 37 | row.icon_url || row.icon_url_override || row.icon_color |
| 38 | ? { |
| 39 | url: row.icon_url ?? undefined, |
| 40 | override: row.icon_url_override ?? undefined, |
| 41 | color: row.icon_color ?? undefined, |
| 42 | } |
| 43 | : undefined |
| 44 | return { |
| 45 | id: row.id, |
| 46 | worktree: row.worktree, |
| 47 | vcs: row.vcs ? Schema.decodeUnknownSync(Project.Vcs)(row.vcs) : undefined, |
| 48 | name: row.name ?? undefined, |
| 49 | icon, |
| 50 | time: { |
| 51 | created: row.time_created, |
| 52 | updated: row.time_updated, |
| 53 | initialized: row.time_initialized ?? undefined, |
| 54 | }, |
| 55 | sandboxes: row.sandboxes, |
| 56 | commands: row.commands ?? undefined, |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | export const UpdateInput = Schema.Struct({ |
| 61 | projectID: ProjectV2.ID, |