From 97564dd2a81c7623bc4b74d0dcf7b0b608ad43ca Mon Sep 17 00:00:00 2001 From: Kamaz Date: Sun, 21 Feb 2021 13:24:18 +0000 Subject: [PATCH] feat: add mapping for cognito pool migration handler --- .../sls-aws/src/cognito/user-pool-handler.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/sls-aws/src/cognito/user-pool-handler.ts b/packages/sls-aws/src/cognito/user-pool-handler.ts index 1f41097..d1a39ee 100644 --- a/packages/sls-aws/src/cognito/user-pool-handler.ts +++ b/packages/sls-aws/src/cognito/user-pool-handler.ts @@ -3,7 +3,8 @@ import type { Context, CustomMessageTriggerEvent, PreSignUpTriggerEvent, - PreTokenGenerationTriggerEvent + PreTokenGenerationTriggerEvent, + UserMigrationTriggerEvent } from 'aws-lambda' import { responseOrError } from '../reponse/response-or-error' @@ -31,5 +32,17 @@ const cognitoUserPoolCustomMessage = ( ): SlsEnvironment => environment(config).successHandler(responseOrError) -export type { PreSignUpHandler, PreTokenGenerationHandler, CustomMessageHandler } -export { cognitoUserPoolPreSignUp, cognitoUserPoolPreTokenGeneration, cognitoUserPoolCustomMessage } +type UserMigrationHandler = Handler> + +const cognitoUserPoolMigration = ( + config?: EnvironmentConfig +): SlsEnvironment => + environment(config).successHandler(responseOrError) + +export type { PreSignUpHandler, PreTokenGenerationHandler, CustomMessageHandler, UserMigrationHandler } +export { + cognitoUserPoolPreSignUp, + cognitoUserPoolPreTokenGeneration, + cognitoUserPoolCustomMessage, + cognitoUserPoolMigration +}