import { InsertOAuth2ConfigRequest, InsertOAuth2ConfigResponse, FetchOAuth2ConfigsResponse, UpdateOAuth2ConfigRequest, UpdateOAuth2ConfigResponse, } from "@budibase/types" import { Expectations, TestAPI } from "./base" export class OAuth2API extends TestAPI { fetch = async (expectations?: Expectations) => { return await this._get("/api/oauth2", { expectations, }) } create = async ( body: InsertOAuth2ConfigRequest, expectations?: Expectations ) => { return await this._post("/api/oauth2", { body, expectations: { status: expectations?.status ?? 201, ...expectations, }, }) } update = async ( body: UpdateOAuth2ConfigRequest, expectations?: Expectations ) => { return await this._put( `/api/oauth2/${body._id}`, { body, expectations, } ) } delete = async (id: string, rev: string, expectations?: Expectations) => { return await this._delete(`/api/oauth2/${id}/${rev}`, { expectations, }) } }