export type GetApiPipelineAccountLocalDeployTasksArgs = {limit?: number | undefined, edge_id?: string | undefined}; export type GetApiPipelineAccountLocalDeployTasksOptions = {baseUrl?: string | undefined, PipelineServiceKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Poll tasks * * GET /pipeline/account/local-deploy/tasks */ export const getApiPipelineAccountLocalDeployTasks = async (args: GetApiPipelineAccountLocalDeployTasksArgs, options?: GetApiPipelineAccountLocalDeployTasksOptions) => { const {baseUrl = "https://api.mezmo.com/v3", fetch: fetchFn = fetch, PipelineServiceKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.limit != null) query.append("limit", String(args.limit)) if (args.edge_id != null) query.append("edge_id", String(args.edge_id)) if (PipelineServiceKey !== undefined) headers.set("Authorization", PipelineServiceKey) const url = `${baseUrl.replace(/\/+$/, '')}/pipeline/account/local-deploy/tasks${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 undefined };