(home: string, importId: string)
| 105 | } |
| 106 | |
| 107 | export async function readImportMeta(home: string, importId: string): Promise<ImportInfo | null> { |
| 108 | try { |
| 109 | const raw = await readFile(join(importedDirOf(home, importId), META_FILE), 'utf8'); |
| 110 | const meta = JSON.parse(raw) as ImportInfo; |
| 111 | // The sidecar is vis-written, but re-sanitize the manifest in case the |
| 112 | // imported directory was hand-edited, so a corrupt type cannot reach the |
| 113 | // session list and crash the UI. |
| 114 | return { ...meta, manifest: meta.manifest ? sanitizeManifest(meta.manifest) : null }; |
| 115 | } catch { |
| 116 | return null; |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | export async function deleteImported(home: string, importId: string): Promise<boolean> { |
| 121 | if (!isImportId(importId)) return false; |
no test coverage detected