From 286bf2a94d5c6ad807275b5f9ccc6962328dc835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1lmi=20=C3=9E=C3=B3r=20Valgeirsson?= Date: Tue, 23 Jan 2018 20:48:40 +0100 Subject: [PATCH] aws-lambda : Add more Cognito triggerSources according to spec (#22943) * aws-lambda : Add more triggerSources according to spec * aws-lambda: Add my info in the Definitions by - list * aws-lambda: Cognito triggerSources list failed npm test due to extra semi colon --- types/aws-lambda/aws-lambda-tests.ts | 7 +++++++ types/aws-lambda/index.d.ts | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 0e1e027c9a..06f3fdb40c 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -291,6 +291,13 @@ cognitoUserPoolEvent.triggerSource === "CustomMessage_Authentication"; cognitoUserPoolEvent.triggerSource === "DefineAuthChallenge_Authentication"; cognitoUserPoolEvent.triggerSource === "CreateAuthChallenge_Authentication"; cognitoUserPoolEvent.triggerSource === "VerifyAuthChallengeResponse_Authentication"; +cognitoUserPoolEvent.triggerSource === "PreSignUp_AdminCreateUser"; +cognitoUserPoolEvent.triggerSource === "PostConfirmation_ConfirmForgotPassword"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_HostedAuth"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_Authentication"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_NewPasswordChallenge"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_AuthenticateDevice"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_RefreshTokens"; str = cognitoUserPoolEvent.region; str = cognitoUserPoolEvent.userPoolId; str = cognitoUserPoolEvent.userName; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index dde8f8bbbb..3dfbe9b561 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -12,6 +12,7 @@ // Daniel Cottone // Kostya Misura // Markus Tacker +// Palmi Valgeirsson // Danilo Raisi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -199,7 +200,7 @@ interface S3CreateEvent { */ interface CognitoUserPoolEvent { version: number; - triggerSource: "PreSignUp_SignUp" | "PostConfirmation_ConfirmSignUp" | "PreAuthentication_Authentication" | "PostAuthentication_Authentication" | "CustomMessage_SignUp" | "CustomMessage_AdminCreateUser" | "CustomMessage_ResendCode" | "CustomMessage_ForgotPassword" | "CustomMessage_UpdateUserAttribute" | "CustomMessage_VerifyUserAttribute" | "CustomMessage_Authentication" | "DefineAuthChallenge_Authentication" | "CreateAuthChallenge_Authentication" | "VerifyAuthChallengeResponse_Authentication"; + triggerSource: "PreSignUp_SignUp" | "PostConfirmation_ConfirmSignUp" | "PreAuthentication_Authentication" | "PostAuthentication_Authentication" | "CustomMessage_SignUp" | "CustomMessage_AdminCreateUser" | "CustomMessage_ResendCode" | "CustomMessage_ForgotPassword" | "CustomMessage_UpdateUserAttribute" | "CustomMessage_VerifyUserAttribute" | "CustomMessage_Authentication" | "DefineAuthChallenge_Authentication" | "CreateAuthChallenge_Authentication" | "VerifyAuthChallengeResponse_Authentication" | "PreSignUp_AdminCreateUser" | "PostConfirmation_ConfirmForgotPassword" | "TokenGeneration_HostedAuth" | "TokenGeneration_Authentication" | "TokenGeneration_NewPasswordChallenge" | "TokenGeneration_AuthenticateDevice" | "TokenGeneration_RefreshTokens"; region: string; userPoolId: string; userName?: string;