@@ -20,7 +20,7 @@ const validTriggerSources = [
2020 'UserMigration' ,
2121] . concat ( customSenderSources ) ;
2222
23- const customSenderValidVersions = [ 'V1_0' ] ;
23+ const customSenderValidVersions = [ 'V1_0' ] ;
2424const preTokenGenerationValidVersions = [ 'V1_0' , 'V2_0' , 'V3_0' ] ;
2525
2626class AwsCompileCognitoUserPoolEvents {
@@ -319,14 +319,18 @@ class AwsCompileCognitoUserPoolEvents {
319319 if ( customSenderSources . includes ( trigger ) ) {
320320 if ( lambdaVersion && ! customSenderValidVersions . includes ( lambdaVersion ) ) {
321321 throw new ServerlessError (
322- `Invalid lambdaVersion "${ lambdaVersion } " for trigger "${ trigger } ". Custom sender triggers only support: ${ customSenderValidVersions . join ( ', ' ) } ` ,
322+ `Invalid lambdaVersion "${ lambdaVersion } " for trigger "${ trigger } ". Custom sender triggers only support: ${ customSenderValidVersions . join (
323+ ', '
324+ ) } `,
323325 'COGNITO_INVALID_LAMBDA_VERSION'
324326 ) ;
325327 }
326328 } else if ( trigger === 'PreTokenGeneration' ) {
327329 if ( lambdaVersion && ! preTokenGenerationValidVersions . includes ( lambdaVersion ) ) {
328330 throw new ServerlessError (
329- `Invalid lambdaVersion "${ lambdaVersion } " for trigger "${ trigger } ". PreTokenGeneration supports: ${ preTokenGenerationValidVersions . join ( ', ' ) } ` ,
331+ `Invalid lambdaVersion "${ lambdaVersion } " for trigger "${ trigger } ". PreTokenGeneration supports: ${ preTokenGenerationValidVersions . join (
332+ ', '
333+ ) } `,
330334 'COGNITO_INVALID_LAMBDA_VERSION'
331335 ) ;
332336 }
@@ -351,7 +355,10 @@ class AwsCompileCognitoUserPoolEvents {
351355 if ( event . cognitoUserPool ) {
352356 if ( event . cognitoUserPool . existing ) return ;
353357
354- this . validateLambdaVersion ( event . cognitoUserPool . trigger , event . cognitoUserPool . lambdaVersion ) ;
358+ this . validateLambdaVersion (
359+ event . cognitoUserPool . trigger ,
360+ event . cognitoUserPool . lambdaVersion
361+ ) ;
355362
356363 // Save trigger functions so we can use them to generate
357364 // IAM permissions later
0 commit comments