@webiny/cognito 0.0.0-unstable.0156a4c312
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cognito.d.ts +55 -0
- package/Cognito.js +104 -0
- package/Cognito.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/admin/Cognito.d.ts +8 -0
- package/admin/Cognito.js +8 -0
- package/admin/Cognito.js.map +1 -0
- package/admin/CognitoLogin.d.ts +7 -0
- package/admin/CognitoLogin.js +13 -0
- package/admin/CognitoLogin.js.map +1 -0
- package/admin/DefaultCognitoSignInConfig.d.ts +23 -0
- package/admin/DefaultCognitoSignInConfig.js +51 -0
- package/admin/DefaultCognitoSignInConfig.js.map +1 -0
- package/admin/Extension.d.ts +2 -0
- package/admin/Extension.js +21 -0
- package/admin/Extension.js.map +1 -0
- package/admin/SignInExtension.d.ts +2 -0
- package/admin/SignInExtension.js +9 -0
- package/admin/SignInExtension.js.map +1 -0
- package/admin/federatedIdentityProviders.d.ts +9 -0
- package/admin/federatedIdentityProviders.js +10 -0
- package/admin/federatedIdentityProviders.js.map +1 -0
- package/admin/index.d.ts +2 -0
- package/admin/index.js +2 -0
- package/admin/presentation/Cognito/CognitoLoginScreen.d.ts +10 -0
- package/admin/presentation/Cognito/CognitoLoginScreen.js +60 -0
- package/admin/presentation/Cognito/CognitoLoginScreen.js.map +1 -0
- package/admin/presentation/Cognito/CognitoPresenter.d.ts +81 -0
- package/admin/presentation/Cognito/CognitoPresenter.js +386 -0
- package/admin/presentation/Cognito/CognitoPresenter.js.map +1 -0
- package/admin/presentation/Cognito/CognitoSignInConfig.d.ts +31 -0
- package/admin/presentation/Cognito/CognitoSignInConfig.js +5 -0
- package/admin/presentation/Cognito/CognitoSignInConfig.js.map +1 -0
- package/admin/presentation/Cognito/abstractions.d.ts +91 -0
- package/admin/presentation/Cognito/abstractions.js +5 -0
- package/admin/presentation/Cognito/abstractions.js.map +1 -0
- package/admin/presentation/Cognito/components/ConfirmTotpCode.d.ts +26 -0
- package/admin/presentation/Cognito/components/ConfirmTotpCode.js +45 -0
- package/admin/presentation/Cognito/components/ConfirmTotpCode.js.map +1 -0
- package/admin/presentation/Cognito/components/Divider.d.ts +20 -0
- package/admin/presentation/Cognito/components/Divider.js +16 -0
- package/admin/presentation/Cognito/components/Divider.js.map +1 -0
- package/admin/presentation/Cognito/components/FederatedLogin.d.ts +24 -0
- package/admin/presentation/Cognito/components/FederatedLogin.js +43 -0
- package/admin/presentation/Cognito/components/FederatedLogin.js.map +1 -0
- package/admin/presentation/Cognito/components/FederatedProviders.d.ts +44 -0
- package/admin/presentation/Cognito/components/FederatedProviders.js +11 -0
- package/admin/presentation/Cognito/components/FederatedProviders.js.map +1 -0
- package/admin/presentation/Cognito/components/FooterSignIn.d.ts +23 -0
- package/admin/presentation/Cognito/components/FooterSignIn.js +13 -0
- package/admin/presentation/Cognito/components/FooterSignIn.js.map +1 -0
- package/admin/presentation/Cognito/components/PasswordResetCodeSent.d.ts +27 -0
- package/admin/presentation/Cognito/components/PasswordResetCodeSent.js +40 -0
- package/admin/presentation/Cognito/components/PasswordResetCodeSent.js.map +1 -0
- package/admin/presentation/Cognito/components/RequestPasswordResetCode.d.ts +26 -0
- package/admin/presentation/Cognito/components/RequestPasswordResetCode.js +42 -0
- package/admin/presentation/Cognito/components/RequestPasswordResetCode.js.map +1 -0
- package/admin/presentation/Cognito/components/RequireNewPassword.d.ts +26 -0
- package/admin/presentation/Cognito/components/RequireNewPassword.js +52 -0
- package/admin/presentation/Cognito/components/RequireNewPassword.js.map +1 -0
- package/admin/presentation/Cognito/components/SetNewPassword.d.ts +26 -0
- package/admin/presentation/Cognito/components/SetNewPassword.js +79 -0
- package/admin/presentation/Cognito/components/SetNewPassword.js.map +1 -0
- package/admin/presentation/Cognito/components/SetupTotp.d.ts +25 -0
- package/admin/presentation/Cognito/components/SetupTotp.js +60 -0
- package/admin/presentation/Cognito/components/SetupTotp.js.map +1 -0
- package/admin/presentation/Cognito/components/SignIn.d.ts +26 -0
- package/admin/presentation/Cognito/components/SignIn.js +64 -0
- package/admin/presentation/Cognito/components/SignIn.js.map +1 -0
- package/admin/presentation/Cognito/components/View.d.ts +98 -0
- package/admin/presentation/Cognito/components/View.js +48 -0
- package/admin/presentation/Cognito/components/View.js.map +1 -0
- package/admin/presentation/Cognito/components/index.d.ts +292 -0
- package/admin/presentation/Cognito/components/index.js +29 -0
- package/admin/presentation/Cognito/components/index.js.map +1 -0
- package/admin/presentation/Cognito/feature.d.ts +3 -0
- package/admin/presentation/Cognito/feature.js +17 -0
- package/admin/presentation/Cognito/feature.js.map +1 -0
- package/admin/presentation/Cognito/signInFeature.d.ts +1 -0
- package/admin/presentation/Cognito/signInFeature.js +11 -0
- package/admin/presentation/Cognito/signInFeature.js.map +1 -0
- package/api/CognitoApiFeature.d.ts +4 -0
- package/api/CognitoApiFeature.js +26 -0
- package/api/CognitoApiFeature.js.map +1 -0
- package/api/domain/Username.d.ts +4 -0
- package/api/domain/Username.js +8 -0
- package/api/domain/Username.js.map +1 -0
- package/api/domain/errors.d.ts +37 -0
- package/api/domain/errors.js +44 -0
- package/api/domain/errors.js.map +1 -0
- package/api/features/CognitoIdp/CognitoIdentityProvider.d.ts +15 -0
- package/api/features/CognitoIdp/CognitoIdentityProvider.js +63 -0
- package/api/features/CognitoIdp/CognitoIdentityProvider.js.map +1 -0
- package/api/features/CognitoIdp/abstractions.d.ts +15 -0
- package/api/features/CognitoIdp/abstractions.js +5 -0
- package/api/features/CognitoIdp/abstractions.js.map +1 -0
- package/api/features/CognitoIdp/feature.d.ts +4 -0
- package/api/features/CognitoIdp/feature.js +11 -0
- package/api/features/CognitoIdp/feature.js.map +1 -0
- package/api/features/CognitoIdp/index.d.ts +2 -0
- package/api/features/CognitoIdp/index.js +2 -0
- package/api/features/CognitoService/CognitoService.d.ts +20 -0
- package/api/features/CognitoService/CognitoService.js +100 -0
- package/api/features/CognitoService/CognitoService.js.map +1 -0
- package/api/features/CognitoService/abstractions.d.ts +54 -0
- package/api/features/CognitoService/abstractions.js +6 -0
- package/api/features/CognitoService/abstractions.js.map +1 -0
- package/api/features/CognitoService/feature.d.ts +8 -0
- package/api/features/CognitoService/feature.js +13 -0
- package/api/features/CognitoService/feature.js.map +1 -0
- package/api/features/CognitoService/index.d.ts +1 -0
- package/api/features/CognitoService/index.js +1 -0
- package/api/features/CreateUser/CreateUserUseCase.d.ts +22 -0
- package/api/features/CreateUser/CreateUserUseCase.js +80 -0
- package/api/features/CreateUser/CreateUserUseCase.js.map +1 -0
- package/api/features/CreateUser/abstractions.d.ts +35 -0
- package/api/features/CreateUser/abstractions.js +5 -0
- package/api/features/CreateUser/abstractions.js.map +1 -0
- package/api/features/CreateUser/feature.d.ts +4 -0
- package/api/features/CreateUser/feature.js +11 -0
- package/api/features/CreateUser/feature.js.map +1 -0
- package/api/features/CreateUser/index.d.ts +2 -0
- package/api/features/CreateUser/index.js +2 -0
- package/api/features/CreateUser/schema.d.ts +15 -0
- package/api/features/CreateUser/schema.js +18 -0
- package/api/features/CreateUser/schema.js.map +1 -0
- package/api/features/DeleteUser/DeleteUserUseCase.d.ts +16 -0
- package/api/features/DeleteUser/DeleteUserUseCase.js +47 -0
- package/api/features/DeleteUser/DeleteUserUseCase.js.map +1 -0
- package/api/features/DeleteUser/abstractions.d.ts +19 -0
- package/api/features/DeleteUser/abstractions.js +5 -0
- package/api/features/DeleteUser/abstractions.js.map +1 -0
- package/api/features/DeleteUser/feature.d.ts +4 -0
- package/api/features/DeleteUser/feature.js +11 -0
- package/api/features/DeleteUser/feature.js.map +1 -0
- package/api/features/DeleteUser/index.d.ts +2 -0
- package/api/features/DeleteUser/index.js +2 -0
- package/api/features/UpdateUser/UpdateUserUseCase.d.ts +21 -0
- package/api/features/UpdateUser/UpdateUserUseCase.js +66 -0
- package/api/features/UpdateUser/UpdateUserUseCase.js.map +1 -0
- package/api/features/UpdateUser/abstractions.d.ts +33 -0
- package/api/features/UpdateUser/abstractions.js +5 -0
- package/api/features/UpdateUser/abstractions.js.map +1 -0
- package/api/features/UpdateUser/feature.d.ts +4 -0
- package/api/features/UpdateUser/feature.js +11 -0
- package/api/features/UpdateUser/feature.js.map +1 -0
- package/api/features/UpdateUser/index.d.ts +2 -0
- package/api/features/UpdateUser/index.js +2 -0
- package/api/features/UpdateUser/schema.d.ts +14 -0
- package/api/features/UpdateUser/schema.js +17 -0
- package/api/features/UpdateUser/schema.js.map +1 -0
- package/api/features/UserInstaller/UserInstaller.d.ts +27 -0
- package/api/features/UserInstaller/UserInstaller.js +48 -0
- package/api/features/UserInstaller/UserInstaller.js.map +1 -0
- package/api/features/UserInstaller/feature.d.ts +4 -0
- package/api/features/UserInstaller/feature.js +11 -0
- package/api/features/UserInstaller/feature.js.map +1 -0
- package/api/graphql/user.gql.d.ts +9 -0
- package/api/graphql/user.gql.js +147 -0
- package/api/graphql/user.gql.js.map +1 -0
- package/api/index.d.ts +1 -0
- package/api/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/infra/CognitoFederationPulumi.d.ts +8 -0
- package/infra/CognitoFederationPulumi.js +17 -0
- package/infra/CognitoFederationPulumi.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
export declare const Components: {
|
|
2
|
+
SignIn: ((props: import("./SignIn.js").SignInProps) => import("react").JSX.Element) & {
|
|
3
|
+
original: (props: import("./SignIn.js").SignInProps) => import("react").JSX.Element;
|
|
4
|
+
originalName: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
} & {
|
|
7
|
+
original: ((props: import("./SignIn.js").SignInProps) => import("react").JSX.Element) & {
|
|
8
|
+
original: (props: import("./SignIn.js").SignInProps) => import("react").JSX.Element;
|
|
9
|
+
originalName: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
originalName: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
} & {
|
|
15
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<((props: import("./SignIn.js").SignInProps) => import("react").JSX.Element) & {
|
|
16
|
+
original: (props: import("./SignIn.js").SignInProps) => import("react").JSX.Element;
|
|
17
|
+
originalName: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
20
|
+
};
|
|
21
|
+
ConfirmTotpCode: ((props: import("./ConfirmTotpCode.js").ConfirmTotpCodeProps) => import("react").JSX.Element) & {
|
|
22
|
+
original: (props: import("./ConfirmTotpCode.js").ConfirmTotpCodeProps) => import("react").JSX.Element;
|
|
23
|
+
originalName: string;
|
|
24
|
+
displayName: string;
|
|
25
|
+
} & {
|
|
26
|
+
original: ((props: import("./ConfirmTotpCode.js").ConfirmTotpCodeProps) => import("react").JSX.Element) & {
|
|
27
|
+
original: (props: import("./ConfirmTotpCode.js").ConfirmTotpCodeProps) => import("react").JSX.Element;
|
|
28
|
+
originalName: string;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
originalName: string;
|
|
32
|
+
displayName: string;
|
|
33
|
+
} & {
|
|
34
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<((props: import("./ConfirmTotpCode.js").ConfirmTotpCodeProps) => import("react").JSX.Element) & {
|
|
35
|
+
original: (props: import("./ConfirmTotpCode.js").ConfirmTotpCodeProps) => import("react").JSX.Element;
|
|
36
|
+
originalName: string;
|
|
37
|
+
displayName: string;
|
|
38
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
39
|
+
};
|
|
40
|
+
SetupTotp: ((props: import("./SetupTotp.js").SetupTotpProps) => import("react").JSX.Element) & {
|
|
41
|
+
original: (props: import("./SetupTotp.js").SetupTotpProps) => import("react").JSX.Element;
|
|
42
|
+
originalName: string;
|
|
43
|
+
displayName: string;
|
|
44
|
+
} & {
|
|
45
|
+
original: ((props: import("./SetupTotp.js").SetupTotpProps) => import("react").JSX.Element) & {
|
|
46
|
+
original: (props: import("./SetupTotp.js").SetupTotpProps) => import("react").JSX.Element;
|
|
47
|
+
originalName: string;
|
|
48
|
+
displayName: string;
|
|
49
|
+
};
|
|
50
|
+
originalName: string;
|
|
51
|
+
displayName: string;
|
|
52
|
+
} & {
|
|
53
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<((props: import("./SetupTotp.js").SetupTotpProps) => import("react").JSX.Element) & {
|
|
54
|
+
original: (props: import("./SetupTotp.js").SetupTotpProps) => import("react").JSX.Element;
|
|
55
|
+
originalName: string;
|
|
56
|
+
displayName: string;
|
|
57
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
58
|
+
};
|
|
59
|
+
RequireNewPassword: ((props: import("./RequireNewPassword.js").RequireNewPasswordProps) => import("react").JSX.Element) & {
|
|
60
|
+
original: (props: import("./RequireNewPassword.js").RequireNewPasswordProps) => import("react").JSX.Element;
|
|
61
|
+
originalName: string;
|
|
62
|
+
displayName: string;
|
|
63
|
+
} & {
|
|
64
|
+
original: ((props: import("./RequireNewPassword.js").RequireNewPasswordProps) => import("react").JSX.Element) & {
|
|
65
|
+
original: (props: import("./RequireNewPassword.js").RequireNewPasswordProps) => import("react").JSX.Element;
|
|
66
|
+
originalName: string;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
originalName: string;
|
|
70
|
+
displayName: string;
|
|
71
|
+
} & {
|
|
72
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<((props: import("./RequireNewPassword.js").RequireNewPasswordProps) => import("react").JSX.Element) & {
|
|
73
|
+
original: (props: import("./RequireNewPassword.js").RequireNewPasswordProps) => import("react").JSX.Element;
|
|
74
|
+
originalName: string;
|
|
75
|
+
displayName: string;
|
|
76
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
77
|
+
};
|
|
78
|
+
RequestPasswordResetCode: ((props: import("./RequestPasswordResetCode.js").ForgotPasswordProps) => import("react").JSX.Element) & {
|
|
79
|
+
original: (props: import("./RequestPasswordResetCode.js").ForgotPasswordProps) => import("react").JSX.Element;
|
|
80
|
+
originalName: string;
|
|
81
|
+
displayName: string;
|
|
82
|
+
} & {
|
|
83
|
+
original: ((props: import("./RequestPasswordResetCode.js").ForgotPasswordProps) => import("react").JSX.Element) & {
|
|
84
|
+
original: (props: import("./RequestPasswordResetCode.js").ForgotPasswordProps) => import("react").JSX.Element;
|
|
85
|
+
originalName: string;
|
|
86
|
+
displayName: string;
|
|
87
|
+
};
|
|
88
|
+
originalName: string;
|
|
89
|
+
displayName: string;
|
|
90
|
+
} & {
|
|
91
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<((props: import("./RequestPasswordResetCode.js").ForgotPasswordProps) => import("react").JSX.Element) & {
|
|
92
|
+
original: (props: import("./RequestPasswordResetCode.js").ForgotPasswordProps) => import("react").JSX.Element;
|
|
93
|
+
originalName: string;
|
|
94
|
+
displayName: string;
|
|
95
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
96
|
+
};
|
|
97
|
+
PasswordResetCodeSent: ((props: import("./PasswordResetCodeSent.js").PasswordResetCodeSentProps) => import("react").JSX.Element) & {
|
|
98
|
+
original: (props: import("./PasswordResetCodeSent.js").PasswordResetCodeSentProps) => import("react").JSX.Element;
|
|
99
|
+
originalName: string;
|
|
100
|
+
displayName: string;
|
|
101
|
+
} & {
|
|
102
|
+
original: ((props: import("./PasswordResetCodeSent.js").PasswordResetCodeSentProps) => import("react").JSX.Element) & {
|
|
103
|
+
original: (props: import("./PasswordResetCodeSent.js").PasswordResetCodeSentProps) => import("react").JSX.Element;
|
|
104
|
+
originalName: string;
|
|
105
|
+
displayName: string;
|
|
106
|
+
};
|
|
107
|
+
originalName: string;
|
|
108
|
+
displayName: string;
|
|
109
|
+
} & {
|
|
110
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<((props: import("./PasswordResetCodeSent.js").PasswordResetCodeSentProps) => import("react").JSX.Element) & {
|
|
111
|
+
original: (props: import("./PasswordResetCodeSent.js").PasswordResetCodeSentProps) => import("react").JSX.Element;
|
|
112
|
+
originalName: string;
|
|
113
|
+
displayName: string;
|
|
114
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
115
|
+
};
|
|
116
|
+
SetNewPassword: ((props: import("./SetNewPassword.js").SetNewPasswordProps) => import("react").JSX.Element) & {
|
|
117
|
+
original: (props: import("./SetNewPassword.js").SetNewPasswordProps) => import("react").JSX.Element;
|
|
118
|
+
originalName: string;
|
|
119
|
+
displayName: string;
|
|
120
|
+
} & {
|
|
121
|
+
original: ((props: import("./SetNewPassword.js").SetNewPasswordProps) => import("react").JSX.Element) & {
|
|
122
|
+
original: (props: import("./SetNewPassword.js").SetNewPasswordProps) => import("react").JSX.Element;
|
|
123
|
+
originalName: string;
|
|
124
|
+
displayName: string;
|
|
125
|
+
};
|
|
126
|
+
originalName: string;
|
|
127
|
+
displayName: string;
|
|
128
|
+
} & {
|
|
129
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<((props: import("./SetNewPassword.js").SetNewPasswordProps) => import("react").JSX.Element) & {
|
|
130
|
+
original: (props: import("./SetNewPassword.js").SetNewPasswordProps) => import("react").JSX.Element;
|
|
131
|
+
originalName: string;
|
|
132
|
+
displayName: string;
|
|
133
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
134
|
+
};
|
|
135
|
+
FederatedLogin: (({ providers }: import("./FederatedLogin.js").FederatedLoginProps) => import("react").JSX.Element) & {
|
|
136
|
+
original: ({ providers }: import("./FederatedLogin.js").FederatedLoginProps) => import("react").JSX.Element;
|
|
137
|
+
originalName: string;
|
|
138
|
+
displayName: string;
|
|
139
|
+
} & {
|
|
140
|
+
original: (({ providers }: import("./FederatedLogin.js").FederatedLoginProps) => import("react").JSX.Element) & {
|
|
141
|
+
original: ({ providers }: import("./FederatedLogin.js").FederatedLoginProps) => import("react").JSX.Element;
|
|
142
|
+
originalName: string;
|
|
143
|
+
displayName: string;
|
|
144
|
+
};
|
|
145
|
+
originalName: string;
|
|
146
|
+
displayName: string;
|
|
147
|
+
} & {
|
|
148
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<(({ providers }: import("./FederatedLogin.js").FederatedLoginProps) => import("react").JSX.Element) & {
|
|
149
|
+
original: ({ providers }: import("./FederatedLogin.js").FederatedLoginProps) => import("react").JSX.Element;
|
|
150
|
+
originalName: string;
|
|
151
|
+
displayName: string;
|
|
152
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
153
|
+
};
|
|
154
|
+
FederatedProviders: {
|
|
155
|
+
Container: (({ children }: import("./FederatedProviders.js").ContainerProps) => import("react").JSX.Element) & {
|
|
156
|
+
original: ({ children }: import("./FederatedProviders.js").ContainerProps) => import("react").JSX.Element;
|
|
157
|
+
originalName: string;
|
|
158
|
+
displayName: string;
|
|
159
|
+
} & {
|
|
160
|
+
original: (({ children }: import("./FederatedProviders.js").ContainerProps) => import("react").JSX.Element) & {
|
|
161
|
+
original: ({ children }: import("./FederatedProviders.js").ContainerProps) => import("react").JSX.Element;
|
|
162
|
+
originalName: string;
|
|
163
|
+
displayName: string;
|
|
164
|
+
};
|
|
165
|
+
originalName: string;
|
|
166
|
+
displayName: string;
|
|
167
|
+
} & {
|
|
168
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<(({ children }: import("./FederatedProviders.js").ContainerProps) => import("react").JSX.Element) & {
|
|
169
|
+
original: ({ children }: import("./FederatedProviders.js").ContainerProps) => import("react").JSX.Element;
|
|
170
|
+
originalName: string;
|
|
171
|
+
displayName: string;
|
|
172
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
Divider: (() => import("react").JSX.Element) & {
|
|
176
|
+
original: () => import("react").JSX.Element;
|
|
177
|
+
originalName: string;
|
|
178
|
+
displayName: string;
|
|
179
|
+
} & {
|
|
180
|
+
original: (() => import("react").JSX.Element) & {
|
|
181
|
+
original: () => import("react").JSX.Element;
|
|
182
|
+
originalName: string;
|
|
183
|
+
displayName: string;
|
|
184
|
+
};
|
|
185
|
+
originalName: string;
|
|
186
|
+
displayName: string;
|
|
187
|
+
} & {
|
|
188
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<(() => import("react").JSX.Element) & {
|
|
189
|
+
original: () => import("react").JSX.Element;
|
|
190
|
+
originalName: string;
|
|
191
|
+
displayName: string;
|
|
192
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
193
|
+
};
|
|
194
|
+
FooterSignIn: (({ onSignIn }: import("./FooterSignIn.js").FooterSignInProps) => import("react").JSX.Element) & {
|
|
195
|
+
original: ({ onSignIn }: import("./FooterSignIn.js").FooterSignInProps) => import("react").JSX.Element;
|
|
196
|
+
originalName: string;
|
|
197
|
+
displayName: string;
|
|
198
|
+
} & {
|
|
199
|
+
original: (({ onSignIn }: import("./FooterSignIn.js").FooterSignInProps) => import("react").JSX.Element) & {
|
|
200
|
+
original: ({ onSignIn }: import("./FooterSignIn.js").FooterSignInProps) => import("react").JSX.Element;
|
|
201
|
+
originalName: string;
|
|
202
|
+
displayName: string;
|
|
203
|
+
};
|
|
204
|
+
originalName: string;
|
|
205
|
+
displayName: string;
|
|
206
|
+
} & {
|
|
207
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<(({ onSignIn }: import("./FooterSignIn.js").FooterSignInProps) => import("react").JSX.Element) & {
|
|
208
|
+
original: ({ onSignIn }: import("./FooterSignIn.js").FooterSignInProps) => import("react").JSX.Element;
|
|
209
|
+
originalName: string;
|
|
210
|
+
displayName: string;
|
|
211
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
212
|
+
};
|
|
213
|
+
View: {
|
|
214
|
+
Container: (({ children }: import("./View.js").ContainerProps) => import("react").JSX.Element) & {
|
|
215
|
+
original: ({ children }: import("./View.js").ContainerProps) => import("react").JSX.Element;
|
|
216
|
+
originalName: string;
|
|
217
|
+
displayName: string;
|
|
218
|
+
} & {
|
|
219
|
+
original: (({ children }: import("./View.js").ContainerProps) => import("react").JSX.Element) & {
|
|
220
|
+
original: ({ children }: import("./View.js").ContainerProps) => import("react").JSX.Element;
|
|
221
|
+
originalName: string;
|
|
222
|
+
displayName: string;
|
|
223
|
+
};
|
|
224
|
+
originalName: string;
|
|
225
|
+
displayName: string;
|
|
226
|
+
} & {
|
|
227
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<(({ children }: import("./View.js").ContainerProps) => import("react").JSX.Element) & {
|
|
228
|
+
original: ({ children }: import("./View.js").ContainerProps) => import("react").JSX.Element;
|
|
229
|
+
originalName: string;
|
|
230
|
+
displayName: string;
|
|
231
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
232
|
+
};
|
|
233
|
+
Content: (({ children }: import("./View.js").ContentProps) => import("react").JSX.Element) & {
|
|
234
|
+
original: ({ children }: import("./View.js").ContentProps) => import("react").JSX.Element;
|
|
235
|
+
originalName: string;
|
|
236
|
+
displayName: string;
|
|
237
|
+
} & {
|
|
238
|
+
original: (({ children }: import("./View.js").ContentProps) => import("react").JSX.Element) & {
|
|
239
|
+
original: ({ children }: import("./View.js").ContentProps) => import("react").JSX.Element;
|
|
240
|
+
originalName: string;
|
|
241
|
+
displayName: string;
|
|
242
|
+
};
|
|
243
|
+
originalName: string;
|
|
244
|
+
displayName: string;
|
|
245
|
+
} & {
|
|
246
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<(({ children }: import("./View.js").ContentProps) => import("react").JSX.Element) & {
|
|
247
|
+
original: ({ children }: import("./View.js").ContentProps) => import("react").JSX.Element;
|
|
248
|
+
originalName: string;
|
|
249
|
+
displayName: string;
|
|
250
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
251
|
+
};
|
|
252
|
+
Title: (({ title, description }: import("./View.js").TitleProps) => import("react").JSX.Element) & {
|
|
253
|
+
original: ({ title, description }: import("./View.js").TitleProps) => import("react").JSX.Element;
|
|
254
|
+
originalName: string;
|
|
255
|
+
displayName: string;
|
|
256
|
+
} & {
|
|
257
|
+
original: (({ title, description }: import("./View.js").TitleProps) => import("react").JSX.Element) & {
|
|
258
|
+
original: ({ title, description }: import("./View.js").TitleProps) => import("react").JSX.Element;
|
|
259
|
+
originalName: string;
|
|
260
|
+
displayName: string;
|
|
261
|
+
};
|
|
262
|
+
originalName: string;
|
|
263
|
+
displayName: string;
|
|
264
|
+
} & {
|
|
265
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<(({ title, description }: import("./View.js").TitleProps) => import("react").JSX.Element) & {
|
|
266
|
+
original: ({ title, description }: import("./View.js").TitleProps) => import("react").JSX.Element;
|
|
267
|
+
originalName: string;
|
|
268
|
+
displayName: string;
|
|
269
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
270
|
+
};
|
|
271
|
+
Footer: (({ children }: import("./View.js").FooterProps) => import("react").JSX.Element) & {
|
|
272
|
+
original: ({ children }: import("./View.js").FooterProps) => import("react").JSX.Element;
|
|
273
|
+
originalName: string;
|
|
274
|
+
displayName: string;
|
|
275
|
+
} & {
|
|
276
|
+
original: (({ children }: import("./View.js").FooterProps) => import("react").JSX.Element) & {
|
|
277
|
+
original: ({ children }: import("./View.js").FooterProps) => import("react").JSX.Element;
|
|
278
|
+
originalName: string;
|
|
279
|
+
displayName: string;
|
|
280
|
+
};
|
|
281
|
+
originalName: string;
|
|
282
|
+
displayName: string;
|
|
283
|
+
} & {
|
|
284
|
+
createDecorator: (decorator: import("@webiny/app/index.js").ComponentDecorator<(({ children }: import("./View.js").FooterProps) => import("react").JSX.Element) & {
|
|
285
|
+
original: ({ children }: import("./View.js").FooterProps) => import("react").JSX.Element;
|
|
286
|
+
originalName: string;
|
|
287
|
+
displayName: string;
|
|
288
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
289
|
+
};
|
|
290
|
+
Error: typeof import("./View.js").Error;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SignIn } from "./SignIn.js";
|
|
2
|
+
import { ConfirmTotpCode } from "./ConfirmTotpCode.js";
|
|
3
|
+
import { SetupTotp } from "./SetupTotp.js";
|
|
4
|
+
import { RequireNewPassword } from "./RequireNewPassword.js";
|
|
5
|
+
import { RequestPasswordResetCode } from "./RequestPasswordResetCode.js";
|
|
6
|
+
import { PasswordResetCodeSent } from "./PasswordResetCodeSent.js";
|
|
7
|
+
import { SetNewPassword } from "./SetNewPassword.js";
|
|
8
|
+
import { FederatedLogin } from "./FederatedLogin.js";
|
|
9
|
+
import { FederatedProviders } from "./FederatedProviders.js";
|
|
10
|
+
import { Divider } from "./Divider.js";
|
|
11
|
+
import { FooterSignIn } from "./FooterSignIn.js";
|
|
12
|
+
import { View } from "./View.js";
|
|
13
|
+
const Components = {
|
|
14
|
+
SignIn: SignIn,
|
|
15
|
+
ConfirmTotpCode: ConfirmTotpCode,
|
|
16
|
+
SetupTotp: SetupTotp,
|
|
17
|
+
RequireNewPassword: RequireNewPassword,
|
|
18
|
+
RequestPasswordResetCode: RequestPasswordResetCode,
|
|
19
|
+
PasswordResetCodeSent: PasswordResetCodeSent,
|
|
20
|
+
SetNewPassword: SetNewPassword,
|
|
21
|
+
FederatedLogin: FederatedLogin,
|
|
22
|
+
FederatedProviders: FederatedProviders,
|
|
23
|
+
Divider: Divider,
|
|
24
|
+
FooterSignIn: FooterSignIn,
|
|
25
|
+
View: View
|
|
26
|
+
};
|
|
27
|
+
export { Components };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/presentation/Cognito/components/index.js","sources":["../../../../../src/admin/presentation/Cognito/components/index.ts"],"sourcesContent":["import { SignIn } from \"./SignIn.js\";\nimport { ConfirmTotpCode } from \"./ConfirmTotpCode.js\";\nimport { SetupTotp } from \"./SetupTotp.js\";\nimport { RequireNewPassword } from \"./RequireNewPassword.js\";\nimport { RequestPasswordResetCode } from \"./RequestPasswordResetCode.js\";\nimport { PasswordResetCodeSent } from \"./PasswordResetCodeSent.js\";\nimport { SetNewPassword } from \"./SetNewPassword.js\";\nimport { FederatedLogin } from \"./FederatedLogin.js\";\nimport { FederatedProviders } from \"./FederatedProviders.js\";\nimport { Divider } from \"./Divider.js\";\nimport { FooterSignIn } from \"./FooterSignIn.js\";\nimport { View } from \"./View.js\";\n\nexport const Components = {\n SignIn,\n ConfirmTotpCode,\n SetupTotp,\n RequireNewPassword,\n RequestPasswordResetCode,\n PasswordResetCodeSent,\n SetNewPassword,\n FederatedLogin,\n FederatedProviders,\n Divider,\n FooterSignIn,\n View\n};\n"],"names":["Components","SignIn","ConfirmTotpCode","SetupTotp","RequireNewPassword","RequestPasswordResetCode","PasswordResetCodeSent","SetNewPassword","FederatedLogin","FederatedProviders","Divider","FooterSignIn","View"],"mappings":";;;;;;;;;;;;AAaO,MAAMA,aAAa;IACtBC,QAAMA;IACNC,iBAAeA;IACfC,WAASA;IACTC,oBAAkBA;IAClBC,0BAAwBA;IACxBC,uBAAqBA;IACrBC,gBAAcA;IACdC,gBAAcA;IACdC,oBAAkBA;IAClBC,SAAOA;IACPC,cAAYA;IACZC,MAAIA;AACR"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { CognitoPresenter } from "./CognitoPresenter.js";
|
|
3
|
+
import { CognitoPresenter as external_abstractions_js_CognitoPresenter } from "./abstractions.js";
|
|
4
|
+
const CognitoFeature = createFeature({
|
|
5
|
+
name: "Cognito",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(CognitoPresenter).inSingletonScope();
|
|
8
|
+
},
|
|
9
|
+
resolve (container) {
|
|
10
|
+
return {
|
|
11
|
+
presenter: container.resolve(external_abstractions_js_CognitoPresenter)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { CognitoFeature };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/presentation/Cognito/feature.js","sources":["../../../../src/admin/presentation/Cognito/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { CognitoPresenter } from \"./CognitoPresenter.js\";\nimport { CognitoPresenter as Presenter } from \"./abstractions.js\";\n\nexport const CognitoFeature = createFeature({\n name: \"Cognito\",\n register(container) {\n container.register(CognitoPresenter).inSingletonScope();\n },\n resolve(container) {\n return {\n presenter: container.resolve(Presenter)\n };\n }\n});\n"],"names":["CognitoFeature","createFeature","container","CognitoPresenter","Presenter"],"mappings":";;;AAIO,MAAMA,iBAAiBC,cAAc;IACxC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,kBAAkB,gBAAgB;IACzD;IACA,SAAQD,SAAS;QACb,OAAO;YACH,WAAWA,UAAU,OAAO,CAACE;QACjC;IACJ;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CognitoSignInFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { DefaultCognitoSignInConfig } from "../../DefaultCognitoSignInConfig.js";
|
|
3
|
+
const CognitoSignInFeature = createFeature({
|
|
4
|
+
name: "CognitoSignIn",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(DefaultCognitoSignInConfig).inSingletonScope();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { CognitoSignInFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=signInFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/presentation/Cognito/signInFeature.js","sources":["../../../../src/admin/presentation/Cognito/signInFeature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { DefaultCognitoSignInConfig } from \"~/admin/DefaultCognitoSignInConfig.js\";\n\nexport const CognitoSignInFeature = createFeature({\n name: \"CognitoSignIn\",\n register(container) {\n container.register(DefaultCognitoSignInConfig).inSingletonScope();\n }\n});\n"],"names":["CognitoSignInFeature","createFeature","container","DefaultCognitoSignInConfig"],"mappings":";;AAGO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,4BAA4B,gBAAgB;IACnE;AACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { AdminUsersSchema } from "./graphql/user.gql.js";
|
|
3
|
+
import { UserInstallerFeature } from "./features/UserInstaller/feature.js";
|
|
4
|
+
import { CognitoIdpFeature } from "./features/CognitoIdp/index.js";
|
|
5
|
+
import { CreateUserFeature } from "./features/CreateUser/index.js";
|
|
6
|
+
import { UpdateUserFeature } from "./features/UpdateUser/index.js";
|
|
7
|
+
import { DeleteUserFeature } from "./features/DeleteUser/index.js";
|
|
8
|
+
import { CognitoServiceFeature } from "./features/CognitoService/feature.js";
|
|
9
|
+
const CognitoApiFeature = createFeature({
|
|
10
|
+
name: "CognitoApiFeature",
|
|
11
|
+
register (container) {
|
|
12
|
+
CreateUserFeature.register(container);
|
|
13
|
+
UpdateUserFeature.register(container);
|
|
14
|
+
DeleteUserFeature.register(container);
|
|
15
|
+
UserInstallerFeature.register(container);
|
|
16
|
+
CognitoIdpFeature.register(container);
|
|
17
|
+
CognitoServiceFeature.register(container, {
|
|
18
|
+
region: String(process.env.COGNITO_REGION),
|
|
19
|
+
userPoolId: String(process.env.COGNITO_USER_POOL_ID)
|
|
20
|
+
});
|
|
21
|
+
container.register(AdminUsersSchema);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export { CognitoApiFeature };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=CognitoApiFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/CognitoApiFeature.js","sources":["../../src/api/CognitoApiFeature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { AdminUsersSchema } from \"~/api/graphql/user.gql.js\";\nimport { UserInstallerFeature } from \"./features/UserInstaller/feature.js\";\nimport { CognitoIdpFeature } from \"./features/CognitoIdp/index.js\";\nimport { CreateUserFeature } from \"./features/CreateUser/index.js\";\nimport { UpdateUserFeature } from \"./features/UpdateUser/index.js\";\nimport { DeleteUserFeature } from \"./features/DeleteUser/index.js\";\nimport { CognitoServiceFeature } from \"~/api/features/CognitoService/feature.js\";\n\nexport const CognitoApiFeature = createFeature({\n name: \"CognitoApiFeature\",\n register(container) {\n // Register features\n CreateUserFeature.register(container);\n UpdateUserFeature.register(container);\n DeleteUserFeature.register(container);\n UserInstallerFeature.register(container);\n CognitoIdpFeature.register(container);\n CognitoServiceFeature.register(container, {\n region: String(process.env.COGNITO_REGION),\n userPoolId: String(process.env.COGNITO_USER_POOL_ID)\n });\n\n // Register GraphQL schema\n container.register(AdminUsersSchema);\n }\n});\n"],"names":["CognitoApiFeature","createFeature","container","CreateUserFeature","UpdateUserFeature","DeleteUserFeature","UserInstallerFeature","CognitoIdpFeature","CognitoServiceFeature","String","process","AdminUsersSchema"],"mappings":";;;;;;;;AASO,MAAMA,oBAAoBC,cAAc;IAC3C,MAAM;IACN,UAASC,SAAS;QAEdC,kBAAkB,QAAQ,CAACD;QAC3BE,kBAAkB,QAAQ,CAACF;QAC3BG,kBAAkB,QAAQ,CAACH;QAC3BI,qBAAqB,QAAQ,CAACJ;QAC9BK,kBAAkB,QAAQ,CAACL;QAC3BM,sBAAsB,QAAQ,CAACN,WAAW;YACtC,QAAQO,OAAOC,QAAQ,GAAG,CAAC,cAAc;YACzC,YAAYD,OAAOC,QAAQ,GAAG,CAAC,oBAAoB;QACvD;QAGAR,UAAU,QAAQ,CAACS;IACvB;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/domain/Username.js","sources":["../../../src/api/domain/Username.ts"],"sourcesContent":["import type { AdminUser, CreateUserInput } from \"@webiny/api-core/features/users/shared/types.js\";\n\nexport class Username {\n static fromUser(user: AdminUser | CreateUserInput) {\n return user.email.toLowerCase();\n }\n}\n"],"names":["Username","user"],"mappings":"AAEO,MAAMA;IACT,OAAO,SAASC,IAAiC,EAAE;QAC/C,OAAOA,KAAK,KAAK,CAAC,WAAW;IACjC;AACJ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseError } from "@webiny/feature/api";
|
|
2
|
+
/**
|
|
3
|
+
* Error when a user already exists in Cognito User Pool
|
|
4
|
+
*/
|
|
5
|
+
export declare class CognitoAccountExistsError extends BaseError<{
|
|
6
|
+
email: string;
|
|
7
|
+
}> {
|
|
8
|
+
readonly code: "Cognito/Account/Exists";
|
|
9
|
+
constructor(email: string);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Error when creating a user in Cognito fails
|
|
13
|
+
*/
|
|
14
|
+
export declare class CognitoCreateUserError extends BaseError<{
|
|
15
|
+
error: Error;
|
|
16
|
+
}> {
|
|
17
|
+
readonly code: "Cognito/User/Create";
|
|
18
|
+
constructor(error: Error);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Error when updating a user in Cognito fails
|
|
22
|
+
*/
|
|
23
|
+
export declare class CognitoUpdateUserError extends BaseError<{
|
|
24
|
+
error: Error;
|
|
25
|
+
}> {
|
|
26
|
+
readonly code: "Cognito/User/Update";
|
|
27
|
+
constructor(error: Error);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Error when deleting a user from Cognito fails
|
|
31
|
+
*/
|
|
32
|
+
export declare class CognitoDeleteUserError extends BaseError<{
|
|
33
|
+
error: Error;
|
|
34
|
+
}> {
|
|
35
|
+
readonly code: "Cognito/User/Delete";
|
|
36
|
+
constructor(error: Error);
|
|
37
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BaseError } from "@webiny/feature/api";
|
|
2
|
+
class CognitoAccountExistsError extends BaseError {
|
|
3
|
+
constructor(email){
|
|
4
|
+
super({
|
|
5
|
+
message: "An account with this email already exists in your Cognito User Pool.",
|
|
6
|
+
data: {
|
|
7
|
+
email
|
|
8
|
+
}
|
|
9
|
+
}), this.code = "Cognito/Account/Exists";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
class CognitoCreateUserError extends BaseError {
|
|
13
|
+
constructor(error){
|
|
14
|
+
super({
|
|
15
|
+
message: `Failed to create user in Cognito: ${error.message}`,
|
|
16
|
+
data: {
|
|
17
|
+
error
|
|
18
|
+
}
|
|
19
|
+
}), this.code = "Cognito/User/Create";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class CognitoUpdateUserError extends BaseError {
|
|
23
|
+
constructor(error){
|
|
24
|
+
super({
|
|
25
|
+
message: `Failed to update user in Cognito: ${error.message}`,
|
|
26
|
+
data: {
|
|
27
|
+
error
|
|
28
|
+
}
|
|
29
|
+
}), this.code = "Cognito/User/Update";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class CognitoDeleteUserError extends BaseError {
|
|
33
|
+
constructor(error){
|
|
34
|
+
super({
|
|
35
|
+
message: `Failed to delete user from Cognito: ${error.message}`,
|
|
36
|
+
data: {
|
|
37
|
+
error
|
|
38
|
+
}
|
|
39
|
+
}), this.code = "Cognito/User/Delete";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export { CognitoAccountExistsError, CognitoCreateUserError, CognitoDeleteUserError, CognitoUpdateUserError };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/domain/errors.js","sources":["../../../src/api/domain/errors.ts"],"sourcesContent":["import { BaseError } from \"@webiny/feature/api\";\n\n/**\n * Error when a user already exists in Cognito User Pool\n */\nexport class CognitoAccountExistsError extends BaseError<{ email: string }> {\n override readonly code = \"Cognito/Account/Exists\" as const;\n\n constructor(email: string) {\n super({\n message: `An account with this email already exists in your Cognito User Pool.`,\n data: { email }\n });\n }\n}\n\n/**\n * Error when creating a user in Cognito fails\n */\nexport class CognitoCreateUserError extends BaseError<{ error: Error }> {\n override readonly code = \"Cognito/User/Create\" as const;\n\n constructor(error: Error) {\n super({\n message: `Failed to create user in Cognito: ${error.message}`,\n data: { error }\n });\n }\n}\n\n/**\n * Error when updating a user in Cognito fails\n */\nexport class CognitoUpdateUserError extends BaseError<{ error: Error }> {\n override readonly code = \"Cognito/User/Update\" as const;\n\n constructor(error: Error) {\n super({\n message: `Failed to update user in Cognito: ${error.message}`,\n data: { error }\n });\n }\n}\n\n/**\n * Error when deleting a user from Cognito fails\n */\nexport class CognitoDeleteUserError extends BaseError<{ error: Error }> {\n override readonly code = \"Cognito/User/Delete\" as const;\n\n constructor(error: Error) {\n super({\n message: `Failed to delete user from Cognito: ${error.message}`,\n data: { error }\n });\n }\n}\n"],"names":["CognitoAccountExistsError","BaseError","email","CognitoCreateUserError","error","CognitoUpdateUserError","CognitoDeleteUserError"],"mappings":";AAKO,MAAMA,kCAAkCC;IAG3C,YAAYC,KAAa,CAAE;QACvB,KAAK,CAAC;YACF,SAAS;YACT,MAAM;gBAAEA;YAAM;QAClB,SANc,IAAI,GAAG;IAOzB;AACJ;AAKO,MAAMC,+BAA+BF;IAGxC,YAAYG,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAAS,CAAC,kCAAkC,EAAEA,MAAM,OAAO,EAAE;YAC7D,MAAM;gBAAEA;YAAM;QAClB,SANc,IAAI,GAAG;IAOzB;AACJ;AAKO,MAAMC,+BAA+BJ;IAGxC,YAAYG,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAAS,CAAC,kCAAkC,EAAEA,MAAM,OAAO,EAAE;YAC7D,MAAM;gBAAEA;YAAM;QAClB,SANc,IAAI,GAAG;IAOzB;AACJ;AAKO,MAAME,+BAA+BL;IAGxC,YAAYG,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAAS,CAAC,oCAAoC,EAAEA,MAAM,OAAO,EAAE;YAC/D,MAAM;gBAAEA;YAAM;QAClB,SANc,IAAI,GAAG;IAOzB;AACJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OidcIdentityProvider } from "@webiny/api-core/idp";
|
|
2
|
+
import { CognitoIdpConfig } from "./abstractions.js";
|
|
3
|
+
declare class CognitoIdentityProviderImpl implements OidcIdentityProvider.Interface {
|
|
4
|
+
private config;
|
|
5
|
+
clientId: string;
|
|
6
|
+
issuer: string;
|
|
7
|
+
constructor(config: CognitoIdpConfig.Interface | undefined);
|
|
8
|
+
isApplicable(token: OidcIdentityProvider.JwtPayload): boolean;
|
|
9
|
+
getIdentity(token: OidcIdentityProvider.JwtPayload): Promise<OidcIdentityProvider.IdentityData>;
|
|
10
|
+
verifyTokenClaims(token: OidcIdentityProvider.JwtPayload): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare const CognitoIdentityProvider: typeof CognitoIdentityProviderImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/idp/abstractions.js").IOidcIdentityProvider>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { OidcIdentityProvider } from "@webiny/api-core/idp";
|
|
2
|
+
import { CognitoIdpConfig } from "./abstractions.js";
|
|
3
|
+
class CognitoIdentityProviderImpl {
|
|
4
|
+
constructor(config){
|
|
5
|
+
this.config = config;
|
|
6
|
+
const region = String(process.env.COGNITO_REGION);
|
|
7
|
+
const userPoolId = String(process.env.COGNITO_USER_POOL_ID);
|
|
8
|
+
this.clientId = String(process.env.COGNITO_CLIENT_ID);
|
|
9
|
+
this.issuer = `https://cognito-idp.${region}.amazonaws.com/${userPoolId}`;
|
|
10
|
+
}
|
|
11
|
+
isApplicable(token) {
|
|
12
|
+
const issuer = token.iss;
|
|
13
|
+
if (!issuer) return false;
|
|
14
|
+
return issuer === this.issuer;
|
|
15
|
+
}
|
|
16
|
+
async getIdentity(token) {
|
|
17
|
+
const isFederated = Array.isArray(token.identities) && token.identities.length > 0;
|
|
18
|
+
const customId = token["custom:id"];
|
|
19
|
+
const givenName = token["given_name"];
|
|
20
|
+
const familyName = token["family_name"];
|
|
21
|
+
const email = token["email"];
|
|
22
|
+
const defaultIdentity = {
|
|
23
|
+
id: customId || token.sub || "",
|
|
24
|
+
displayName: `${givenName || ""} ${familyName || ""}`.trim() || email || "Unknown User",
|
|
25
|
+
type: "admin",
|
|
26
|
+
profile: {
|
|
27
|
+
email: email || "",
|
|
28
|
+
firstName: givenName || "",
|
|
29
|
+
lastName: familyName || "",
|
|
30
|
+
external: isFederated
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const customIdentity = this.config ? await this.config.getIdentity(token) : null;
|
|
34
|
+
if (!customIdentity) return defaultIdentity;
|
|
35
|
+
return {
|
|
36
|
+
...defaultIdentity,
|
|
37
|
+
...customIdentity,
|
|
38
|
+
type: "admin",
|
|
39
|
+
profile: {
|
|
40
|
+
...defaultIdentity.profile,
|
|
41
|
+
...customIdentity.profile,
|
|
42
|
+
external: isFederated
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async verifyTokenClaims(token) {
|
|
47
|
+
if (this.config?.verifyTokenClaims) await this.config.verifyTokenClaims(token);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const CognitoIdentityProvider = OidcIdentityProvider.createImplementation({
|
|
51
|
+
implementation: CognitoIdentityProviderImpl,
|
|
52
|
+
dependencies: [
|
|
53
|
+
[
|
|
54
|
+
CognitoIdpConfig,
|
|
55
|
+
{
|
|
56
|
+
optional: true
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
export { CognitoIdentityProvider };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=CognitoIdentityProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/CognitoIdp/CognitoIdentityProvider.js","sources":["../../../../src/api/features/CognitoIdp/CognitoIdentityProvider.ts"],"sourcesContent":["import { OidcIdentityProvider } from \"@webiny/api-core/idp\";\nimport { CognitoIdpConfig } from \"./abstractions.js\";\n\nclass CognitoIdentityProviderImpl implements OidcIdentityProvider.Interface {\n public clientId: string;\n public issuer: string;\n\n constructor(private config: CognitoIdpConfig.Interface | undefined) {\n const region = String(process.env.COGNITO_REGION);\n const userPoolId = String(process.env.COGNITO_USER_POOL_ID);\n this.clientId = String(process.env.COGNITO_CLIENT_ID);\n this.issuer = `https://cognito-idp.${region}.amazonaws.com/${userPoolId}`;\n }\n\n isApplicable(token: OidcIdentityProvider.JwtPayload) {\n const issuer = token.iss as string;\n if (!issuer) {\n return false;\n }\n\n return issuer === this.issuer;\n }\n\n async getIdentity(\n token: OidcIdentityProvider.JwtPayload\n ): Promise<OidcIdentityProvider.IdentityData> {\n const isFederated = Array.isArray(token.identities) && token.identities.length > 0;\n\n const customId = token[\"custom:id\"] as string | undefined;\n const givenName = token[\"given_name\"] as string | undefined;\n const familyName = token[\"family_name\"] as string | undefined;\n const email = token[\"email\"] as string | undefined;\n\n const defaultIdentity: OidcIdentityProvider.IdentityData = {\n id: customId || token.sub || \"\",\n displayName: `${givenName || \"\"} ${familyName || \"\"}`.trim() || email || \"Unknown User\",\n type: \"admin\",\n profile: {\n email: email || \"\",\n firstName: givenName || \"\",\n lastName: familyName || \"\",\n external: isFederated\n }\n };\n\n const customIdentity = this.config ? await this.config.getIdentity(token) : null;\n\n if (!customIdentity) {\n return defaultIdentity;\n }\n\n return {\n ...defaultIdentity,\n ...customIdentity,\n type: \"admin\",\n profile: {\n ...defaultIdentity.profile,\n ...customIdentity.profile,\n external: isFederated\n }\n };\n }\n\n async verifyTokenClaims(token: OidcIdentityProvider.JwtPayload): Promise<void> {\n if (this.config?.verifyTokenClaims) {\n await this.config.verifyTokenClaims(token);\n }\n }\n}\n\nexport const CognitoIdentityProvider = OidcIdentityProvider.createImplementation({\n implementation: CognitoIdentityProviderImpl,\n dependencies: [[CognitoIdpConfig, { optional: true }]]\n});\n"],"names":["CognitoIdentityProviderImpl","config","region","String","process","userPoolId","token","issuer","isFederated","Array","customId","givenName","familyName","email","defaultIdentity","customIdentity","CognitoIdentityProvider","OidcIdentityProvider","CognitoIdpConfig"],"mappings":";;AAGA,MAAMA;IAIF,YAAoBC,MAA8C,CAAE;aAAhDA,MAAM,GAANA;QAChB,MAAMC,SAASC,OAAOC,QAAQ,GAAG,CAAC,cAAc;QAChD,MAAMC,aAAaF,OAAOC,QAAQ,GAAG,CAAC,oBAAoB;QAC1D,IAAI,CAAC,QAAQ,GAAGD,OAAOC,QAAQ,GAAG,CAAC,iBAAiB;QACpD,IAAI,CAAC,MAAM,GAAG,CAAC,oBAAoB,EAAEF,OAAO,eAAe,EAAEG,YAAY;IAC7E;IAEA,aAAaC,KAAsC,EAAE;QACjD,MAAMC,SAASD,MAAM,GAAG;QACxB,IAAI,CAACC,QACD,OAAO;QAGX,OAAOA,WAAW,IAAI,CAAC,MAAM;IACjC;IAEA,MAAM,YACFD,KAAsC,EACI;QAC1C,MAAME,cAAcC,MAAM,OAAO,CAACH,MAAM,UAAU,KAAKA,MAAM,UAAU,CAAC,MAAM,GAAG;QAEjF,MAAMI,WAAWJ,KAAK,CAAC,YAAY;QACnC,MAAMK,YAAYL,KAAK,CAAC,aAAa;QACrC,MAAMM,aAAaN,KAAK,CAAC,cAAc;QACvC,MAAMO,QAAQP,KAAK,CAAC,QAAQ;QAE5B,MAAMQ,kBAAqD;YACvD,IAAIJ,YAAYJ,MAAM,GAAG,IAAI;YAC7B,aAAa,GAAGK,aAAa,GAAG,CAAC,EAAEC,cAAc,IAAI,CAAC,IAAI,MAAMC,SAAS;YACzE,MAAM;YACN,SAAS;gBACL,OAAOA,SAAS;gBAChB,WAAWF,aAAa;gBACxB,UAAUC,cAAc;gBACxB,UAAUJ;YACd;QACJ;QAEA,MAAMO,iBAAiB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAACT,SAAS;QAE5E,IAAI,CAACS,gBACD,OAAOD;QAGX,OAAO;YACH,GAAGA,eAAe;YAClB,GAAGC,cAAc;YACjB,MAAM;YACN,SAAS;gBACL,GAAGD,gBAAgB,OAAO;gBAC1B,GAAGC,eAAe,OAAO;gBACzB,UAAUP;YACd;QACJ;IACJ;IAEA,MAAM,kBAAkBF,KAAsC,EAAiB;QAC3E,IAAI,IAAI,CAAC,MAAM,EAAE,mBACb,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAACA;IAE5C;AACJ;AAEO,MAAMU,0BAA0BC,qBAAqB,oBAAoB,CAAC;IAC7E,gBAAgBjB;IAChB,cAAc;QAAC;YAACkB;YAAkB;gBAAE,UAAU;YAAK;SAAE;KAAC;AAC1D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type jwt from "jsonwebtoken";
|
|
2
|
+
import type { IdentityData } from "@webiny/api-core/idp";
|
|
3
|
+
export type CognitoIdentity = Omit<IdentityData, "type"> & {
|
|
4
|
+
profile?: Omit<IdentityData["profile"], "external">;
|
|
5
|
+
};
|
|
6
|
+
export interface ICognitoIdpConfig {
|
|
7
|
+
getIdentity(token: jwt.JwtPayload): Promise<CognitoIdentity> | CognitoIdentity;
|
|
8
|
+
verifyTokenClaims?(token: jwt.JwtPayload): Promise<void> | void;
|
|
9
|
+
}
|
|
10
|
+
export declare const CognitoIdpConfig: import("@webiny/di").Abstraction<ICognitoIdpConfig>;
|
|
11
|
+
export declare namespace CognitoIdpConfig {
|
|
12
|
+
type Interface = ICognitoIdpConfig;
|
|
13
|
+
type IdentityData = CognitoIdentity;
|
|
14
|
+
type JwtPayload = jwt.JwtPayload;
|
|
15
|
+
}
|