export type CreateApiApiAdminCacheClearTaskDefNameArgs = {taskDefName: string}; export type CreateApiApiAdminCacheClearTaskDefNameOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove execution cached values for the task * * POST /api/admin/cache/clear/{taskDefName} */ export const createApiApiAdminCacheClearTaskDefName = async (args: CreateApiApiAdminCacheClearTaskDefNameArgs, options?: CreateApiApiAdminCacheClearTaskDefNameOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/admin/cache/clear/${encodeURIComponent(String(args.taskDefName))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };