@webiny/cognito 6.4.5 → 6.6.0-alpha.0

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 (225) hide show
  1. package/Cognito.d.ts +0 -51
  2. package/Cognito.js +4 -78
  3. package/Cognito.js.map +1 -1
  4. package/admin/Cognito.d.ts +3 -1
  5. package/admin/Extension.js +21 -0
  6. package/admin/Extension.js.map +1 -1
  7. package/admin/features/account/getCurrentUser/GetCurrentUserGateway.d.ts +11 -0
  8. package/admin/features/account/getCurrentUser/GetCurrentUserGateway.js +44 -0
  9. package/admin/features/account/getCurrentUser/GetCurrentUserGateway.js.map +1 -0
  10. package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.d.ts +10 -0
  11. package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.js +19 -0
  12. package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.js.map +1 -0
  13. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.d.ts +16 -0
  14. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js +5 -0
  15. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js.map +1 -0
  16. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.d.ts +10 -0
  17. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js +5 -0
  18. package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js.map +1 -0
  19. package/admin/features/account/getCurrentUser/abstractions/index.d.ts +6 -0
  20. package/admin/features/account/getCurrentUser/abstractions/index.js +2 -0
  21. package/admin/features/account/getCurrentUser/feature.d.ts +3 -0
  22. package/admin/features/account/getCurrentUser/feature.js +19 -0
  23. package/admin/features/account/getCurrentUser/feature.js.map +1 -0
  24. package/admin/features/account/getCurrentUser/index.d.ts +1 -0
  25. package/admin/features/account/getCurrentUser/index.js +1 -0
  26. package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.d.ts +11 -0
  27. package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js +48 -0
  28. package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js.map +1 -0
  29. package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.d.ts +10 -0
  30. package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js +19 -0
  31. package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js.map +1 -0
  32. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.d.ts +26 -0
  33. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js +5 -0
  34. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js.map +1 -0
  35. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.d.ts +13 -0
  36. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js +5 -0
  37. package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js.map +1 -0
  38. package/admin/features/account/updateCurrentUser/abstractions/index.d.ts +8 -0
  39. package/admin/features/account/updateCurrentUser/abstractions/index.js +2 -0
  40. package/admin/features/account/updateCurrentUser/feature.d.ts +3 -0
  41. package/admin/features/account/updateCurrentUser/feature.js +19 -0
  42. package/admin/features/account/updateCurrentUser/feature.js.map +1 -0
  43. package/admin/features/account/updateCurrentUser/index.d.ts +1 -0
  44. package/admin/features/account/updateCurrentUser/index.js +1 -0
  45. package/admin/features/permissions/feature.d.ts +1 -1
  46. package/admin/features/users/createUser/CreateUserGateway.d.ts +11 -0
  47. package/admin/features/users/createUser/CreateUserGateway.js +49 -0
  48. package/admin/features/users/createUser/CreateUserGateway.js.map +1 -0
  49. package/admin/features/users/createUser/CreateUserUseCase.d.ts +10 -0
  50. package/admin/features/users/createUser/CreateUserUseCase.js +18 -0
  51. package/admin/features/users/createUser/CreateUserUseCase.js.map +1 -0
  52. package/admin/features/users/createUser/abstractions/CreateUserGateway.d.ts +21 -0
  53. package/admin/features/users/createUser/abstractions/CreateUserGateway.js +5 -0
  54. package/admin/features/users/createUser/abstractions/CreateUserGateway.js.map +1 -0
  55. package/admin/features/users/createUser/abstractions/CreateUserUseCase.d.ts +14 -0
  56. package/admin/features/users/createUser/abstractions/CreateUserUseCase.js +5 -0
  57. package/admin/features/users/createUser/abstractions/CreateUserUseCase.js.map +1 -0
  58. package/admin/features/users/createUser/abstractions/index.d.ts +2 -0
  59. package/admin/features/users/createUser/abstractions/index.js +2 -0
  60. package/admin/features/users/createUser/feature.d.ts +3 -0
  61. package/admin/features/users/createUser/feature.js +19 -0
  62. package/admin/features/users/createUser/feature.js.map +1 -0
  63. package/admin/features/users/createUser/index.d.ts +2 -0
  64. package/admin/features/users/createUser/index.js +2 -0
  65. package/admin/features/users/deleteUser/DeleteUserGateway.d.ts +11 -0
  66. package/admin/features/users/deleteUser/DeleteUserGateway.js +40 -0
  67. package/admin/features/users/deleteUser/DeleteUserGateway.js.map +1 -0
  68. package/admin/features/users/deleteUser/DeleteUserUseCase.d.ts +10 -0
  69. package/admin/features/users/deleteUser/DeleteUserUseCase.js +18 -0
  70. package/admin/features/users/deleteUser/DeleteUserUseCase.js.map +1 -0
  71. package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.d.ts +11 -0
  72. package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.js +5 -0
  73. package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.js.map +1 -0
  74. package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.d.ts +11 -0
  75. package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js +5 -0
  76. package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js.map +1 -0
  77. package/admin/features/users/deleteUser/abstractions/index.d.ts +2 -0
  78. package/admin/features/users/deleteUser/abstractions/index.js +2 -0
  79. package/admin/features/users/deleteUser/feature.d.ts +3 -0
  80. package/admin/features/users/deleteUser/feature.js +19 -0
  81. package/admin/features/users/deleteUser/feature.js.map +1 -0
  82. package/admin/features/users/deleteUser/index.d.ts +2 -0
  83. package/admin/features/users/deleteUser/index.js +2 -0
  84. package/admin/features/users/getUser/GetUserGateway.d.ts +11 -0
  85. package/admin/features/users/getUser/GetUserGateway.js +57 -0
  86. package/admin/features/users/getUser/GetUserGateway.js.map +1 -0
  87. package/admin/features/users/getUser/GetUserUseCase.d.ts +10 -0
  88. package/admin/features/users/getUser/GetUserUseCase.js +18 -0
  89. package/admin/features/users/getUser/GetUserUseCase.js.map +1 -0
  90. package/admin/features/users/getUser/abstractions/GetUserGateway.d.ts +32 -0
  91. package/admin/features/users/getUser/abstractions/GetUserGateway.js +5 -0
  92. package/admin/features/users/getUser/abstractions/GetUserGateway.js.map +1 -0
  93. package/admin/features/users/getUser/abstractions/GetUserUseCase.d.ts +14 -0
  94. package/admin/features/users/getUser/abstractions/GetUserUseCase.js +5 -0
  95. package/admin/features/users/getUser/abstractions/GetUserUseCase.js.map +1 -0
  96. package/admin/features/users/getUser/abstractions/index.d.ts +2 -0
  97. package/admin/features/users/getUser/abstractions/index.js +2 -0
  98. package/admin/features/users/getUser/feature.d.ts +3 -0
  99. package/admin/features/users/getUser/feature.js +19 -0
  100. package/admin/features/users/getUser/feature.js.map +1 -0
  101. package/admin/features/users/getUser/index.d.ts +2 -0
  102. package/admin/features/users/getUser/index.js +2 -0
  103. package/admin/features/users/listUsers/ListUsersGateway.d.ts +11 -0
  104. package/admin/features/users/listUsers/ListUsersGateway.js +39 -0
  105. package/admin/features/users/listUsers/ListUsersGateway.js.map +1 -0
  106. package/admin/features/users/listUsers/ListUsersUseCase.d.ts +10 -0
  107. package/admin/features/users/listUsers/ListUsersUseCase.js +18 -0
  108. package/admin/features/users/listUsers/ListUsersUseCase.js.map +1 -0
  109. package/admin/features/users/listUsers/abstractions/ListUsersGateway.d.ts +17 -0
  110. package/admin/features/users/listUsers/abstractions/ListUsersGateway.js +5 -0
  111. package/admin/features/users/listUsers/abstractions/ListUsersGateway.js.map +1 -0
  112. package/admin/features/users/listUsers/abstractions/ListUsersUseCase.d.ts +10 -0
  113. package/admin/features/users/listUsers/abstractions/ListUsersUseCase.js +5 -0
  114. package/admin/features/users/listUsers/abstractions/ListUsersUseCase.js.map +1 -0
  115. package/admin/features/users/listUsers/abstractions/index.d.ts +2 -0
  116. package/admin/features/users/listUsers/abstractions/index.js +2 -0
  117. package/admin/features/users/listUsers/feature.d.ts +3 -0
  118. package/admin/features/users/listUsers/feature.js +19 -0
  119. package/admin/features/users/listUsers/feature.js.map +1 -0
  120. package/admin/features/users/listUsers/index.d.ts +2 -0
  121. package/admin/features/users/listUsers/index.js +2 -0
  122. package/admin/features/users/updateUser/UpdateUserGateway.d.ts +11 -0
  123. package/admin/features/users/updateUser/UpdateUserGateway.js +59 -0
  124. package/admin/features/users/updateUser/UpdateUserGateway.js.map +1 -0
  125. package/admin/features/users/updateUser/UpdateUserUseCase.d.ts +10 -0
  126. package/admin/features/users/updateUser/UpdateUserUseCase.js +18 -0
  127. package/admin/features/users/updateUser/UpdateUserUseCase.js.map +1 -0
  128. package/admin/features/users/updateUser/abstractions/UpdateUserGateway.d.ts +33 -0
  129. package/admin/features/users/updateUser/abstractions/UpdateUserGateway.js +5 -0
  130. package/admin/features/users/updateUser/abstractions/UpdateUserGateway.js.map +1 -0
  131. package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.d.ts +15 -0
  132. package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.js +5 -0
  133. package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.js.map +1 -0
  134. package/admin/features/users/updateUser/abstractions/index.d.ts +2 -0
  135. package/admin/features/users/updateUser/abstractions/index.js +2 -0
  136. package/admin/features/users/updateUser/feature.d.ts +3 -0
  137. package/admin/features/users/updateUser/feature.js +19 -0
  138. package/admin/features/users/updateUser/feature.js.map +1 -0
  139. package/admin/features/users/updateUser/index.d.ts +2 -0
  140. package/admin/features/users/updateUser/index.js +2 -0
  141. package/admin/presentation/Cognito/CognitoLoginScreen.js +0 -9
  142. package/admin/presentation/Cognito/CognitoLoginScreen.js.map +1 -1
  143. package/admin/presentation/Cognito/CognitoPresenter.d.ts +1 -25
  144. package/admin/presentation/Cognito/CognitoPresenter.js +10 -122
  145. package/admin/presentation/Cognito/CognitoPresenter.js.map +1 -1
  146. package/admin/presentation/Cognito/abstractions.d.ts +1 -20
  147. package/admin/presentation/Cognito/abstractions.js.map +1 -1
  148. package/admin/presentation/Cognito/components/Divider.d.ts +1 -19
  149. package/admin/presentation/Cognito/components/Divider.js +2 -3
  150. package/admin/presentation/Cognito/components/Divider.js.map +1 -1
  151. package/admin/presentation/Cognito/components/FederatedLogin.d.ts +5 -22
  152. package/admin/presentation/Cognito/components/FederatedLogin.js +6 -19
  153. package/admin/presentation/Cognito/components/FederatedLogin.js.map +1 -1
  154. package/admin/presentation/Cognito/components/FooterSignIn.d.ts +3 -20
  155. package/admin/presentation/Cognito/components/FooterSignIn.js +2 -3
  156. package/admin/presentation/Cognito/components/FooterSignIn.js.map +1 -1
  157. package/admin/presentation/Cognito/components/PasswordResetCodeSent.d.ts +1 -19
  158. package/admin/presentation/Cognito/components/PasswordResetCodeSent.js +2 -3
  159. package/admin/presentation/Cognito/components/PasswordResetCodeSent.js.map +1 -1
  160. package/admin/presentation/Cognito/components/RequestPasswordResetCode.d.ts +1 -19
  161. package/admin/presentation/Cognito/components/RequestPasswordResetCode.js +2 -3
  162. package/admin/presentation/Cognito/components/RequestPasswordResetCode.js.map +1 -1
  163. package/admin/presentation/Cognito/components/RequireNewPassword.d.ts +1 -19
  164. package/admin/presentation/Cognito/components/RequireNewPassword.js +2 -3
  165. package/admin/presentation/Cognito/components/RequireNewPassword.js.map +1 -1
  166. package/admin/presentation/Cognito/components/SetNewPassword.d.ts +1 -19
  167. package/admin/presentation/Cognito/components/SetNewPassword.js +2 -3
  168. package/admin/presentation/Cognito/components/SetNewPassword.js.map +1 -1
  169. package/admin/presentation/Cognito/components/SignIn.d.ts +3 -19
  170. package/admin/presentation/Cognito/components/SignIn.js +7 -14
  171. package/admin/presentation/Cognito/components/SignIn.js.map +1 -1
  172. package/admin/presentation/Cognito/components/View.d.ts +1 -1
  173. package/admin/ui/views/Account/Account.js +42 -34
  174. package/admin/ui/views/Account/Account.js.map +1 -1
  175. package/admin/ui/views/Users/UsersDataList.js +44 -26
  176. package/admin/ui/views/Users/UsersDataList.js.map +1 -1
  177. package/admin/ui/views/Users/UsersForm.js +16 -22
  178. package/admin/ui/views/Users/UsersForm.js.map +1 -1
  179. package/admin/ui/views/Users/hooks/useUserForm.d.ts +2 -2
  180. package/admin/ui/views/Users/hooks/useUserForm.js +60 -78
  181. package/admin/ui/views/Users/hooks/useUserForm.js.map +1 -1
  182. package/api/features/CognitoIdp/CognitoIdentityProvider.js +11 -15
  183. package/api/features/CognitoIdp/CognitoIdentityProvider.js.map +1 -1
  184. package/api/features/CognitoIdp/abstractions.d.ts +1 -1
  185. package/api/features/CognitoIdp/abstractions.js.map +1 -1
  186. package/api/graphql/user.gql.d.ts +2 -2
  187. package/api/graphql/user.gql.js +2 -2
  188. package/api/graphql/user.gql.js.map +1 -1
  189. package/index.d.ts +1 -0
  190. package/index.js +1 -0
  191. package/package.json +18 -23
  192. package/admin/DefaultCognitoSignInConfig.d.ts +0 -23
  193. package/admin/DefaultCognitoSignInConfig.js +0 -51
  194. package/admin/DefaultCognitoSignInConfig.js.map +0 -1
  195. package/admin/SignInExtension.d.ts +0 -2
  196. package/admin/SignInExtension.js +0 -9
  197. package/admin/SignInExtension.js.map +0 -1
  198. package/admin/index.d.ts +0 -2
  199. package/admin/index.js +0 -2
  200. package/admin/presentation/Cognito/CognitoSignInConfig.d.ts +0 -31
  201. package/admin/presentation/Cognito/CognitoSignInConfig.js +0 -5
  202. package/admin/presentation/Cognito/CognitoSignInConfig.js.map +0 -1
  203. package/admin/presentation/Cognito/components/ConfirmTotpCode.d.ts +0 -26
  204. package/admin/presentation/Cognito/components/ConfirmTotpCode.js +0 -45
  205. package/admin/presentation/Cognito/components/ConfirmTotpCode.js.map +0 -1
  206. package/admin/presentation/Cognito/components/SetupTotp.d.ts +0 -25
  207. package/admin/presentation/Cognito/components/SetupTotp.js +0 -60
  208. package/admin/presentation/Cognito/components/SetupTotp.js.map +0 -1
  209. package/admin/presentation/Cognito/components/index.d.ts +0 -292
  210. package/admin/presentation/Cognito/components/index.js +0 -29
  211. package/admin/presentation/Cognito/components/index.js.map +0 -1
  212. package/admin/presentation/Cognito/signInFeature.d.ts +0 -1
  213. package/admin/presentation/Cognito/signInFeature.js +0 -11
  214. package/admin/presentation/Cognito/signInFeature.js.map +0 -1
  215. package/admin/ui/views/Account/graphql.d.ts +0 -2
  216. package/admin/ui/views/Account/graphql.js +0 -41
  217. package/admin/ui/views/Account/graphql.js.map +0 -1
  218. package/admin/ui/views/Users/graphql.d.ts +0 -5
  219. package/admin/ui/views/Users/graphql.js +0 -98
  220. package/admin/ui/views/Users/graphql.js.map +0 -1
  221. package/api/index.d.ts +0 -1
  222. package/api/index.js +0 -1
  223. package/infra/CognitoFederationPulumi.d.ts +0 -8
  224. package/infra/CognitoFederationPulumi.js +0 -17
  225. package/infra/CognitoFederationPulumi.js.map +0 -1
package/Cognito.d.ts CHANGED
@@ -1,55 +1,4 @@
1
1
  import { z } from "zod";
2
- declare const federationSchema: z.ZodObject<{
3
- domain: z.ZodString;
4
- callbackUrls: z.ZodArray<z.ZodString>;
5
- logoutUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
- responseType: z.ZodDefault<z.ZodEnum<{
7
- code: "code";
8
- token: "token";
9
- }>>;
10
- allowCredentialsLogin: z.ZodDefault<z.ZodBoolean>;
11
- identityProviders: z.ZodArray<z.ZodObject<{
12
- type: z.ZodEnum<{
13
- google: "google";
14
- facebook: "facebook";
15
- amazon: "amazon";
16
- apple: "apple";
17
- oidc: "oidc";
18
- }>;
19
- name: z.ZodOptional<z.ZodString>;
20
- label: z.ZodString;
21
- providerDetails: z.ZodRecord<z.ZodString, z.ZodAny>;
22
- idpIdentifiers: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
- attributeMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
24
- }, z.core.$strip>>;
25
- }, z.core.$strip>;
26
2
  export declare const Cognito: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<z.ZodObject<{
27
3
  apiConfig: z.ZodOptional<z.ZodString>;
28
- adminConfig: z.ZodOptional<z.ZodString>;
29
- federation: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
30
- domain: z.ZodString;
31
- callbackUrls: z.ZodArray<z.ZodString>;
32
- logoutUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
- responseType: z.ZodDefault<z.ZodEnum<{
34
- code: "code";
35
- token: "token";
36
- }>>;
37
- allowCredentialsLogin: z.ZodDefault<z.ZodBoolean>;
38
- identityProviders: z.ZodArray<z.ZodObject<{
39
- type: z.ZodEnum<{
40
- google: "google";
41
- facebook: "facebook";
42
- amazon: "amazon";
43
- apple: "apple";
44
- oidc: "oidc";
45
- }>;
46
- name: z.ZodOptional<z.ZodString>;
47
- label: z.ZodString;
48
- providerDetails: z.ZodRecord<z.ZodString, z.ZodAny>;
49
- idpIdentifiers: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
- attributeMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
51
- }, z.core.$strip>>;
52
- }, z.core.$strip>, z.ZodCustom<() => Promise<z.infer<typeof federationSchema>>, () => Promise<z.infer<typeof federationSchema>>>]>>;
53
- mfa: z.ZodDefault<z.ZodBoolean>;
54
4
  }, z.core.$strip>>;
55
- export {};
package/Cognito.js CHANGED
@@ -1,33 +1,7 @@
1
1
  import react from "react";
2
2
  import { defineExtension } from "@webiny/project/defineExtension/index.js";
3
3
  import { Admin, Api, Infra } from "@webiny/project-aws";
4
- import { Await } from "@webiny/react-properties";
5
4
  import { z } from "zod";
6
- const identityProviderSchema = z.object({
7
- type: z["enum"]([
8
- "google",
9
- "facebook",
10
- "amazon",
11
- "apple",
12
- "oidc"
13
- ]),
14
- name: z.string().optional(),
15
- label: z.string(),
16
- providerDetails: z.record(z.string(), z.any()),
17
- idpIdentifiers: z.array(z.string()).optional(),
18
- attributeMapping: z.record(z.string(), z.string()).optional()
19
- });
20
- const federationSchema = z.object({
21
- domain: z.string().describe("Cognito User Pool domain prefix."),
22
- callbackUrls: z.array(z.string()).describe("OAuth callback URLs."),
23
- logoutUrls: z.array(z.string()).optional(),
24
- responseType: z["enum"]([
25
- "code",
26
- "token"
27
- ]).default("code"),
28
- allowCredentialsLogin: z.boolean().default(true),
29
- identityProviders: z.array(identityProviderSchema)
30
- });
31
5
  const Cognito = defineExtension({
32
6
  type: "Project/Cognito",
33
7
  tags: {
@@ -35,67 +9,19 @@ const Cognito = defineExtension({
35
9
  },
36
10
  description: "Enable and configure Cognito authentication.",
37
11
  paramsSchema: z.object({
38
- apiConfig: z.string().describe("Path to API configuration.").optional(),
39
- adminConfig: z.string().describe("Path to Admin configuration.").optional(),
40
- federation: z.union([
41
- federationSchema,
42
- z.custom((val)=>"function" == typeof val)
43
- ]).optional(),
44
- mfa: z.boolean().describe("Enable TOTP MFA for all users.").default(false)
12
+ apiConfig: z.string().describe("Path to API configuration.").optional()
45
13
  }),
46
- render: (props)=>{
47
- const federationProp = props.federation;
48
- const federationFn = federationProp ? "function" == typeof federationProp ? federationProp : ()=>Promise.resolve(federationProp) : null;
49
- return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Infra.EnvVar, {
14
+ render: (props)=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Infra.EnvVar, {
50
15
  varName: "REACT_APP_IDP_TYPE",
51
16
  value: "cognito"
52
- }), props.mfa ? /*#__PURE__*/ react.createElement(Infra.EnvVar, {
53
- varName: "COGNITO_MFA",
54
- value: "true"
55
- }) : null, /*#__PURE__*/ react.createElement(Api.Extension, {
17
+ }), /*#__PURE__*/ react.createElement(Api.Extension, {
56
18
  src: import.meta.dirname + "/api/CognitoApiFeature.js",
57
19
  exportName: "CognitoApiFeature"
58
20
  }), props.apiConfig ? /*#__PURE__*/ react.createElement(Api.Extension, {
59
21
  src: props.apiConfig
60
22
  }) : null, /*#__PURE__*/ react.createElement(Admin.Extension, {
61
23
  src: import.meta.dirname + "/admin/Extension.js"
62
- }), props.adminConfig ? /*#__PURE__*/ react.createElement(Admin.Extension, {
63
- src: props.adminConfig
64
- }) : null, federationFn ? /*#__PURE__*/ react.createElement(Await, {
65
- fn: federationFn
66
- }, (federation)=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Admin.Extension, {
67
- src: import.meta.dirname + "/admin/SignInExtension.js",
68
- exportName: "SignInExtension"
69
- }), /*#__PURE__*/ react.createElement(Infra.EnvVar, {
70
- varName: "COGNITO_FEDERATION_INFRA_CONFIG",
71
- value: JSON.stringify({
72
- domain: federation.domain,
73
- callbackUrls: federation.callbackUrls,
74
- logoutUrls: federation.logoutUrls,
75
- identityProviders: federation.identityProviders.map((idp)=>({
76
- type: idp.type,
77
- name: idp.name,
78
- providerDetails: idp.providerDetails,
79
- idpIdentifiers: idp.idpIdentifiers,
80
- attributeMapping: idp.attributeMapping
81
- }))
82
- })
83
- }), /*#__PURE__*/ react.createElement(Infra.Core.Pulumi, {
84
- src: import.meta.dirname + "/infra/CognitoFederationPulumi.js"
85
- }), /*#__PURE__*/ react.createElement(Admin.BuildParam, {
86
- paramName: "cognitoFederation",
87
- value: {
88
- callbackUrls: federation.callbackUrls,
89
- logoutUrls: federation.logoutUrls || federation.callbackUrls,
90
- responseType: federation.responseType,
91
- allowCredentialsLogin: federation.allowCredentialsLogin,
92
- providers: federation.identityProviders.map((idp)=>({
93
- name: idp.name || idp.type,
94
- label: idp.label
95
- }))
96
- }
97
- }))) : null);
98
- }
24
+ }))
99
25
  });
100
26
  export { Cognito };
101
27
 
package/Cognito.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Cognito.js","sources":["../src/Cognito.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { Api, Admin, Infra } from \"@webiny/project-aws\";\nimport { Await } from \"@webiny/react-properties\";\nimport { z } from \"zod\";\n\nconst identityProviderSchema = z.object({\n type: z.enum([\"google\", \"facebook\", \"amazon\", \"apple\", \"oidc\"]),\n name: z.string().optional(),\n label: z.string(),\n providerDetails: z.record(z.string(), z.any()),\n idpIdentifiers: z.array(z.string()).optional(),\n attributeMapping: z.record(z.string(), z.string()).optional()\n});\n\nconst federationSchema = z.object({\n domain: z.string().describe(\"Cognito User Pool domain prefix.\"),\n callbackUrls: z.array(z.string()).describe(\"OAuth callback URLs.\"),\n logoutUrls: z.array(z.string()).optional(),\n responseType: z.enum([\"code\", \"token\"]).default(\"code\"),\n allowCredentialsLogin: z.boolean().default(true),\n identityProviders: z.array(identityProviderSchema)\n});\n\nexport const Cognito = defineExtension({\n type: \"Project/Cognito\",\n tags: { runtimeContext: \"project\" },\n description: \"Enable and configure Cognito authentication.\",\n paramsSchema: z.object({\n apiConfig: z.string().describe(\"Path to API configuration.\").optional(),\n adminConfig: z.string().describe(\"Path to Admin configuration.\").optional(),\n federation: z\n .union([\n federationSchema,\n z.custom<() => Promise<z.infer<typeof federationSchema>>>(\n val => typeof val === \"function\"\n )\n ])\n .optional(),\n mfa: z.boolean().describe(\"Enable TOTP MFA for all users.\").default(false)\n }),\n render: props => {\n const federationProp = props.federation;\n const federationFn = federationProp\n ? typeof federationProp === \"function\"\n ? federationProp\n : () => Promise.resolve(federationProp)\n : null;\n\n return (\n <>\n <Infra.EnvVar varName={\"REACT_APP_IDP_TYPE\"} value={\"cognito\"} />\n {props.mfa ? <Infra.EnvVar varName={\"COGNITO_MFA\"} value={\"true\"} /> : null}\n\n {/* Api extensions */}\n <Api.Extension\n src={import.meta.dirname + \"/api/CognitoApiFeature.js\"}\n exportName={\"CognitoApiFeature\"}\n />\n {props.apiConfig ? <Api.Extension src={props.apiConfig} /> : null}\n\n {/* Admin extensions */}\n <Admin.Extension src={import.meta.dirname + \"/admin/Extension.js\"} />\n {props.adminConfig ? <Admin.Extension src={props.adminConfig} /> : null}\n\n {/* Federation infra + admin config */}\n {federationFn ? (\n <Await fn={federationFn}>\n {federation => (\n <>\n <Admin.Extension\n src={import.meta.dirname + \"/admin/SignInExtension.js\"}\n exportName={\"SignInExtension\"}\n />\n <Infra.EnvVar\n varName={\"COGNITO_FEDERATION_INFRA_CONFIG\"}\n value={JSON.stringify({\n domain: federation.domain,\n callbackUrls: federation.callbackUrls,\n logoutUrls: federation.logoutUrls,\n identityProviders: federation.identityProviders.map(\n idp => ({\n type: idp.type,\n name: idp.name,\n providerDetails: idp.providerDetails,\n idpIdentifiers: idp.idpIdentifiers,\n attributeMapping: idp.attributeMapping\n })\n )\n })}\n />\n <Infra.Core.Pulumi\n src={import.meta.dirname + \"/infra/CognitoFederationPulumi.js\"}\n />\n <Admin.BuildParam\n paramName={\"cognitoFederation\"}\n value={{\n callbackUrls: federation.callbackUrls,\n logoutUrls:\n federation.logoutUrls || federation.callbackUrls,\n responseType: federation.responseType,\n allowCredentialsLogin: federation.allowCredentialsLogin,\n providers: federation.identityProviders.map(idp => ({\n name: idp.name || idp.type,\n label: idp.label\n }))\n }}\n />\n </>\n )}\n </Await>\n ) : null}\n </>\n );\n }\n});\n"],"names":["identityProviderSchema","z","federationSchema","Cognito","defineExtension","val","props","federationProp","federationFn","Promise","Infra","Api","Admin","Await","federation","JSON","idp"],"mappings":";;;;;AAMA,MAAMA,yBAAyBC,EAAE,MAAM,CAAC;IACpC,MAAMA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAU;QAAY;QAAU;QAAS;KAAO;IAC9D,MAAMA,EAAE,MAAM,GAAG,QAAQ;IACzB,OAAOA,EAAE,MAAM;IACf,iBAAiBA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,GAAG;IAC3C,gBAAgBA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ;IAC5C,kBAAkBA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,MAAM,IAAI,QAAQ;AAC/D;AAEA,MAAMC,mBAAmBD,EAAE,MAAM,CAAC;IAC9B,QAAQA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,cAAcA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ,CAAC;IAC3C,YAAYA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ;IACxC,cAAcA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAQ;KAAQ,EAAE,OAAO,CAAC;IAChD,uBAAuBA,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3C,mBAAmBA,EAAE,KAAK,CAACD;AAC/B;AAEO,MAAMG,UAAUC,gBAAgB;IACnC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcH,EAAE,MAAM,CAAC;QACnB,WAAWA,EAAE,MAAM,GAAG,QAAQ,CAAC,8BAA8B,QAAQ;QACrE,aAAaA,EAAE,MAAM,GAAG,QAAQ,CAAC,gCAAgC,QAAQ;QACzE,YAAYA,EAAAA,KACF,CAAC;YACHC;YACAD,EAAE,MAAM,CACJI,CAAAA,MAAO,AAAe,cAAf,OAAOA;SAErB,EACA,QAAQ;QACb,KAAKJ,EAAE,OAAO,GAAG,QAAQ,CAAC,kCAAkC,OAAO,CAAC;IACxE;IACA,QAAQK,CAAAA;QACJ,MAAMC,iBAAiBD,MAAM,UAAU;QACvC,MAAME,eAAeD,iBACf,AAA0B,cAA1B,OAAOA,iBACHA,iBACA,IAAME,QAAQ,OAAO,CAACF,kBAC1B;QAEN,OAAO,WAAP,GACI,wDACI,oBAACG,MAAM,MAAM;YAAC,SAAS;YAAsB,OAAO;YACnDJ,MAAM,GAAG,GAAG,WAAH,GAAG,oBAACI,MAAM,MAAM;YAAC,SAAS;YAAe,OAAO;aAAa,oBAGvE,oBAACC,IAAI,SAAS;YACV,KAAK,YAAY,OAAO,GAAG;YAC3B,YAAY;YAEfL,MAAM,SAAS,GAAG,WAAH,GAAG,oBAACK,IAAI,SAAS;YAAC,KAAKL,MAAM,SAAS;aAAO,oBAG7D,oBAACM,MAAM,SAAS;YAAC,KAAK,YAAY,OAAO,GAAG;YAC3CN,MAAM,WAAW,GAAG,WAAH,GAAG,oBAACM,MAAM,SAAS;YAAC,KAAKN,MAAM,WAAW;aAAO,MAGlEE,eAAe,WAAfA,GACG,oBAACK,OAAKA;YAAC,IAAIL;WACNM,CAAAA,aAAAA,WAAAA,GACG,wDACI,oBAACF,MAAM,SAAS;gBACZ,KAAK,YAAY,OAAO,GAAG;gBAC3B,YAAY;8BAEhB,oBAACF,MAAM,MAAM;gBACT,SAAS;gBACT,OAAOK,KAAK,SAAS,CAAC;oBAClB,QAAQD,WAAW,MAAM;oBACzB,cAAcA,WAAW,YAAY;oBACrC,YAAYA,WAAW,UAAU;oBACjC,mBAAmBA,WAAW,iBAAiB,CAAC,GAAG,CAC/CE,CAAAA,MAAQ;4BACJ,MAAMA,IAAI,IAAI;4BACd,MAAMA,IAAI,IAAI;4BACd,iBAAiBA,IAAI,eAAe;4BACpC,gBAAgBA,IAAI,cAAc;4BAClC,kBAAkBA,IAAI,gBAAgB;wBAC1C;gBAER;8BAEJ,oBAACN,MAAM,IAAI,CAAC,MAAM;gBACd,KAAK,YAAY,OAAO,GAAG;8BAE/B,oBAACE,MAAM,UAAU;gBACb,WAAW;gBACX,OAAO;oBACH,cAAcE,WAAW,YAAY;oBACrC,YACIA,WAAW,UAAU,IAAIA,WAAW,YAAY;oBACpD,cAAcA,WAAW,YAAY;oBACrC,uBAAuBA,WAAW,qBAAqB;oBACvD,WAAWA,WAAW,iBAAiB,CAAC,GAAG,CAACE,CAAAA,MAAQ;4BAChD,MAAMA,IAAI,IAAI,IAAIA,IAAI,IAAI;4BAC1B,OAAOA,IAAI,KAAK;wBACpB;gBACJ;mBAKhB;IAGhB;AACJ"}
1
+ {"version":3,"file":"Cognito.js","sources":["../src/Cognito.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { Api, Admin, Infra } from \"@webiny/project-aws\";\nimport { z } from \"zod\";\n\nexport const Cognito = defineExtension({\n type: \"Project/Cognito\",\n tags: { runtimeContext: \"project\" },\n description: \"Enable and configure Cognito authentication.\",\n paramsSchema: z.object({\n apiConfig: z.string().describe(\"Path to API configuration.\").optional()\n }),\n render: props => {\n return (\n <>\n <Infra.EnvVar varName={\"REACT_APP_IDP_TYPE\"} value={\"cognito\"} />\n {/* Api extensions */}\n <Api.Extension\n src={import.meta.dirname + \"/api/CognitoApiFeature.js\"}\n exportName={\"CognitoApiFeature\"}\n />\n {props.apiConfig ? <Api.Extension src={props.apiConfig} /> : null}\n {/* Admin extensions */}\n <Admin.Extension src={import.meta.dirname + \"/admin/Extension.js\"} />\n </>\n );\n }\n});\n"],"names":["Cognito","defineExtension","z","props","Infra","Api","Admin"],"mappings":";;;;AAKO,MAAMA,UAAUC,gBAAgB;IACnC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,WAAWA,EAAE,MAAM,GAAG,QAAQ,CAAC,8BAA8B,QAAQ;IACzE;IACA,QAAQC,CAAAA,QACG,WAAP,GACI,wDACI,oBAACC,MAAM,MAAM;YAAC,SAAS;YAAsB,OAAO;0BAEpD,oBAACC,IAAI,SAAS;YACV,KAAK,YAAY,OAAO,GAAG;YAC3B,YAAY;YAEfF,MAAM,SAAS,GAAG,WAAH,GAAG,oBAACE,IAAI,SAAS;YAAC,KAAKF,MAAM,SAAS;aAAO,oBAE7D,oBAACG,MAAM,SAAS;YAAC,KAAK,YAAY,OAAO,GAAG;;AAI5D"}
@@ -3,4 +3,6 @@ import { type CognitoLoginProps } from "./CognitoLogin.js";
3
3
  export interface CognitoAdminProps {
4
4
  login: CognitoLoginProps;
5
5
  }
6
- export declare const CognitoAdmin: React.MemoExoticComponent<(props: CognitoAdminProps) => React.JSX.Element>;
6
+ declare const CognitoIdP: (props: CognitoAdminProps) => React.JSX.Element;
7
+ export declare const CognitoAdmin: React.MemoExoticComponent<typeof CognitoIdP>;
8
+ export {};
@@ -3,6 +3,13 @@ import { RegisterFeature } from "@webiny/app-admin";
3
3
  import { CognitoFeature } from "./presentation/Cognito/feature.js";
4
4
  import { CognitoAdmin } from "./Cognito.js";
5
5
  import { CognitoPermissionsFeature } from "./features/permissions/feature.js";
6
+ import { GetCurrentUserFeature } from "./features/account/getCurrentUser/index.js";
7
+ import { UpdateCurrentUserFeature } from "./features/account/updateCurrentUser/index.js";
8
+ import { ListUsersFeature } from "./features/users/listUsers/index.js";
9
+ import { GetUserFeature } from "./features/users/getUser/index.js";
10
+ import { CreateUserFeature } from "./features/users/createUser/index.js";
11
+ import { UpdateUserFeature } from "./features/users/updateUser/index.js";
12
+ import { DeleteUserFeature } from "./features/users/deleteUser/index.js";
6
13
  const Extension = ()=>{
7
14
  const region = process.env.REACT_APP_USER_POOL_REGION || "";
8
15
  const userPoolId = process.env.REACT_APP_USER_POOL_ID || "";
@@ -11,6 +18,20 @@ const Extension = ()=>{
11
18
  feature: CognitoFeature
12
19
  }), /*#__PURE__*/ react.createElement(RegisterFeature, {
13
20
  feature: CognitoPermissionsFeature
21
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
22
+ feature: GetCurrentUserFeature
23
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
24
+ feature: UpdateCurrentUserFeature
25
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
26
+ feature: ListUsersFeature
27
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
28
+ feature: GetUserFeature
29
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
30
+ feature: CreateUserFeature
31
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
32
+ feature: UpdateUserFeature
33
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
34
+ feature: DeleteUserFeature
14
35
  }), /*#__PURE__*/ react.createElement(CognitoAdmin, {
15
36
  login: {
16
37
  region,
@@ -1 +1 @@
1
- {"version":3,"file":"admin/Extension.js","sources":["../../src/admin/Extension.tsx"],"sourcesContent":["import React from \"react\";\nimport { RegisterFeature } from \"@webiny/app-admin\";\nimport { CognitoFeature } from \"./presentation/Cognito/feature.js\";\nimport { CognitoAdmin } from \"./Cognito.js\";\nimport { CognitoPermissionsFeature } from \"./features/permissions/feature.js\";\n\nexport const Extension = () => {\n const region = process.env.REACT_APP_USER_POOL_REGION || \"\";\n const userPoolId = process.env.REACT_APP_USER_POOL_ID || \"\";\n const clientId = process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID || \"\";\n\n return (\n <>\n <RegisterFeature feature={CognitoFeature} />\n <RegisterFeature feature={CognitoPermissionsFeature} />\n <CognitoAdmin login={{ region, userPoolId, clientId }} />\n </>\n );\n};\n"],"names":["Extension","region","process","userPoolId","clientId","RegisterFeature","CognitoFeature","CognitoPermissionsFeature","CognitoAdmin"],"mappings":";;;;;AAMO,MAAMA,YAAY;IACrB,MAAMC,SAASC,QAAQ,GAAG,CAAC,0BAA0B,IAAI;IACzD,MAAMC,aAAaD,QAAQ,GAAG,CAAC,sBAAsB,IAAI;IACzD,MAAME,WAAWF,QAAQ,GAAG,CAAC,iCAAiC,IAAI;IAElE,OAAO,WAAP,GACI,wDACI,oBAACG,iBAAeA;QAAC,SAASC;sBAC1B,oBAACD,iBAAeA;QAAC,SAASE;sBAC1B,oBAACC,cAAYA;QAAC,OAAO;YAAEP;YAAQE;YAAYC;QAAS;;AAGhE"}
1
+ {"version":3,"file":"admin/Extension.js","sources":["../../src/admin/Extension.tsx"],"sourcesContent":["import React from \"react\";\nimport { RegisterFeature } from \"@webiny/app-admin\";\nimport { CognitoFeature } from \"./presentation/Cognito/feature.js\";\nimport { CognitoAdmin } from \"./Cognito.js\";\nimport { CognitoPermissionsFeature } from \"./features/permissions/feature.js\";\nimport { GetCurrentUserFeature } from \"./features/account/getCurrentUser/index.js\";\nimport { UpdateCurrentUserFeature } from \"./features/account/updateCurrentUser/index.js\";\nimport { ListUsersFeature } from \"./features/users/listUsers/index.js\";\nimport { GetUserFeature } from \"./features/users/getUser/index.js\";\nimport { CreateUserFeature } from \"./features/users/createUser/index.js\";\nimport { UpdateUserFeature } from \"./features/users/updateUser/index.js\";\nimport { DeleteUserFeature } from \"./features/users/deleteUser/index.js\";\n\nexport const Extension = () => {\n const region = process.env.REACT_APP_USER_POOL_REGION || \"\";\n const userPoolId = process.env.REACT_APP_USER_POOL_ID || \"\";\n const clientId = process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID || \"\";\n\n return (\n <>\n <RegisterFeature feature={CognitoFeature} />\n <RegisterFeature feature={CognitoPermissionsFeature} />\n <RegisterFeature feature={GetCurrentUserFeature} />\n <RegisterFeature feature={UpdateCurrentUserFeature} />\n <RegisterFeature feature={ListUsersFeature} />\n <RegisterFeature feature={GetUserFeature} />\n <RegisterFeature feature={CreateUserFeature} />\n <RegisterFeature feature={UpdateUserFeature} />\n <RegisterFeature feature={DeleteUserFeature} />\n <CognitoAdmin\n login={{\n region,\n userPoolId,\n clientId\n }}\n />\n </>\n );\n};\n"],"names":["Extension","region","process","userPoolId","clientId","RegisterFeature","CognitoFeature","CognitoPermissionsFeature","GetCurrentUserFeature","UpdateCurrentUserFeature","ListUsersFeature","GetUserFeature","CreateUserFeature","UpdateUserFeature","DeleteUserFeature","CognitoAdmin"],"mappings":";;;;;;;;;;;;AAaO,MAAMA,YAAY;IACrB,MAAMC,SAASC,QAAQ,GAAG,CAAC,0BAA0B,IAAI;IACzD,MAAMC,aAAaD,QAAQ,GAAG,CAAC,sBAAsB,IAAI;IACzD,MAAME,WAAWF,QAAQ,GAAG,CAAC,iCAAiC,IAAI;IAElE,OAAO,WAAP,GACI,wDACI,oBAACG,iBAAeA;QAAC,SAASC;sBAC1B,oBAACD,iBAAeA;QAAC,SAASE;sBAC1B,oBAACF,iBAAeA;QAAC,SAASG;sBAC1B,oBAACH,iBAAeA;QAAC,SAASI;sBAC1B,oBAACJ,iBAAeA;QAAC,SAASK;sBAC1B,oBAACL,iBAAeA;QAAC,SAASM;sBAC1B,oBAACN,iBAAeA;QAAC,SAASO;sBAC1B,oBAACP,iBAAeA;QAAC,SAASQ;sBAC1B,oBAACR,iBAAeA;QAAC,SAASS;sBAC1B,oBAACC,cAAYA;QACT,OAAO;YACHd;YACAE;YACAC;QACJ;;AAIhB"}
@@ -0,0 +1,11 @@
1
+ import { GetCurrentUserGateway as GatewayAbstraction } from "./abstractions/index.js";
2
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient";
3
+ declare class GetCurrentUserGatewayImpl implements GatewayAbstraction.Interface {
4
+ private readonly client;
5
+ constructor(client: MainGraphQLClient.Interface);
6
+ execute(): Promise<GatewayAbstraction.Result>;
7
+ }
8
+ export declare const GetCurrentUserGateway: typeof GetCurrentUserGatewayImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions/GetCurrentUserGateway.js").IGetCurrentUserGateway>;
10
+ };
11
+ export {};
@@ -0,0 +1,44 @@
1
+ import { GetCurrentUserGateway } from "./abstractions/index.js";
2
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient";
3
+ const GET_CURRENT_USER = `
4
+ query GetCurrentUser {
5
+ adminUsers {
6
+ user: getCurrentUser {
7
+ data {
8
+ id
9
+ email
10
+ firstName
11
+ lastName
12
+ avatar
13
+ external
14
+ }
15
+ error {
16
+ code
17
+ message
18
+ }
19
+ }
20
+ }
21
+ }
22
+ `;
23
+ class GetCurrentUserGatewayImpl {
24
+ constructor(client){
25
+ this.client = client;
26
+ }
27
+ async execute() {
28
+ const response = await this.client.execute({
29
+ query: GET_CURRENT_USER
30
+ });
31
+ const { data, error } = response.adminUsers.user;
32
+ if (!data) throw new Error(error?.message || "Could not fetch current user.");
33
+ return data;
34
+ }
35
+ }
36
+ const GetCurrentUserGateway_GetCurrentUserGateway = GetCurrentUserGateway.createImplementation({
37
+ implementation: GetCurrentUserGatewayImpl,
38
+ dependencies: [
39
+ MainGraphQLClient
40
+ ]
41
+ });
42
+ export { GetCurrentUserGateway_GetCurrentUserGateway as GetCurrentUserGateway };
43
+
44
+ //# sourceMappingURL=GetCurrentUserGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/getCurrentUser/GetCurrentUserGateway.js","sources":["../../../../../src/admin/features/account/getCurrentUser/GetCurrentUserGateway.ts"],"sourcesContent":["import { GetCurrentUserGateway as GatewayAbstraction } from \"./abstractions/index.js\";\nimport { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient\";\n\nconst GET_CURRENT_USER = /* GraphQL */ `\n query GetCurrentUser {\n adminUsers {\n user: getCurrentUser {\n data {\n id\n email\n firstName\n lastName\n avatar\n external\n }\n error {\n code\n message\n }\n }\n }\n }\n`;\n\ntype GetCurrentUserResponse = {\n adminUsers: {\n user:\n | { data: GatewayAbstraction.Result; error: null }\n | { data: null; error: { code: string; message: string } };\n };\n};\n\nclass GetCurrentUserGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private readonly client: MainGraphQLClient.Interface) {}\n\n async execute(): Promise<GatewayAbstraction.Result> {\n const response = await this.client.execute<GetCurrentUserResponse>({\n query: GET_CURRENT_USER\n });\n\n const { data, error } = response.adminUsers.user;\n\n if (!data) {\n throw new Error(error?.message || \"Could not fetch current user.\");\n }\n\n return data;\n }\n}\n\nexport const GetCurrentUserGateway = GatewayAbstraction.createImplementation({\n implementation: GetCurrentUserGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["GET_CURRENT_USER","GetCurrentUserGatewayImpl","client","response","data","error","Error","GetCurrentUserGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;AAGA,MAAMA,mBAAiC,CAAC;;;;;;;;;;;;;;;;;;;AAmBxC,CAAC;AAUD,MAAMC;IACF,YAA6BC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAEnE,MAAM,UAA8C;QAChD,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAyB;YAC/D,OAAOH;QACX;QAEA,MAAM,EAAEI,IAAI,EAAEC,KAAK,EAAE,GAAGF,SAAS,UAAU,CAAC,IAAI;QAEhD,IAAI,CAACC,MACD,MAAM,IAAIE,MAAMD,OAAO,WAAW;QAGtC,OAAOD;IACX;AACJ;AAEO,MAAMG,8CAAwBC,sBAAAA,oBAAuC,CAAC;IACzE,gBAAgBP;IAChB,cAAc;QAACQ;KAAkB;AACrC"}
@@ -0,0 +1,10 @@
1
+ import { GetCurrentUserUseCase as UseCaseAbstraction, GetCurrentUserGateway } from "./abstractions/index.js";
2
+ declare class GetCurrentUserUseCaseImpl implements UseCaseAbstraction.Interface {
3
+ private readonly gateway;
4
+ constructor(gateway: GetCurrentUserGateway.Interface);
5
+ execute(): Promise<UseCaseAbstraction.Result>;
6
+ }
7
+ export declare const GetCurrentUserUseCase: typeof GetCurrentUserUseCaseImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions/GetCurrentUserUseCase.js").IGetCurrentUserUseCase>;
9
+ };
10
+ export {};
@@ -0,0 +1,19 @@
1
+ import { GetCurrentUserGateway, GetCurrentUserUseCase } from "./abstractions/index.js";
2
+ class GetCurrentUserUseCaseImpl {
3
+ constructor(gateway){
4
+ this.gateway = gateway;
5
+ }
6
+ async execute() {
7
+ const result = await this.gateway.execute();
8
+ return result;
9
+ }
10
+ }
11
+ const GetCurrentUserUseCase_GetCurrentUserUseCase = GetCurrentUserUseCase.createImplementation({
12
+ implementation: GetCurrentUserUseCaseImpl,
13
+ dependencies: [
14
+ GetCurrentUserGateway
15
+ ]
16
+ });
17
+ export { GetCurrentUserUseCase_GetCurrentUserUseCase as GetCurrentUserUseCase };
18
+
19
+ //# sourceMappingURL=GetCurrentUserUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/getCurrentUser/GetCurrentUserUseCase.js","sources":["../../../../../src/admin/features/account/getCurrentUser/GetCurrentUserUseCase.ts"],"sourcesContent":["import {\n GetCurrentUserUseCase as UseCaseAbstraction,\n GetCurrentUserGateway\n} from \"./abstractions/index.js\";\n\nclass GetCurrentUserUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private readonly gateway: GetCurrentUserGateway.Interface) {}\n\n async execute(): Promise<UseCaseAbstraction.Result> {\n const result = await this.gateway.execute();\n return result;\n }\n}\n\nexport const GetCurrentUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetCurrentUserUseCaseImpl,\n dependencies: [GetCurrentUserGateway]\n});\n"],"names":["GetCurrentUserUseCaseImpl","gateway","result","GetCurrentUserUseCase","UseCaseAbstraction","GetCurrentUserGateway"],"mappings":";AAKA,MAAMA;IACF,YAA6BC,OAAwC,CAAE;aAA1CA,OAAO,GAAPA;IAA2C;IAExE,MAAM,UAA8C;QAChD,MAAMC,SAAS,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO;QACzC,OAAOA;IACX;AACJ;AAEO,MAAMC,8CAAwBC,sBAAAA,oBAAuC,CAAC;IACzE,gBAAgBJ;IAChB,cAAc;QAACK;KAAsB;AACzC"}
@@ -0,0 +1,16 @@
1
+ export interface IGetCurrentUserGatewayResult {
2
+ id: string;
3
+ email: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ avatar: any;
7
+ external: boolean;
8
+ }
9
+ export interface IGetCurrentUserGateway {
10
+ execute(): Promise<IGetCurrentUserGatewayResult>;
11
+ }
12
+ export declare const GetCurrentUserGateway: import("@webiny/di").Abstraction<IGetCurrentUserGateway>;
13
+ export declare namespace GetCurrentUserGateway {
14
+ type Interface = IGetCurrentUserGateway;
15
+ type Result = IGetCurrentUserGatewayResult;
16
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const GetCurrentUserGateway = createAbstraction("Cognito/GetCurrentUserGateway");
3
+ export { GetCurrentUserGateway };
4
+
5
+ //# sourceMappingURL=GetCurrentUserGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js","sources":["../../../../../../src/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface IGetCurrentUserGatewayResult {\n id: string;\n email: string;\n firstName: string;\n lastName: string;\n avatar: any;\n external: boolean;\n}\n\nexport interface IGetCurrentUserGateway {\n execute(): Promise<IGetCurrentUserGatewayResult>;\n}\n\nexport const GetCurrentUserGateway = createAbstraction<IGetCurrentUserGateway>(\n \"Cognito/GetCurrentUserGateway\"\n);\n\nexport namespace GetCurrentUserGateway {\n export type Interface = IGetCurrentUserGateway;\n export type Result = IGetCurrentUserGatewayResult;\n}\n"],"names":["GetCurrentUserGateway","createAbstraction"],"mappings":";AAeO,MAAMA,wBAAwBC,kBACjC"}
@@ -0,0 +1,10 @@
1
+ import type { IGetCurrentUserGatewayResult } from "./GetCurrentUserGateway.js";
2
+ export type IGetCurrentUserUseCaseResult = IGetCurrentUserGatewayResult;
3
+ export interface IGetCurrentUserUseCase {
4
+ execute(): Promise<IGetCurrentUserUseCaseResult>;
5
+ }
6
+ export declare const GetCurrentUserUseCase: import("@webiny/di").Abstraction<IGetCurrentUserUseCase>;
7
+ export declare namespace GetCurrentUserUseCase {
8
+ type Interface = IGetCurrentUserUseCase;
9
+ type Result = IGetCurrentUserUseCaseResult;
10
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const GetCurrentUserUseCase = createAbstraction("Cognito/GetCurrentUserUseCase");
3
+ export { GetCurrentUserUseCase };
4
+
5
+ //# sourceMappingURL=GetCurrentUserUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js","sources":["../../../../../../src/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IGetCurrentUserGatewayResult } from \"./GetCurrentUserGateway.js\";\n\nexport type IGetCurrentUserUseCaseResult = IGetCurrentUserGatewayResult;\n\nexport interface IGetCurrentUserUseCase {\n execute(): Promise<IGetCurrentUserUseCaseResult>;\n}\n\nexport const GetCurrentUserUseCase = createAbstraction<IGetCurrentUserUseCase>(\n \"Cognito/GetCurrentUserUseCase\"\n);\n\nexport namespace GetCurrentUserUseCase {\n export type Interface = IGetCurrentUserUseCase;\n export type Result = IGetCurrentUserUseCaseResult;\n}\n"],"names":["GetCurrentUserUseCase","createAbstraction"],"mappings":";AASO,MAAMA,wBAAwBC,kBACjC"}
@@ -0,0 +1,6 @@
1
+ export { GetCurrentUserGateway } from "./GetCurrentUserGateway.js";
2
+ export type { IGetCurrentUserGateway } from "./GetCurrentUserGateway.js";
3
+ export type { IGetCurrentUserGatewayResult } from "./GetCurrentUserGateway.js";
4
+ export { GetCurrentUserUseCase } from "./GetCurrentUserUseCase.js";
5
+ export type { IGetCurrentUserUseCase } from "./GetCurrentUserUseCase.js";
6
+ export type { IGetCurrentUserUseCaseResult } from "./GetCurrentUserUseCase.js";
@@ -0,0 +1,2 @@
1
+ export { GetCurrentUserGateway } from "./GetCurrentUserGateway.js";
2
+ export { GetCurrentUserUseCase } from "./GetCurrentUserUseCase.js";
@@ -0,0 +1,3 @@
1
+ export declare const GetCurrentUserFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ useCase: import("./abstractions/GetCurrentUserUseCase.js").IGetCurrentUserUseCase;
3
+ }, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { GetCurrentUserUseCase } from "./abstractions/index.js";
3
+ import { GetCurrentUserUseCase as external_GetCurrentUserUseCase_js_GetCurrentUserUseCase } from "./GetCurrentUserUseCase.js";
4
+ import { GetCurrentUserGateway } from "./GetCurrentUserGateway.js";
5
+ const GetCurrentUserFeature = createFeature({
6
+ name: "Cognito/GetCurrentUser",
7
+ register (container) {
8
+ container.register(external_GetCurrentUserUseCase_js_GetCurrentUserUseCase);
9
+ container.register(GetCurrentUserGateway).inSingletonScope();
10
+ },
11
+ resolve (container) {
12
+ return {
13
+ useCase: container.resolve(GetCurrentUserUseCase)
14
+ };
15
+ }
16
+ });
17
+ export { GetCurrentUserFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/getCurrentUser/feature.js","sources":["../../../../../src/admin/features/account/getCurrentUser/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { GetCurrentUserUseCase as UseCaseAbstraction } from \"./abstractions/index.js\";\nimport { GetCurrentUserUseCase } from \"./GetCurrentUserUseCase.js\";\nimport { GetCurrentUserGateway } from \"./GetCurrentUserGateway.js\";\n\nexport const GetCurrentUserFeature = createFeature({\n name: \"Cognito/GetCurrentUser\",\n register(container) {\n container.register(GetCurrentUserUseCase);\n container.register(GetCurrentUserGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCaseAbstraction)\n };\n }\n});\n"],"names":["GetCurrentUserFeature","createFeature","container","GetCurrentUserUseCase","GetCurrentUserGateway","UseCaseAbstraction"],"mappings":";;;;AAKO,MAAMA,wBAAwBC,cAAc;IAC/C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,uBAAuB,gBAAgB;IAC9D;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
@@ -0,0 +1 @@
1
+ export { GetCurrentUserFeature } from "./feature.js";
@@ -0,0 +1 @@
1
+ export { GetCurrentUserFeature } from "./feature.js";
@@ -0,0 +1,11 @@
1
+ import { UpdateCurrentUserGateway as GatewayAbstraction } from "./abstractions/index.js";
2
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient";
3
+ declare class UpdateCurrentUserGatewayImpl implements GatewayAbstraction.Interface {
4
+ private readonly client;
5
+ constructor(client: MainGraphQLClient.Interface);
6
+ execute(params: GatewayAbstraction.Params): Promise<GatewayAbstraction.Result>;
7
+ }
8
+ export declare const UpdateCurrentUserGateway: typeof UpdateCurrentUserGatewayImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions/UpdateCurrentUserGateway.js").IUpdateCurrentUserGateway>;
10
+ };
11
+ export {};
@@ -0,0 +1,48 @@
1
+ import { UpdateCurrentUserGateway } from "./abstractions/index.js";
2
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient";
3
+ const UPDATE_CURRENT_USER = `
4
+ mutation UpdateCurrentUser($data: AdminUsersCurrentUserInput!) {
5
+ adminUsers {
6
+ updateCurrentUser(data: $data) {
7
+ data {
8
+ id
9
+ email
10
+ firstName
11
+ lastName
12
+ avatar
13
+ external
14
+ }
15
+ error {
16
+ code
17
+ message
18
+ data
19
+ }
20
+ }
21
+ }
22
+ }
23
+ `;
24
+ class UpdateCurrentUserGatewayImpl {
25
+ constructor(client){
26
+ this.client = client;
27
+ }
28
+ async execute(params) {
29
+ const response = await this.client.execute({
30
+ query: UPDATE_CURRENT_USER,
31
+ variables: {
32
+ data: params
33
+ }
34
+ });
35
+ const { data, error } = response.adminUsers.updateCurrentUser;
36
+ if (!data) throw new Error(error?.message || "Could not update current user.");
37
+ return data;
38
+ }
39
+ }
40
+ const UpdateCurrentUserGateway_UpdateCurrentUserGateway = UpdateCurrentUserGateway.createImplementation({
41
+ implementation: UpdateCurrentUserGatewayImpl,
42
+ dependencies: [
43
+ MainGraphQLClient
44
+ ]
45
+ });
46
+ export { UpdateCurrentUserGateway_UpdateCurrentUserGateway as UpdateCurrentUserGateway };
47
+
48
+ //# sourceMappingURL=UpdateCurrentUserGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js","sources":["../../../../../src/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.ts"],"sourcesContent":["import { UpdateCurrentUserGateway as GatewayAbstraction } from \"./abstractions/index.js\";\nimport { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient\";\n\nconst UPDATE_CURRENT_USER = /* GraphQL */ `\n mutation UpdateCurrentUser($data: AdminUsersCurrentUserInput!) {\n adminUsers {\n updateCurrentUser(data: $data) {\n data {\n id\n email\n firstName\n lastName\n avatar\n external\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n\ntype UpdateCurrentUserResponse = {\n adminUsers: {\n updateCurrentUser:\n | { data: GatewayAbstraction.Result; error: null }\n | { data: null; error: { code: string; message: string; data: any } };\n };\n};\n\nclass UpdateCurrentUserGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private readonly client: MainGraphQLClient.Interface) {}\n\n async execute(params: GatewayAbstraction.Params): Promise<GatewayAbstraction.Result> {\n const response = await this.client.execute<UpdateCurrentUserResponse>({\n query: UPDATE_CURRENT_USER,\n variables: { data: params }\n });\n\n const { data, error } = response.adminUsers.updateCurrentUser;\n\n if (!data) {\n throw new Error(error?.message || \"Could not update current user.\");\n }\n\n return data;\n }\n}\n\nexport const UpdateCurrentUserGateway = GatewayAbstraction.createImplementation({\n implementation: UpdateCurrentUserGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["UPDATE_CURRENT_USER","UpdateCurrentUserGatewayImpl","client","params","response","data","error","Error","UpdateCurrentUserGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;AAGA,MAAMA,sBAAoC,CAAC;;;;;;;;;;;;;;;;;;;;AAoB3C,CAAC;AAUD,MAAMC;IACF,YAA6BC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAEnE,MAAM,QAAQC,MAAiC,EAAsC;QACjF,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA4B;YAClE,OAAOJ;YACP,WAAW;gBAAE,MAAMG;YAAO;QAC9B;QAEA,MAAM,EAAEE,IAAI,EAAEC,KAAK,EAAE,GAAGF,SAAS,UAAU,CAAC,iBAAiB;QAE7D,IAAI,CAACC,MACD,MAAM,IAAIE,MAAMD,OAAO,WAAW;QAGtC,OAAOD;IACX;AACJ;AAEO,MAAMG,oDAA2BC,yBAAAA,oBAAuC,CAAC;IAC5E,gBAAgBR;IAChB,cAAc;QAACS;KAAkB;AACrC"}
@@ -0,0 +1,10 @@
1
+ import { UpdateCurrentUserUseCase as UseCaseAbstraction, UpdateCurrentUserGateway } from "./abstractions/index.js";
2
+ declare class UpdateCurrentUserUseCaseImpl implements UseCaseAbstraction.Interface {
3
+ private readonly gateway;
4
+ constructor(gateway: UpdateCurrentUserGateway.Interface);
5
+ execute(params: UseCaseAbstraction.Params): Promise<UseCaseAbstraction.Result>;
6
+ }
7
+ export declare const UpdateCurrentUserUseCase: typeof UpdateCurrentUserUseCaseImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions/UpdateCurrentUserUseCase.js").IUpdateCurrentUserUseCase>;
9
+ };
10
+ export {};
@@ -0,0 +1,19 @@
1
+ import { UpdateCurrentUserGateway, UpdateCurrentUserUseCase } from "./abstractions/index.js";
2
+ class UpdateCurrentUserUseCaseImpl {
3
+ constructor(gateway){
4
+ this.gateway = gateway;
5
+ }
6
+ async execute(params) {
7
+ const result = await this.gateway.execute(params);
8
+ return result;
9
+ }
10
+ }
11
+ const UpdateCurrentUserUseCase_UpdateCurrentUserUseCase = UpdateCurrentUserUseCase.createImplementation({
12
+ implementation: UpdateCurrentUserUseCaseImpl,
13
+ dependencies: [
14
+ UpdateCurrentUserGateway
15
+ ]
16
+ });
17
+ export { UpdateCurrentUserUseCase_UpdateCurrentUserUseCase as UpdateCurrentUserUseCase };
18
+
19
+ //# sourceMappingURL=UpdateCurrentUserUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js","sources":["../../../../../src/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.ts"],"sourcesContent":["import {\n UpdateCurrentUserUseCase as UseCaseAbstraction,\n UpdateCurrentUserGateway\n} from \"./abstractions/index.js\";\n\nclass UpdateCurrentUserUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private readonly gateway: UpdateCurrentUserGateway.Interface) {}\n\n async execute(params: UseCaseAbstraction.Params): Promise<UseCaseAbstraction.Result> {\n const result = await this.gateway.execute(params);\n return result;\n }\n}\n\nexport const UpdateCurrentUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: UpdateCurrentUserUseCaseImpl,\n dependencies: [UpdateCurrentUserGateway]\n});\n"],"names":["UpdateCurrentUserUseCaseImpl","gateway","params","result","UpdateCurrentUserUseCase","UseCaseAbstraction","UpdateCurrentUserGateway"],"mappings":";AAKA,MAAMA;IACF,YAA6BC,OAA2C,CAAE;aAA7CA,OAAO,GAAPA;IAA8C;IAE3E,MAAM,QAAQC,MAAiC,EAAsC;QACjF,MAAMC,SAAS,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAACD;QAC1C,OAAOC;IACX;AACJ;AAEO,MAAMC,oDAA2BC,yBAAAA,oBAAuC,CAAC;IAC5E,gBAAgBL;IAChB,cAAc;QAACM;KAAyB;AAC5C"}
@@ -0,0 +1,26 @@
1
+ export interface IUpdateCurrentUserGatewayParams {
2
+ firstName?: string;
3
+ lastName?: string;
4
+ email?: string;
5
+ password?: string;
6
+ avatar?: {
7
+ src?: string;
8
+ };
9
+ }
10
+ export interface IUpdateCurrentUserGatewayResult {
11
+ id: string;
12
+ email: string;
13
+ firstName: string;
14
+ lastName: string;
15
+ avatar: any;
16
+ external: boolean;
17
+ }
18
+ export interface IUpdateCurrentUserGateway {
19
+ execute(params: IUpdateCurrentUserGatewayParams): Promise<IUpdateCurrentUserGatewayResult>;
20
+ }
21
+ export declare const UpdateCurrentUserGateway: import("@webiny/di").Abstraction<IUpdateCurrentUserGateway>;
22
+ export declare namespace UpdateCurrentUserGateway {
23
+ type Interface = IUpdateCurrentUserGateway;
24
+ type Params = IUpdateCurrentUserGatewayParams;
25
+ type Result = IUpdateCurrentUserGatewayResult;
26
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const UpdateCurrentUserGateway = createAbstraction("Cognito/UpdateCurrentUserGateway");
3
+ export { UpdateCurrentUserGateway };
4
+
5
+ //# sourceMappingURL=UpdateCurrentUserGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js","sources":["../../../../../../src/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface IUpdateCurrentUserGatewayParams {\n firstName?: string;\n lastName?: string;\n email?: string;\n password?: string;\n avatar?: { src?: string };\n}\n\nexport interface IUpdateCurrentUserGatewayResult {\n id: string;\n email: string;\n firstName: string;\n lastName: string;\n avatar: any;\n external: boolean;\n}\n\nexport interface IUpdateCurrentUserGateway {\n execute(params: IUpdateCurrentUserGatewayParams): Promise<IUpdateCurrentUserGatewayResult>;\n}\n\nexport const UpdateCurrentUserGateway = createAbstraction<IUpdateCurrentUserGateway>(\n \"Cognito/UpdateCurrentUserGateway\"\n);\n\nexport namespace UpdateCurrentUserGateway {\n export type Interface = IUpdateCurrentUserGateway;\n export type Params = IUpdateCurrentUserGatewayParams;\n export type Result = IUpdateCurrentUserGatewayResult;\n}\n"],"names":["UpdateCurrentUserGateway","createAbstraction"],"mappings":";AAuBO,MAAMA,2BAA2BC,kBACpC"}
@@ -0,0 +1,13 @@
1
+ import type { IUpdateCurrentUserGatewayParams } from "./UpdateCurrentUserGateway.js";
2
+ import type { IUpdateCurrentUserGatewayResult } from "./UpdateCurrentUserGateway.js";
3
+ export type IUpdateCurrentUserUseCaseParams = IUpdateCurrentUserGatewayParams;
4
+ export type IUpdateCurrentUserUseCaseResult = IUpdateCurrentUserGatewayResult;
5
+ export interface IUpdateCurrentUserUseCase {
6
+ execute(params: IUpdateCurrentUserUseCaseParams): Promise<IUpdateCurrentUserUseCaseResult>;
7
+ }
8
+ export declare const UpdateCurrentUserUseCase: import("@webiny/di").Abstraction<IUpdateCurrentUserUseCase>;
9
+ export declare namespace UpdateCurrentUserUseCase {
10
+ type Interface = IUpdateCurrentUserUseCase;
11
+ type Params = IUpdateCurrentUserUseCaseParams;
12
+ type Result = IUpdateCurrentUserUseCaseResult;
13
+ }