import { AuthOptions } from './authOptions'; import { AuthResult } from './authResult'; import { HttpClient } from './httpClient'; import { ApiClientConfig } from './main'; import { MFA, TrustedDevice } from './models'; import OAuthClient from './oAuthClient'; import { WithPkceParams } from './pkceService'; import CredentialsResponse = MFA.CredentialsResponse; import EmailCredential = MFA.EmailCredential; import StepUpResponse = MFA.StepUpResponse; import PhoneCredential = MFA.PhoneCredential; export type RemoveMfaEmailParams = { accessToken: string; }; export type RemoveMfaPhoneNumberParams = { accessToken: string; phoneNumber: string; }; export type StartMfaEmailRegistrationParams = { accessToken: string; trustDevice?: boolean; action?: string; }; export type StartMfaEmailRegistrationResponse = { status: 'email_sent'; } | { status: 'enabled'; credential: EmailCredential; }; export type StartMfaPhoneNumberRegistrationParams = { accessToken: string; phoneNumber: string; trustDevice?: boolean; action?: string; }; export type StartMfaPhoneNumberRegistrationResponse = { status: 'sms_sent'; } | { status: 'enabled'; credential: PhoneCredential; }; export type StepUpParams = { options?: WithPkceParams; accessToken?: string; tkn?: string; action?: string; }; export type VerifyMfaEmailRegistrationParams = { accessToken: string; verificationCode: string; trustDevice?: boolean; }; export type VerifyMfaPasswordlessParams = { challengeId: string; verificationCode: string; trustDevice?: boolean; }; export type VerifyMfaPhoneNumberRegistrationParams = { accessToken: string; verificationCode: string; trustDevice?: boolean; }; export type DeleteTrustedDeviceParams = { accessToken: string; trustedDeviceId: string; }; export type ListTrustedDevicesResponse = { trustedDevices: TrustedDevice[]; }; /** * Identity Rest API Client */ export default class MfaClient { private config; private http; private oAuthClient; private credentialsUrl; private emailCredentialUrl; private emailCredentialVerifyUrl; private passwordlessVerifyAuthCodeUrl; private passwordlessVerifyUrl; private phoneNumberCredentialUrl; private phoneNumberCredentialVerifyUrl; private stepUpUrl; private trustedDeviceUrl; constructor(props: { config: ApiClientConfig; http: HttpClient; oAuthClient: OAuthClient; }); getMfaStepUpToken(params: WithPkceParams): Promise; listMfaCredentials(accessToken: string): Promise; removeMfaEmail(params: RemoveMfaEmailParams): Promise; removeMfaPhoneNumber(params: RemoveMfaPhoneNumberParams): Promise; startMfaEmailRegistration(params: StartMfaEmailRegistrationParams): Promise; startMfaPhoneNumberRegistration(params: StartMfaPhoneNumberRegistrationParams): Promise; verifyMfaEmailRegistration(params: VerifyMfaEmailRegistrationParams): Promise; verifyMfaPasswordless(params: VerifyMfaPasswordlessParams): Promise; verifyMfaPhoneNumberRegistration(params: VerifyMfaPhoneNumberRegistrationParams): Promise; listTrustedDevices(accessToken: string): Promise; deleteTrustedDevices(params: DeleteTrustedDeviceParams): Promise; }