export type DeleteApiExperimentalFlowInstancesInstanceIdArgs = {instance_id: string}; export type DeleteApiExperimentalFlowInstancesInstanceIdOptions = {baseUrl?: string | undefined, OAuth10?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Flow instance * * DELETE /experimental/flow/instances/{instance_id} * * Also accepts auth: OAuth2.0, SessionCookie + XToken */ export const deleteApiExperimentalFlowInstancesInstanceId = async (args: DeleteApiExperimentalFlowInstancesInstanceIdArgs, options?: DeleteApiExperimentalFlowInstancesInstanceIdOptions) => { const {baseUrl = "https://scrive.com", fetch: fetchFn = fetch, OAuth10} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth10 !== undefined) headers.set('authorization', `oauth1 ${OAuth10}`) const url = `${baseUrl.replace(/\/+$/, '')}/experimental/flow/instances/${encodeURIComponent(String(args.instance_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };