@webiny/cognito 6.4.11 → 6.6.0-alpha.1

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 (164) hide show
  1. package/Cognito.d.ts +4 -4
  2. package/admin/Cognito.d.ts +3 -1
  3. package/admin/Cognito.js +8 -2
  4. package/admin/Cognito.js.map +1 -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.d.ts +2 -2
  142. package/admin/presentation/Cognito/components/View.d.ts +1 -1
  143. package/admin/presentation/Cognito/components/index.d.ts +1 -1
  144. package/admin/ui/views/Account/Account.js +42 -34
  145. package/admin/ui/views/Account/Account.js.map +1 -1
  146. package/admin/ui/views/Users/UsersDataList.js +44 -26
  147. package/admin/ui/views/Users/UsersDataList.js.map +1 -1
  148. package/admin/ui/views/Users/UsersForm.js +1 -1
  149. package/admin/ui/views/Users/UsersForm.js.map +1 -1
  150. package/admin/ui/views/Users/UsersView.js +3 -3
  151. package/admin/ui/views/Users/UsersView.js.map +1 -1
  152. package/admin/ui/views/Users/hooks/useUserForm.d.ts +2 -2
  153. package/admin/ui/views/Users/hooks/useUserForm.js +60 -78
  154. package/admin/ui/views/Users/hooks/useUserForm.js.map +1 -1
  155. package/api/graphql/user.gql.d.ts +2 -2
  156. package/api/graphql/user.gql.js +2 -2
  157. package/api/graphql/user.gql.js.map +1 -1
  158. package/package.json +21 -24
  159. package/admin/ui/views/Account/graphql.d.ts +0 -2
  160. package/admin/ui/views/Account/graphql.js +0 -41
  161. package/admin/ui/views/Account/graphql.js.map +0 -1
  162. package/admin/ui/views/Users/graphql.d.ts +0 -5
  163. package/admin/ui/views/Users/graphql.js +0 -98
  164. package/admin/ui/views/Users/graphql.js.map +0 -1
package/Cognito.d.ts CHANGED
@@ -10,10 +10,10 @@ declare const federationSchema: z.ZodObject<{
10
10
  allowCredentialsLogin: z.ZodDefault<z.ZodBoolean>;
11
11
  identityProviders: z.ZodArray<z.ZodObject<{
12
12
  type: z.ZodEnum<{
13
- google: "google";
14
- facebook: "facebook";
15
13
  amazon: "amazon";
16
14
  apple: "apple";
15
+ facebook: "facebook";
16
+ google: "google";
17
17
  oidc: "oidc";
18
18
  }>;
19
19
  name: z.ZodOptional<z.ZodString>;
@@ -37,10 +37,10 @@ export declare const Cognito: import("@webiny/project/defineExtension/defineExte
37
37
  allowCredentialsLogin: z.ZodDefault<z.ZodBoolean>;
38
38
  identityProviders: z.ZodArray<z.ZodObject<{
39
39
  type: z.ZodEnum<{
40
- google: "google";
41
- facebook: "facebook";
42
40
  amazon: "amazon";
43
41
  apple: "apple";
42
+ facebook: "facebook";
43
+ google: "google";
44
44
  oidc: "oidc";
45
45
  }>;
46
46
  name: z.ZodOptional<z.ZodString>;
@@ -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 {};
package/admin/Cognito.js CHANGED
@@ -15,12 +15,18 @@ const CognitoIdP = (props)=>{
15
15
  route: Routes.Users.List,
16
16
  element: /*#__PURE__*/ react.createElement(AdminLayout, {
17
17
  title: "Admin Users"
18
- }, /*#__PURE__*/ react.createElement(UsersView, null))
18
+ }, /*#__PURE__*/ react.createElement(AdminConfig.Breadcrumb, {
19
+ name: "users",
20
+ label: "Users"
21
+ }), /*#__PURE__*/ react.createElement(UsersView, null))
19
22
  }), /*#__PURE__*/ react.createElement(Route, {
20
23
  route: Routes.Users.Account,
21
24
  element: /*#__PURE__*/ react.createElement(AdminLayout, {
22
25
  title: "User Account"
23
- }, /*#__PURE__*/ react.createElement(UserAccountForm, null))
26
+ }, /*#__PURE__*/ react.createElement(AdminConfig.Breadcrumb, {
27
+ name: "account",
28
+ label: "Account"
29
+ }), /*#__PURE__*/ react.createElement(UserAccountForm, null))
24
30
  }), /*#__PURE__*/ react.createElement(Menu, {
25
31
  name: "cognito.settings.adminUsers",
26
32
  parent: "settings.security",
@@ -1 +1 @@
1
- {"version":3,"file":"admin/Cognito.js","sources":["../../src/admin/Cognito.tsx"],"sourcesContent":["import React, { Fragment, memo } from \"react\";\nimport { AdminConfig, AdminLayout } from \"@webiny/app-admin\";\nimport { HasPermission } from \"@webiny/app-admin\";\nimport { useRouter } from \"@webiny/app-admin\";\nimport { UsersView } from \"./ui/views/Users/UsersView.js\";\nimport { UserAccountForm } from \"./ui/views/Account/index.js\";\nimport { SecurityPermission } from \"./SecurityPermission.js\";\nimport { CognitoLogin, type CognitoLoginProps } from \"./CognitoLogin.js\";\nimport { Routes } from \"./routes.js\";\nimport { AccountDetails } from \"~/admin/presentation/userMenu/AccountDetails.js\";\n\nconst { Route, Menu } = AdminConfig;\n\nexport interface CognitoAdminProps {\n login: CognitoLoginProps;\n}\n\nconst CognitoIdP = (props: CognitoAdminProps) => {\n const { getLink } = useRouter();\n\n return (\n <Fragment>\n <SecurityPermission />\n <CognitoLogin {...props.login} />\n <AdminConfig>\n <HasPermission name={\"adminUsers.user\"}>\n <Route\n route={Routes.Users.List}\n element={\n <AdminLayout title={\"Admin Users\"}>\n <UsersView />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.Users.Account}\n element={\n <AdminLayout title={\"User Account\"}>\n <UserAccountForm />\n </AdminLayout>\n }\n />\n\n <Menu\n name={\"cognito.settings.adminUsers\"}\n parent={\"settings.security\"}\n before={\"$first\"}\n element={\n <Menu.Link\n text={\"Users\"}\n to={getLink(Routes.Users.List)}\n pinnable={true}\n />\n }\n />\n </HasPermission>\n\n <Menu.User\n name={\"accountSettings\"}\n after={\"userInfo\"}\n element={<AccountDetails accountRoute={getLink(Routes.Users.Account)} />}\n />\n </AdminConfig>\n </Fragment>\n );\n};\n\nexport const CognitoAdmin = memo(CognitoIdP);\n"],"names":["Route","Menu","AdminConfig","CognitoIdP","props","getLink","useRouter","Fragment","SecurityPermission","CognitoLogin","HasPermission","Routes","AdminLayout","UsersView","UserAccountForm","AccountDetails","CognitoAdmin","memo"],"mappings":";;;;;;;;AAWA,MAAM,EAAEA,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAE,GAAGC;AAMxB,MAAMC,aAAa,CAACC;IAChB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,OAAO,WAAP,GACI,oBAACC,UAAQA,MAAAA,WAAAA,GACL,oBAACC,oBAAkBA,OAAAA,WAAAA,GACnB,oBAACC,cAAiBL,MAAM,KAAK,iBAC7B,oBAACF,aAAWA,MAAAA,WAAAA,GACR,oBAACQ,eAAaA;QAAC,MAAM;qBACjB,oBAACV,OAAKA;QACF,OAAOW,OAAO,KAAK,CAAC,IAAI;QACxB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACC,WAASA;sBAKtB,oBAACb,OAAKA;QACF,OAAOW,OAAO,KAAK,CAAC,OAAO;QAC3B,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACE,iBAAeA;sBAK5B,oBAACb,MAAIA;QACD,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,IAAII,QAAQM,OAAO,KAAK,CAAC,IAAI;YAC7B,UAAU;;uBAM1B,oBAACV,KAAK,IAAI;QACN,MAAM;QACN,OAAO;QACP,uBAAS,oBAACc,gBAAcA;YAAC,cAAcV,QAAQM,OAAO,KAAK,CAAC,OAAO;;;AAKvF;AAEO,MAAMK,eAAe,WAAHA,GAAGC,KAAKd"}
1
+ {"version":3,"file":"admin/Cognito.js","sources":["../../src/admin/Cognito.tsx"],"sourcesContent":["import React, { Fragment, memo } from \"react\";\nimport { AdminConfig, AdminLayout } from \"@webiny/app-admin\";\nimport { HasPermission } from \"@webiny/app-admin\";\nimport { useRouter } from \"@webiny/app-admin\";\nimport { UsersView } from \"./ui/views/Users/UsersView.js\";\nimport { UserAccountForm } from \"./ui/views/Account/index.js\";\nimport { SecurityPermission } from \"./SecurityPermission.js\";\nimport { CognitoLogin, type CognitoLoginProps } from \"./CognitoLogin.js\";\nimport { Routes } from \"./routes.js\";\nimport { AccountDetails } from \"~/admin/presentation/userMenu/AccountDetails.js\";\n\nconst { Route, Menu } = AdminConfig;\n\nexport interface CognitoAdminProps {\n login: CognitoLoginProps;\n}\n\nconst CognitoIdP = (props: CognitoAdminProps) => {\n const { getLink } = useRouter();\n\n return (\n <Fragment>\n <SecurityPermission />\n <CognitoLogin {...props.login} />\n <AdminConfig>\n <HasPermission name={\"adminUsers.user\"}>\n <Route\n route={Routes.Users.List}\n element={\n <AdminLayout title={\"Admin Users\"}>\n <AdminConfig.Breadcrumb name={\"users\"} label={\"Users\"} />\n <UsersView />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.Users.Account}\n element={\n <AdminLayout title={\"User Account\"}>\n <AdminConfig.Breadcrumb name={\"account\"} label={\"Account\"} />\n <UserAccountForm />\n </AdminLayout>\n }\n />\n\n <Menu\n name={\"cognito.settings.adminUsers\"}\n parent={\"settings.security\"}\n before={\"$first\"}\n element={\n <Menu.Link\n text={\"Users\"}\n to={getLink(Routes.Users.List)}\n pinnable={true}\n />\n }\n />\n </HasPermission>\n\n <Menu.User\n name={\"accountSettings\"}\n after={\"userInfo\"}\n element={<AccountDetails accountRoute={getLink(Routes.Users.Account)} />}\n />\n </AdminConfig>\n </Fragment>\n );\n};\n\nexport const CognitoAdmin = memo(CognitoIdP);\n"],"names":["Route","Menu","AdminConfig","CognitoIdP","props","getLink","useRouter","Fragment","SecurityPermission","CognitoLogin","HasPermission","Routes","AdminLayout","UsersView","UserAccountForm","AccountDetails","CognitoAdmin","memo"],"mappings":";;;;;;;;AAWA,MAAM,EAAEA,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAE,GAAGC;AAMxB,MAAMC,aAAa,CAACC;IAChB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,OAAO,WAAP,GACI,oBAACC,UAAQA,MAAAA,WAAAA,GACL,oBAACC,oBAAkBA,OAAAA,WAAAA,GACnB,oBAACC,cAAiBL,MAAM,KAAK,iBAC7B,oBAACF,aAAWA,MAAAA,WAAAA,GACR,oBAACQ,eAAaA;QAAC,MAAM;qBACjB,oBAACV,OAAKA;QACF,OAAOW,OAAO,KAAK,CAAC,IAAI;QACxB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACV,YAAY,UAAU;YAAC,MAAM;YAAS,OAAO;0BAC9C,oBAACW,WAASA;sBAKtB,oBAACb,OAAKA;QACF,OAAOW,OAAO,KAAK,CAAC,OAAO;QAC3B,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACV,YAAY,UAAU;YAAC,MAAM;YAAW,OAAO;0BAChD,oBAACY,iBAAeA;sBAK5B,oBAACb,MAAIA;QACD,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,IAAII,QAAQM,OAAO,KAAK,CAAC,IAAI;YAC7B,UAAU;;uBAM1B,oBAACV,KAAK,IAAI;QACN,MAAM;QACN,OAAO;QACP,uBAAS,oBAACc,gBAAcA;YAAC,cAAcV,QAAQM,OAAO,KAAK,CAAC,OAAO;;;AAKvF;AAEO,MAAMK,eAAe,WAAHA,GAAGC,KAAKd"}
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const UpdateCurrentUserUseCase = createAbstraction("Cognito/UpdateCurrentUserUseCase");
3
+ export { UpdateCurrentUserUseCase };
4
+
5
+ //# sourceMappingURL=UpdateCurrentUserUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js","sources":["../../../../../../src/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IUpdateCurrentUserGatewayParams } from \"./UpdateCurrentUserGateway.js\";\nimport type { IUpdateCurrentUserGatewayResult } from \"./UpdateCurrentUserGateway.js\";\n\nexport type IUpdateCurrentUserUseCaseParams = IUpdateCurrentUserGatewayParams;\nexport type IUpdateCurrentUserUseCaseResult = IUpdateCurrentUserGatewayResult;\n\nexport interface IUpdateCurrentUserUseCase {\n execute(params: IUpdateCurrentUserUseCaseParams): Promise<IUpdateCurrentUserUseCaseResult>;\n}\n\nexport const UpdateCurrentUserUseCase = createAbstraction<IUpdateCurrentUserUseCase>(\n \"Cognito/UpdateCurrentUserUseCase\"\n);\n\nexport namespace UpdateCurrentUserUseCase {\n export type Interface = IUpdateCurrentUserUseCase;\n export type Params = IUpdateCurrentUserUseCaseParams;\n export type Result = IUpdateCurrentUserUseCaseResult;\n}\n"],"names":["UpdateCurrentUserUseCase","createAbstraction"],"mappings":";AAWO,MAAMA,2BAA2BC,kBACpC"}
@@ -0,0 +1,8 @@
1
+ export { UpdateCurrentUserGateway } from "./UpdateCurrentUserGateway.js";
2
+ export type { IUpdateCurrentUserGateway } from "./UpdateCurrentUserGateway.js";
3
+ export type { IUpdateCurrentUserGatewayParams } from "./UpdateCurrentUserGateway.js";
4
+ export type { IUpdateCurrentUserGatewayResult } from "./UpdateCurrentUserGateway.js";
5
+ export { UpdateCurrentUserUseCase } from "./UpdateCurrentUserUseCase.js";
6
+ export type { IUpdateCurrentUserUseCase } from "./UpdateCurrentUserUseCase.js";
7
+ export type { IUpdateCurrentUserUseCaseParams } from "./UpdateCurrentUserUseCase.js";
8
+ export type { IUpdateCurrentUserUseCaseResult } from "./UpdateCurrentUserUseCase.js";
@@ -0,0 +1,2 @@
1
+ export { UpdateCurrentUserGateway } from "./UpdateCurrentUserGateway.js";
2
+ export { UpdateCurrentUserUseCase } from "./UpdateCurrentUserUseCase.js";
@@ -0,0 +1,3 @@
1
+ export declare const UpdateCurrentUserFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ useCase: import("./abstractions/UpdateCurrentUserUseCase.js").IUpdateCurrentUserUseCase;
3
+ }, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { UpdateCurrentUserUseCase } from "./abstractions/index.js";
3
+ import { UpdateCurrentUserUseCase as external_UpdateCurrentUserUseCase_js_UpdateCurrentUserUseCase } from "./UpdateCurrentUserUseCase.js";
4
+ import { UpdateCurrentUserGateway } from "./UpdateCurrentUserGateway.js";
5
+ const UpdateCurrentUserFeature = createFeature({
6
+ name: "Cognito/UpdateCurrentUser",
7
+ register (container) {
8
+ container.register(external_UpdateCurrentUserUseCase_js_UpdateCurrentUserUseCase);
9
+ container.register(UpdateCurrentUserGateway).inSingletonScope();
10
+ },
11
+ resolve (container) {
12
+ return {
13
+ useCase: container.resolve(UpdateCurrentUserUseCase)
14
+ };
15
+ }
16
+ });
17
+ export { UpdateCurrentUserFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/features/account/updateCurrentUser/feature.js","sources":["../../../../../src/admin/features/account/updateCurrentUser/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { UpdateCurrentUserUseCase as UseCaseAbstraction } from \"./abstractions/index.js\";\nimport { UpdateCurrentUserUseCase } from \"./UpdateCurrentUserUseCase.js\";\nimport { UpdateCurrentUserGateway } from \"./UpdateCurrentUserGateway.js\";\n\nexport const UpdateCurrentUserFeature = createFeature({\n name: \"Cognito/UpdateCurrentUser\",\n register(container) {\n container.register(UpdateCurrentUserUseCase);\n container.register(UpdateCurrentUserGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCaseAbstraction)\n };\n }\n});\n"],"names":["UpdateCurrentUserFeature","createFeature","container","UpdateCurrentUserUseCase","UpdateCurrentUserGateway","UseCaseAbstraction"],"mappings":";;;;AAKO,MAAMA,2BAA2BC,cAAc;IAClD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,0BAA0B,gBAAgB;IACjE;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
@@ -0,0 +1 @@
1
+ export { UpdateCurrentUserFeature } from "./feature.js";
@@ -0,0 +1 @@
1
+ export { UpdateCurrentUserFeature } from "./feature.js";
@@ -1,4 +1,4 @@
1
- export declare const CognitoPermissionsFeature: import("@webiny/feature/admin").FeatureDefinition<{
1
+ export declare const CognitoPermissionsFeature: import("@webiny/feature/admin/createFeature.js").FeatureDefinition<{
2
2
  permissions: {
3
3
  canAccess: (entityId: "user") => boolean;
4
4
  canAction: (action: string, entityId: "user") => boolean;
@@ -0,0 +1,11 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
2
+ import { CreateUserGateway as GatewayAbstraction, type ICreateUserGatewayParams, type ICreateUserGatewayResult } from "./abstractions/index.js";
3
+ declare class CreateUserGraphQLGateway implements GatewayAbstraction.Interface {
4
+ private readonly client;
5
+ constructor(client: MainGraphQLClient.Interface);
6
+ execute(params: ICreateUserGatewayParams): Promise<ICreateUserGatewayResult>;
7
+ }
8
+ export declare const CreateUserGateway: typeof CreateUserGraphQLGateway & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions/CreateUserGateway.js").ICreateUserGateway>;
10
+ };
11
+ export {};