import { OAuthUserConsentResponseSchema, OAuthUserConsentRevokeResponseSchema, } from "./types.js";
import { OAuthResponseError } from "./util.js";
export async function oauthUserConsent(client) {
    const resp = await client.get('/oidc/user/consent', OAuthUserConsentResponseSchema);
    if (resp.success) {
        return resp.data;
    }
    throw new OAuthResponseError({ message: resp.message });
}
export async function oauthUserConsentRevoke(client, clientId) {
    const resp = await client.delete(`/oidc/user/consent/${encodeURIComponent(clientId)}`, OAuthUserConsentRevokeResponseSchema);
    if (resp.success) {
        return resp.data;
    }
    throw new OAuthResponseError({ message: resp.message });
}
//# sourceMappingURL=consent.js.map