From 76971327761e1037b5216159e76833015bea4943 Mon Sep 17 00:00:00 2001 From: Josh Woodcock Date: Tue, 13 Feb 2018 10:54:48 -0600 Subject: [PATCH] Add and update MFA typescript interface for CognitoUser (#279) * add and update missing and inconsistent typescript interfaces for CognitoUser * ignore intellij settings --- index.d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 3bb86faa4f8..a07bdbb5dfd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -48,7 +48,10 @@ declare module "amazon-cognito-identity-js" { onFailure: (err: any) => void, newPasswordRequired?: (userAttributes: any, requiredAttributes: any) => void, mfaRequired?: (challengeName: any, challengeParameters: any) => void, - customChallenge?: (challengeParameters: any) => void + totpRequired?: (challengeName: any, challengeParameters: any) => void, + customChallenge?: (challengeParameters: any) => void, + mfaSetup?: (challengeName: any, challengeParameters: any) => void, + selectMFAType?: (challengeName: any, challengeParameters: any) => void }): void; public confirmRegistration(code: string, forceAliasCreation: boolean, callback: NodeCallback): void; public sendCustomChallengeAnswer(answerChallenge: any, callback:NodeCallback):void; @@ -59,8 +62,8 @@ declare module "amazon-cognito-identity-js" { public setDeviceStatusRemembered(callbacks: { onSuccess: (success: string) => void, onFailure: (err: any) => void }): void; public setDeviceStatusNotRemembered(callbacks: { onSuccess: (success: string) => void, onFailure: (err: any) => void }): void; public getDevice(callbacks: {onSuccess: (success: string) => void, onFailure: (err: Error) => void}): any; + public sendMFACode(confirmationCode: string, callbacks: { onSuccess: (session: CognitoUserSession) => void, onFailure: (err: any) => void }, mfaType: string): void; public listDevices(limit: number, paginationToken: string, callbacks: {onSuccess: (data: any) => void, onFailure: (err: Error) => void}): void; - public sendMFACode(confirmationCode: string, callbacks: { onSuccess: (session: CognitoUserSession) => void, onFailure: (err: any) => void }): void; public completeNewPasswordChallenge(newPassword: string, requiredAttributeData: any, callbacks: { @@ -80,6 +83,12 @@ declare module "amazon-cognito-identity-js" { public enableMFA(callback: NodeCallback): void; public disableMFA(callback: NodeCallback): void; public getMFAOptions(callback: NodeCallback): void; + public associateSoftwareToken( + callbacks: { + associateSecretCode: (secretCode: string) => void, + onFailure: (err: any) => void + }); + public verifySoftwareToken(totpCode, friendlyDeviceName, callbacks: {onSuccess: (session: CognitoUserSession) => void, onFailure: (err: Error) => void}): any; } export interface MFAOption {