import { type ApiClientInterface, BaseService, type CommonErrors, type ServiceDependencies } from "../../api/base-service"; import { type CheckConsentResponse, type CheckConsentWithErrorResponse, type ConnectRequest, type GrantConsentRequest, type OAuthTokenResponse, type UpdateConsentRequest } from "./schemas"; export type { CheckConsentResponse, CheckConsentWithErrorResponse, ConnectRequest, GrantConsentRequest, OAuthApplication, OAuthScope, OAuthTokenResponse, UpdateConsentRequest, } from "./schemas"; export type CheckConsentResult = CommonErrors | ["application_not_found", { error_identifier: string; }] | [null, CheckConsentResponse]; export type UpdateConsentResult = CommonErrors | ["application_not_found", { error_identifier: string; }] | ["invalid_user_updates", { error_identifier: string; error_details?: Record; }] | [null, CheckConsentResponse]; export type GrantConsentResult = CommonErrors | ["application_not_found", { error_identifier: string; }] | ["missing_required_fields", { error_identifier: string; error_details: { missing_fields: string[]; }; }] | [null, OAuthTokenResponse]; export type ConnectResult = CommonErrors | ["application_not_found", { error_identifier: string; }] | ["consent_not_granted", CheckConsentWithErrorResponse] | ["missing_required_fields", CheckConsentWithErrorResponse] | [null, OAuthTokenResponse]; export declare class OAuthService extends BaseService { constructor(client: ApiClientInterface, deps?: ServiceDependencies); private parseErrorResponse; /** * Check consent status for an OAuth application. * Returns application info, consent status, and required/missing fields. */ checkConsent(clientId: string): Promise; /** * Update user data and return consent status. * Used to fill in missing required fields before granting consent. */ updateConsent(clientId: string, request: UpdateConsentRequest): Promise; /** * Grant consent for an OAuth application. * Returns a one-time login token for redirect. */ grantConsent(clientId: string, request?: GrantConsentRequest): Promise; /** * Connect to an OAuth application. * Returns a one-time login token if consent is granted and all fields are present. * Otherwise returns consent data with error information. */ connect(clientId: string, request?: ConnectRequest): Promise; }