export type GetApiRootMWfIdWorkflowWfIdInvocationInvocationIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve a workflow invocation * * GET /root/{m-wf-id}/workflow/{wf-id}/invocation/{invocation-id} */ export const getApiRootMWfIdWorkflowWfIdInvocationInvocationId = async (options?: GetApiRootMWfIdWorkflowWfIdInvocationInvocationIdOptions) => { const {baseUrl = "https://localhost:5000/api/v1/user/unknown", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/root/${encodeURIComponent(String(args['m-wf-id']))}/workflow/${encodeURIComponent(String(args['wf-id']))}/invocation/${encodeURIComponent(String(args['invocation-id']))}${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 (await res.json()) as unknown };