export type CreateApiExperimentalFlowInstancesInstanceIdTrashArgs = {instance_id: string}; export type CreateApiExperimentalFlowInstancesInstanceIdTrashOptions = {baseUrl?: string | undefined, OAuth10?: string | undefined, fetch?: typeof fetch | undefined}; /** * Trash Flow instance * * POST /experimental/flow/instances/{instance_id}/trash * * Also accepts auth: OAuth2.0, SessionCookie + XToken */ export const createApiExperimentalFlowInstancesInstanceIdTrash = async (args: CreateApiExperimentalFlowInstancesInstanceIdTrashArgs, options?: CreateApiExperimentalFlowInstancesInstanceIdTrashOptions) => { 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))}/trash${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 };