1 | import { Handler } from "../../handler";
|
2 | import { BaseTriggerEvent, StringMap } from "./_common";
|
3 |
|
4 | export interface BaseCustomMessageTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
|
5 | request: {
|
6 | userAttributes: StringMap;
|
7 | codeParameter: string;
|
8 | linkParameter: string;
|
9 | |
10 |
|
11 |
|
12 | usernameParameter: string | null;
|
13 | clientMetadata?: StringMap | undefined;
|
14 | };
|
15 | response: {
|
16 | smsMessage: string | null;
|
17 | emailMessage: string | null;
|
18 | emailSubject: string | null;
|
19 | };
|
20 | }
|
21 |
|
22 | export type CustomMessageAdminCreateUserTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_AdminCreateUser">;
|
23 |
|
24 | export type CustomMessageAuthenticationTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_Authentication">;
|
25 |
|
26 | export type CustomMessageForgotPasswordTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_ForgotPassword">;
|
27 |
|
28 | export type CustomMessageResendCodeTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_ResendCode">;
|
29 |
|
30 | export type CustomMessageSignUpTriggerEvent = BaseCustomMessageTriggerEvent<"CustomMessage_SignUp">;
|
31 |
|
32 | export type CustomMessageUpdateUserAttributeTriggerEvent = BaseCustomMessageTriggerEvent<
|
33 | "CustomMessage_UpdateUserAttribute"
|
34 | >;
|
35 |
|
36 | export type CustomMessageVerifyUserAttributeTriggerEvent = BaseCustomMessageTriggerEvent<
|
37 | "CustomMessage_VerifyUserAttribute"
|
38 | >;
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export type CustomMessageTriggerEvent =
|
44 | | CustomMessageSignUpTriggerEvent
|
45 | | CustomMessageAdminCreateUserTriggerEvent
|
46 | | CustomMessageResendCodeTriggerEvent
|
47 | | CustomMessageForgotPasswordTriggerEvent
|
48 | | CustomMessageUpdateUserAttributeTriggerEvent
|
49 | | CustomMessageVerifyUserAttributeTriggerEvent
|
50 | | CustomMessageAuthenticationTriggerEvent;
|
51 |
|
52 | export type CustomMessageTriggerHandler = Handler<CustomMessageTriggerEvent>;
|