0

List Apps

by
Published today

List the workspace's apps, optionally filtered by path prefix or creator.

Script windmill Verified

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 4 hours ago
1
//native
2

3
import * as wmill from "windmill-client"
4

5
// windmill-client errors only carry the status text: throw the response body, which says why
6
wmill.OpenAPI.interceptors.response.use(async (response) => {
7
  if (!response.ok) {
8
    throw new Error(`${response.status} ${await response.text()}`)
9
  }
10
  return response
11
})
12

13
/**
14
 * List Apps
15
 * List the workspace's apps, optionally filtered by path prefix or creator.
16
 */
17
export async function main(
18
  path_start: string | undefined,
19
  created_by: string | undefined,
20
  page: number | undefined,
21
  per_page: number | undefined
22
) {
23
  return await wmill.AppService.listApps({
24
    workspace: wmill.getWorkspace(),
25
    pathStart: path_start || undefined,
26
    createdBy: created_by || undefined,
27
    page: page ?? undefined,
28
    perPage: per_page ?? undefined,
29
  })
30
}
31