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 | };
|
26 | }
|
27 |
|
28 | export type UserMigrationAuthenticationTriggerEvent = BaseUserMigrationTriggerEvent<'UserMigration_Authentication'>;
|
29 |
|
30 | export type UserMigrationForgotPasswordTriggerEvent = BaseUserMigrationTriggerEvent<'UserMigration_ForgotPassword'>;
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export type UserMigrationTriggerEvent =
|
36 | | UserMigrationAuthenticationTriggerEvent
|
37 | | UserMigrationForgotPasswordTriggerEvent;
|
38 |
|
39 | export type UserMigrationTriggerHandler = Handler<UserMigrationTriggerEvent>;
|