@webiny/cognito 6.6.0-alpha.0 → 6.6.0-alpha.10

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.
Files changed (282) hide show
  1. package/Cognito.d.ts +51 -0
  2. package/Cognito.js +83 -6
  3. package/Cognito.js.map +1 -1
  4. package/admin/Cognito.d.ts +1 -1
  5. package/admin/Cognito.js +2 -38
  6. package/admin/Cognito.js.map +1 -1
  7. package/admin/DefaultCognitoSignInConfig.d.ts +23 -0
  8. package/admin/DefaultCognitoSignInConfig.js +51 -0
  9. package/admin/DefaultCognitoSignInConfig.js.map +1 -0
  10. package/admin/Extension.js +0 -24
  11. package/admin/Extension.js.map +1 -1
  12. package/admin/SignInExtension.d.ts +2 -0
  13. package/admin/SignInExtension.js +9 -0
  14. package/admin/SignInExtension.js.map +1 -0
  15. package/admin/index.d.ts +2 -0
  16. package/admin/index.js +2 -0
  17. package/admin/presentation/Cognito/CognitoLoginScreen.d.ts +2 -2
  18. package/admin/presentation/Cognito/CognitoLoginScreen.js +9 -0
  19. package/admin/presentation/Cognito/CognitoLoginScreen.js.map +1 -1
  20. package/admin/presentation/Cognito/CognitoPresenter.d.ts +25 -1
  21. package/admin/presentation/Cognito/CognitoPresenter.js +122 -10
  22. package/admin/presentation/Cognito/CognitoPresenter.js.map +1 -1
  23. package/admin/presentation/Cognito/CognitoSignInConfig.d.ts +31 -0
  24. package/admin/presentation/Cognito/CognitoSignInConfig.js +5 -0
  25. package/admin/presentation/Cognito/CognitoSignInConfig.js.map +1 -0
  26. package/admin/presentation/Cognito/abstractions.d.ts +20 -1
  27. package/admin/presentation/Cognito/abstractions.js.map +1 -1
  28. package/admin/presentation/Cognito/components/ConfirmTotpCode.d.ts +26 -0
  29. package/admin/presentation/Cognito/components/ConfirmTotpCode.js +45 -0
  30. package/admin/presentation/Cognito/components/ConfirmTotpCode.js.map +1 -0
  31. package/admin/presentation/Cognito/components/Divider.d.ts +19 -1
  32. package/admin/presentation/Cognito/components/Divider.js +3 -2
  33. package/admin/presentation/Cognito/components/Divider.js.map +1 -1
  34. package/admin/presentation/Cognito/components/FederatedLogin.d.ts +22 -5
  35. package/admin/presentation/Cognito/components/FederatedLogin.js +19 -6
  36. package/admin/presentation/Cognito/components/FederatedLogin.js.map +1 -1
  37. package/admin/presentation/Cognito/components/FooterSignIn.d.ts +20 -3
  38. package/admin/presentation/Cognito/components/FooterSignIn.js +3 -2
  39. package/admin/presentation/Cognito/components/FooterSignIn.js.map +1 -1
  40. package/admin/presentation/Cognito/components/PasswordResetCodeSent.d.ts +19 -1
  41. package/admin/presentation/Cognito/components/PasswordResetCodeSent.js +3 -2
  42. package/admin/presentation/Cognito/components/PasswordResetCodeSent.js.map +1 -1
  43. package/admin/presentation/Cognito/components/RequestPasswordResetCode.d.ts +19 -1
  44. package/admin/presentation/Cognito/components/RequestPasswordResetCode.js +3 -2
  45. package/admin/presentation/Cognito/components/RequestPasswordResetCode.js.map +1 -1
  46. package/admin/presentation/Cognito/components/RequireNewPassword.d.ts +19 -1
  47. package/admin/presentation/Cognito/components/RequireNewPassword.js +3 -2
  48. package/admin/presentation/Cognito/components/RequireNewPassword.js.map +1 -1
  49. package/admin/presentation/Cognito/components/SetNewPassword.d.ts +19 -1
  50. package/admin/presentation/Cognito/components/SetNewPassword.js +6 -5
  51. package/admin/presentation/Cognito/components/SetNewPassword.js.map +1 -1
  52. package/admin/presentation/Cognito/components/SetupTotp.d.ts +25 -0
  53. package/admin/presentation/Cognito/components/SetupTotp.js +60 -0
  54. package/admin/presentation/Cognito/components/SetupTotp.js.map +1 -0
  55. package/admin/presentation/Cognito/components/SignIn.d.ts +19 -3
  56. package/admin/presentation/Cognito/components/SignIn.js +14 -7
  57. package/admin/presentation/Cognito/components/SignIn.js.map +1 -1
  58. package/admin/presentation/Cognito/components/index.d.ts +292 -0
  59. package/admin/presentation/Cognito/components/index.js +29 -0
  60. package/admin/presentation/Cognito/components/index.js.map +1 -0
  61. package/admin/presentation/Cognito/signInFeature.d.ts +1 -0
  62. package/admin/presentation/Cognito/signInFeature.js +11 -0
  63. package/admin/presentation/Cognito/signInFeature.js.map +1 -0
  64. package/api/features/CognitoIdp/CognitoIdentityProvider.js +15 -11
  65. package/api/features/CognitoIdp/CognitoIdentityProvider.js.map +1 -1
  66. package/api/features/CognitoIdp/abstractions.d.ts +1 -1
  67. package/api/features/CognitoIdp/abstractions.js.map +1 -1
  68. package/api/features/CognitoIdp/feature.js +1 -1
  69. package/api/features/CognitoIdp/feature.js.map +1 -1
  70. package/api/features/UpdateUser/UpdateUserUseCase.js +1 -1
  71. package/api/features/UpdateUser/UpdateUserUseCase.js.map +1 -1
  72. package/api/graphql/user.gql.d.ts +1 -0
  73. package/api/graphql/user.gql.js +4 -0
  74. package/api/graphql/user.gql.js.map +1 -1
  75. package/api/index.d.ts +1 -0
  76. package/api/index.js +1 -0
  77. package/index.d.ts +0 -1
  78. package/index.js +0 -1
  79. package/infra/CognitoFederationPulumi.d.ts +8 -0
  80. package/infra/CognitoFederationPulumi.js +17 -0
  81. package/infra/CognitoFederationPulumi.js.map +1 -0
  82. package/package.json +25 -24
  83. package/admin/SecurityPermission.d.ts +0 -2
  84. package/admin/SecurityPermission.js +0 -15
  85. package/admin/SecurityPermission.js.map +0 -1
  86. package/admin/domain/permissionsSchema.d.ts +0 -10
  87. package/admin/domain/permissionsSchema.js +0 -18
  88. package/admin/domain/permissionsSchema.js.map +0 -1
  89. package/admin/features/account/getCurrentUser/GetCurrentUserGateway.d.ts +0 -11
  90. package/admin/features/account/getCurrentUser/GetCurrentUserGateway.js +0 -44
  91. package/admin/features/account/getCurrentUser/GetCurrentUserGateway.js.map +0 -1
  92. package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.d.ts +0 -10
  93. package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.js +0 -19
  94. package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.js.map +0 -1
  95. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.d.ts +0 -16
  96. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js +0 -5
  97. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js.map +0 -1
  98. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.d.ts +0 -10
  99. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js +0 -5
  100. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js.map +0 -1
  101. package/admin/features/account/getCurrentUser/abstractions/index.d.ts +0 -6
  102. package/admin/features/account/getCurrentUser/abstractions/index.js +0 -2
  103. package/admin/features/account/getCurrentUser/feature.d.ts +0 -3
  104. package/admin/features/account/getCurrentUser/feature.js +0 -19
  105. package/admin/features/account/getCurrentUser/feature.js.map +0 -1
  106. package/admin/features/account/getCurrentUser/index.d.ts +0 -1
  107. package/admin/features/account/getCurrentUser/index.js +0 -1
  108. package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.d.ts +0 -11
  109. package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js +0 -48
  110. package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js.map +0 -1
  111. package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.d.ts +0 -10
  112. package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js +0 -19
  113. package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js.map +0 -1
  114. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.d.ts +0 -26
  115. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js +0 -5
  116. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js.map +0 -1
  117. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.d.ts +0 -13
  118. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js +0 -5
  119. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js.map +0 -1
  120. package/admin/features/account/updateCurrentUser/abstractions/index.d.ts +0 -8
  121. package/admin/features/account/updateCurrentUser/abstractions/index.js +0 -2
  122. package/admin/features/account/updateCurrentUser/feature.d.ts +0 -3
  123. package/admin/features/account/updateCurrentUser/feature.js +0 -19
  124. package/admin/features/account/updateCurrentUser/feature.js.map +0 -1
  125. package/admin/features/account/updateCurrentUser/index.d.ts +0 -1
  126. package/admin/features/account/updateCurrentUser/index.js +0 -1
  127. package/admin/features/permissions/abstractions.d.ts +0 -17
  128. package/admin/features/permissions/abstractions.js +0 -6
  129. package/admin/features/permissions/abstractions.js.map +0 -1
  130. package/admin/features/permissions/feature.d.ts +0 -14
  131. package/admin/features/permissions/feature.js +0 -7
  132. package/admin/features/permissions/feature.js.map +0 -1
  133. package/admin/features/users/createUser/CreateUserGateway.d.ts +0 -11
  134. package/admin/features/users/createUser/CreateUserGateway.js +0 -49
  135. package/admin/features/users/createUser/CreateUserGateway.js.map +0 -1
  136. package/admin/features/users/createUser/CreateUserUseCase.d.ts +0 -10
  137. package/admin/features/users/createUser/CreateUserUseCase.js +0 -18
  138. package/admin/features/users/createUser/CreateUserUseCase.js.map +0 -1
  139. package/admin/features/users/createUser/abstractions/CreateUserGateway.d.ts +0 -21
  140. package/admin/features/users/createUser/abstractions/CreateUserGateway.js +0 -5
  141. package/admin/features/users/createUser/abstractions/CreateUserGateway.js.map +0 -1
  142. package/admin/features/users/createUser/abstractions/CreateUserUseCase.d.ts +0 -14
  143. package/admin/features/users/createUser/abstractions/CreateUserUseCase.js +0 -5
  144. package/admin/features/users/createUser/abstractions/CreateUserUseCase.js.map +0 -1
  145. package/admin/features/users/createUser/abstractions/index.d.ts +0 -2
  146. package/admin/features/users/createUser/abstractions/index.js +0 -2
  147. package/admin/features/users/createUser/feature.d.ts +0 -3
  148. package/admin/features/users/createUser/feature.js +0 -19
  149. package/admin/features/users/createUser/feature.js.map +0 -1
  150. package/admin/features/users/createUser/index.d.ts +0 -2
  151. package/admin/features/users/createUser/index.js +0 -2
  152. package/admin/features/users/deleteUser/DeleteUserGateway.d.ts +0 -11
  153. package/admin/features/users/deleteUser/DeleteUserGateway.js +0 -40
  154. package/admin/features/users/deleteUser/DeleteUserGateway.js.map +0 -1
  155. package/admin/features/users/deleteUser/DeleteUserUseCase.d.ts +0 -10
  156. package/admin/features/users/deleteUser/DeleteUserUseCase.js +0 -18
  157. package/admin/features/users/deleteUser/DeleteUserUseCase.js.map +0 -1
  158. package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.d.ts +0 -11
  159. package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.js +0 -5
  160. package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.js.map +0 -1
  161. package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.d.ts +0 -11
  162. package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js +0 -5
  163. package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js.map +0 -1
  164. package/admin/features/users/deleteUser/abstractions/index.d.ts +0 -2
  165. package/admin/features/users/deleteUser/abstractions/index.js +0 -2
  166. package/admin/features/users/deleteUser/feature.d.ts +0 -3
  167. package/admin/features/users/deleteUser/feature.js +0 -19
  168. package/admin/features/users/deleteUser/feature.js.map +0 -1
  169. package/admin/features/users/deleteUser/index.d.ts +0 -2
  170. package/admin/features/users/deleteUser/index.js +0 -2
  171. package/admin/features/users/getUser/GetUserGateway.d.ts +0 -11
  172. package/admin/features/users/getUser/GetUserGateway.js +0 -57
  173. package/admin/features/users/getUser/GetUserGateway.js.map +0 -1
  174. package/admin/features/users/getUser/GetUserUseCase.d.ts +0 -10
  175. package/admin/features/users/getUser/GetUserUseCase.js +0 -18
  176. package/admin/features/users/getUser/GetUserUseCase.js.map +0 -1
  177. package/admin/features/users/getUser/abstractions/GetUserGateway.d.ts +0 -32
  178. package/admin/features/users/getUser/abstractions/GetUserGateway.js +0 -5
  179. package/admin/features/users/getUser/abstractions/GetUserGateway.js.map +0 -1
  180. package/admin/features/users/getUser/abstractions/GetUserUseCase.d.ts +0 -14
  181. package/admin/features/users/getUser/abstractions/GetUserUseCase.js +0 -5
  182. package/admin/features/users/getUser/abstractions/GetUserUseCase.js.map +0 -1
  183. package/admin/features/users/getUser/abstractions/index.d.ts +0 -2
  184. package/admin/features/users/getUser/abstractions/index.js +0 -2
  185. package/admin/features/users/getUser/feature.d.ts +0 -3
  186. package/admin/features/users/getUser/feature.js +0 -19
  187. package/admin/features/users/getUser/feature.js.map +0 -1
  188. package/admin/features/users/getUser/index.d.ts +0 -2
  189. package/admin/features/users/getUser/index.js +0 -2
  190. package/admin/features/users/listUsers/ListUsersGateway.d.ts +0 -11
  191. package/admin/features/users/listUsers/ListUsersGateway.js +0 -39
  192. package/admin/features/users/listUsers/ListUsersGateway.js.map +0 -1
  193. package/admin/features/users/listUsers/ListUsersUseCase.d.ts +0 -10
  194. package/admin/features/users/listUsers/ListUsersUseCase.js +0 -18
  195. package/admin/features/users/listUsers/ListUsersUseCase.js.map +0 -1
  196. package/admin/features/users/listUsers/abstractions/ListUsersGateway.d.ts +0 -17
  197. package/admin/features/users/listUsers/abstractions/ListUsersGateway.js +0 -5
  198. package/admin/features/users/listUsers/abstractions/ListUsersGateway.js.map +0 -1
  199. package/admin/features/users/listUsers/abstractions/ListUsersUseCase.d.ts +0 -10
  200. package/admin/features/users/listUsers/abstractions/ListUsersUseCase.js +0 -5
  201. package/admin/features/users/listUsers/abstractions/ListUsersUseCase.js.map +0 -1
  202. package/admin/features/users/listUsers/abstractions/index.d.ts +0 -2
  203. package/admin/features/users/listUsers/abstractions/index.js +0 -2
  204. package/admin/features/users/listUsers/feature.d.ts +0 -3
  205. package/admin/features/users/listUsers/feature.js +0 -19
  206. package/admin/features/users/listUsers/feature.js.map +0 -1
  207. package/admin/features/users/listUsers/index.d.ts +0 -2
  208. package/admin/features/users/listUsers/index.js +0 -2
  209. package/admin/features/users/updateUser/UpdateUserGateway.d.ts +0 -11
  210. package/admin/features/users/updateUser/UpdateUserGateway.js +0 -59
  211. package/admin/features/users/updateUser/UpdateUserGateway.js.map +0 -1
  212. package/admin/features/users/updateUser/UpdateUserUseCase.d.ts +0 -10
  213. package/admin/features/users/updateUser/UpdateUserUseCase.js +0 -18
  214. package/admin/features/users/updateUser/UpdateUserUseCase.js.map +0 -1
  215. package/admin/features/users/updateUser/abstractions/UpdateUserGateway.d.ts +0 -33
  216. package/admin/features/users/updateUser/abstractions/UpdateUserGateway.js +0 -5
  217. package/admin/features/users/updateUser/abstractions/UpdateUserGateway.js.map +0 -1
  218. package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.d.ts +0 -15
  219. package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.js +0 -5
  220. package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.js.map +0 -1
  221. package/admin/features/users/updateUser/abstractions/index.d.ts +0 -2
  222. package/admin/features/users/updateUser/abstractions/index.js +0 -2
  223. package/admin/features/users/updateUser/feature.d.ts +0 -3
  224. package/admin/features/users/updateUser/feature.js +0 -19
  225. package/admin/features/users/updateUser/feature.js.map +0 -1
  226. package/admin/features/users/updateUser/index.d.ts +0 -2
  227. package/admin/features/users/updateUser/index.js +0 -2
  228. package/admin/presentation/shared/createPasswordValidator.d.ts +0 -8
  229. package/admin/presentation/shared/createPasswordValidator.js +0 -16
  230. package/admin/presentation/shared/createPasswordValidator.js.map +0 -1
  231. package/admin/presentation/shared/usePasswordValidator.d.ts +0 -1
  232. package/admin/presentation/shared/usePasswordValidator.js +0 -16
  233. package/admin/presentation/shared/usePasswordValidator.js.map +0 -1
  234. package/admin/presentation/userMenu/AccountDetails.d.ts +0 -6
  235. package/admin/presentation/userMenu/AccountDetails.js +0 -20
  236. package/admin/presentation/userMenu/AccountDetails.js.map +0 -1
  237. package/admin/presentation/userMenu/useIsDefaultTenant.d.ts +0 -1
  238. package/admin/presentation/userMenu/useIsDefaultTenant.js +0 -9
  239. package/admin/presentation/userMenu/useIsDefaultTenant.js.map +0 -1
  240. package/admin/routes.d.ts +0 -10
  241. package/admin/routes.js +0 -20
  242. package/admin/routes.js.map +0 -1
  243. package/admin/ui/UserItem.d.ts +0 -10
  244. package/admin/ui/UserItem.js +0 -0
  245. package/admin/ui/components/AvatarImage/AvatarImage.d.ts +0 -3
  246. package/admin/ui/components/AvatarImage/AvatarImage.js +0 -31
  247. package/admin/ui/components/AvatarImage/AvatarImage.js.map +0 -1
  248. package/admin/ui/components/AvatarImage/AvatarImagePreview.d.ts +0 -10
  249. package/admin/ui/components/AvatarImage/AvatarImagePreview.js +0 -53
  250. package/admin/ui/components/AvatarImage/AvatarImagePreview.js.map +0 -1
  251. package/admin/ui/components/AvatarImage/AvatarImageTrigger.d.ts +0 -7
  252. package/admin/ui/components/AvatarImage/AvatarImageTrigger.js +0 -28
  253. package/admin/ui/components/AvatarImage/AvatarImageTrigger.js.map +0 -1
  254. package/admin/ui/components/AvatarImage/index.d.ts +0 -1
  255. package/admin/ui/components/AvatarImage/index.js +0 -1
  256. package/admin/ui/views/Account/Account.d.ts +0 -2
  257. package/admin/ui/views/Account/Account.js +0 -137
  258. package/admin/ui/views/Account/Account.js.map +0 -1
  259. package/admin/ui/views/Account/index.d.ts +0 -1
  260. package/admin/ui/views/Account/index.js +0 -1
  261. package/admin/ui/views/Users/UsersDataList.d.ts +0 -3
  262. package/admin/ui/views/Users/UsersDataList.js +0 -177
  263. package/admin/ui/views/Users/UsersDataList.js.map +0 -1
  264. package/admin/ui/views/Users/UsersForm.d.ts +0 -5
  265. package/admin/ui/views/Users/UsersForm.js +0 -163
  266. package/admin/ui/views/Users/UsersForm.js.map +0 -1
  267. package/admin/ui/views/Users/UsersView.d.ts +0 -2
  268. package/admin/ui/views/Users/UsersView.js +0 -14
  269. package/admin/ui/views/Users/UsersView.js.map +0 -1
  270. package/admin/ui/views/Users/components/DeleteAction.d.ts +0 -7
  271. package/admin/ui/views/Users/components/DeleteAction.js +0 -29
  272. package/admin/ui/views/Users/components/DeleteAction.js.map +0 -1
  273. package/admin/ui/views/Users/hooks/useUserForm.d.ts +0 -27
  274. package/admin/ui/views/Users/hooks/useUserForm.js +0 -101
  275. package/admin/ui/views/Users/hooks/useUserForm.js.map +0 -1
  276. package/admin/ui/views/Users/search.js +0 -21
  277. package/admin/ui/views/Users/search.js.map +0 -1
  278. package/admin/ui/views/Users/search.svg +0 -20
  279. package/admin/ui/views/utils.d.ts +0 -3
  280. package/admin/ui/views/utils.js +0 -12
  281. package/admin/ui/views/utils.js.map +0 -1
  282. package/static/svg/search.43fa797c.svg +0 -20
@@ -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 @@
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"}
@@ -14,20 +14,12 @@ class CognitoIdentityProviderImpl {
14
14
  return issuer === this.issuer;
15
15
  }
16
16
  async getIdentity(token) {
17
- const customIdentity = this.config ? await this.config.getIdentity(token) : null;
18
- if (customIdentity) return {
19
- ...customIdentity,
20
- type: "admin",
21
- profile: {
22
- ...customIdentity,
23
- external: false
24
- }
25
- };
17
+ const isFederated = Array.isArray(token.identities) && token.identities.length > 0;
26
18
  const customId = token["custom:id"];
27
19
  const givenName = token["given_name"];
28
20
  const familyName = token["family_name"];
29
21
  const email = token["email"];
30
- return {
22
+ const defaultIdentity = {
31
23
  id: customId || token.sub || "",
32
24
  displayName: `${givenName || ""} ${familyName || ""}`.trim() || email || "Unknown User",
33
25
  type: "admin",
@@ -35,7 +27,19 @@ class CognitoIdentityProviderImpl {
35
27
  email: email || "",
36
28
  firstName: givenName || "",
37
29
  lastName: familyName || "",
38
- external: false
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
39
43
  }
40
44
  };
41
45
  }
@@ -1 +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 customIdentity = this.config ? await this.config.getIdentity(token) : null;\n\n if (customIdentity) {\n return {\n ...customIdentity,\n type: \"admin\",\n profile: {\n ...customIdentity,\n external: false\n }\n };\n }\n\n // Default identity\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 return {\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: false\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","customIdentity","customId","givenName","familyName","email","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,iBAAiB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAACF,SAAS;QAE5E,IAAIE,gBACA,OAAO;YACH,GAAGA,cAAc;YACjB,MAAM;YACN,SAAS;gBACL,GAAGA,cAAc;gBACjB,UAAU;YACd;QACJ;QAIJ,MAAMC,WAAWH,KAAK,CAAC,YAAY;QACnC,MAAMI,YAAYJ,KAAK,CAAC,aAAa;QACrC,MAAMK,aAAaL,KAAK,CAAC,cAAc;QACvC,MAAMM,QAAQN,KAAK,CAAC,QAAQ;QAE5B,OAAO;YACH,IAAIG,YAAYH,MAAM,GAAG,IAAI;YAC7B,aAAa,GAAGI,aAAa,GAAG,CAAC,EAAEC,cAAc,IAAI,CAAC,IAAI,MAAMC,SAAS;YACzE,MAAM;YACN,SAAS;gBACL,OAAOA,SAAS;gBAChB,WAAWF,aAAa;gBACxB,UAAUC,cAAc;gBACxB,UAAU;YACd;QACJ;IACJ;IAEA,MAAM,kBAAkBL,KAAsC,EAAiB;QAC3E,IAAI,IAAI,CAAC,MAAM,EAAE,mBACb,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAACA;IAE5C;AACJ;AAEO,MAAMO,0BAA0BC,qBAAqB,oBAAoB,CAAC;IAC7E,gBAAgBd;IAChB,cAAc;QAAC;YAACe;YAAkB;gBAAE,UAAU;YAAK;SAAE;KAAC;AAC1D"}
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"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GC,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"}
@@ -1,7 +1,7 @@
1
1
  import type jwt from "jsonwebtoken";
2
2
  import type { IdentityData } from "@webiny/api-core/idp";
3
3
  export type CognitoIdentity = Omit<IdentityData, "type"> & {
4
- profile: Omit<IdentityData["profile"], "external">;
4
+ profile?: Omit<IdentityData["profile"], "external">;
5
5
  };
6
6
  export interface ICognitoIdpConfig {
7
7
  getIdentity(token: jwt.JwtPayload): Promise<CognitoIdentity> | CognitoIdentity;
@@ -1 +1 @@
1
- {"version":3,"file":"api/features/CognitoIdp/abstractions.js","sources":["../../../../src/api/features/CognitoIdp/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type jwt from \"jsonwebtoken\";\nimport type { IdentityData } from \"@webiny/api-core/idp\";\n\nexport type CognitoIdentity = Omit<IdentityData, \"type\"> & {\n profile: Omit<IdentityData[\"profile\"], \"external\">;\n};\n\nexport interface ICognitoIdpConfig {\n getIdentity(token: jwt.JwtPayload): Promise<CognitoIdentity> | CognitoIdentity;\n verifyTokenClaims?(token: jwt.JwtPayload): Promise<void> | void;\n}\n\nexport const CognitoIdpConfig = createAbstraction<ICognitoIdpConfig>(\"CognitoIdpConfig\");\n\nexport namespace CognitoIdpConfig {\n export type Interface = ICognitoIdpConfig;\n export type IdentityData = CognitoIdentity;\n export type JwtPayload = jwt.JwtPayload;\n}\n"],"names":["CognitoIdpConfig","createAbstraction"],"mappings":";AAaO,MAAMA,mBAAmBC,kBAAqC"}
1
+ {"version":3,"file":"api/features/CognitoIdp/abstractions.js","sources":["../../../../src/api/features/CognitoIdp/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type jwt from \"jsonwebtoken\";\nimport type { IdentityData } from \"@webiny/api-core/idp\";\n\nexport type CognitoIdentity = Omit<IdentityData, \"type\"> & {\n profile?: Omit<IdentityData[\"profile\"], \"external\">;\n};\n\nexport interface ICognitoIdpConfig {\n getIdentity(token: jwt.JwtPayload): Promise<CognitoIdentity> | CognitoIdentity;\n verifyTokenClaims?(token: jwt.JwtPayload): Promise<void> | void;\n}\n\nexport const CognitoIdpConfig = createAbstraction<ICognitoIdpConfig>(\"CognitoIdpConfig\");\n\nexport namespace CognitoIdpConfig {\n export type Interface = ICognitoIdpConfig;\n export type IdentityData = CognitoIdentity;\n export type JwtPayload = jwt.JwtPayload;\n}\n"],"names":["CognitoIdpConfig","createAbstraction"],"mappings":";AAaO,MAAMA,mBAAmBC,kBAAqC"}
@@ -3,7 +3,7 @@ import { CognitoIdentityProvider } from "./CognitoIdentityProvider.js";
3
3
  const CognitoIdpFeature = createFeature({
4
4
  name: "CognitoIdp",
5
5
  register (container) {
6
- container.register(CognitoIdentityProvider).inSingletonScope();
6
+ container.register(CognitoIdentityProvider).inContainerScope();
7
7
  }
8
8
  });
9
9
  export { CognitoIdpFeature };
@@ -1 +1 @@
1
- {"version":3,"file":"api/features/CognitoIdp/feature.js","sources":["../../../../src/api/features/CognitoIdp/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CognitoIdentityProvider } from \"./CognitoIdentityProvider.js\";\n\nexport const CognitoIdpFeature = createFeature({\n name: \"CognitoIdp\",\n register(container) {\n container.register(CognitoIdentityProvider).inSingletonScope();\n }\n});\n"],"names":["CognitoIdpFeature","createFeature","container","CognitoIdentityProvider"],"mappings":";;AAGO,MAAMA,oBAAoBC,cAAc;IAC3C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,yBAAyB,gBAAgB;IAChE;AACJ"}
1
+ {"version":3,"file":"api/features/CognitoIdp/feature.js","sources":["../../../../src/api/features/CognitoIdp/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CognitoIdentityProvider } from \"./CognitoIdentityProvider.js\";\n\nexport const CognitoIdpFeature = createFeature({\n name: \"CognitoIdp\",\n register(container) {\n // Registered per request by CognitoApiFeature (the `<Cognito/>` extension). Container scoped:\n // one provider per request, built from the request container, so it sees the optional\n // CognitoIdpConfig that other extensions (e.g. Entra ID) register there.\n container.register(CognitoIdentityProvider).inContainerScope();\n }\n});\n"],"names":["CognitoIdpFeature","createFeature","container","CognitoIdentityProvider"],"mappings":";;AAGO,MAAMA,oBAAoBC,cAAc;IAC3C,MAAM;IACN,UAASC,SAAS;QAIdA,UAAU,QAAQ,CAACC,yBAAyB,gBAAgB;IAChE;AACJ"}
@@ -33,6 +33,7 @@ class UpdateUserUseCaseImpl {
33
33
  });
34
34
  if (getUserResult.isFail()) return Result.fail(getUserResult.error);
35
35
  const originalUser = getUserResult.value;
36
+ if (void 0 !== data.email && data.email !== originalUser.email) return Result.fail(new UserValidationError("The email address cannot be changed."));
36
37
  const updateUserResult = await this.updateUserUseCase.execute(id, userDataWithoutPassword);
37
38
  if (updateUserResult.isFail()) return Result.fail(updateUserResult.error);
38
39
  const updatedUser = updateUserResult.value;
@@ -43,7 +44,6 @@ class UpdateUserUseCaseImpl {
43
44
  const attrValue = "function" == typeof mappedAttr ? mappedAttr(updatedUser) : updatedUser[mappedAttr];
44
45
  attributes[attr] = attrValue;
45
46
  });
46
- if (originalUser.email !== updatedUser.email) attributes["email_verified"] = "true";
47
47
  await this.cognitoService.updateUserAttributes(Username.fromUser(originalUser), attributes);
48
48
  if (password) await this.cognitoService.setPermanentPassword(Username.fromUser(updatedUser), password);
49
49
  return Result.ok(updatedUser);
@@ -1 +1 @@
1
- {"version":3,"file":"api/features/UpdateUser/UpdateUserUseCase.js","sources":["../../../../src/api/features/UpdateUser/UpdateUserUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { UpdateUserUseCase as CoreUpdateUser } from \"@webiny/api-core/features/users/UpdateUser/index.js\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/users/GetUser/index.js\";\nimport {\n NotAuthorizedError,\n UserValidationError\n} from \"@webiny/api-core/features/users/shared/errors.js\";\nimport type { AdminUser } from \"@webiny/api-core/types/users.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { UpdateUserUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { Username } from \"~/api/domain/Username.js\";\nimport { CognitoUpdateUserError } from \"~/api/domain/errors.js\";\nimport { updateAdminUserValidation } from \"./schema.js\";\nimport type { UpdateAdminUserInput } from \"./abstractions.js\";\nimport { CognitoService } from \"~/api/features/CognitoService/index.js\";\n\ntype MappedAttrType = (user: AdminUser) => string | keyof AdminUser;\n\nconst defaultUpdateAttributes = {\n family_name: \"lastName\",\n given_name: \"firstName\",\n preferred_username: \"email\"\n};\n\nclass UpdateUserUseCaseImpl implements UseCaseAbstraction.Interface {\n private updateAttributes: Record<string, string | MappedAttrType>;\n\n constructor(\n private identityContext: IdentityContext.Interface,\n private cognitoService: CognitoService.Interface,\n private updateUserUseCase: CoreUpdateUser.Interface,\n private getUserUseCase: GetUserUseCase.Interface\n ) {\n this.updateAttributes = defaultUpdateAttributes;\n }\n\n async execute(\n id: string,\n input: UpdateAdminUserInput\n ): Promise<Result<AdminUser, UseCaseAbstraction.Error>> {\n const permission = await this.identityContext.getPermission(\"adminUsers.user\");\n if (!permission) {\n return Result.fail(new NotAuthorizedError());\n }\n\n // Validate input (including password)\n const validation = updateAdminUserValidation.safeParse(input);\n if (!validation.success) {\n return Result.fail(new UserValidationError(validation.error.issues[0].message));\n }\n\n const data = validation.data;\n const { password, ...userDataWithoutPassword } = data;\n\n // Get original user to know the email before update\n const getUserResult = await this.getUserUseCase.execute({ id });\n if (getUserResult.isFail()) {\n return Result.fail(getUserResult.error);\n }\n\n const originalUser = getUserResult.value;\n\n // Update user in api-core\n const updateUserResult = await this.updateUserUseCase.execute(id, userDataWithoutPassword);\n if (updateUserResult.isFail()) {\n return Result.fail(updateUserResult.error);\n }\n\n const updatedUser = updateUserResult.value;\n\n // Update user in Cognito\n try {\n // Build new attributes\n const attributes: Record<string, string> = {};\n\n Object.keys(this.updateAttributes).forEach(attr => {\n const mappedAttr = this.updateAttributes[\n attr as keyof typeof this.updateAttributes\n ] as MappedAttrType;\n const attrValue =\n typeof mappedAttr === \"function\"\n ? mappedAttr(updatedUser)\n : updatedUser[mappedAttr];\n attributes[attr] = attrValue;\n });\n\n // If email changed, set email_verified to true\n if (originalUser.email !== updatedUser.email) {\n attributes[\"email_verified\"] = \"true\";\n }\n\n await this.cognitoService.updateUserAttributes(\n Username.fromUser(originalUser),\n attributes\n );\n\n // Update password if provided\n if (password) {\n await this.cognitoService.setPermanentPassword(\n Username.fromUser(updatedUser),\n password\n );\n }\n\n return Result.ok(updatedUser);\n } catch (cognitoError) {\n return Result.fail(new CognitoUpdateUserError(cognitoError as Error));\n }\n }\n}\n\nexport const UpdateUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: UpdateUserUseCaseImpl,\n dependencies: [IdentityContext, CognitoService, CoreUpdateUser, GetUserUseCase]\n});\n"],"names":["defaultUpdateAttributes","UpdateUserUseCaseImpl","identityContext","cognitoService","updateUserUseCase","getUserUseCase","id","input","permission","Result","NotAuthorizedError","validation","updateAdminUserValidation","UserValidationError","data","password","userDataWithoutPassword","getUserResult","originalUser","updateUserResult","updatedUser","attributes","Object","attr","mappedAttr","attrValue","Username","cognitoError","CognitoUpdateUserError","UpdateUserUseCase","UseCaseAbstraction","IdentityContext","CognitoService","CoreUpdateUser","GetUserUseCase"],"mappings":";;;;;;;;;;AAkBA,MAAMA,0BAA0B;IAC5B,aAAa;IACb,YAAY;IACZ,oBAAoB;AACxB;AAEA,MAAMC;IAGF,YACYC,eAA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AGE;YACvB;YAGA,IAAIP,aAAa,KAAK,KAAKE,YAAY,KAAK,EACxCC,UAAU,CAAC,iBAAiB,GAAG;YAGnC,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAC1CK,SAAS,QAAQ,CAACR,eAClBG;YAIJ,IAAIN,UACA,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAC1CW,SAAS,QAAQ,CAACN,cAClBL;YAIR,OAAON,OAAO,EAAE,CAACW;QACrB,EAAE,OAAOO,cAAc;YACnB,OAAOlB,OAAO,IAAI,CAAC,IAAImB,uBAAuBD;QAClD;IACJ;AACJ;AAEO,MAAME,sCAAoBC,2CAAAA,oBAAuC,CAAC;IACrE,gBAAgB7B;IAChB,cAAc;QAAC8B;QAAiBC;QAAgBC;QAAgBC;KAAe;AACnF"}
1
+ {"version":3,"file":"api/features/UpdateUser/UpdateUserUseCase.js","sources":["../../../../src/api/features/UpdateUser/UpdateUserUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { UpdateUserUseCase as CoreUpdateUser } from \"@webiny/api-core/features/users/UpdateUser/index.js\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/users/GetUser/index.js\";\nimport {\n NotAuthorizedError,\n UserValidationError\n} from \"@webiny/api-core/features/users/shared/errors.js\";\nimport type { AdminUser } from \"@webiny/api-core/types/users.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { UpdateUserUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { Username } from \"~/api/domain/Username.js\";\nimport { CognitoUpdateUserError } from \"~/api/domain/errors.js\";\nimport { updateAdminUserValidation } from \"./schema.js\";\nimport type { UpdateAdminUserInput } from \"./abstractions.js\";\nimport { CognitoService } from \"~/api/features/CognitoService/index.js\";\n\ntype MappedAttrType = (user: AdminUser) => string | keyof AdminUser;\n\nconst defaultUpdateAttributes = {\n family_name: \"lastName\",\n given_name: \"firstName\",\n preferred_username: \"email\"\n};\n\nclass UpdateUserUseCaseImpl implements UseCaseAbstraction.Interface {\n private updateAttributes: Record<string, string | MappedAttrType>;\n\n constructor(\n private identityContext: IdentityContext.Interface,\n private cognitoService: CognitoService.Interface,\n private updateUserUseCase: CoreUpdateUser.Interface,\n private getUserUseCase: GetUserUseCase.Interface\n ) {\n this.updateAttributes = defaultUpdateAttributes;\n }\n\n async execute(\n id: string,\n input: UpdateAdminUserInput\n ): Promise<Result<AdminUser, UseCaseAbstraction.Error>> {\n const permission = await this.identityContext.getPermission(\"adminUsers.user\");\n if (!permission) {\n return Result.fail(new NotAuthorizedError());\n }\n\n // Validate input (including password)\n const validation = updateAdminUserValidation.safeParse(input);\n if (!validation.success) {\n return Result.fail(new UserValidationError(validation.error.issues[0].message));\n }\n\n const data = validation.data;\n const { password, ...userDataWithoutPassword } = data;\n\n // Get original user to know the email before update\n const getUserResult = await this.getUserUseCase.execute({ id });\n if (getUserResult.isFail()) {\n return Result.fail(getUserResult.error);\n }\n\n const originalUser = getUserResult.value;\n\n /*\n * The email is the user pool username, which Cognito cannot change, and the sign-in key.\n * api-core would drop it silently; saying so is better than reporting a change that did not\n * happen. The forms send the current address back unchanged, which is not a change.\n */\n if (data.email !== undefined && data.email !== originalUser.email) {\n return Result.fail(new UserValidationError(\"The email address cannot be changed.\"));\n }\n\n // Update user in api-core\n const updateUserResult = await this.updateUserUseCase.execute(id, userDataWithoutPassword);\n if (updateUserResult.isFail()) {\n return Result.fail(updateUserResult.error);\n }\n\n const updatedUser = updateUserResult.value;\n\n // Update user in Cognito\n try {\n // Build new attributes\n const attributes: Record<string, string> = {};\n\n Object.keys(this.updateAttributes).forEach(attr => {\n const mappedAttr = this.updateAttributes[\n attr as keyof typeof this.updateAttributes\n ] as MappedAttrType;\n const attrValue =\n typeof mappedAttr === \"function\"\n ? mappedAttr(updatedUser)\n : updatedUser[mappedAttr];\n attributes[attr] = attrValue;\n });\n\n await this.cognitoService.updateUserAttributes(\n Username.fromUser(originalUser),\n attributes\n );\n\n // Update password if provided\n if (password) {\n await this.cognitoService.setPermanentPassword(\n Username.fromUser(updatedUser),\n password\n );\n }\n\n return Result.ok(updatedUser);\n } catch (cognitoError) {\n return Result.fail(new CognitoUpdateUserError(cognitoError as Error));\n }\n }\n}\n\nexport const UpdateUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: UpdateUserUseCaseImpl,\n dependencies: [IdentityContext, CognitoService, CoreUpdateUser, GetUserUseCase]\n});\n"],"names":["defaultUpdateAttributes","UpdateUserUseCaseImpl","identityContext","cognitoService","updateUserUseCase","getUserUseCase","id","input","permission","Result","NotAuthorizedError","validation","updateAdminUserValidation","UserValidationError","data","password","userDataWithoutPassword","getUserResult","originalUser","undefined","updateUserResult","updatedUser","attributes","Object","attr","mappedAttr","attrValue","Username","cognitoError","CognitoUpdateUserError","UpdateUserUseCase","UseCaseAbstraction","IdentityContext","CognitoService","CoreUpdateUser","GetUserUseCase"],"mappings":";;;;;;;;;;AAkBA,MAAMA,0BAA0B;IAC5B,aAAa;IACb,YAAY;IACZ,oBAAoB;AACxB;AAEA,MAAMC;IAGF,YACYC,eAA0C,EAC1CC,cAAwC,EACxCC,iBAA2C,EAC3CC,cAAwC,CAClD;aAJUH,eAAe,GAAfA;aACAC,cAAc,GAAdA;aACAC,iBAAiB,GAAjBA;aACAC,cAAc,GAAdA;QAER,IAAI,CAAC,gBAAgB,GAAGL;IAC5B;IAEA,MAAM,QACFM,EAAU,EACVC,KAA2B,EACyB;QACpD,MAAMC,aAAa,MAAM,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;QAC5D,IAAI,CAACA,YACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAI3B,MAAMC,aAAaC,0BAA0B,SAAS,CAACL;QACvD,IAAI,CAACI,WAAW,OAAO,EACnB,OAAOF,OAAO,IAAI,CAAC,IAAII,oBAAoBF,WAAW,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO;QAGjF,MAAMG,OAAOH,WAAW,IAAI;QAC5B,M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ACnF"}
@@ -1,5 +1,6 @@
1
1
  import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
2
2
  declare class AdminUserSchemaImpl implements CoreGraphQLSchemaFactory.Interface {
3
+ getSchemaKey: () => string;
3
4
  execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
4
5
  }
5
6
  export declare const AdminUsersSchema: typeof AdminUserSchemaImpl & {
@@ -1,4 +1,5 @@
1
1
  import { ErrorResponse, NotFoundResponse, Response } from "@webiny/api-graphql/responses.js";
2
+ import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
2
3
  import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
3
4
  import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
4
5
  import { GetUserUseCase } from "@webiny/api-core/features/users/GetUser/index.js";
@@ -133,6 +134,9 @@ class AdminUserSchemaImpl {
133
134
  });
134
135
  return builder;
135
136
  }
137
+ constructor(){
138
+ this.getSchemaKey = staticSchemaKey("cognito/AdminUserSchemaImpl");
139
+ }
136
140
  }
137
141
  const AdminUsersSchema = CoreGraphQLSchemaFactory.createImplementation({
138
142
  implementation: AdminUserSchemaImpl,
@@ -1 +1 @@
1
- {"version":3,"file":"api/graphql/user.gql.js","sources":["../../../src/api/graphql/user.gql.ts"],"sourcesContent":["import { ErrorResponse, NotFoundResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/users/GetUser/index.js\";\nimport NotAuthorizedResponse from \"@webiny/api-core/graphql/security/NotAuthorizedResponse.js\";\nimport { CreateUserUseCase } from \"~/api/features/CreateUser/index.js\";\nimport { UpdateUserUseCase } from \"~/api/features/UpdateUser/index.js\";\nimport { DeleteUserUseCase } from \"~/api/features/DeleteUser/index.js\";\n\nclass AdminUserSchemaImpl implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(/* GraphQL */ `\n \"\"\"\n This input type is used by administrators to create other user's accounts within the same tenant.\n \"\"\"\n input AdminUsersCreateInput {\n email: String!\n firstName: String!\n lastName: String!\n password: String!\n avatar: JSON\n roles: [RefInput!]\n teams: [RefInput!]\n }\n\n \"\"\"\n This input type is used by administrators to update other user's accounts within the same tenant.\n \"\"\"\n input AdminUsersUpdateInput {\n email: String\n firstName: String\n lastName: String\n password: String\n avatar: JSON\n roles: [RefInput!]\n teams: [RefInput!]\n }\n\n \"\"\"\n This input type is used by the user who is updating his own account\n \"\"\"\n input AdminUsersCurrentUserInput {\n email: String\n firstName: String\n lastName: String\n password: String\n avatar: JSON\n }\n\n extend type AdminUsersMutation {\n updateCurrentUser(data: AdminUsersCurrentUserInput!): AdminUsersResponse\n\n createUser(data: AdminUsersCreateInput!): AdminUsersResponse\n\n updateUser(id: ID!, data: AdminUsersUpdateInput!): AdminUsersResponse\n\n deleteUser(id: ID!): AdminUsersBooleanResponse\n }\n `);\n\n builder.addResolver({\n path: \"AdminUsersMutation.updateCurrentUser\",\n dependencies: [IdentityContext, GetUserUseCase, UpdateUserUseCase],\n resolver: (\n identityContext: IdentityContext.Interface,\n getUserUseCase: GetUserUseCase.Interface,\n updateUserUseCase: UpdateUserUseCase.Interface\n ) => {\n return async ({ args }) => {\n const identity = identityContext.getIdentity();\n if (!identity.isAdmin()) {\n return new NotAuthorizedResponse();\n }\n\n // Current user might not have permissions for `adminUsers`.\n return await identityContext.withoutAuthorization(async () => {\n const getUserResult = await getUserUseCase.execute({ id: identity.id });\n if (getUserResult.isFail()) {\n // TODO: check if current identity belongs to a different tenant.\n // TODO: If so, switch to that other tenant, and update his profile there.\n return new NotFoundResponse(\"User not found!\");\n }\n\n const user = getUserResult.value;\n\n // TODO: UpdateCurrentUser should be a dedicated use case\n const updateResult = await updateUserUseCase.execute(user.id, args.data);\n if (updateResult.isFail()) {\n return new ErrorResponse({\n message: updateResult.error.message,\n code: updateResult.error.code,\n data: updateResult.error.data\n });\n }\n\n return new Response(updateResult.value);\n });\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.createUser\",\n dependencies: [CreateUserUseCase],\n resolver: (createUserUseCase: CreateUserUseCase.Interface) => {\n return async ({ args }) => {\n const result = await createUserUseCase.execute(args.data);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code,\n data: result.error.data\n });\n }\n\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.updateUser\",\n dependencies: [UpdateUserUseCase, IdentityContext],\n resolver: (\n updateUserUseCase: UpdateUserUseCase.Interface,\n identityContext: IdentityContext.Interface\n ) => {\n return async ({ args }) => {\n if (args.id === identityContext.getIdentity().id) {\n return new ErrorResponse({\n message:\n \"You're not allowed to update your own account using this API.\",\n code: \"AdminUser/GraphQL/UpdateSelf\"\n });\n }\n\n const result = await updateUserUseCase.execute(args.id, args.data);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code\n });\n }\n\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.deleteUser\",\n dependencies: [DeleteUserUseCase],\n resolver: (deleteUserUseCase: DeleteUserUseCase.Interface) => {\n return async ({ args }) => {\n const result = await deleteUserUseCase.execute(args.id);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code,\n data: result.error.data\n });\n }\n\n return new Response(true);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const AdminUsersSchema = CoreGraphQLSchemaFactory.createImplementation({\n implementation: AdminUserSchemaImpl,\n dependencies: []\n});\n"],"names":["AdminUserSchemaImpl","builder","IdentityContext","GetUserUseCase","UpdateUserUseCase","identityContext","getUserUseCase","updateUserUseCase","args","identity","NotAuthorizedResponse","getUserResult","NotFoundResponse","user","updateResult","ErrorResponse","Response","CreateUserUseCase","createUserUseCase","result","DeleteUserUseCase","deleteUserUseCase","AdminUsersSchema","CoreGraphQLSchemaFactory"],"mappings":";;;;;;;;AASA,MAAMA;IACF,MAAM,QACFC,OAA+C,EAChB;QAC/BA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA+CnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;gBAAiBC;gBAAgBC;aAAkB;YAClE,UAAU,CACNC,iBACAC,gBACAC,oBAEO,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMC,WAAWJ,gBAAgB,WAAW;oBAC5C,IAAI,CAACI,SAAS,OAAO,IACjB,OAAO,IAAIC;oBAIf,OAAO,MAAML,gBAAgB,oBAAoB,CAAC;wBAC9C,MAAMM,gBAAgB,MAAML,eAAe,OAAO,CAAC;4BAAE,IAAIG,SAAS,EAAE;wBAAC;wBACrE,IAAIE,cAAc,MAAM,IAGpB,OAAO,IAAIC,iBAAiB;wBAGhC,MAAMC,OAAOF,cAAc,KAAK;wBAGhC,MAAMG,eAAe,MAAMP,kBAAkB,OAAO,CAACM,KAAK,EAAE,EAAEL,KAAK,IAAI;wBACvE,IAAIM,aAAa,MAAM,IACnB,OAAO,IAAIC,cAAc;4BACrB,SAASD,aAAa,KAAK,CAAC,OAAO;4BACnC,MAAMA,aAAa,KAAK,CAAC,IAAI;4BAC7B,MAAMA,aAAa,KAAK,CAAC,IAAI;wBACjC;wBAGJ,OAAO,IAAIE,SAASF,aAAa,KAAK;oBAC1C;gBACJ;QAER;QAEAb,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACgB;aAAkB;YACjC,UAAU,CAACC,oBACA,OAAO,EAAEV,IAAI,EAAE;oBAClB,MAAMW,SAAS,MAAMD,kBAAkB,OA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AC1E,gBAAgBvB;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"api/graphql/user.gql.js","sources":["../../../src/api/graphql/user.gql.ts"],"sourcesContent":["import { ErrorResponse, NotFoundResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/users/GetUser/index.js\";\nimport NotAuthorizedResponse from \"@webiny/api-core/graphql/security/NotAuthorizedResponse.js\";\nimport { CreateUserUseCase } from \"~/api/features/CreateUser/index.js\";\nimport { UpdateUserUseCase } from \"~/api/features/UpdateUser/index.js\";\nimport { DeleteUserUseCase } from \"~/api/features/DeleteUser/index.js\";\n\nclass AdminUserSchemaImpl implements CoreGraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"cognito/AdminUserSchemaImpl\");\n\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(/* GraphQL */ `\n \"\"\"\n This input type is used by administrators to create other user's accounts within the same tenant.\n \"\"\"\n input AdminUsersCreateInput {\n email: String!\n firstName: String!\n lastName: String!\n password: String!\n avatar: JSON\n roles: [RefInput!]\n teams: [RefInput!]\n }\n\n \"\"\"\n This input type is used by administrators to update other user's accounts within the same tenant.\n \"\"\"\n input AdminUsersUpdateInput {\n email: String\n firstName: String\n lastName: String\n password: String\n avatar: JSON\n roles: [RefInput!]\n teams: [RefInput!]\n }\n\n \"\"\"\n This input type is used by the user who is updating his own account\n \"\"\"\n input AdminUsersCurrentUserInput {\n email: String\n firstName: String\n lastName: String\n password: String\n avatar: JSON\n }\n\n extend type AdminUsersMutation {\n updateCurrentUser(data: AdminUsersCurrentUserInput!): AdminUsersResponse\n\n createUser(data: AdminUsersCreateInput!): AdminUsersResponse\n\n updateUser(id: ID!, data: AdminUsersUpdateInput!): AdminUsersResponse\n\n deleteUser(id: ID!): AdminUsersBooleanResponse\n }\n `);\n\n builder.addResolver({\n path: \"AdminUsersMutation.updateCurrentUser\",\n dependencies: [IdentityContext, GetUserUseCase, UpdateUserUseCase],\n resolver: (\n identityContext: IdentityContext.Interface,\n getUserUseCase: GetUserUseCase.Interface,\n updateUserUseCase: UpdateUserUseCase.Interface\n ) => {\n return async ({ args }) => {\n const identity = identityContext.getIdentity();\n if (!identity.isAdmin()) {\n return new NotAuthorizedResponse();\n }\n\n // Current user might not have permissions for `adminUsers`.\n return await identityContext.withoutAuthorization(async () => {\n const getUserResult = await getUserUseCase.execute({ id: identity.id });\n if (getUserResult.isFail()) {\n // TODO: check if current identity belongs to a different tenant.\n // TODO: If so, switch to that other tenant, and update his profile there.\n return new NotFoundResponse(\"User not found!\");\n }\n\n const user = getUserResult.value;\n\n // TODO: UpdateCurrentUser should be a dedicated use case\n const updateResult = await updateUserUseCase.execute(user.id, args.data);\n if (updateResult.isFail()) {\n return new ErrorResponse({\n message: updateResult.error.message,\n code: updateResult.error.code,\n data: updateResult.error.data\n });\n }\n\n return new Response(updateResult.value);\n });\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.createUser\",\n dependencies: [CreateUserUseCase],\n resolver: (createUserUseCase: CreateUserUseCase.Interface) => {\n return async ({ args }) => {\n const result = await createUserUseCase.execute(args.data);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code,\n data: result.error.data\n });\n }\n\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.updateUser\",\n dependencies: [UpdateUserUseCase, IdentityContext],\n resolver: (\n updateUserUseCase: UpdateUserUseCase.Interface,\n identityContext: IdentityContext.Interface\n ) => {\n return async ({ args }) => {\n if (args.id === identityContext.getIdentity().id) {\n return new ErrorResponse({\n message:\n \"You're not allowed to update your own account using this API.\",\n code: \"AdminUser/GraphQL/UpdateSelf\"\n });\n }\n\n const result = await updateUserUseCase.execute(args.id, args.data);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code\n });\n }\n\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.deleteUser\",\n dependencies: [DeleteUserUseCase],\n resolver: (deleteUserUseCase: DeleteUserUseCase.Interface) => {\n return async ({ args }) => {\n const result = await deleteUserUseCase.execute(args.id);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code,\n data: result.error.data\n });\n }\n\n return new Response(true);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const AdminUsersSchema = CoreGraphQLSchemaFactory.createImplementation({\n implementation: AdminUserSchemaImpl,\n dependencies: []\n});\n"],"names":["AdminUserSchemaImpl","builder","IdentityContext","GetUserUseCase","UpdateUserUseCase","identityContext","getUserUseCase","updateUserUseCase","args","identity","NotAuthorizedResponse","getUserResult","NotFoundResponse","user","updateResult","ErrorResponse","Response","CreateUserUseCase","createUserUseCase","result","DeleteUserUseCase","deleteUserUseCase","staticSchemaKey","AdminUsersSchema","CoreGraphQLSchemaFactory"],"mappings":";;;;;;;;;AAUA,MAAMA;IAGF,MAAM,QACFC,OAA+C,EAChB;QAC/BA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA+CnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;gBAAiBC;gBAAgBC;aAAkB;YAClE,UAAU,CACNC,iBACAC,gBACAC,oBAEO,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMC,WAAWJ,gBAAgB,WAAW;oBAC5C,IAAI,CAACI,SAAS,OAAO,IACjB,OAAO,IAAIC;oBAIf,OAAO,MAAML,gBAAgB,oBAAoB,CAAC;wBAC9C,MAAMM,gBAAgB,MAAML,eAAe,OA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c;wBACrB,SAASI,OAAO,KAAK,CAAC,OAAO;wBAC7B,MAAMA,OAAO,KAAK,CAAC,IAAI;oBAC3B;oBAGJ,OAAO,IAAIH,SAASG,OAAO,KAAK;gBACpC;QAER;QAEAlB,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACmB;aAAkB;YACjC,UAAU,CAACC,oBACA,OAAO,EAAEb,IAAI,EAAE;oBAClB,MAAMW,SAAS,MAAME,kBAAkB,OAAO,CAACb,KAAK,EAAE;oBACtD,IAAIW,OAAO,MAAM,IACb,OAAO,IAAIJ,cAAc;wBACrB,SAASI,OAAO,KAAK,CAAC,OAAO;wBAC7B,MAAMA,OAAO,KAAK,CAAC,IAAI;wBACvB,MAAMA,OAAO,KAAK,CAAC,IAAI;oBAC3B;oBAGJ,OAAO,IAAIH,SAAS;gBACxB;QAER;QAEA,OAAOf;IACX;;aAnKO,YAAY,GAAGqB,gBAAgB;;AAoK1C;AAEO,MAAMC,mBAAmBC,yBAAyB,oBAAoB,CAAC;IAC1E,gBAAgBxB;IAChB,cAAc,EAAE;AACpB"}
package/api/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { CognitoIdpConfig } from "./features/CognitoIdp/index.js";
package/api/index.js ADDED
@@ -0,0 +1 @@
1
+ export { CognitoIdpConfig } from "./features/CognitoIdp/index.js";
package/index.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export { Cognito } from "./Cognito.js";
2
- export { CognitoIdpConfig } from "./api/features/CognitoIdp/index.js";
package/index.js CHANGED
@@ -1,2 +1 @@
1
1
  export { Cognito } from "./Cognito.js";
2
- export { CognitoIdpConfig } from "./api/features/CognitoIdp/index.js";
@@ -0,0 +1,8 @@
1
+ import { CorePulumi } from "@webiny/project-aws";
2
+ declare class CognitoFederationPulumiImpl implements CorePulumi.Interface {
3
+ execute(app: CorePulumi.Params): void;
4
+ }
5
+ declare const _default: typeof CognitoFederationPulumiImpl & {
6
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project-aws").ICorePulumi>;
7
+ };
8
+ export default _default;