(filename)
| 248 | |
| 249 | // Fetch YAML for the specified workflow |
| 250 | export async function fetchYaml(filename) { |
| 251 | try { |
| 252 | const yamlFilename = addYamlSuffix(filename) |
| 253 | const response = await fetch(apiUrl(`/api/workflows/${encodeURIComponent(yamlFilename)}/get`)) |
| 254 | |
| 255 | const data = await response.json().catch(() => ({})) |
| 256 | |
| 257 | if (response.ok) { |
| 258 | return { |
| 259 | success: true, |
| 260 | content: data?.content |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | return { |
| 265 | success: false, |
| 266 | detail: data?.detail, |
| 267 | message: data?.message || 'Failed to fetch YAML file', |
| 268 | status: response.status |
| 269 | } |
| 270 | } catch (error) { |
| 271 | console.error('Error fetching YAML file:', error) |
| 272 | return { |
| 273 | success: false, |
| 274 | message: 'API error' |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | // Fetch the VueFlow graph |
| 280 | export async function fetchVueGraph(key) { |
nothing calls this directly
no test coverage detected