//native
import * as wmill from "windmill-client"
// windmill-client errors only carry the status text: throw the response body, which says why
wmill.OpenAPI.interceptors.response.use(async (response) => {
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return response
})
export type DynSelect_path = string
export async function path() {
const paths = await wmill.FlowService.listFlowPaths({
workspace: wmill.getWorkspace(),
})
return paths.map((p) => ({ value: p, label: p }))
}
/**
* Delete Flow
* Permanently delete a flow and all its versions. Use Archive Flow to hide it while keeping them.
*/
export async function main(path: DynSelect_path) {
return await wmill.FlowService.deleteFlowByPath({
workspace: wmill.getWorkspace(),
path,
})
}
Submitted by hugo989 5 hours ago