//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_name = string
export async function name() {
const names = await wmill.GroupService.listGroupNames({
workspace: wmill.getWorkspace(),
})
return names.map((n) => ({ value: n, label: n }))
}
/**
* Get Group
* Get a group by name, including its members.
*/
export async function main(name: DynSelect_name) {
return await wmill.GroupService.getGroup({
workspace: wmill.getWorkspace(),
name,
})
}
Submitted by hugo989 5 hours ago