1 | import { Handler } from "../../handler";
|
2 | import { BaseTriggerEvent, StringMap } from "./_common";
|
3 |
|
4 | export interface BaseCustomEmailSenderTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
|
5 | request: {
|
6 | type: string;
|
7 | code: string | null;
|
8 | userAttributes: StringMap;
|
9 | clientMetadata?: StringMap | undefined;
|
10 | };
|
11 | }
|
12 |
|
13 | export type AccountTakeOverActionType = "BLOCK" | "NO_ACTION" | "MFA" | "MFA_IF_CONFIGURED" | "MFA_REQUIRED";
|
14 |
|
15 | export interface CustomEmailSender_AccountTakeOverNotification_UserAttributes {
|
16 | EVENT_ID: string;
|
17 | USER_NAME: string;
|
18 | IP_ADDRESS: string;
|
19 | ACCOUNT_TAKE_OVER_ACTION: AccountTakeOverActionType;
|
20 | ONE_CLICK_LINK_VALID: string;
|
21 | ONE_CLICK_LINK_INVALID: string;
|
22 | LOGIN_TIME: string;
|
23 | FEEDBACK_TOKEN: string;
|
24 | CITY?: string | undefined;
|
25 | COUNTRY?: string | undefined;
|
26 | DEVICE_NAME?: string | undefined;
|
27 | }
|
28 |
|
29 | export interface CustomEmailSenderSignUpTriggerEvent
|
30 | extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_SignUp">
|
31 | {}
|
32 |
|
33 | export interface CustomEmailSenderResendCodeTriggerEvent
|
34 | extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_ResendCode">
|
35 | {}
|
36 |
|
37 | export interface CustomEmailSenderForgotPasswordTriggerEvent
|
38 | extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_ForgotPassword">
|
39 | {}
|
40 |
|
41 | export interface CustomEmailSenderUpdateUserAttributeTriggerEvent
|
42 | extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_UpdateUserAttribute">
|
43 | {}
|
44 |
|
45 | export interface CustomEmailSenderVerifyUserAttributeTriggerEvent
|
46 | extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_VerifyUserAttribute">
|
47 | {}
|
48 |
|
49 | export interface CustomEmailSenderAdminCreateUserTriggerEvent
|
50 | extends BaseCustomEmailSenderTriggerEvent<"CustomEmailSender_AdminCreateUser">
|
51 | {}
|
52 |
|
53 | export interface CustomEmailSenderAccountTakeOverNotificationTriggerEvent
|
54 | extends BaseTriggerEvent<"CustomEmailSender_AccountTakeOverNotification">
|
55 | {
|
56 | request: {
|
57 | type: string;
|
58 | code: string | null;
|
59 | userAttributes: CustomEmailSender_AccountTakeOverNotification_UserAttributes;
|
60 | clientMetadata?: StringMap | undefined;
|
61 | };
|
62 | }
|
63 |
|
64 |
|
65 |
|
66 |
|
67 | export type CustomEmailSenderTriggerEvent =
|
68 | | CustomEmailSenderSignUpTriggerEvent
|
69 | | CustomEmailSenderResendCodeTriggerEvent
|
70 | | CustomEmailSenderForgotPasswordTriggerEvent
|
71 | | CustomEmailSenderUpdateUserAttributeTriggerEvent
|
72 | | CustomEmailSenderVerifyUserAttributeTriggerEvent
|
73 | | CustomEmailSenderAdminCreateUserTriggerEvent
|
74 | | CustomEmailSenderAccountTakeOverNotificationTriggerEvent;
|
75 |
|
76 | export type CustomEmailSenderTriggerHandler = Handler<CustomEmailSenderTriggerEvent>;
|