1 | import { Handler } from '../../handler';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export interface CognitoUserPoolTriggerEvent {
|
9 | version: number;
|
10 | triggerSource:
|
11 | | 'PreSignUp_SignUp'
|
12 | | 'PreSignUp_ExternalProvider'
|
13 | | 'PostConfirmation_ConfirmSignUp'
|
14 | | 'PreAuthentication_Authentication'
|
15 | | 'PostAuthentication_Authentication'
|
16 | | 'CustomMessage_SignUp'
|
17 | | 'CustomMessage_AdminCreateUser'
|
18 | | 'CustomMessage_ResendCode'
|
19 | | 'CustomMessage_ForgotPassword'
|
20 | | 'CustomMessage_UpdateUserAttribute'
|
21 | | 'CustomMessage_VerifyUserAttribute'
|
22 | | 'CustomMessage_Authentication'
|
23 | | 'DefineAuthChallenge_Authentication'
|
24 | | 'CreateAuthChallenge_Authentication'
|
25 | | 'VerifyAuthChallengeResponse_Authentication'
|
26 | | 'PreSignUp_AdminCreateUser'
|
27 | | 'PostConfirmation_ConfirmForgotPassword'
|
28 | | 'TokenGeneration_HostedAuth'
|
29 | | 'TokenGeneration_Authentication'
|
30 | | 'TokenGeneration_NewPasswordChallenge'
|
31 | | 'TokenGeneration_AuthenticateDevice'
|
32 | | 'TokenGeneration_RefreshTokens'
|
33 | | 'UserMigration_Authentication'
|
34 | | 'UserMigration_ForgotPassword';
|
35 | region: string;
|
36 | userPoolId: string;
|
37 | userName?: string | undefined;
|
38 | callerContext: {
|
39 | awsSdkVersion: string;
|
40 | clientId: string;
|
41 | };
|
42 | request: {
|
43 | userAttributes: { [key: string]: string };
|
44 | validationData?: { [key: string]: string } | undefined;
|
45 | codeParameter?: string | undefined;
|
46 | linkParameter?: string | undefined;
|
47 | usernameParameter?: string | undefined;
|
48 | newDeviceUsed?: boolean | undefined;
|
49 | session?: Array<{
|
50 | challengeName:
|
51 | | 'CUSTOM_CHALLENGE'
|
52 | | 'PASSWORD_VERIFIER'
|
53 | | 'SMS_MFA'
|
54 | | 'DEVICE_SRP_AUTH'
|
55 | | 'DEVICE_PASSWORD_VERIFIER'
|
56 | | 'ADMIN_NO_SRP_AUTH'
|
57 | | 'SRP_A';
|
58 | challengeResult: boolean;
|
59 | challengeMetadata?: string | undefined;
|
60 | }> | undefined;
|
61 | challengeName?: string | undefined;
|
62 | privateChallengeParameters?: { [key: string]: string } | undefined;
|
63 | challengeAnswer?: string | undefined;
|
64 | password?: string | undefined;
|
65 | clientMetadata?: { [key: string]: string } | undefined;
|
66 | userNotFound?: boolean | undefined;
|
67 | };
|
68 | response: {
|
69 | autoConfirmUser?: boolean | undefined;
|
70 | autoVerifyPhone?: boolean | undefined;
|
71 | autoVerifyEmail?: boolean | undefined;
|
72 | smsMessage?: string | undefined;
|
73 | emailMessage?: string | undefined;
|
74 | emailSubject?: string | undefined;
|
75 | challengeName?: string | undefined;
|
76 | issueTokens?: boolean | undefined;
|
77 | failAuthentication?: boolean | undefined;
|
78 | publicChallengeParameters?: { [key: string]: string } | undefined;
|
79 | privateChallengeParameters?: { [key: string]: string } | undefined;
|
80 | challengeMetadata?: string | undefined;
|
81 | answerCorrect?: boolean | undefined;
|
82 | userAttributes?: { [key: string]: string } | undefined;
|
83 | finalUserStatus?: 'CONFIRMED' | 'RESET_REQUIRED' | undefined;
|
84 | messageAction?: 'SUPPRESS' | undefined;
|
85 | desiredDeliveryMediums?: Array<'EMAIL' | 'SMS'> | undefined;
|
86 | forceAliasCreation?: boolean | undefined;
|
87 | claimsOverrideDetails?: {
|
88 | claimsToAddOrOverride?: { [key: string]: string } | undefined;
|
89 | claimsToSuppress?: string[] | undefined;
|
90 | groupOverrideDetails?: null | {
|
91 | groupsToOverride?: string[] | undefined;
|
92 | iamRolesToOverride?: string[] | undefined;
|
93 | preferredRole?: string | undefined;
|
94 | } | undefined;
|
95 | } | undefined;
|
96 | };
|
97 | }
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | export type CognitoUserPoolEvent = CognitoUserPoolTriggerEvent;
|
103 |
|
104 |
|
105 |
|
106 |
|
107 | export type CognitoUserPoolTriggerHandler = Handler<CognitoUserPoolTriggerEvent>;
|
108 |
|
109 | export * from './create-auth-challenge';
|
110 | export * from './custom-message';
|
111 | export * from './custom-email-sender';
|
112 | export * from './define-auth-challenge';
|
113 | export * from './post-authentication';
|
114 | export * from './post-confirmation';
|
115 | export * from './pre-authentication';
|
116 | export * from './pre-signup';
|
117 | export * from './pre-token-generation';
|
118 | export * from './user-migration';
|
119 | export * from './verify-auth-challenge-response';
|