Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
Add and update MFA typescript interface for CognitoUser (aws-amplify#279
Browse files Browse the repository at this point in the history
)

* add and update missing and inconsistent typescript interfaces for CognitoUser

* ignore intellij settings
  • Loading branch information
woodcockjosh authored and mlabieniec committed Feb 13, 2018
1 parent 9b25fec commit 7697132
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions index.d.ts
Expand Up @@ -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<any, any>): void;
public sendCustomChallengeAnswer(answerChallenge: any, callback:NodeCallback<any, any>):void;
Expand All @@ -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: {
Expand All @@ -80,6 +83,12 @@ declare module "amazon-cognito-identity-js" {
public enableMFA(callback: NodeCallback<Error, string>): void;
public disableMFA(callback: NodeCallback<Error, string>): void;
public getMFAOptions(callback: NodeCallback<Error, MFAOption[]>): 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 {
Expand Down

0 comments on commit 7697132

Please sign in to comment.