export type GetApiApiMetadataWorkflowNameArgs = {name: string, version?: number | undefined, metadata?: boolean | undefined}; export type GetApiApiMetadataWorkflowNameOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieves workflow definition along with blueprint * * GET /api/metadata/workflow/{name} */ export const getApiApiMetadataWorkflowName = async (args: GetApiApiMetadataWorkflowNameArgs, options?: GetApiApiMetadataWorkflowNameOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.version != null) query.append("version", String(args.version)) if (args.metadata != null) query.append("metadata", String(args.metadata)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/metadata/workflow/${encodeURIComponent(String(args.name))}${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() };