(
options: ParseAgentFileOptions & {
onSuccess: (data: ImportAgentData) => void;
}
)
| 149 | * This is a convenience function that combines file selection and parsing |
| 150 | */ |
| 151 | export async function openImportWizardWithFile( |
| 152 | options: ParseAgentFileOptions & { |
| 153 | onSuccess: (data: ImportAgentData) => void; |
| 154 | } |
| 155 | ): Promise<void> { |
| 156 | const { onSuccess, onParseError } = options; |
| 157 | const file = await selectFile(".json,.zip"); |
| 158 | |
| 159 | if (!file) return; |
| 160 | |
| 161 | const data = await parseAgentImportFile(file, { |
| 162 | onParseError: (msg) => onParseError?.(msg), |
| 163 | ...options, |
| 164 | }); |
| 165 | |
| 166 | if (data) { |
| 167 | onSuccess(data); |
| 168 | } |
| 169 | } |
nothing calls this directly
no test coverage detected