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?:
|
50 | | Array<{
|
51 | challengeName:
|
52 | | "CUSTOM_CHALLENGE"
|
53 | | "PASSWORD_VERIFIER"
|
54 | | "SMS_MFA"
|
55 | | "DEVICE_SRP_AUTH"
|
56 | | "DEVICE_PASSWORD_VERIFIER"
|
57 | | "ADMIN_NO_SRP_AUTH"
|
58 | | "SRP_A";
|
59 | challengeResult: boolean;
|
60 | challengeMetadata?: string | undefined;
|
61 | }>
|
62 | | undefined;
|
63 | challengeName?: string | undefined;
|
64 | privateChallengeParameters?: { [key: string]: string } | undefined;
|
65 | challengeAnswer?: string | undefined;
|
66 | password?: string | undefined;
|
67 | clientMetadata?: { [key: string]: string } | undefined;
|
68 | userNotFound?: boolean | undefined;
|
69 | };
|
70 | response: {
|
71 | autoConfirmUser?: boolean | undefined;
|
72 | autoVerifyPhone?: boolean | undefined;
|
73 | autoVerifyEmail?: boolean | undefined;
|
74 | smsMessage?: string | undefined;
|
75 | emailMessage?: string | undefined;
|
76 | emailSubject?: string | undefined;
|
77 | challengeName?: string | undefined;
|
78 | issueTokens?: boolean | undefined;
|
79 | failAuthentication?: boolean | undefined;
|
80 | publicChallengeParameters?: { [key: string]: string } | undefined;
|
81 | privateChallengeParameters?: { [key: string]: string } | undefined;
|
82 | challengeMetadata?: string | undefined;
|
83 | answerCorrect?: boolean | undefined;
|
84 | userAttributes?: { [key: string]: string } | undefined;
|
85 | finalUserStatus?: "CONFIRMED" | "RESET_REQUIRED" | undefined;
|
86 | messageAction?: "SUPPRESS" | undefined;
|
87 | desiredDeliveryMediums?: Array<"EMAIL" | "SMS"> | undefined;
|
88 | forceAliasCreation?: boolean | undefined;
|
89 | claimsOverrideDetails?:
|
90 | | {
|
91 | claimsToAddOrOverride?: { [key: string]: string } | undefined;
|
92 | claimsToSuppress?: string[] | undefined;
|
93 | groupOverrideDetails?:
|
94 | | null
|
95 | | {
|
96 | groupsToOverride?: string[] | undefined;
|
97 | iamRolesToOverride?: string[] | undefined;
|
98 | preferredRole?: string | undefined;
|
99 | }
|
100 | | undefined;
|
101 | }
|
102 | | undefined;
|
103 | };
|
104 | }
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | export type CognitoUserPoolEvent = CognitoUserPoolTriggerEvent;
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | export type CognitoUserPoolTriggerHandler = Handler<CognitoUserPoolTriggerEvent>;
|
115 |
|
116 | export * from "./create-auth-challenge";
|
117 | export * from "./custom-email-sender";
|
118 | export * from "./custom-message";
|
119 | export * from "./custom-sms-sender";
|
120 | export * from "./define-auth-challenge";
|
121 | export * from "./post-authentication";
|
122 | export * from "./post-confirmation";
|
123 | export * from "./pre-authentication";
|
124 | export * from "./pre-signup";
|
125 | export * from "./pre-token-generation";
|
126 | export * from "./pre-token-generation-v2";
|
127 | export * from "./user-migration";
|
128 | export * from "./verify-auth-challenge-response";
|