import api from "@/lib/api-client"; import { IApproveAuthorizationPayload, IAuthorizeParams, IOAuthAuthorizeInfo, IOAuthGrant, } from "@/ee/oauth/types/oauth.types"; export async function getOAuthAuthorizeInfo( params: IAuthorizeParams, ): Promise { const req = await api.post( "/oauth/authorize-info", params, ); return req.data; } export async function approveOAuthAuthorization( payload: IApproveAuthorizationPayload, ): Promise<{ redirectUrl: string }> { const req = await api.post<{ redirectUrl: string }>( "/oauth/authorize", payload, ); return req.data; } export async function getOAuthGrants(): Promise { const req = await api.post("/oauth/grants", {}); return req.data; } export async function revokeOAuthGrant(grantId: string): Promise { await api.post("/oauth/grants/revoke", { grantId }); }