export type CreateApiApiWorkflowWorkflowIdVariablesArgs = {workflowId: string, body: {[key: string]: Record}}; export type CreateApiApiWorkflowWorkflowIdVariablesOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update workflow variables * * POST /api/workflow/{workflowId}/variables */ export const createApiApiWorkflowWorkflowIdVariables = async (args: CreateApiApiWorkflowWorkflowIdVariablesArgs, options?: CreateApiApiWorkflowWorkflowIdVariablesOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/workflow/${encodeURIComponent(String(args.workflowId))}/variables${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };