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 +}