export type GetApiApiMetadataTaskdefsArgs = {access?: string | undefined, metadata?: boolean | undefined, tagKey?: string | undefined, tagValue?: string | undefined}; export type GetApiApiMetadataTaskdefsOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets all task definition * * GET /api/metadata/taskdefs */ export const getApiApiMetadataTaskdefs = async (args: GetApiApiMetadataTaskdefsArgs, options?: GetApiApiMetadataTaskdefsOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.access != null) query.append("access", String(args.access)) if (args.metadata != null) query.append("metadata", String(args.metadata)) if (args.tagKey != null) query.append("tagKey", String(args.tagKey)) if (args.tagValue != null) query.append("tagValue", String(args.tagValue)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/metadata/taskdefs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };