export type GetApiRiveterV1RunStatusArgs = {run_key: string}; export type GetApiRiveterV1RunStatusOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Check the current status of a project run * * GET /riveter/v1/run_status */ export const getApiRiveterV1RunStatus = async (args: GetApiRiveterV1RunStatusArgs, options?: GetApiRiveterV1RunStatusOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.run_key != null) query.append("run_key", String(args.run_key)) const url = `${baseUrl.replace(/\/+$/, '')}/riveter/v1/run_status${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 };