/**
 * get the name of the custom user pool attribute holding the mapped groups
 */ export const getGroupsCustomAttributeName = ( ) => process . env . GROUPS_ATTRIBUTE_CLAIM_NAME || "custom:groups" ; param groupsFromIdP export const parseGroupsAttribute = ( groupsFromIdP ) : string [ ] => { if ( groupsFromIdP ) { if ( groupsFromIdP . startsWith ( "[" ) && groupsFromIdP . endsWith ( "]" ) ) { return groupsFromIdP . substring ( 1 , groupsFromIdP . length - 1 ) . split ( /\s*,\s*/ ) . filter ( group => group . length > 0 ) ; } else { return [ groupsFromIdP ] ; } } return [ ] ; } ; /**
 * Type information for the lambda event for the PreTokenGeneration trigger
 */ export interface PreTokenGenerationEvent { triggerSource ? : string ; userPoolId ? : string ; request : { userAttributes : { [ key ] : string ; } ; groupConfiguration : { groupsToOverride : string [ ] ; iamRolesToOverride : string [ ] ; preferredRole : string [ ] | null ; } ; } ; response : { claimsOverrideDetails ? : { claimsToAddOrOverride ? : { [ key ] : string ; } ; claimsToSuppress ? : string [ ] ; groupOverrideDetails ? : { groupsToOverride ? : string [ ] ; iamRolesToOverride ? : string [ ] ; preferredRole ? : string ; } ; } | null ; } ; }