1 | import { Handler } from "../../handler";
|
2 | import { BaseTriggerEvent, StringMap } from "./_common";
|
3 |
|
4 | export type UserStatus =
|
5 | | "UNCONFIRMED"
|
6 | | "CONFIRMED"
|
7 | | "ARCHIVED"
|
8 | | "COMPROMISED"
|
9 | | "UNKNOWN"
|
10 | | "RESET_REQUIRED"
|
11 | | "FORCE_CHANGE_PASSWORD";
|
12 |
|
13 | export interface BaseUserMigrationTriggerEvent<T extends string> extends BaseTriggerEvent<T> {
|
14 | request: {
|
15 | password: string;
|
16 | validationData?: StringMap | undefined;
|
17 | clientMetadata?: StringMap | undefined;
|
18 | };
|
19 | response: {
|
20 | userAttributes: StringMap;
|
21 | finalUserStatus?: UserStatus | undefined;
|
22 | messageAction?: "RESEND" | "SUPPRESS" | undefined;
|
23 | desiredDeliveryMediums: Array<"SMS" | "EMAIL">;
|
24 | forceAliasCreation?: boolean | undefined;
|
25 | enableSMSMFA?: boolean | undefined;
|
26 | };
|
27 | }
|
28 |
|
29 | export type UserMigrationAuthenticationTriggerEvent = BaseUserMigrationTriggerEvent<"UserMigration_Authentication">;
|
30 |
|
31 | export type UserMigrationForgotPasswordTriggerEvent = BaseUserMigrationTriggerEvent<"UserMigration_ForgotPassword">;
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export type UserMigrationTriggerEvent =
|
37 | | UserMigrationAuthenticationTriggerEvent
|
38 | | UserMigrationForgotPasswordTriggerEvent;
|
39 |
|
40 | export type UserMigrationTriggerHandler = Handler<UserMigrationTriggerEvent>;
|