@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.
- package/Cognito.d.ts +0 -51
- package/Cognito.js +4 -78
- package/Cognito.js.map +1 -1
- package/admin/Cognito.d.ts +3 -1
- package/admin/Extension.js +21 -0
- package/admin/Extension.js.map +1 -1
- package/admin/features/account/getCurrentUser/GetCurrentUserGateway.d.ts +11 -0
- package/admin/features/account/getCurrentUser/GetCurrentUserGateway.js +44 -0
- package/admin/features/account/getCurrentUser/GetCurrentUserGateway.js.map +1 -0
- package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.d.ts +10 -0
- package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.js +19 -0
- package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.js.map +1 -0
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.d.ts +16 -0
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js +5 -0
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js.map +1 -0
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.d.ts +10 -0
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js +5 -0
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js.map +1 -0
- package/admin/features/account/getCurrentUser/abstractions/index.d.ts +6 -0
- package/admin/features/account/getCurrentUser/abstractions/index.js +2 -0
- package/admin/features/account/getCurrentUser/feature.d.ts +3 -0
- package/admin/features/account/getCurrentUser/feature.js +19 -0
- package/admin/features/account/getCurrentUser/feature.js.map +1 -0
- package/admin/features/account/getCurrentUser/index.d.ts +1 -0
- package/admin/features/account/getCurrentUser/index.js +1 -0
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.d.ts +11 -0
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js +48 -0
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js.map +1 -0
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.d.ts +10 -0
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js +19 -0
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js.map +1 -0
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.d.ts +26 -0
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js +5 -0
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js.map +1 -0
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.d.ts +13 -0
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js +5 -0
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js.map +1 -0
- package/admin/features/account/updateCurrentUser/abstractions/index.d.ts +8 -0
- package/admin/features/account/updateCurrentUser/abstractions/index.js +2 -0
- package/admin/features/account/updateCurrentUser/feature.d.ts +3 -0
- package/admin/features/account/updateCurrentUser/feature.js +19 -0
- package/admin/features/account/updateCurrentUser/feature.js.map +1 -0
- package/admin/features/account/updateCurrentUser/index.d.ts +1 -0
- package/admin/features/account/updateCurrentUser/index.js +1 -0
- package/admin/features/permissions/feature.d.ts +1 -1
- package/admin/features/users/createUser/CreateUserGateway.d.ts +11 -0
- package/admin/features/users/createUser/CreateUserGateway.js +49 -0
- package/admin/features/users/createUser/CreateUserGateway.js.map +1 -0
- package/admin/features/users/createUser/CreateUserUseCase.d.ts +10 -0
- package/admin/features/users/createUser/CreateUserUseCase.js +18 -0
- package/admin/features/users/createUser/CreateUserUseCase.js.map +1 -0
- package/admin/features/users/createUser/abstractions/CreateUserGateway.d.ts +21 -0
- package/admin/features/users/createUser/abstractions/CreateUserGateway.js +5 -0
- package/admin/features/users/createUser/abstractions/CreateUserGateway.js.map +1 -0
- package/admin/features/users/createUser/abstractions/CreateUserUseCase.d.ts +14 -0
- package/admin/features/users/createUser/abstractions/CreateUserUseCase.js +5 -0
- package/admin/features/users/createUser/abstractions/CreateUserUseCase.js.map +1 -0
- package/admin/features/users/createUser/abstractions/index.d.ts +2 -0
- package/admin/features/users/createUser/abstractions/index.js +2 -0
- package/admin/features/users/createUser/feature.d.ts +3 -0
- package/admin/features/users/createUser/feature.js +19 -0
- package/admin/features/users/createUser/feature.js.map +1 -0
- package/admin/features/users/createUser/index.d.ts +2 -0
- package/admin/features/users/createUser/index.js +2 -0
- package/admin/features/users/deleteUser/DeleteUserGateway.d.ts +11 -0
- package/admin/features/users/deleteUser/DeleteUserGateway.js +40 -0
- package/admin/features/users/deleteUser/DeleteUserGateway.js.map +1 -0
- package/admin/features/users/deleteUser/DeleteUserUseCase.d.ts +10 -0
- package/admin/features/users/deleteUser/DeleteUserUseCase.js +18 -0
- package/admin/features/users/deleteUser/DeleteUserUseCase.js.map +1 -0
- package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.d.ts +11 -0
- package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.js +5 -0
- package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.js.map +1 -0
- package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.d.ts +11 -0
- package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js +5 -0
- package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js.map +1 -0
- package/admin/features/users/deleteUser/abstractions/index.d.ts +2 -0
- package/admin/features/users/deleteUser/abstractions/index.js +2 -0
- package/admin/features/users/deleteUser/feature.d.ts +3 -0
- package/admin/features/users/deleteUser/feature.js +19 -0
- package/admin/features/users/deleteUser/feature.js.map +1 -0
- package/admin/features/users/deleteUser/index.d.ts +2 -0
- package/admin/features/users/deleteUser/index.js +2 -0
- package/admin/features/users/getUser/GetUserGateway.d.ts +11 -0
- package/admin/features/users/getUser/GetUserGateway.js +57 -0
- package/admin/features/users/getUser/GetUserGateway.js.map +1 -0
- package/admin/features/users/getUser/GetUserUseCase.d.ts +10 -0
- package/admin/features/users/getUser/GetUserUseCase.js +18 -0
- package/admin/features/users/getUser/GetUserUseCase.js.map +1 -0
- package/admin/features/users/getUser/abstractions/GetUserGateway.d.ts +32 -0
- package/admin/features/users/getUser/abstractions/GetUserGateway.js +5 -0
- package/admin/features/users/getUser/abstractions/GetUserGateway.js.map +1 -0
- package/admin/features/users/getUser/abstractions/GetUserUseCase.d.ts +14 -0
- package/admin/features/users/getUser/abstractions/GetUserUseCase.js +5 -0
- package/admin/features/users/getUser/abstractions/GetUserUseCase.js.map +1 -0
- package/admin/features/users/getUser/abstractions/index.d.ts +2 -0
- package/admin/features/users/getUser/abstractions/index.js +2 -0
- package/admin/features/users/getUser/feature.d.ts +3 -0
- package/admin/features/users/getUser/feature.js +19 -0
- package/admin/features/users/getUser/feature.js.map +1 -0
- package/admin/features/users/getUser/index.d.ts +2 -0
- package/admin/features/users/getUser/index.js +2 -0
- package/admin/features/users/listUsers/ListUsersGateway.d.ts +11 -0
- package/admin/features/users/listUsers/ListUsersGateway.js +39 -0
- package/admin/features/users/listUsers/ListUsersGateway.js.map +1 -0
- package/admin/features/users/listUsers/ListUsersUseCase.d.ts +10 -0
- package/admin/features/users/listUsers/ListUsersUseCase.js +18 -0
- package/admin/features/users/listUsers/ListUsersUseCase.js.map +1 -0
- package/admin/features/users/listUsers/abstractions/ListUsersGateway.d.ts +17 -0
- package/admin/features/users/listUsers/abstractions/ListUsersGateway.js +5 -0
- package/admin/features/users/listUsers/abstractions/ListUsersGateway.js.map +1 -0
- package/admin/features/users/listUsers/abstractions/ListUsersUseCase.d.ts +10 -0
- package/admin/features/users/listUsers/abstractions/ListUsersUseCase.js +5 -0
- package/admin/features/users/listUsers/abstractions/ListUsersUseCase.js.map +1 -0
- package/admin/features/users/listUsers/abstractions/index.d.ts +2 -0
- package/admin/features/users/listUsers/abstractions/index.js +2 -0
- package/admin/features/users/listUsers/feature.d.ts +3 -0
- package/admin/features/users/listUsers/feature.js +19 -0
- package/admin/features/users/listUsers/feature.js.map +1 -0
- package/admin/features/users/listUsers/index.d.ts +2 -0
- package/admin/features/users/listUsers/index.js +2 -0
- package/admin/features/users/updateUser/UpdateUserGateway.d.ts +11 -0
- package/admin/features/users/updateUser/UpdateUserGateway.js +59 -0
- package/admin/features/users/updateUser/UpdateUserGateway.js.map +1 -0
- package/admin/features/users/updateUser/UpdateUserUseCase.d.ts +10 -0
- package/admin/features/users/updateUser/UpdateUserUseCase.js +18 -0
- package/admin/features/users/updateUser/UpdateUserUseCase.js.map +1 -0
- package/admin/features/users/updateUser/abstractions/UpdateUserGateway.d.ts +33 -0
- package/admin/features/users/updateUser/abstractions/UpdateUserGateway.js +5 -0
- package/admin/features/users/updateUser/abstractions/UpdateUserGateway.js.map +1 -0
- package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.d.ts +15 -0
- package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.js +5 -0
- package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.js.map +1 -0
- package/admin/features/users/updateUser/abstractions/index.d.ts +2 -0
- package/admin/features/users/updateUser/abstractions/index.js +2 -0
- package/admin/features/users/updateUser/feature.d.ts +3 -0
- package/admin/features/users/updateUser/feature.js +19 -0
- package/admin/features/users/updateUser/feature.js.map +1 -0
- package/admin/features/users/updateUser/index.d.ts +2 -0
- package/admin/features/users/updateUser/index.js +2 -0
- package/admin/presentation/Cognito/CognitoLoginScreen.js +0 -9
- package/admin/presentation/Cognito/CognitoLoginScreen.js.map +1 -1
- package/admin/presentation/Cognito/CognitoPresenter.d.ts +1 -25
- package/admin/presentation/Cognito/CognitoPresenter.js +10 -122
- package/admin/presentation/Cognito/CognitoPresenter.js.map +1 -1
- package/admin/presentation/Cognito/abstractions.d.ts +1 -20
- package/admin/presentation/Cognito/abstractions.js.map +1 -1
- package/admin/presentation/Cognito/components/Divider.d.ts +1 -19
- package/admin/presentation/Cognito/components/Divider.js +2 -3
- package/admin/presentation/Cognito/components/Divider.js.map +1 -1
- package/admin/presentation/Cognito/components/FederatedLogin.d.ts +5 -22
- package/admin/presentation/Cognito/components/FederatedLogin.js +6 -19
- package/admin/presentation/Cognito/components/FederatedLogin.js.map +1 -1
- package/admin/presentation/Cognito/components/FooterSignIn.d.ts +3 -20
- package/admin/presentation/Cognito/components/FooterSignIn.js +2 -3
- package/admin/presentation/Cognito/components/FooterSignIn.js.map +1 -1
- package/admin/presentation/Cognito/components/PasswordResetCodeSent.d.ts +1 -19
- package/admin/presentation/Cognito/components/PasswordResetCodeSent.js +2 -3
- package/admin/presentation/Cognito/components/PasswordResetCodeSent.js.map +1 -1
- package/admin/presentation/Cognito/components/RequestPasswordResetCode.d.ts +1 -19
- package/admin/presentation/Cognito/components/RequestPasswordResetCode.js +2 -3
- package/admin/presentation/Cognito/components/RequestPasswordResetCode.js.map +1 -1
- package/admin/presentation/Cognito/components/RequireNewPassword.d.ts +1 -19
- package/admin/presentation/Cognito/components/RequireNewPassword.js +2 -3
- package/admin/presentation/Cognito/components/RequireNewPassword.js.map +1 -1
- package/admin/presentation/Cognito/components/SetNewPassword.d.ts +1 -19
- package/admin/presentation/Cognito/components/SetNewPassword.js +2 -3
- package/admin/presentation/Cognito/components/SetNewPassword.js.map +1 -1
- package/admin/presentation/Cognito/components/SignIn.d.ts +3 -19
- package/admin/presentation/Cognito/components/SignIn.js +7 -14
- package/admin/presentation/Cognito/components/SignIn.js.map +1 -1
- package/admin/presentation/Cognito/components/View.d.ts +1 -1
- package/admin/ui/views/Account/Account.js +42 -34
- package/admin/ui/views/Account/Account.js.map +1 -1
- package/admin/ui/views/Users/UsersDataList.js +44 -26
- package/admin/ui/views/Users/UsersDataList.js.map +1 -1
- package/admin/ui/views/Users/UsersForm.js +16 -22
- package/admin/ui/views/Users/UsersForm.js.map +1 -1
- package/admin/ui/views/Users/hooks/useUserForm.d.ts +2 -2
- package/admin/ui/views/Users/hooks/useUserForm.js +60 -78
- package/admin/ui/views/Users/hooks/useUserForm.js.map +1 -1
- package/api/features/CognitoIdp/CognitoIdentityProvider.js +11 -15
- package/api/features/CognitoIdp/CognitoIdentityProvider.js.map +1 -1
- package/api/features/CognitoIdp/abstractions.d.ts +1 -1
- package/api/features/CognitoIdp/abstractions.js.map +1 -1
- package/api/graphql/user.gql.d.ts +2 -2
- package/api/graphql/user.gql.js +2 -2
- package/api/graphql/user.gql.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +18 -23
- package/admin/DefaultCognitoSignInConfig.d.ts +0 -23
- package/admin/DefaultCognitoSignInConfig.js +0 -51
- package/admin/DefaultCognitoSignInConfig.js.map +0 -1
- package/admin/SignInExtension.d.ts +0 -2
- package/admin/SignInExtension.js +0 -9
- package/admin/SignInExtension.js.map +0 -1
- package/admin/index.d.ts +0 -2
- package/admin/index.js +0 -2
- package/admin/presentation/Cognito/CognitoSignInConfig.d.ts +0 -31
- package/admin/presentation/Cognito/CognitoSignInConfig.js +0 -5
- package/admin/presentation/Cognito/CognitoSignInConfig.js.map +0 -1
- package/admin/presentation/Cognito/components/ConfirmTotpCode.d.ts +0 -26
- package/admin/presentation/Cognito/components/ConfirmTotpCode.js +0 -45
- package/admin/presentation/Cognito/components/ConfirmTotpCode.js.map +0 -1
- package/admin/presentation/Cognito/components/SetupTotp.d.ts +0 -25
- package/admin/presentation/Cognito/components/SetupTotp.js +0 -60
- package/admin/presentation/Cognito/components/SetupTotp.js.map +0 -1
- package/admin/presentation/Cognito/components/index.d.ts +0 -292
- package/admin/presentation/Cognito/components/index.js +0 -29
- package/admin/presentation/Cognito/components/index.js.map +0 -1
- package/admin/presentation/Cognito/signInFeature.d.ts +0 -1
- package/admin/presentation/Cognito/signInFeature.js +0 -11
- package/admin/presentation/Cognito/signInFeature.js.map +0 -1
- package/admin/ui/views/Account/graphql.d.ts +0 -2
- package/admin/ui/views/Account/graphql.js +0 -41
- package/admin/ui/views/Account/graphql.js.map +0 -1
- package/admin/ui/views/Users/graphql.d.ts +0 -5
- package/admin/ui/views/Users/graphql.js +0 -98
- package/admin/ui/views/Users/graphql.js.map +0 -1
- package/api/index.d.ts +0 -1
- package/api/index.js +0 -1
- package/infra/CognitoFederationPulumi.d.ts +0 -8
- package/infra/CognitoFederationPulumi.js +0 -17
- package/infra/CognitoFederationPulumi.js.map +0 -1
|
@@ -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,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 {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
|
|
2
|
+
import { CreateUserGateway } from "./abstractions/index.js";
|
|
3
|
+
const CREATE_USER = `
|
|
4
|
+
mutation CreateUser($data: AdminUsersCreateInput!) {
|
|
5
|
+
adminUsers {
|
|
6
|
+
user: createUser(data: $data) {
|
|
7
|
+
data {
|
|
8
|
+
id
|
|
9
|
+
email
|
|
10
|
+
firstName
|
|
11
|
+
lastName
|
|
12
|
+
avatar
|
|
13
|
+
createdOn
|
|
14
|
+
external
|
|
15
|
+
}
|
|
16
|
+
error {
|
|
17
|
+
code
|
|
18
|
+
message
|
|
19
|
+
data
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
class CreateUserGraphQLGateway {
|
|
26
|
+
constructor(client){
|
|
27
|
+
this.client = client;
|
|
28
|
+
}
|
|
29
|
+
async execute(params) {
|
|
30
|
+
const response = await this.client.execute({
|
|
31
|
+
query: CREATE_USER,
|
|
32
|
+
variables: {
|
|
33
|
+
data: params.data
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const envelope = response.adminUsers.user;
|
|
37
|
+
if (envelope.error) throw new Error(envelope.error.message);
|
|
38
|
+
return envelope.data;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const CreateUserGateway_CreateUserGateway = CreateUserGateway.createImplementation({
|
|
42
|
+
implementation: CreateUserGraphQLGateway,
|
|
43
|
+
dependencies: [
|
|
44
|
+
MainGraphQLClient
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
export { CreateUserGateway_CreateUserGateway as CreateUserGateway };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=CreateUserGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/createUser/CreateUserGateway.js","sources":["../../../../../src/admin/features/users/createUser/CreateUserGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport {\n CreateUserGateway as GatewayAbstraction,\n type ICreateUserGatewayParams,\n type ICreateUserGatewayResult\n} from \"./abstractions/index.js\";\n\nconst CREATE_USER = /* GraphQL */ `\n mutation CreateUser($data: AdminUsersCreateInput!) {\n adminUsers {\n user: createUser(data: $data) {\n data {\n id\n email\n firstName\n lastName\n avatar\n createdOn\n external\n }\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n\ntype CreateUserResponse = {\n adminUsers: {\n user:\n | { data: ICreateUserGatewayResult; error: null }\n | { data: null; error: { code: string; message: string; data: unknown } };\n };\n};\n\nclass CreateUserGraphQLGateway implements GatewayAbstraction.Interface {\n constructor(private readonly client: MainGraphQLClient.Interface) {}\n\n async execute(params: ICreateUserGatewayParams): Promise<ICreateUserGatewayResult> {\n const response = await this.client.execute<CreateUserResponse>({\n query: CREATE_USER,\n variables: { data: params.data }\n });\n\n const envelope = response.adminUsers.user;\n if (envelope.error) {\n throw new Error(envelope.error.message);\n }\n\n return envelope.data;\n }\n}\n\nexport const CreateUserGateway = GatewayAbstraction.createImplementation({\n implementation: CreateUserGraphQLGateway,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["CREATE_USER","CreateUserGraphQLGateway","client","params","response","envelope","Error","CreateUserGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;AAOA,MAAMA,cAA4B,CAAC;;;;;;;;;;;;;;;;;;;;;AAqBnC,CAAC;AAUD,MAAMC;IACF,YAA6BC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAEnE,MAAM,QAAQC,MAAgC,EAAqC;QAC/E,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAqB;YAC3D,OAAOJ;YACP,WAAW;gBAAE,MAAMG,OAAO,IAAI;YAAC;QACnC;QAEA,MAAME,WAAWD,SAAS,UAAU,CAAC,IAAI;QACzC,IAAIC,SAAS,KAAK,EACd,MAAM,IAAIC,MAAMD,SAAS,KAAK,CAAC,OAAO;QAG1C,OAAOA,SAAS,IAAI;IACxB;AACJ;AAEO,MAAME,sCAAoBC,kBAAAA,oBAAuC,CAAC;IACrE,gBAAgBP;IAChB,cAAc;QAACQ;KAAkB;AACrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CreateUserGateway, CreateUserUseCase as UseCaseAbstraction, type ICreateUserUseCaseParams, type ICreateUserUseCaseResult } from "./abstractions/index.js";
|
|
2
|
+
declare class CreateUserUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
3
|
+
private readonly gateway;
|
|
4
|
+
constructor(gateway: CreateUserGateway.Interface);
|
|
5
|
+
execute(params: ICreateUserUseCaseParams): Promise<ICreateUserUseCaseResult>;
|
|
6
|
+
}
|
|
7
|
+
export declare const CreateUserUseCase: typeof CreateUserUseCaseImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/CreateUserUseCase.js").ICreateUserUseCase>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CreateUserGateway, CreateUserUseCase } from "./abstractions/index.js";
|
|
2
|
+
class CreateUserUseCaseImpl {
|
|
3
|
+
constructor(gateway){
|
|
4
|
+
this.gateway = gateway;
|
|
5
|
+
}
|
|
6
|
+
async execute(params) {
|
|
7
|
+
return this.gateway.execute(params);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const CreateUserUseCase_CreateUserUseCase = CreateUserUseCase.createImplementation({
|
|
11
|
+
implementation: CreateUserUseCaseImpl,
|
|
12
|
+
dependencies: [
|
|
13
|
+
CreateUserGateway
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
export { CreateUserUseCase_CreateUserUseCase as CreateUserUseCase };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=CreateUserUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/createUser/CreateUserUseCase.js","sources":["../../../../../src/admin/features/users/createUser/CreateUserUseCase.ts"],"sourcesContent":["import {\n CreateUserGateway,\n CreateUserUseCase as UseCaseAbstraction,\n type ICreateUserUseCaseParams,\n type ICreateUserUseCaseResult\n} from \"./abstractions/index.js\";\n\nclass CreateUserUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private readonly gateway: CreateUserGateway.Interface) {}\n\n async execute(params: ICreateUserUseCaseParams): Promise<ICreateUserUseCaseResult> {\n return this.gateway.execute(params);\n }\n}\n\nexport const CreateUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: CreateUserUseCaseImpl,\n dependencies: [CreateUserGateway]\n});\n"],"names":["CreateUserUseCaseImpl","gateway","params","CreateUserUseCase","UseCaseAbstraction","CreateUserGateway"],"mappings":";AAOA,MAAMA;IACF,YAA6BC,OAAoC,CAAE;aAAtCA,OAAO,GAAPA;IAAuC;IAEpE,MAAM,QAAQC,MAAgC,EAAqC;QAC/E,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,sCAAoBC,kBAAAA,oBAAuC,CAAC;IACrE,gBAAgBJ;IAChB,cAAc;QAACK;KAAkB;AACrC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ICreateUserGatewayResult {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
firstName: string;
|
|
5
|
+
lastName: string;
|
|
6
|
+
avatar: any;
|
|
7
|
+
createdOn: string;
|
|
8
|
+
external: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ICreateUserGatewayParams {
|
|
11
|
+
data: Record<string, any>;
|
|
12
|
+
}
|
|
13
|
+
export interface ICreateUserGateway {
|
|
14
|
+
execute(params: ICreateUserGatewayParams): Promise<ICreateUserGatewayResult>;
|
|
15
|
+
}
|
|
16
|
+
export declare const CreateUserGateway: import("@webiny/di").Abstraction<ICreateUserGateway>;
|
|
17
|
+
export declare namespace CreateUserGateway {
|
|
18
|
+
type Interface = ICreateUserGateway;
|
|
19
|
+
type Params = ICreateUserGatewayParams;
|
|
20
|
+
type Result = ICreateUserGatewayResult;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/createUser/abstractions/CreateUserGateway.js","sources":["../../../../../../src/admin/features/users/createUser/abstractions/CreateUserGateway.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface ICreateUserGatewayResult {\n id: string;\n email: string;\n firstName: string;\n lastName: string;\n avatar: any;\n createdOn: string;\n external: boolean;\n}\n\nexport interface ICreateUserGatewayParams {\n data: Record<string, any>;\n}\n\nexport interface ICreateUserGateway {\n execute(params: ICreateUserGatewayParams): Promise<ICreateUserGatewayResult>;\n}\n\nexport const CreateUserGateway = createAbstraction<ICreateUserGateway>(\"CreateUserGateway\");\n\nexport namespace CreateUserGateway {\n export type Interface = ICreateUserGateway;\n export type Params = ICreateUserGatewayParams;\n export type Result = ICreateUserGatewayResult;\n}\n"],"names":["CreateUserGateway","createAbstraction"],"mappings":";AAoBO,MAAMA,oBAAoBC,kBAAsC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ICreateUserGatewayResult } from "./CreateUserGateway.js";
|
|
2
|
+
export type ICreateUserUseCaseResult = ICreateUserGatewayResult;
|
|
3
|
+
export interface ICreateUserUseCaseParams {
|
|
4
|
+
data: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export interface ICreateUserUseCase {
|
|
7
|
+
execute(params: ICreateUserUseCaseParams): Promise<ICreateUserUseCaseResult>;
|
|
8
|
+
}
|
|
9
|
+
export declare const CreateUserUseCase: import("@webiny/di").Abstraction<ICreateUserUseCase>;
|
|
10
|
+
export declare namespace CreateUserUseCase {
|
|
11
|
+
type Interface = ICreateUserUseCase;
|
|
12
|
+
type Params = ICreateUserUseCaseParams;
|
|
13
|
+
type Result = ICreateUserUseCaseResult;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/createUser/abstractions/CreateUserUseCase.js","sources":["../../../../../../src/admin/features/users/createUser/abstractions/CreateUserUseCase.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { ICreateUserGatewayResult } from \"./CreateUserGateway.js\";\n\nexport type ICreateUserUseCaseResult = ICreateUserGatewayResult;\n\nexport interface ICreateUserUseCaseParams {\n data: Record<string, any>;\n}\n\nexport interface ICreateUserUseCase {\n execute(params: ICreateUserUseCaseParams): Promise<ICreateUserUseCaseResult>;\n}\n\nexport const CreateUserUseCase = createAbstraction<ICreateUserUseCase>(\"CreateUserUseCase\");\n\nexport namespace CreateUserUseCase {\n export type Interface = ICreateUserUseCase;\n export type Params = ICreateUserUseCaseParams;\n export type Result = ICreateUserUseCaseResult;\n}\n"],"names":["CreateUserUseCase","createAbstraction"],"mappings":";AAaO,MAAMA,oBAAoBC,kBAAsC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { CreateUserGateway, type ICreateUserGateway, type ICreateUserGatewayParams, type ICreateUserGatewayResult } from "./CreateUserGateway.js";
|
|
2
|
+
export { CreateUserUseCase, type ICreateUserUseCase, type ICreateUserUseCaseParams, type ICreateUserUseCaseResult } from "./CreateUserUseCase.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { CreateUserUseCase } from "./abstractions/index.js";
|
|
3
|
+
import { CreateUserUseCase as external_CreateUserUseCase_js_CreateUserUseCase } from "./CreateUserUseCase.js";
|
|
4
|
+
import { CreateUserGateway } from "./CreateUserGateway.js";
|
|
5
|
+
const CreateUserFeature = createFeature({
|
|
6
|
+
name: "Cognito/Users/CreateUser",
|
|
7
|
+
register (container) {
|
|
8
|
+
container.register(external_CreateUserUseCase_js_CreateUserUseCase);
|
|
9
|
+
container.register(CreateUserGateway).inSingletonScope();
|
|
10
|
+
},
|
|
11
|
+
resolve (container) {
|
|
12
|
+
return {
|
|
13
|
+
useCase: container.resolve(CreateUserUseCase)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export { CreateUserFeature };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/createUser/feature.js","sources":["../../../../../src/admin/features/users/createUser/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { CreateUserUseCase as UseCaseAbstraction } from \"./abstractions/index.js\";\nimport { CreateUserUseCase } from \"./CreateUserUseCase.js\";\nimport { CreateUserGateway } from \"./CreateUserGateway.js\";\n\nexport const CreateUserFeature = createFeature({\n name: \"Cognito/Users/CreateUser\",\n register(container) {\n container.register(CreateUserUseCase);\n container.register(CreateUserGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCaseAbstraction)\n };\n }\n});\n"],"names":["CreateUserFeature","createFeature","container","CreateUserUseCase","CreateUserGateway","UseCaseAbstraction"],"mappings":";;;;AAKO,MAAMA,oBAAoBC,cAAc;IAC3C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,mBAAmB,gBAAgB;IAC1D;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
|
|
2
|
+
import { DeleteUserGateway as GatewayAbstraction, type IDeleteUserGatewayParams } from "./abstractions/index.js";
|
|
3
|
+
declare class DeleteUserGraphQLGateway implements GatewayAbstraction.Interface {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: MainGraphQLClient.Interface);
|
|
6
|
+
execute(params: IDeleteUserGatewayParams): Promise<boolean>;
|
|
7
|
+
}
|
|
8
|
+
export declare const DeleteUserGateway: typeof DeleteUserGraphQLGateway & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/DeleteUserGateway.js").IDeleteUserGateway>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
|
|
2
|
+
import { DeleteUserGateway } from "./abstractions/index.js";
|
|
3
|
+
const DELETE_USER = `
|
|
4
|
+
mutation DeleteUser($id: ID!) {
|
|
5
|
+
adminUsers {
|
|
6
|
+
deleteUser(id: $id) {
|
|
7
|
+
data
|
|
8
|
+
error {
|
|
9
|
+
code
|
|
10
|
+
message
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
class DeleteUserGraphQLGateway {
|
|
17
|
+
constructor(client){
|
|
18
|
+
this.client = client;
|
|
19
|
+
}
|
|
20
|
+
async execute(params) {
|
|
21
|
+
const response = await this.client.execute({
|
|
22
|
+
query: DELETE_USER,
|
|
23
|
+
variables: {
|
|
24
|
+
id: params.id
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const envelope = response.adminUsers.deleteUser;
|
|
28
|
+
if (envelope.error) throw new Error(envelope.error.message);
|
|
29
|
+
return envelope.data;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const DeleteUserGateway_DeleteUserGateway = DeleteUserGateway.createImplementation({
|
|
33
|
+
implementation: DeleteUserGraphQLGateway,
|
|
34
|
+
dependencies: [
|
|
35
|
+
MainGraphQLClient
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
export { DeleteUserGateway_DeleteUserGateway as DeleteUserGateway };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=DeleteUserGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/deleteUser/DeleteUserGateway.js","sources":["../../../../../src/admin/features/users/deleteUser/DeleteUserGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport {\n DeleteUserGateway as GatewayAbstraction,\n type IDeleteUserGatewayParams\n} from \"./abstractions/index.js\";\n\nconst DELETE_USER = /* GraphQL */ `\n mutation DeleteUser($id: ID!) {\n adminUsers {\n deleteUser(id: $id) {\n data\n error {\n code\n message\n }\n }\n }\n }\n`;\n\ntype DeleteUserResponse = {\n adminUsers: {\n deleteUser:\n | { data: boolean; error: null }\n | { data: null; error: { code: string; message: string } };\n };\n};\n\nclass DeleteUserGraphQLGateway implements GatewayAbstraction.Interface {\n constructor(private readonly client: MainGraphQLClient.Interface) {}\n\n async execute(params: IDeleteUserGatewayParams): Promise<boolean> {\n const response = await this.client.execute<DeleteUserResponse>({\n query: DELETE_USER,\n variables: { id: params.id }\n });\n\n const envelope = response.adminUsers.deleteUser;\n if (envelope.error) {\n throw new Error(envelope.error.message);\n }\n\n return envelope.data;\n }\n}\n\nexport const DeleteUserGateway = GatewayAbstraction.createImplementation({\n implementation: DeleteUserGraphQLGateway,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["DELETE_USER","DeleteUserGraphQLGateway","client","params","response","envelope","Error","DeleteUserGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;AAMA,MAAMA,cAA4B,CAAC;;;;;;;;;;;;AAYnC,CAAC;AAUD,MAAMC;IACF,YAA6BC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAEnE,MAAM,QAAQC,MAAgC,EAAoB;QAC9D,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAqB;YAC3D,OAAOJ;YACP,WAAW;gBAAE,IAAIG,OAAO,EAAE;YAAC;QAC/B;QAEA,MAAME,WAAWD,SAAS,UAAU,CAAC,UAAU;QAC/C,IAAIC,SAAS,KAAK,EACd,MAAM,IAAIC,MAAMD,SAAS,KAAK,CAAC,OAAO;QAG1C,OAAOA,SAAS,IAAI;IACxB;AACJ;AAEO,MAAME,sCAAoBC,kBAAAA,oBAAuC,CAAC;IACrE,gBAAgBP;IAChB,cAAc;QAACQ;KAAkB;AACrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DeleteUserGateway, DeleteUserUseCase as UseCaseAbstraction, type IDeleteUserUseCaseParams } from "./abstractions/index.js";
|
|
2
|
+
declare class DeleteUserUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
3
|
+
private readonly gateway;
|
|
4
|
+
constructor(gateway: DeleteUserGateway.Interface);
|
|
5
|
+
execute(params: IDeleteUserUseCaseParams): Promise<boolean>;
|
|
6
|
+
}
|
|
7
|
+
export declare const DeleteUserUseCase: typeof DeleteUserUseCaseImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/DeleteUserUseCase.js").IDeleteUserUseCase>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DeleteUserGateway, DeleteUserUseCase } from "./abstractions/index.js";
|
|
2
|
+
class DeleteUserUseCaseImpl {
|
|
3
|
+
constructor(gateway){
|
|
4
|
+
this.gateway = gateway;
|
|
5
|
+
}
|
|
6
|
+
async execute(params) {
|
|
7
|
+
return this.gateway.execute(params);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const DeleteUserUseCase_DeleteUserUseCase = DeleteUserUseCase.createImplementation({
|
|
11
|
+
implementation: DeleteUserUseCaseImpl,
|
|
12
|
+
dependencies: [
|
|
13
|
+
DeleteUserGateway
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
export { DeleteUserUseCase_DeleteUserUseCase as DeleteUserUseCase };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=DeleteUserUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/deleteUser/DeleteUserUseCase.js","sources":["../../../../../src/admin/features/users/deleteUser/DeleteUserUseCase.ts"],"sourcesContent":["import {\n DeleteUserGateway,\n DeleteUserUseCase as UseCaseAbstraction,\n type IDeleteUserUseCaseParams\n} from \"./abstractions/index.js\";\n\nclass DeleteUserUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private readonly gateway: DeleteUserGateway.Interface) {}\n\n async execute(params: IDeleteUserUseCaseParams): Promise<boolean> {\n return this.gateway.execute(params);\n }\n}\n\nexport const DeleteUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: DeleteUserUseCaseImpl,\n dependencies: [DeleteUserGateway]\n});\n"],"names":["DeleteUserUseCaseImpl","gateway","params","DeleteUserUseCase","UseCaseAbstraction","DeleteUserGateway"],"mappings":";AAMA,MAAMA;IACF,YAA6BC,OAAoC,CAAE;aAAtCA,OAAO,GAAPA;IAAuC;IAEpE,MAAM,QAAQC,MAAgC,EAAoB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,sCAAoBC,kBAAAA,oBAAuC,CAAC;IACrE,gBAAgBJ;IAChB,cAAc;QAACK;KAAkB;AACrC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface IDeleteUserGatewayParams {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export interface IDeleteUserGateway {
|
|
5
|
+
execute(params: IDeleteUserGatewayParams): Promise<boolean>;
|
|
6
|
+
}
|
|
7
|
+
export declare const DeleteUserGateway: import("@webiny/di").Abstraction<IDeleteUserGateway>;
|
|
8
|
+
export declare namespace DeleteUserGateway {
|
|
9
|
+
type Interface = IDeleteUserGateway;
|
|
10
|
+
type Params = IDeleteUserGatewayParams;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/deleteUser/abstractions/DeleteUserGateway.js","sources":["../../../../../../src/admin/features/users/deleteUser/abstractions/DeleteUserGateway.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface IDeleteUserGatewayParams {\n id: string;\n}\n\nexport interface IDeleteUserGateway {\n execute(params: IDeleteUserGatewayParams): Promise<boolean>;\n}\n\nexport const DeleteUserGateway = createAbstraction<IDeleteUserGateway>(\"DeleteUserGateway\");\n\nexport namespace DeleteUserGateway {\n export type Interface = IDeleteUserGateway;\n export type Params = IDeleteUserGatewayParams;\n}\n"],"names":["DeleteUserGateway","createAbstraction"],"mappings":";AAUO,MAAMA,oBAAoBC,kBAAsC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface IDeleteUserUseCaseParams {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export interface IDeleteUserUseCase {
|
|
5
|
+
execute(params: IDeleteUserUseCaseParams): Promise<boolean>;
|
|
6
|
+
}
|
|
7
|
+
export declare const DeleteUserUseCase: import("@webiny/di").Abstraction<IDeleteUserUseCase>;
|
|
8
|
+
export declare namespace DeleteUserUseCase {
|
|
9
|
+
type Interface = IDeleteUserUseCase;
|
|
10
|
+
type Params = IDeleteUserUseCaseParams;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js","sources":["../../../../../../src/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface IDeleteUserUseCaseParams {\n id: string;\n}\n\nexport interface IDeleteUserUseCase {\n execute(params: IDeleteUserUseCaseParams): Promise<boolean>;\n}\n\nexport const DeleteUserUseCase = createAbstraction<IDeleteUserUseCase>(\"DeleteUserUseCase\");\n\nexport namespace DeleteUserUseCase {\n export type Interface = IDeleteUserUseCase;\n export type Params = IDeleteUserUseCaseParams;\n}\n"],"names":["DeleteUserUseCase","createAbstraction"],"mappings":";AAUO,MAAMA,oBAAoBC,kBAAsC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { DeleteUserUseCase } from "./abstractions/index.js";
|
|
3
|
+
import { DeleteUserUseCase as external_DeleteUserUseCase_js_DeleteUserUseCase } from "./DeleteUserUseCase.js";
|
|
4
|
+
import { DeleteUserGateway } from "./DeleteUserGateway.js";
|
|
5
|
+
const DeleteUserFeature = createFeature({
|
|
6
|
+
name: "Cognito/Users/DeleteUser",
|
|
7
|
+
register (container) {
|
|
8
|
+
container.register(external_DeleteUserUseCase_js_DeleteUserUseCase);
|
|
9
|
+
container.register(DeleteUserGateway).inSingletonScope();
|
|
10
|
+
},
|
|
11
|
+
resolve (container) {
|
|
12
|
+
return {
|
|
13
|
+
useCase: container.resolve(DeleteUserUseCase)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export { DeleteUserFeature };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/deleteUser/feature.js","sources":["../../../../../src/admin/features/users/deleteUser/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { DeleteUserUseCase as UseCaseAbstraction } from \"./abstractions/index.js\";\nimport { DeleteUserUseCase } from \"./DeleteUserUseCase.js\";\nimport { DeleteUserGateway } from \"./DeleteUserGateway.js\";\n\nexport const DeleteUserFeature = createFeature({\n name: \"Cognito/Users/DeleteUser\",\n register(container) {\n container.register(DeleteUserUseCase);\n container.register(DeleteUserGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCaseAbstraction)\n };\n }\n});\n"],"names":["DeleteUserFeature","createFeature","container","DeleteUserUseCase","DeleteUserGateway","UseCaseAbstraction"],"mappings":";;;;AAKO,MAAMA,oBAAoBC,cAAc;IAC3C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,mBAAmB,gBAAgB;IAC1D;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
|
|
2
|
+
import { GetUserGateway as GatewayAbstraction, type IGetUserGatewayParams, type IGetUserGatewayResult } from "./abstractions/index.js";
|
|
3
|
+
declare class GetUserGraphQLGateway implements GatewayAbstraction.Interface {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: MainGraphQLClient.Interface);
|
|
6
|
+
execute(params: IGetUserGatewayParams): Promise<IGetUserGatewayResult>;
|
|
7
|
+
}
|
|
8
|
+
export declare const GetUserGateway: typeof GetUserGraphQLGateway & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/GetUserGateway.js").IGetUserGateway>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/index.js";
|
|
2
|
+
import { GetUserGateway } from "./abstractions/index.js";
|
|
3
|
+
const GET_USER = `
|
|
4
|
+
query GetUser($id: ID!) {
|
|
5
|
+
adminUsers {
|
|
6
|
+
user: getUser(where: { id: $id }) {
|
|
7
|
+
data {
|
|
8
|
+
id
|
|
9
|
+
email
|
|
10
|
+
firstName
|
|
11
|
+
lastName
|
|
12
|
+
avatar
|
|
13
|
+
external
|
|
14
|
+
roles {
|
|
15
|
+
id
|
|
16
|
+
slug
|
|
17
|
+
name
|
|
18
|
+
}
|
|
19
|
+
teams {
|
|
20
|
+
id
|
|
21
|
+
slug
|
|
22
|
+
name
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
error {
|
|
26
|
+
code
|
|
27
|
+
message
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
class GetUserGraphQLGateway {
|
|
34
|
+
constructor(client){
|
|
35
|
+
this.client = client;
|
|
36
|
+
}
|
|
37
|
+
async execute(params) {
|
|
38
|
+
const response = await this.client.execute({
|
|
39
|
+
query: GET_USER,
|
|
40
|
+
variables: {
|
|
41
|
+
id: params.id
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const envelope = response.adminUsers.user;
|
|
45
|
+
if (envelope.error) throw new Error(envelope.error.message);
|
|
46
|
+
return envelope.data;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const GetUserGateway_GetUserGateway = GetUserGateway.createImplementation({
|
|
50
|
+
implementation: GetUserGraphQLGateway,
|
|
51
|
+
dependencies: [
|
|
52
|
+
MainGraphQLClient
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
export { GetUserGateway_GetUserGateway as GetUserGateway };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=GetUserGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/getUser/GetUserGateway.js","sources":["../../../../../src/admin/features/users/getUser/GetUserGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport {\n GetUserGateway as GatewayAbstraction,\n type IGetUserGatewayParams,\n type IGetUserGatewayResult\n} from \"./abstractions/index.js\";\n\nconst GET_USER = /* GraphQL */ `\n query GetUser($id: ID!) {\n adminUsers {\n user: getUser(where: { id: $id }) {\n data {\n id\n email\n firstName\n lastName\n avatar\n external\n roles {\n id\n slug\n name\n }\n teams {\n id\n slug\n name\n }\n }\n error {\n code\n message\n }\n }\n }\n }\n`;\n\ntype GetUserResponse = {\n adminUsers: {\n user:\n | { data: IGetUserGatewayResult; error: null }\n | { data: null; error: { code: string; message: string } };\n };\n};\n\nclass GetUserGraphQLGateway implements GatewayAbstraction.Interface {\n constructor(private readonly client: MainGraphQLClient.Interface) {}\n\n async execute(params: IGetUserGatewayParams): Promise<IGetUserGatewayResult> {\n const response = await this.client.execute<GetUserResponse>({\n query: GET_USER,\n variables: { id: params.id }\n });\n\n const envelope = response.adminUsers.user;\n if (envelope.error) {\n throw new Error(envelope.error.message);\n }\n\n return envelope.data;\n }\n}\n\nexport const GetUserGateway = GatewayAbstraction.createImplementation({\n implementation: GetUserGraphQLGateway,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["GET_USER","GetUserGraphQLGateway","client","params","response","envelope","Error","GetUserGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;AAOA,MAAMA,WAAyB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BhC,CAAC;AAUD,MAAMC;IACF,YAA6BC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAEnE,MAAM,QAAQC,MAA6B,EAAkC;QACzE,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAkB;YACxD,OAAOJ;YACP,WAAW;gBAAE,IAAIG,OAAO,EAAE;YAAC;QAC/B;QAEA,MAAME,WAAWD,SAAS,UAAU,CAAC,IAAI;QACzC,IAAIC,SAAS,KAAK,EACd,MAAM,IAAIC,MAAMD,SAAS,KAAK,CAAC,OAAO;QAG1C,OAAOA,SAAS,IAAI;IACxB;AACJ;AAEO,MAAME,gCAAiBC,eAAAA,oBAAuC,CAAC;IAClE,gBAAgBP;IAChB,cAAc;QAACQ;KAAkB;AACrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GetUserGateway, GetUserUseCase as UseCaseAbstraction, type IGetUserUseCaseParams, type IGetUserUseCaseResult } from "./abstractions/index.js";
|
|
2
|
+
declare class GetUserUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
3
|
+
private readonly gateway;
|
|
4
|
+
constructor(gateway: GetUserGateway.Interface);
|
|
5
|
+
execute(params: IGetUserUseCaseParams): Promise<IGetUserUseCaseResult>;
|
|
6
|
+
}
|
|
7
|
+
export declare const GetUserUseCase: typeof GetUserUseCaseImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/GetUserUseCase.js").IGetUserUseCase>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GetUserGateway, GetUserUseCase } from "./abstractions/index.js";
|
|
2
|
+
class GetUserUseCaseImpl {
|
|
3
|
+
constructor(gateway){
|
|
4
|
+
this.gateway = gateway;
|
|
5
|
+
}
|
|
6
|
+
async execute(params) {
|
|
7
|
+
return this.gateway.execute(params);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const GetUserUseCase_GetUserUseCase = GetUserUseCase.createImplementation({
|
|
11
|
+
implementation: GetUserUseCaseImpl,
|
|
12
|
+
dependencies: [
|
|
13
|
+
GetUserGateway
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
export { GetUserUseCase_GetUserUseCase as GetUserUseCase };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=GetUserUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin/features/users/getUser/GetUserUseCase.js","sources":["../../../../../src/admin/features/users/getUser/GetUserUseCase.ts"],"sourcesContent":["import {\n GetUserGateway,\n GetUserUseCase as UseCaseAbstraction,\n type IGetUserUseCaseParams,\n type IGetUserUseCaseResult\n} from \"./abstractions/index.js\";\n\nclass GetUserUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private readonly gateway: GetUserGateway.Interface) {}\n\n async execute(params: IGetUserUseCaseParams): Promise<IGetUserUseCaseResult> {\n return this.gateway.execute(params);\n }\n}\n\nexport const GetUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetUserUseCaseImpl,\n dependencies: [GetUserGateway]\n});\n"],"names":["GetUserUseCaseImpl","gateway","params","GetUserUseCase","UseCaseAbstraction","GetUserGateway"],"mappings":";AAOA,MAAMA;IACF,YAA6BC,OAAiC,CAAE;aAAnCA,OAAO,GAAPA;IAAoC;IAEjE,MAAM,QAAQC,MAA6B,EAAkC;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,gCAAiBC,eAAAA,oBAAuC,CAAC;IAClE,gBAAgBJ;IAChB,cAAc;QAACK;KAAe;AAClC"}
|