| 345 | |
| 346 | // Fetch the config schema |
| 347 | export async function fetchConfigSchema(breadcrumbs) { |
| 348 | try { |
| 349 | const response = await fetch(apiUrl('/api/config/schema'), { |
| 350 | method: 'POST', |
| 351 | headers: { |
| 352 | 'Content-Type': 'application/json', |
| 353 | }, |
| 354 | body: JSON.stringify({ |
| 355 | breadcrumbs: breadcrumbs |
| 356 | }) |
| 357 | }) |
| 358 | |
| 359 | if (!response.ok) { |
| 360 | throw new Error(`Failed to fetch config schema: ${response.status} ${response.statusText}`) |
| 361 | } |
| 362 | |
| 363 | const data = await response.json() |
| 364 | return data |
| 365 | } catch (error) { |
| 366 | console.error('Failed to fetch config schema:', error) |
| 367 | throw error |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | // Download execution logs |
| 372 | export async function fetchLogsZip(sessionId) { |