Skip to content

Commit

Permalink
Add and update MFA typescript interface for CognitoUser (#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 43a0f0a commit 3281689
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,4 +6,5 @@ node_modules/**
packages/*/node_modules/**
.DS_Store
.vscode
.idea
*.log
13 changes: 11 additions & 2 deletions packages/amazon-cognito-identity-js/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 3281689

Please sign in to comment.