@webiny/cognito 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2
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.js +3 -1
- package/Cognito.js.map +1 -1
- package/admin/Cognito.d.ts +1 -1
- package/admin/Cognito.js +2 -38
- package/admin/Cognito.js.map +1 -1
- package/admin/Extension.js +0 -24
- package/admin/Extension.js.map +1 -1
- package/admin/presentation/Cognito/CognitoLoginScreen.d.ts +2 -2
- package/admin/presentation/Cognito/components/SetNewPassword.d.ts +1 -1
- package/admin/presentation/Cognito/components/SetNewPassword.js +4 -4
- package/admin/presentation/Cognito/components/SetNewPassword.js.map +1 -1
- package/api/features/CognitoIdp/feature.js +1 -1
- package/api/features/CognitoIdp/feature.js.map +1 -1
- package/api/features/UpdateUser/UpdateUserUseCase.js +1 -1
- package/api/features/UpdateUser/UpdateUserUseCase.js.map +1 -1
- package/api/graphql/user.gql.d.ts +3 -2
- package/api/graphql/user.gql.js +6 -2
- package/api/graphql/user.gql.js.map +1 -1
- package/infra/CognitoFederationPulumi.d.ts +1 -1
- package/package.json +19 -22
- package/admin/SecurityPermission.d.ts +0 -2
- package/admin/SecurityPermission.js +0 -15
- package/admin/SecurityPermission.js.map +0 -1
- package/admin/domain/permissionsSchema.d.ts +0 -10
- package/admin/domain/permissionsSchema.js +0 -18
- package/admin/domain/permissionsSchema.js.map +0 -1
- package/admin/features/account/getCurrentUser/GetCurrentUserGateway.d.ts +0 -11
- package/admin/features/account/getCurrentUser/GetCurrentUserGateway.js +0 -44
- package/admin/features/account/getCurrentUser/GetCurrentUserGateway.js.map +0 -1
- package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.d.ts +0 -10
- package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.js +0 -19
- package/admin/features/account/getCurrentUser/GetCurrentUserUseCase.js.map +0 -1
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.d.ts +0 -16
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js +0 -5
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserGateway.js.map +0 -1
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.d.ts +0 -10
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js +0 -5
- package/admin/features/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js.map +0 -1
- package/admin/features/account/getCurrentUser/abstractions/index.d.ts +0 -6
- package/admin/features/account/getCurrentUser/abstractions/index.js +0 -2
- package/admin/features/account/getCurrentUser/feature.d.ts +0 -3
- package/admin/features/account/getCurrentUser/feature.js +0 -19
- package/admin/features/account/getCurrentUser/feature.js.map +0 -1
- package/admin/features/account/getCurrentUser/index.d.ts +0 -1
- package/admin/features/account/getCurrentUser/index.js +0 -1
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.d.ts +0 -11
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js +0 -48
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserGateway.js.map +0 -1
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.d.ts +0 -10
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js +0 -19
- package/admin/features/account/updateCurrentUser/UpdateCurrentUserUseCase.js.map +0 -1
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.d.ts +0 -26
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js +0 -5
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js.map +0 -1
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.d.ts +0 -13
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js +0 -5
- package/admin/features/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js.map +0 -1
- package/admin/features/account/updateCurrentUser/abstractions/index.d.ts +0 -8
- package/admin/features/account/updateCurrentUser/abstractions/index.js +0 -2
- package/admin/features/account/updateCurrentUser/feature.d.ts +0 -3
- package/admin/features/account/updateCurrentUser/feature.js +0 -19
- package/admin/features/account/updateCurrentUser/feature.js.map +0 -1
- package/admin/features/account/updateCurrentUser/index.d.ts +0 -1
- package/admin/features/account/updateCurrentUser/index.js +0 -1
- package/admin/features/permissions/abstractions.d.ts +0 -17
- package/admin/features/permissions/abstractions.js +0 -6
- package/admin/features/permissions/abstractions.js.map +0 -1
- package/admin/features/permissions/feature.d.ts +0 -14
- package/admin/features/permissions/feature.js +0 -7
- package/admin/features/permissions/feature.js.map +0 -1
- package/admin/features/users/createUser/CreateUserGateway.d.ts +0 -11
- package/admin/features/users/createUser/CreateUserGateway.js +0 -49
- package/admin/features/users/createUser/CreateUserGateway.js.map +0 -1
- package/admin/features/users/createUser/CreateUserUseCase.d.ts +0 -10
- package/admin/features/users/createUser/CreateUserUseCase.js +0 -18
- package/admin/features/users/createUser/CreateUserUseCase.js.map +0 -1
- package/admin/features/users/createUser/abstractions/CreateUserGateway.d.ts +0 -21
- package/admin/features/users/createUser/abstractions/CreateUserGateway.js +0 -5
- package/admin/features/users/createUser/abstractions/CreateUserGateway.js.map +0 -1
- package/admin/features/users/createUser/abstractions/CreateUserUseCase.d.ts +0 -14
- package/admin/features/users/createUser/abstractions/CreateUserUseCase.js +0 -5
- package/admin/features/users/createUser/abstractions/CreateUserUseCase.js.map +0 -1
- package/admin/features/users/createUser/abstractions/index.d.ts +0 -2
- package/admin/features/users/createUser/abstractions/index.js +0 -2
- package/admin/features/users/createUser/feature.d.ts +0 -3
- package/admin/features/users/createUser/feature.js +0 -19
- package/admin/features/users/createUser/feature.js.map +0 -1
- package/admin/features/users/createUser/index.d.ts +0 -2
- package/admin/features/users/createUser/index.js +0 -2
- package/admin/features/users/deleteUser/DeleteUserGateway.d.ts +0 -11
- package/admin/features/users/deleteUser/DeleteUserGateway.js +0 -40
- package/admin/features/users/deleteUser/DeleteUserGateway.js.map +0 -1
- package/admin/features/users/deleteUser/DeleteUserUseCase.d.ts +0 -10
- package/admin/features/users/deleteUser/DeleteUserUseCase.js +0 -18
- package/admin/features/users/deleteUser/DeleteUserUseCase.js.map +0 -1
- package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.d.ts +0 -11
- package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.js +0 -5
- package/admin/features/users/deleteUser/abstractions/DeleteUserGateway.js.map +0 -1
- package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.d.ts +0 -11
- package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js +0 -5
- package/admin/features/users/deleteUser/abstractions/DeleteUserUseCase.js.map +0 -1
- package/admin/features/users/deleteUser/abstractions/index.d.ts +0 -2
- package/admin/features/users/deleteUser/abstractions/index.js +0 -2
- package/admin/features/users/deleteUser/feature.d.ts +0 -3
- package/admin/features/users/deleteUser/feature.js +0 -19
- package/admin/features/users/deleteUser/feature.js.map +0 -1
- package/admin/features/users/deleteUser/index.d.ts +0 -2
- package/admin/features/users/deleteUser/index.js +0 -2
- package/admin/features/users/getUser/GetUserGateway.d.ts +0 -11
- package/admin/features/users/getUser/GetUserGateway.js +0 -57
- package/admin/features/users/getUser/GetUserGateway.js.map +0 -1
- package/admin/features/users/getUser/GetUserUseCase.d.ts +0 -10
- package/admin/features/users/getUser/GetUserUseCase.js +0 -18
- package/admin/features/users/getUser/GetUserUseCase.js.map +0 -1
- package/admin/features/users/getUser/abstractions/GetUserGateway.d.ts +0 -32
- package/admin/features/users/getUser/abstractions/GetUserGateway.js +0 -5
- package/admin/features/users/getUser/abstractions/GetUserGateway.js.map +0 -1
- package/admin/features/users/getUser/abstractions/GetUserUseCase.d.ts +0 -14
- package/admin/features/users/getUser/abstractions/GetUserUseCase.js +0 -5
- package/admin/features/users/getUser/abstractions/GetUserUseCase.js.map +0 -1
- package/admin/features/users/getUser/abstractions/index.d.ts +0 -2
- package/admin/features/users/getUser/abstractions/index.js +0 -2
- package/admin/features/users/getUser/feature.d.ts +0 -3
- package/admin/features/users/getUser/feature.js +0 -19
- package/admin/features/users/getUser/feature.js.map +0 -1
- package/admin/features/users/getUser/index.d.ts +0 -2
- package/admin/features/users/getUser/index.js +0 -2
- package/admin/features/users/listUsers/ListUsersGateway.d.ts +0 -11
- package/admin/features/users/listUsers/ListUsersGateway.js +0 -39
- package/admin/features/users/listUsers/ListUsersGateway.js.map +0 -1
- package/admin/features/users/listUsers/ListUsersUseCase.d.ts +0 -10
- package/admin/features/users/listUsers/ListUsersUseCase.js +0 -18
- package/admin/features/users/listUsers/ListUsersUseCase.js.map +0 -1
- package/admin/features/users/listUsers/abstractions/ListUsersGateway.d.ts +0 -17
- package/admin/features/users/listUsers/abstractions/ListUsersGateway.js +0 -5
- package/admin/features/users/listUsers/abstractions/ListUsersGateway.js.map +0 -1
- package/admin/features/users/listUsers/abstractions/ListUsersUseCase.d.ts +0 -10
- package/admin/features/users/listUsers/abstractions/ListUsersUseCase.js +0 -5
- package/admin/features/users/listUsers/abstractions/ListUsersUseCase.js.map +0 -1
- package/admin/features/users/listUsers/abstractions/index.d.ts +0 -2
- package/admin/features/users/listUsers/abstractions/index.js +0 -2
- package/admin/features/users/listUsers/feature.d.ts +0 -3
- package/admin/features/users/listUsers/feature.js +0 -19
- package/admin/features/users/listUsers/feature.js.map +0 -1
- package/admin/features/users/listUsers/index.d.ts +0 -2
- package/admin/features/users/listUsers/index.js +0 -2
- package/admin/features/users/updateUser/UpdateUserGateway.d.ts +0 -11
- package/admin/features/users/updateUser/UpdateUserGateway.js +0 -59
- package/admin/features/users/updateUser/UpdateUserGateway.js.map +0 -1
- package/admin/features/users/updateUser/UpdateUserUseCase.d.ts +0 -10
- package/admin/features/users/updateUser/UpdateUserUseCase.js +0 -18
- package/admin/features/users/updateUser/UpdateUserUseCase.js.map +0 -1
- package/admin/features/users/updateUser/abstractions/UpdateUserGateway.d.ts +0 -33
- package/admin/features/users/updateUser/abstractions/UpdateUserGateway.js +0 -5
- package/admin/features/users/updateUser/abstractions/UpdateUserGateway.js.map +0 -1
- package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.d.ts +0 -15
- package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.js +0 -5
- package/admin/features/users/updateUser/abstractions/UpdateUserUseCase.js.map +0 -1
- package/admin/features/users/updateUser/abstractions/index.d.ts +0 -2
- package/admin/features/users/updateUser/abstractions/index.js +0 -2
- package/admin/features/users/updateUser/feature.d.ts +0 -3
- package/admin/features/users/updateUser/feature.js +0 -19
- package/admin/features/users/updateUser/feature.js.map +0 -1
- package/admin/features/users/updateUser/index.d.ts +0 -2
- package/admin/features/users/updateUser/index.js +0 -2
- package/admin/presentation/shared/createPasswordValidator.d.ts +0 -8
- package/admin/presentation/shared/createPasswordValidator.js +0 -16
- package/admin/presentation/shared/createPasswordValidator.js.map +0 -1
- package/admin/presentation/shared/usePasswordValidator.d.ts +0 -1
- package/admin/presentation/shared/usePasswordValidator.js +0 -16
- package/admin/presentation/shared/usePasswordValidator.js.map +0 -1
- package/admin/presentation/userMenu/AccountDetails.d.ts +0 -6
- package/admin/presentation/userMenu/AccountDetails.js +0 -20
- package/admin/presentation/userMenu/AccountDetails.js.map +0 -1
- package/admin/presentation/userMenu/useIsDefaultTenant.d.ts +0 -1
- package/admin/presentation/userMenu/useIsDefaultTenant.js +0 -9
- package/admin/presentation/userMenu/useIsDefaultTenant.js.map +0 -1
- package/admin/routes.d.ts +0 -10
- package/admin/routes.js +0 -20
- package/admin/routes.js.map +0 -1
- package/admin/ui/UserItem.d.ts +0 -10
- package/admin/ui/UserItem.js +0 -0
- package/admin/ui/components/AvatarImage/AvatarImage.d.ts +0 -3
- package/admin/ui/components/AvatarImage/AvatarImage.js +0 -31
- package/admin/ui/components/AvatarImage/AvatarImage.js.map +0 -1
- package/admin/ui/components/AvatarImage/AvatarImagePreview.d.ts +0 -10
- package/admin/ui/components/AvatarImage/AvatarImagePreview.js +0 -53
- package/admin/ui/components/AvatarImage/AvatarImagePreview.js.map +0 -1
- package/admin/ui/components/AvatarImage/AvatarImageTrigger.d.ts +0 -7
- package/admin/ui/components/AvatarImage/AvatarImageTrigger.js +0 -28
- package/admin/ui/components/AvatarImage/AvatarImageTrigger.js.map +0 -1
- package/admin/ui/components/AvatarImage/index.d.ts +0 -1
- package/admin/ui/components/AvatarImage/index.js +0 -1
- package/admin/ui/views/Account/Account.d.ts +0 -2
- package/admin/ui/views/Account/Account.js +0 -137
- package/admin/ui/views/Account/Account.js.map +0 -1
- package/admin/ui/views/Account/index.d.ts +0 -1
- package/admin/ui/views/Account/index.js +0 -1
- package/admin/ui/views/Users/UsersDataList.d.ts +0 -3
- package/admin/ui/views/Users/UsersDataList.js +0 -177
- package/admin/ui/views/Users/UsersDataList.js.map +0 -1
- package/admin/ui/views/Users/UsersForm.d.ts +0 -5
- package/admin/ui/views/Users/UsersForm.js +0 -169
- package/admin/ui/views/Users/UsersForm.js.map +0 -1
- package/admin/ui/views/Users/UsersView.d.ts +0 -2
- package/admin/ui/views/Users/UsersView.js +0 -14
- package/admin/ui/views/Users/UsersView.js.map +0 -1
- package/admin/ui/views/Users/components/DeleteAction.d.ts +0 -7
- package/admin/ui/views/Users/components/DeleteAction.js +0 -29
- package/admin/ui/views/Users/components/DeleteAction.js.map +0 -1
- package/admin/ui/views/Users/hooks/useUserForm.d.ts +0 -27
- package/admin/ui/views/Users/hooks/useUserForm.js +0 -101
- package/admin/ui/views/Users/hooks/useUserForm.js.map +0 -1
- package/admin/ui/views/Users/search.js +0 -21
- package/admin/ui/views/Users/search.js.map +0 -1
- package/admin/ui/views/Users/search.svg +0 -20
- package/admin/ui/views/utils.d.ts +0 -3
- package/admin/ui/views/utils.js +0 -12
- package/admin/ui/views/utils.js.map +0 -1
- package/static/svg/search.43fa797c.svg +0 -20
package/Cognito.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { defineExtension } from "@webiny/project/defineExtension/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Api } from "@webiny/project-aws/api.js";
|
|
4
|
+
import { Admin } from "@webiny/project-aws/admin.js";
|
|
5
|
+
import { Infra } from "@webiny/project-aws/infra.js";
|
|
4
6
|
import { Await } from "@webiny/react-properties";
|
|
5
7
|
import { z } from "zod";
|
|
6
8
|
const identityProviderSchema = z.object({
|
package/Cognito.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cognito.js","sources":["../src/Cognito.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { Api
|
|
1
|
+
{"version":3,"file":"Cognito.js","sources":["../src/Cognito.tsx"],"sourcesContent":["import React from \"react\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { Api } from \"@webiny/project-aws/api.js\";\nimport { Admin } from \"@webiny/project-aws/admin.js\";\nimport { Infra } from \"@webiny/project-aws/infra.js\";\nimport { Await } from \"@webiny/react-properties\";\nimport { z } from \"zod\";\n\nconst identityProviderSchema = z.object({\n type: z.enum([\"google\", \"facebook\", \"amazon\", \"apple\", \"oidc\"]),\n name: z.string().optional(),\n label: z.string(),\n providerDetails: z.record(z.string(), z.any()),\n idpIdentifiers: z.array(z.string()).optional(),\n attributeMapping: z.record(z.string(), z.string()).optional()\n});\n\nconst federationSchema = z.object({\n domain: z.string().describe(\"Cognito User Pool domain prefix.\"),\n callbackUrls: z.array(z.string()).describe(\"OAuth callback URLs.\"),\n logoutUrls: z.array(z.string()).optional(),\n responseType: z.enum([\"code\", \"token\"]).default(\"code\"),\n allowCredentialsLogin: z.boolean().default(true),\n identityProviders: z.array(identityProviderSchema)\n});\n\nexport const Cognito = defineExtension({\n type: \"Project/Cognito\",\n tags: { runtimeContext: \"project\" },\n description: \"Enable and configure Cognito authentication.\",\n paramsSchema: z.object({\n apiConfig: z.string().describe(\"Path to API configuration.\").optional(),\n adminConfig: z.string().describe(\"Path to Admin configuration.\").optional(),\n federation: z\n .union([\n federationSchema,\n z.custom<() => Promise<z.infer<typeof federationSchema>>>(\n val => typeof val === \"function\"\n )\n ])\n .optional(),\n mfa: z.boolean().describe(\"Enable TOTP MFA for all users.\").default(false)\n }),\n render: props => {\n const federationProp = props.federation;\n const federationFn = federationProp\n ? typeof federationProp === \"function\"\n ? federationProp\n : () => Promise.resolve(federationProp)\n : null;\n\n return (\n <>\n <Infra.EnvVar varName={\"REACT_APP_IDP_TYPE\"} value={\"cognito\"} />\n {props.mfa ? <Infra.EnvVar varName={\"COGNITO_MFA\"} value={\"true\"} /> : null}\n\n {/* Api extensions */}\n <Api.Extension\n src={import.meta.dirname + \"/api/CognitoApiFeature.js\"}\n exportName={\"CognitoApiFeature\"}\n />\n {props.apiConfig ? <Api.Extension src={props.apiConfig} /> : null}\n\n {/* Admin extensions */}\n <Admin.Extension src={import.meta.dirname + \"/admin/Extension.js\"} />\n {props.adminConfig ? <Admin.Extension src={props.adminConfig} /> : null}\n\n {/* Federation infra + admin config */}\n {federationFn ? (\n <Await fn={federationFn}>\n {federation => (\n <>\n <Admin.Extension\n src={import.meta.dirname + \"/admin/SignInExtension.js\"}\n exportName={\"SignInExtension\"}\n />\n <Infra.EnvVar\n varName={\"COGNITO_FEDERATION_INFRA_CONFIG\"}\n value={JSON.stringify({\n domain: federation.domain,\n callbackUrls: federation.callbackUrls,\n logoutUrls: federation.logoutUrls,\n identityProviders: federation.identityProviders.map(\n idp => ({\n type: idp.type,\n name: idp.name,\n providerDetails: idp.providerDetails,\n idpIdentifiers: idp.idpIdentifiers,\n attributeMapping: idp.attributeMapping\n })\n )\n })}\n />\n <Infra.Core.Pulumi\n src={import.meta.dirname + \"/infra/CognitoFederationPulumi.js\"}\n />\n <Admin.BuildParam\n paramName={\"cognitoFederation\"}\n value={{\n callbackUrls: federation.callbackUrls,\n logoutUrls:\n federation.logoutUrls || federation.callbackUrls,\n responseType: federation.responseType,\n allowCredentialsLogin: federation.allowCredentialsLogin,\n providers: federation.identityProviders.map(idp => ({\n name: idp.name || idp.type,\n label: idp.label\n }))\n }}\n />\n </>\n )}\n </Await>\n ) : null}\n </>\n );\n }\n});\n"],"names":["identityProviderSchema","z","federationSchema","Cognito","defineExtension","val","props","federationProp","federationFn","Promise","Infra","Api","Admin","Await","federation","JSON","idp"],"mappings":";;;;;;;AAQA,MAAMA,yBAAyBC,EAAE,MAAM,CAAC;IACpC,MAAMA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAU;QAAY;QAAU;QAAS;KAAO;IAC9D,MAAMA,EAAE,MAAM,GAAG,QAAQ;IACzB,OAAOA,EAAE,MAAM;IACf,iBAAiBA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,GAAG;IAC3C,gBAAgBA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ;IAC5C,kBAAkBA,EAAE,MAAM,CAACA,EAAE,MAAM,IAAIA,EAAE,MAAM,IAAI,QAAQ;AAC/D;AAEA,MAAMC,mBAAmBD,EAAE,MAAM,CAAC;IAC9B,QAAQA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,cAAcA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ,CAAC;IAC3C,YAAYA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ;IACxC,cAAcA,CAAC,CAADA,OAAM,CAAC;QAAC;QAAQ;KAAQ,EAAE,OAAO,CAAC;IAChD,uBAAuBA,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3C,mBAAmBA,EAAE,KAAK,CAACD;AAC/B;AAEO,MAAMG,UAAUC,gBAAgB;IACnC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcH,EAAE,MAAM,CAAC;QACnB,WAAWA,EAAE,MAAM,GAAG,QAAQ,CAAC,8BAA8B,QAAQ;QACrE,aAAaA,EAAE,MAAM,GAAG,QAAQ,CAAC,gCAAgC,QAAQ;QACzE,YAAYA,EAAAA,KACF,CAAC;YACHC;YACAD,EAAE,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AClC,kBAAkBA,IAAI,gBAAgB;wBAC1C;gBAER;8BAEJ,oBAACN,MAAM,IAAI,CAAC,MAAM;gBACd,KAAK,YAAY,OAAO,GAAG;8BAE/B,oBAACE,MAAM,UAAU;gBACb,WAAW;gBACX,OAAO;oBACH,cAAcE,WAAW,YAAY;oBACrC,YACIA,WAAW,UAAU,IAAIA,WAAW,YAAY;oBACpD,cAAcA,WAAW,YAAY;oBACrC,uBAAuBA,WAAW,qBAAqB;oBACvD,WAAWA,WAAW,iBAAiB,CAAC,GAAG,CAACE,CAAAA,MAAQ;4BAChD,MAAMA,IAAI,IAAI,IAAIA,IAAI,IAAI;4BAC1B,OAAOA,IAAI,KAAK;wBACpB;gBACJ;mBAKhB;IAGhB;AACJ"}
|
package/admin/Cognito.d.ts
CHANGED
package/admin/Cognito.js
CHANGED
|
@@ -1,43 +1,7 @@
|
|
|
1
1
|
import react, { Fragment, memo } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { UsersView } from "./ui/views/Users/UsersView.js";
|
|
4
|
-
import { UserAccountForm } from "./ui/views/Account/index.js";
|
|
5
|
-
import { SecurityPermission } from "./SecurityPermission.js";
|
|
2
|
+
import { AdminUsers } from "@webiny/app-admin";
|
|
6
3
|
import { CognitoLogin } from "./CognitoLogin.js";
|
|
7
|
-
|
|
8
|
-
import { AccountDetails } from "./presentation/userMenu/AccountDetails.js";
|
|
9
|
-
const { Route: Route, Menu: Menu } = AdminConfig;
|
|
10
|
-
const CognitoIdP = (props)=>{
|
|
11
|
-
const { getLink } = useRouter();
|
|
12
|
-
return /*#__PURE__*/ react.createElement(Fragment, null, /*#__PURE__*/ react.createElement(SecurityPermission, null), /*#__PURE__*/ react.createElement(CognitoLogin, props.login), /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(HasPermission, {
|
|
13
|
-
name: "adminUsers.user"
|
|
14
|
-
}, /*#__PURE__*/ react.createElement(Route, {
|
|
15
|
-
route: Routes.Users.List,
|
|
16
|
-
element: /*#__PURE__*/ react.createElement(AdminLayout, {
|
|
17
|
-
title: "Admin Users"
|
|
18
|
-
}, /*#__PURE__*/ react.createElement(UsersView, null))
|
|
19
|
-
}), /*#__PURE__*/ react.createElement(Route, {
|
|
20
|
-
route: Routes.Users.Account,
|
|
21
|
-
element: /*#__PURE__*/ react.createElement(AdminLayout, {
|
|
22
|
-
title: "User Account"
|
|
23
|
-
}, /*#__PURE__*/ react.createElement(UserAccountForm, null))
|
|
24
|
-
}), /*#__PURE__*/ react.createElement(Menu, {
|
|
25
|
-
name: "cognito.settings.adminUsers",
|
|
26
|
-
parent: "settings.security",
|
|
27
|
-
before: "$first",
|
|
28
|
-
element: /*#__PURE__*/ react.createElement(Menu.Link, {
|
|
29
|
-
text: "Users",
|
|
30
|
-
to: getLink(Routes.Users.List),
|
|
31
|
-
pinnable: true
|
|
32
|
-
})
|
|
33
|
-
})), /*#__PURE__*/ react.createElement(Menu.User, {
|
|
34
|
-
name: "accountSettings",
|
|
35
|
-
after: "userInfo",
|
|
36
|
-
element: /*#__PURE__*/ react.createElement(AccountDetails, {
|
|
37
|
-
accountRoute: getLink(Routes.Users.Account)
|
|
38
|
-
})
|
|
39
|
-
})));
|
|
40
|
-
};
|
|
4
|
+
const CognitoIdP = (props)=>/*#__PURE__*/ react.createElement(Fragment, null, /*#__PURE__*/ react.createElement(CognitoLogin, props.login), /*#__PURE__*/ react.createElement(AdminUsers, null));
|
|
41
5
|
const CognitoAdmin = /*#__PURE__*/ memo(CognitoIdP);
|
|
42
6
|
export { CognitoAdmin };
|
|
43
7
|
|
package/admin/Cognito.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/Cognito.js","sources":["../../src/admin/Cognito.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"admin/Cognito.js","sources":["../../src/admin/Cognito.tsx"],"sourcesContent":["import React from \"react\";\nimport { Fragment } from \"react\";\nimport { memo } from \"react\";\nimport { AdminUsers } from \"@webiny/app-admin\";\nimport { CognitoLogin } from \"./CognitoLogin.js\";\nimport type { CognitoLoginProps } from \"./CognitoLogin.js\";\n\nexport interface CognitoAdminProps {\n login: CognitoLoginProps;\n}\n\nconst CognitoIdP = (props: CognitoAdminProps) => {\n return (\n <Fragment>\n <CognitoLogin {...props.login} />\n <AdminUsers />\n </Fragment>\n );\n};\n\nexport const CognitoAdmin = memo(CognitoIdP);\n"],"names":["CognitoIdP","props","Fragment","CognitoLogin","AdminUsers","CognitoAdmin","memo"],"mappings":";;;AAWA,MAAMA,aAAa,CAACC,QACT,WAAP,GACI,oBAACC,UAAQA,MAAAA,WAAAA,GACL,oBAACC,cAAiBF,MAAM,KAAK,iBAC7B,oBAACG,YAAUA;AAKhB,MAAMC,eAAe,WAAHA,GAAGC,KAAKN"}
|
package/admin/Extension.js
CHANGED
|
@@ -2,36 +2,12 @@ import react from "react";
|
|
|
2
2
|
import { RegisterFeature } from "@webiny/app-admin";
|
|
3
3
|
import { CognitoFeature } from "./presentation/Cognito/feature.js";
|
|
4
4
|
import { CognitoAdmin } from "./Cognito.js";
|
|
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";
|
|
13
5
|
const Extension = ()=>{
|
|
14
6
|
const region = process.env.REACT_APP_USER_POOL_REGION || "";
|
|
15
7
|
const userPoolId = process.env.REACT_APP_USER_POOL_ID || "";
|
|
16
8
|
const clientId = process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID || "";
|
|
17
9
|
return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
18
10
|
feature: CognitoFeature
|
|
19
|
-
}), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
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
|
|
35
11
|
}), /*#__PURE__*/ react.createElement(CognitoAdmin, {
|
|
36
12
|
login: {
|
|
37
13
|
region,
|
package/admin/Extension.js.map
CHANGED
|
@@ -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\";\
|
|
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\";\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 <CognitoAdmin\n login={{\n region,\n userPoolId,\n clientId\n }}\n />\n </>\n );\n};\n"],"names":["Extension","region","process","userPoolId","clientId","RegisterFeature","CognitoFeature","CognitoAdmin"],"mappings":";;;;AAKO,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,oBAACC,cAAYA;QACT,OAAO;YACHN;YACAE;YACAC;QACJ;;AAIhB"}
|
|
@@ -5,6 +5,6 @@ export interface CognitoLoginScreenProps {
|
|
|
5
5
|
clientId: string;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const CognitoLoginScreen: ((props: CognitoLoginScreenProps) => React.JSX.Element) & {
|
|
9
|
-
|
|
8
|
+
export declare const CognitoLoginScreen: ((props: CognitoLoginScreenProps) => React.JSX.Element) & React.NamedExoticComponent<CognitoLoginScreenProps> & {
|
|
9
|
+
readonly type: (props: CognitoLoginScreenProps) => React.JSX.Element;
|
|
10
10
|
};
|
|
@@ -18,7 +18,7 @@ export declare const SetNewPassword: ((props: SetNewPasswordProps) => React.JSX.
|
|
|
18
18
|
originalName: string;
|
|
19
19
|
displayName: string;
|
|
20
20
|
} & {
|
|
21
|
-
createDecorator: (decorator: import("@webiny/app
|
|
21
|
+
createDecorator: (decorator: import("@webiny/app").ComponentDecorator<((props: SetNewPasswordProps) => React.JSX.Element) & {
|
|
22
22
|
original: (props: SetNewPasswordProps) => React.JSX.Element;
|
|
23
23
|
originalName: string;
|
|
24
24
|
displayName: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { Alert, Button, Grid, Input } from "@webiny/admin-ui";
|
|
3
|
-
import { makeDecoratable } from "@webiny/app-admin";
|
|
3
|
+
import { PasswordPolicyFeature, makeDecoratable } from "@webiny/app-admin";
|
|
4
4
|
import { Bind, Form, useForm } from "@webiny/form";
|
|
5
5
|
import { validation } from "@webiny/validation";
|
|
6
6
|
import { View } from "./View.js";
|
|
7
7
|
import { FooterSignIn } from "./FooterSignIn.js";
|
|
8
|
-
import {
|
|
8
|
+
import { useFeature } from "@webiny/app";
|
|
9
9
|
const SetNewPassword = makeDecoratable("CognitoSetNewPassword", (props)=>{
|
|
10
10
|
const { vm, onSetNewPassword, onCancel } = props;
|
|
11
|
-
const
|
|
11
|
+
const { passwordPolicy } = useFeature(PasswordPolicyFeature);
|
|
12
12
|
return /*#__PURE__*/ react.createElement(View.Container, null, /*#__PURE__*/ react.createElement(Form, {
|
|
13
13
|
onSubmit: (data)=>onSetNewPassword(data.code, data.password),
|
|
14
14
|
submitOnEnter: true
|
|
@@ -34,7 +34,7 @@ const SetNewPassword = makeDecoratable("CognitoSetNewPassword", (props)=>{
|
|
|
34
34
|
name: "password",
|
|
35
35
|
validators: [
|
|
36
36
|
validation.create("required"),
|
|
37
|
-
|
|
37
|
+
(value)=>passwordPolicy.validate(value)
|
|
38
38
|
]
|
|
39
39
|
}, /*#__PURE__*/ react.createElement(Input, {
|
|
40
40
|
type: "password",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/presentation/Cognito/components/SetNewPassword.js","sources":["../../../../../src/admin/presentation/Cognito/components/SetNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button, Grid, Input, Alert } from \"@webiny/admin-ui\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport { Form, Bind, useForm } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { View } from \"./View.js\";\nimport type { SetNewPasswordVM } from \"~/admin/presentation/Cognito/abstractions.js\";\nimport { FooterSignIn } from \"~/admin/presentation/Cognito/components/FooterSignIn.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"admin/presentation/Cognito/components/SetNewPassword.js","sources":["../../../../../src/admin/presentation/Cognito/components/SetNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button, Grid, Input, Alert } from \"@webiny/admin-ui\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport { Form, Bind, useForm } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { View } from \"./View.js\";\nimport type { SetNewPasswordVM } from \"~/admin/presentation/Cognito/abstractions.js\";\nimport { FooterSignIn } from \"~/admin/presentation/Cognito/components/FooterSignIn.js\";\nimport { PasswordPolicyFeature } from \"@webiny/app-admin\";\nimport { useFeature } from \"@webiny/app\";\n\nexport interface SetNewPasswordProps {\n vm: SetNewPasswordVM;\n onSetNewPassword: (code: string, password: string) => void;\n onCancel: () => void;\n}\n\nexport const SetNewPassword = makeDecoratable(\n \"CognitoSetNewPassword\",\n (props: SetNewPasswordProps) => {\n const { vm, onSetNewPassword, onCancel } = props;\n const { passwordPolicy } = useFeature(PasswordPolicyFeature);\n\n return (\n <View.Container>\n <Form\n onSubmit={(data: any) => onSetNewPassword(data.code, data.password)}\n submitOnEnter\n >\n {({ submit }) => (\n <View.Content>\n <View.Title title={\"Set new password\"} />\n\n {vm.message && (\n <div className={\"mb-lg\"}>\n <Alert title={vm.message.title} type={vm.message.type}>\n {vm.message.text}\n </Alert>\n </div>\n )}\n\n <Grid>\n <Grid.Column span={12}>\n <Bind name=\"code\" validators={validation.create(\"required\")}>\n <Input\n label={\"Verification Code\"}\n description={\"Enter the code we sent to your email.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <Bind\n name=\"password\"\n validators={[\n validation.create(\"required\"),\n (value: string) => passwordPolicy.validate(value)\n ]}\n >\n <Input\n type={\"password\"}\n label={\"New Password\"}\n description={\"Enter your new password.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <RetypePassword />\n </Grid.Column>\n <Grid.Column span={12}>\n <div className={\"flex items-center justify-between\"}>\n <FooterSignIn onSignIn={onCancel} />\n <Button\n text={\"Reset Password\"}\n onClick={submit}\n containerClassName={\"ml-auto\"}\n disabled={vm.isLoading}\n />\n </div>\n </Grid.Column>\n </Grid>\n </View.Content>\n )}\n </Form>\n </View.Container>\n );\n }\n);\n\nconst RetypePassword = () => {\n const form = useForm();\n const matchOriginalValidator = (value: string) => {\n if (value !== form.getValue(\"password\")) {\n throw Error(`Passwords do not match.`);\n }\n };\n\n return (\n <Bind\n name=\"confirmPassword\"\n validators={[validation.create(\"required\"), matchOriginalValidator]}\n >\n <Input\n type={\"password\"}\n label={\"Retype Password\"}\n description={\"Enter your new password once more.\"}\n autoComplete={\"new-password\"}\n />\n </Bind>\n );\n};\n"],"names":["SetNewPassword","makeDecoratable","props","vm","onSetNewPassword","onCancel","passwordPolicy","useFeature","PasswordPolicyFeature","View","Form","data","submit","Alert","Grid","Bind","validation","Input","value","RetypePassword","FooterSignIn","Button","form","useForm","matchOriginalValidator","Error"],"mappings":";;;;;;;;AAiBO,MAAMA,iBAAiBC,gBAC1B,yBACA,CAACC;IACG,MAAM,EAAEC,EAAE,EAAEC,gBAAgB,EAAEC,QAAQ,EAAE,GAAGH;IAC3C,MAAM,EAAEI,cAAc,EAAE,GAAGC,WAAWC;IAEtC,OAAO,WAAP,GACI,oBAACC,KAAK,SAAS,sBACX,oBAACC,MAAIA;QACD,UAAU,CAACC,OAAcP,iBAAiBO,KAAK,IAAI,EAAEA,KAAK,QAAQ;QAClE;OAEC,CAAC,EAAEC,MAAM,EAAE,iBACR,oBAACH,KAAK,OAAO,sBACT,oBAACA,KAAK,KAAK;YAAC,OAAO;YAElBN,GAAG,OAAO,IAAI,WAAJ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Feature = createFeature({
|
|
4
4
|
name: "CognitoIdp",
|
|
5
5
|
register (container) {
|
|
6
|
-
container.register(CognitoIdentityProvider).
|
|
6
|
+
container.register(CognitoIdentityProvider).inContainerScope();
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
9
|
export { CognitoIdpFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/features/CognitoIdp/feature.js","sources":["../../../../src/api/features/CognitoIdp/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CognitoIdentityProvider } from \"./CognitoIdentityProvider.js\";\n\nexport const CognitoIdpFeature = createFeature({\n name: \"CognitoIdp\",\n register(container) {\n container.register(CognitoIdentityProvider).
|
|
1
|
+
{"version":3,"file":"api/features/CognitoIdp/feature.js","sources":["../../../../src/api/features/CognitoIdp/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CognitoIdentityProvider } from \"./CognitoIdentityProvider.js\";\n\nexport const CognitoIdpFeature = createFeature({\n name: \"CognitoIdp\",\n register(container) {\n // Registered per request by CognitoApiFeature (the `<Cognito/>` extension). Container scoped:\n // one provider per request, built from the request container, so it sees the optional\n // CognitoIdpConfig that other extensions (e.g. Entra ID) register there.\n container.register(CognitoIdentityProvider).inContainerScope();\n }\n});\n"],"names":["CognitoIdpFeature","createFeature","container","CognitoIdentityProvider"],"mappings":";;AAGO,MAAMA,oBAAoBC,cAAc;IAC3C,MAAM;IACN,UAASC,SAAS;QAIdA,UAAU,QAAQ,CAACC,yBAAyB,gBAAgB;IAChE;AACJ"}
|
|
@@ -33,6 +33,7 @@ class UpdateUserUseCaseImpl {
|
|
|
33
33
|
});
|
|
34
34
|
if (getUserResult.isFail()) return Result.fail(getUserResult.error);
|
|
35
35
|
const originalUser = getUserResult.value;
|
|
36
|
+
if (void 0 !== data.email && data.email !== originalUser.email) return Result.fail(new UserValidationError("The email address cannot be changed."));
|
|
36
37
|
const updateUserResult = await this.updateUserUseCase.execute(id, userDataWithoutPassword);
|
|
37
38
|
if (updateUserResult.isFail()) return Result.fail(updateUserResult.error);
|
|
38
39
|
const updatedUser = updateUserResult.value;
|
|
@@ -43,7 +44,6 @@ class UpdateUserUseCaseImpl {
|
|
|
43
44
|
const attrValue = "function" == typeof mappedAttr ? mappedAttr(updatedUser) : updatedUser[mappedAttr];
|
|
44
45
|
attributes[attr] = attrValue;
|
|
45
46
|
});
|
|
46
|
-
if (originalUser.email !== updatedUser.email) attributes["email_verified"] = "true";
|
|
47
47
|
await this.cognitoService.updateUserAttributes(Username.fromUser(originalUser), attributes);
|
|
48
48
|
if (password) await this.cognitoService.setPermanentPassword(Username.fromUser(updatedUser), password);
|
|
49
49
|
return Result.ok(updatedUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/features/UpdateUser/UpdateUserUseCase.js","sources":["../../../../src/api/features/UpdateUser/UpdateUserUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { UpdateUserUseCase as CoreUpdateUser } from \"@webiny/api-core/features/users/UpdateUser/index.js\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/users/GetUser/index.js\";\nimport {\n NotAuthorizedError,\n UserValidationError\n} from \"@webiny/api-core/features/users/shared/errors.js\";\nimport type { AdminUser } from \"@webiny/api-core/types/users.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { UpdateUserUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { Username } from \"~/api/domain/Username.js\";\nimport { CognitoUpdateUserError } from \"~/api/domain/errors.js\";\nimport { updateAdminUserValidation } from \"./schema.js\";\nimport type { UpdateAdminUserInput } from \"./abstractions.js\";\nimport { CognitoService } from \"~/api/features/CognitoService/index.js\";\n\ntype MappedAttrType = (user: AdminUser) => string | keyof AdminUser;\n\nconst defaultUpdateAttributes = {\n family_name: \"lastName\",\n given_name: \"firstName\",\n preferred_username: \"email\"\n};\n\nclass UpdateUserUseCaseImpl implements UseCaseAbstraction.Interface {\n private updateAttributes: Record<string, string | MappedAttrType>;\n\n constructor(\n private identityContext: IdentityContext.Interface,\n private cognitoService: CognitoService.Interface,\n private updateUserUseCase: CoreUpdateUser.Interface,\n private getUserUseCase: GetUserUseCase.Interface\n ) {\n this.updateAttributes = defaultUpdateAttributes;\n }\n\n async execute(\n id: string,\n input: UpdateAdminUserInput\n ): Promise<Result<AdminUser, UseCaseAbstraction.Error>> {\n const permission = await this.identityContext.getPermission(\"adminUsers.user\");\n if (!permission) {\n return Result.fail(new NotAuthorizedError());\n }\n\n // Validate input (including password)\n const validation = updateAdminUserValidation.safeParse(input);\n if (!validation.success) {\n return Result.fail(new UserValidationError(validation.error.issues[0].message));\n }\n\n const data = validation.data;\n const { password, ...userDataWithoutPassword } = data;\n\n // Get original user to know the email before update\n const getUserResult = await this.getUserUseCase.execute({ id });\n if (getUserResult.isFail()) {\n return Result.fail(getUserResult.error);\n }\n\n const originalUser = getUserResult.value;\n\n // Update user in api-core\n const updateUserResult = await this.updateUserUseCase.execute(id, userDataWithoutPassword);\n if (updateUserResult.isFail()) {\n return Result.fail(updateUserResult.error);\n }\n\n const updatedUser = updateUserResult.value;\n\n // Update user in Cognito\n try {\n // Build new attributes\n const attributes: Record<string, string> = {};\n\n Object.keys(this.updateAttributes).forEach(attr => {\n const mappedAttr = this.updateAttributes[\n attr as keyof typeof this.updateAttributes\n ] as MappedAttrType;\n const attrValue =\n typeof mappedAttr === \"function\"\n ? mappedAttr(updatedUser)\n : updatedUser[mappedAttr];\n attributes[attr] = attrValue;\n });\n\n
|
|
1
|
+
{"version":3,"file":"api/features/UpdateUser/UpdateUserUseCase.js","sources":["../../../../src/api/features/UpdateUser/UpdateUserUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { UpdateUserUseCase as CoreUpdateUser } from \"@webiny/api-core/features/users/UpdateUser/index.js\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/users/GetUser/index.js\";\nimport {\n NotAuthorizedError,\n UserValidationError\n} from \"@webiny/api-core/features/users/shared/errors.js\";\nimport type { AdminUser } from \"@webiny/api-core/types/users.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { UpdateUserUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { Username } from \"~/api/domain/Username.js\";\nimport { CognitoUpdateUserError } from \"~/api/domain/errors.js\";\nimport { updateAdminUserValidation } from \"./schema.js\";\nimport type { UpdateAdminUserInput } from \"./abstractions.js\";\nimport { CognitoService } from \"~/api/features/CognitoService/index.js\";\n\ntype MappedAttrType = (user: AdminUser) => string | keyof AdminUser;\n\nconst defaultUpdateAttributes = {\n family_name: \"lastName\",\n given_name: \"firstName\",\n preferred_username: \"email\"\n};\n\nclass UpdateUserUseCaseImpl implements UseCaseAbstraction.Interface {\n private updateAttributes: Record<string, string | MappedAttrType>;\n\n constructor(\n private identityContext: IdentityContext.Interface,\n private cognitoService: CognitoService.Interface,\n private updateUserUseCase: CoreUpdateUser.Interface,\n private getUserUseCase: GetUserUseCase.Interface\n ) {\n this.updateAttributes = defaultUpdateAttributes;\n }\n\n async execute(\n id: string,\n input: UpdateAdminUserInput\n ): Promise<Result<AdminUser, UseCaseAbstraction.Error>> {\n const permission = await this.identityContext.getPermission(\"adminUsers.user\");\n if (!permission) {\n return Result.fail(new NotAuthorizedError());\n }\n\n // Validate input (including password)\n const validation = updateAdminUserValidation.safeParse(input);\n if (!validation.success) {\n return Result.fail(new UserValidationError(validation.error.issues[0].message));\n }\n\n const data = validation.data;\n const { password, ...userDataWithoutPassword } = data;\n\n // Get original user to know the email before update\n const getUserResult = await this.getUserUseCase.execute({ id });\n if (getUserResult.isFail()) {\n return Result.fail(getUserResult.error);\n }\n\n const originalUser = getUserResult.value;\n\n /*\n * The email is the user pool username, which Cognito cannot change, and the sign-in key.\n * api-core would drop it silently; saying so is better than reporting a change that did not\n * happen. The forms send the current address back unchanged, which is not a change.\n */\n if (data.email !== undefined && data.email !== originalUser.email) {\n return Result.fail(new UserValidationError(\"The email address cannot be changed.\"));\n }\n\n // Update user in api-core\n const updateUserResult = await this.updateUserUseCase.execute(id, userDataWithoutPassword);\n if (updateUserResult.isFail()) {\n return Result.fail(updateUserResult.error);\n }\n\n const updatedUser = updateUserResult.value;\n\n // Update user in Cognito\n try {\n // Build new attributes\n const attributes: Record<string, string> = {};\n\n Object.keys(this.updateAttributes).forEach(attr => {\n const mappedAttr = this.updateAttributes[\n attr as keyof typeof this.updateAttributes\n ] as MappedAttrType;\n const attrValue =\n typeof mappedAttr === \"function\"\n ? mappedAttr(updatedUser)\n : updatedUser[mappedAttr];\n attributes[attr] = attrValue;\n });\n\n await this.cognitoService.updateUserAttributes(\n Username.fromUser(originalUser),\n attributes\n );\n\n // Update password if provided\n if (password) {\n await this.cognitoService.setPermanentPassword(\n Username.fromUser(updatedUser),\n password\n );\n }\n\n return Result.ok(updatedUser);\n } catch (cognitoError) {\n return Result.fail(new CognitoUpdateUserError(cognitoError as Error));\n }\n }\n}\n\nexport const UpdateUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: UpdateUserUseCaseImpl,\n dependencies: [IdentityContext, CognitoService, CoreUpdateUser, GetUserUseCase]\n});\n"],"names":["defaultUpdateAttributes","UpdateUserUseCaseImpl","identityContext","cognitoService","updateUserUseCase","getUserUseCase","id","input","permission","Result","NotAuthorizedError","validation","updateAdminUserValidation","UserValidationError","data","password","userDataWithoutPassword","getUserResult","originalUser","undefined","updateUserResult","updatedUser","attributes","Object","attr","mappedAttr","attrValue","Username","cognitoError","CognitoUpdateUserError","UpdateUserUseCase","UseCaseAbstraction","IdentityContext","CognitoService","CoreUpdateUser","GetUserUseCase"],"mappings":";;;;;;;;;;AAkBA,MAAMA,0BAA0B;IAC5B,aAAa;IACb,YAAY;IACZ,oBAAoB;AACxB;AAEA,MAAMC;IAGF,YACYC,eAA0C,EAC1CC,cAAwC,EACxCC,iBAA2C,EAC3CC,cAAwC,CAClD;aAJUH,eAAe,GAAfA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ACXA,WAAW,CAACI,WAAW;gBACjCH,UAAU,CAACE,KAAK,GAAGE;YACvB;YAEA,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAC1CC,SAAS,QAAQ,CAACT,eAClBI;YAIJ,IAAIP,UACA,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAC1CY,SAAS,QAAQ,CAACN,cAClBN;YAIR,OAAON,OAAO,EAAE,CAACY;QACrB,EAAE,OAAOO,cAAc;YACnB,OAAOnB,OAAO,IAAI,CAAC,IAAIoB,uBAAuBD;QAClD;IACJ;AACJ;AAEO,MAAME,sCAAoBC,2CAAAA,oBAAuC,CAAC;IACrE,gBAAgB9B;IAChB,cAAc;QAAC+B;QAAiBC;QAAgBC;QAAgBC;KAAe;AACnF"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { CoreGraphQLSchemaFactory } from "@webiny/
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
2
|
declare class AdminUserSchemaImpl implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
getSchemaKey: () => string;
|
|
3
4
|
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
5
|
}
|
|
5
6
|
export declare const AdminUsersSchema: typeof AdminUserSchemaImpl & {
|
|
6
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.core").ICoreGraphQLSchemaFactory>;
|
|
7
8
|
};
|
|
8
9
|
export {};
|
package/api/graphql/user.gql.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ErrorResponse, NotFoundResponse, Response } from "@webiny/
|
|
2
|
-
import {
|
|
1
|
+
import { ErrorResponse, NotFoundResponse, Response } from "@webiny/api-graphql/responses.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
3
4
|
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
4
5
|
import { GetUserUseCase } from "@webiny/api-core/features/users/GetUser/index.js";
|
|
5
6
|
import NotAuthorizedResponse from "@webiny/api-core/graphql/security/NotAuthorizedResponse.js";
|
|
@@ -133,6 +134,9 @@ class AdminUserSchemaImpl {
|
|
|
133
134
|
});
|
|
134
135
|
return builder;
|
|
135
136
|
}
|
|
137
|
+
constructor(){
|
|
138
|
+
this.getSchemaKey = staticSchemaKey("cognito/AdminUserSchemaImpl");
|
|
139
|
+
}
|
|
136
140
|
}
|
|
137
141
|
const AdminUsersSchema = CoreGraphQLSchemaFactory.createImplementation({
|
|
138
142
|
implementation: AdminUserSchemaImpl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/graphql/user.gql.js","sources":["../../../src/api/graphql/user.gql.ts"],"sourcesContent":["import { ErrorResponse, NotFoundResponse, Response } from \"@webiny/handler-graphql/responses.js\";\nimport { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/users/GetUser/index.js\";\nimport NotAuthorizedResponse from \"@webiny/api-core/graphql/security/NotAuthorizedResponse.js\";\nimport { CreateUserUseCase } from \"~/api/features/CreateUser/index.js\";\nimport { UpdateUserUseCase } from \"~/api/features/UpdateUser/index.js\";\nimport { DeleteUserUseCase } from \"~/api/features/DeleteUser/index.js\";\n\nclass AdminUserSchemaImpl implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(/* GraphQL */ `\n \"\"\"\n This input type is used by administrators to create other user's accounts within the same tenant.\n \"\"\"\n input AdminUsersCreateInput {\n email: String!\n firstName: String!\n lastName: String!\n password: String!\n avatar: JSON\n roles: [RefInput!]\n teams: [RefInput!]\n }\n\n \"\"\"\n This input type is used by administrators to update other user's accounts within the same tenant.\n \"\"\"\n input AdminUsersUpdateInput {\n email: String\n firstName: String\n lastName: String\n password: String\n avatar: JSON\n roles: [RefInput!]\n teams: [RefInput!]\n }\n\n \"\"\"\n This input type is used by the user who is updating his own account\n \"\"\"\n input AdminUsersCurrentUserInput {\n email: String\n firstName: String\n lastName: String\n password: String\n avatar: JSON\n }\n\n extend type AdminUsersMutation {\n updateCurrentUser(data: AdminUsersCurrentUserInput!): AdminUsersResponse\n\n createUser(data: AdminUsersCreateInput!): AdminUsersResponse\n\n updateUser(id: ID!, data: AdminUsersUpdateInput!): AdminUsersResponse\n\n deleteUser(id: ID!): AdminUsersBooleanResponse\n }\n `);\n\n builder.addResolver({\n path: \"AdminUsersMutation.updateCurrentUser\",\n dependencies: [IdentityContext, GetUserUseCase, UpdateUserUseCase],\n resolver: (\n identityContext: IdentityContext.Interface,\n getUserUseCase: GetUserUseCase.Interface,\n updateUserUseCase: UpdateUserUseCase.Interface\n ) => {\n return async ({ args }) => {\n const identity = identityContext.getIdentity();\n if (!identity.isAdmin()) {\n return new NotAuthorizedResponse();\n }\n\n // Current user might not have permissions for `adminUsers`.\n return await identityContext.withoutAuthorization(async () => {\n const getUserResult = await getUserUseCase.execute({ id: identity.id });\n if (getUserResult.isFail()) {\n // TODO: check if current identity belongs to a different tenant.\n // TODO: If so, switch to that other tenant, and update his profile there.\n return new NotFoundResponse(\"User not found!\");\n }\n\n const user = getUserResult.value;\n\n // TODO: UpdateCurrentUser should be a dedicated use case\n const updateResult = await updateUserUseCase.execute(user.id, args.data);\n if (updateResult.isFail()) {\n return new ErrorResponse({\n message: updateResult.error.message,\n code: updateResult.error.code,\n data: updateResult.error.data\n });\n }\n\n return new Response(updateResult.value);\n });\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.createUser\",\n dependencies: [CreateUserUseCase],\n resolver: (createUserUseCase: CreateUserUseCase.Interface) => {\n return async ({ args }) => {\n const result = await createUserUseCase.execute(args.data);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code,\n data: result.error.data\n });\n }\n\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.updateUser\",\n dependencies: [UpdateUserUseCase, IdentityContext],\n resolver: (\n updateUserUseCase: UpdateUserUseCase.Interface,\n identityContext: IdentityContext.Interface\n ) => {\n return async ({ args }) => {\n if (args.id === identityContext.getIdentity().id) {\n return new ErrorResponse({\n message:\n \"You're not allowed to update your own account using this API.\",\n code: \"AdminUser/GraphQL/UpdateSelf\"\n });\n }\n\n const result = await updateUserUseCase.execute(args.id, args.data);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code\n });\n }\n\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.deleteUser\",\n dependencies: [DeleteUserUseCase],\n resolver: (deleteUserUseCase: DeleteUserUseCase.Interface) => {\n return async ({ args }) => {\n const result = await deleteUserUseCase.execute(args.id);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code,\n data: result.error.data\n });\n }\n\n return new Response(true);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const AdminUsersSchema = CoreGraphQLSchemaFactory.createImplementation({\n implementation: AdminUserSchemaImpl,\n dependencies: []\n});\n"],"names":["AdminUserSchemaImpl","builder","IdentityContext","GetUserUseCase","UpdateUserUseCase","identityContext","getUserUseCase","updateUserUseCase","args","identity","NotAuthorizedResponse","getUserResult","NotFoundResponse","user","updateResult","ErrorResponse","Response","CreateUserUseCase","createUserUseCase","result","DeleteUserUseCase","deleteUserUseCase","AdminUsersSchema","CoreGraphQLSchemaFactory"],"mappings":";;;;;;;;AASA,MAAMA;IACF,MAAM,QACFC,OAA+C,EAChB;QAC/BA,QAAQ,WAA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O,KAAK;gBACpC;QAER;QAEAlB,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACG;gBAAmBF;aAAgB;YAClD,UAAU,CACNK,mBACAF,kBAEO,OAAO,EAAEG,IAAI,EAAE;oBAClB,IAAIA,KAAK,EAAE,KAAKH,gBAAgB,WAAW,GAAG,EAAE,EAC5C,OAAO,IAAIU,cAAc;wBACrB,SACI;wBACJ,MAAM;oBACV;oBAGJ,MAAMI,SAAS,MAAMZ,kBAAkB,OAAO,CAACC,KAAK,EAAE,EAAEA,KAAK,IAAI;oBACjE,IAAIW,OAAO,MAAM,IACb,OAAO,IAAIJ,cAAc;wBACrB,SAASI,OAAO,KAAK,CAAC,OAAO;wBAC7B,MAAMA,OAAO,KAAK,CAAC,IAAI;oBAC3B;oBAGJ,OAAO,IAAIH,SAASG,OAAO,KAAK;gBACpC;QAER;QAEAlB,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACmB;aAAkB;YACjC,UAAU,CAACC,oBACA,OAAO,EAAEb,IAAI,EAAE;oBAClB,MAAMW,SAAS,MAAME,kBAAkB,OAAO,CAACb,KAAK,EAAE;oBACtD,IAAIW,OAAO,MAAM,IACb,OAAO,IAAIJ,cAAc;wBACrB,SAASI,OAAO,KAAK,CAAC,OAAO;wBAC7B,MAAMA,OAAO,KAAK,CAAC,IAAI;wBACvB,MAAMA,OAAO,KAAK,CAAC,IAAI;oBAC3B;oBAGJ,OAAO,IAAIH,SAAS;gBACxB;QAER;QAEA,OAAOf;IACX;AACJ;AAEO,MAAMqB,mBAAmBC,yBAAyB,oBAAoB,CAAC;IAC1E,gBAAgBvB;IAChB,cAAc,EAAE;AACpB"}
|
|
1
|
+
{"version":3,"file":"api/graphql/user.gql.js","sources":["../../../src/api/graphql/user.gql.ts"],"sourcesContent":["import { ErrorResponse, NotFoundResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/users/GetUser/index.js\";\nimport NotAuthorizedResponse from \"@webiny/api-core/graphql/security/NotAuthorizedResponse.js\";\nimport { CreateUserUseCase } from \"~/api/features/CreateUser/index.js\";\nimport { UpdateUserUseCase } from \"~/api/features/UpdateUser/index.js\";\nimport { DeleteUserUseCase } from \"~/api/features/DeleteUser/index.js\";\n\nclass AdminUserSchemaImpl implements CoreGraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"cognito/AdminUserSchemaImpl\");\n\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(/* GraphQL */ `\n \"\"\"\n This input type is used by administrators to create other user's accounts within the same tenant.\n \"\"\"\n input AdminUsersCreateInput {\n email: String!\n firstName: String!\n lastName: String!\n password: String!\n avatar: JSON\n roles: [RefInput!]\n teams: [RefInput!]\n }\n\n \"\"\"\n This input type is used by administrators to update other user's accounts within the same tenant.\n \"\"\"\n input AdminUsersUpdateInput {\n email: String\n firstName: String\n lastName: String\n password: String\n avatar: JSON\n roles: [RefInput!]\n teams: [RefInput!]\n }\n\n \"\"\"\n This input type is used by the user who is updating his own account\n \"\"\"\n input AdminUsersCurrentUserInput {\n email: String\n firstName: String\n lastName: String\n password: String\n avatar: JSON\n }\n\n extend type AdminUsersMutation {\n updateCurrentUser(data: AdminUsersCurrentUserInput!): AdminUsersResponse\n\n createUser(data: AdminUsersCreateInput!): AdminUsersResponse\n\n updateUser(id: ID!, data: AdminUsersUpdateInput!): AdminUsersResponse\n\n deleteUser(id: ID!): AdminUsersBooleanResponse\n }\n `);\n\n builder.addResolver({\n path: \"AdminUsersMutation.updateCurrentUser\",\n dependencies: [IdentityContext, GetUserUseCase, UpdateUserUseCase],\n resolver: (\n identityContext: IdentityContext.Interface,\n getUserUseCase: GetUserUseCase.Interface,\n updateUserUseCase: UpdateUserUseCase.Interface\n ) => {\n return async ({ args }) => {\n const identity = identityContext.getIdentity();\n if (!identity.isAdmin()) {\n return new NotAuthorizedResponse();\n }\n\n // Current user might not have permissions for `adminUsers`.\n return await identityContext.withoutAuthorization(async () => {\n const getUserResult = await getUserUseCase.execute({ id: identity.id });\n if (getUserResult.isFail()) {\n // TODO: check if current identity belongs to a different tenant.\n // TODO: If so, switch to that other tenant, and update his profile there.\n return new NotFoundResponse(\"User not found!\");\n }\n\n const user = getUserResult.value;\n\n // TODO: UpdateCurrentUser should be a dedicated use case\n const updateResult = await updateUserUseCase.execute(user.id, args.data);\n if (updateResult.isFail()) {\n return new ErrorResponse({\n message: updateResult.error.message,\n code: updateResult.error.code,\n data: updateResult.error.data\n });\n }\n\n return new Response(updateResult.value);\n });\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.createUser\",\n dependencies: [CreateUserUseCase],\n resolver: (createUserUseCase: CreateUserUseCase.Interface) => {\n return async ({ args }) => {\n const result = await createUserUseCase.execute(args.data);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code,\n data: result.error.data\n });\n }\n\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.updateUser\",\n dependencies: [UpdateUserUseCase, IdentityContext],\n resolver: (\n updateUserUseCase: UpdateUserUseCase.Interface,\n identityContext: IdentityContext.Interface\n ) => {\n return async ({ args }) => {\n if (args.id === identityContext.getIdentity().id) {\n return new ErrorResponse({\n message:\n \"You're not allowed to update your own account using this API.\",\n code: \"AdminUser/GraphQL/UpdateSelf\"\n });\n }\n\n const result = await updateUserUseCase.execute(args.id, args.data);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code\n });\n }\n\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersMutation.deleteUser\",\n dependencies: [DeleteUserUseCase],\n resolver: (deleteUserUseCase: DeleteUserUseCase.Interface) => {\n return async ({ args }) => {\n const result = await deleteUserUseCase.execute(args.id);\n if (result.isFail()) {\n return new ErrorResponse({\n message: result.error.message,\n code: result.error.code,\n data: result.error.data\n });\n }\n\n return new Response(true);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const AdminUsersSchema = CoreGraphQLSchemaFactory.createImplementation({\n implementation: AdminUserSchemaImpl,\n dependencies: []\n});\n"],"names":["AdminUserSchemaImpl","builder","IdentityContext","GetUserUseCase","UpdateUserUseCase","identityContext","getUserUseCase","updateUserUseCase","args","identity","NotAuthorizedResponse","getUserResult","NotFoundResponse","user","updateResult","ErrorResponse","Response","CreateUserUseCase","createUserUseCase","result","DeleteUserUseCase","deleteUserUseCase","staticSchemaKey","AdminUsersSchema","CoreGraphQLSchemaFactory"],"mappings":";;;;;;;;;AAUA,MAAMA;IAGF,MAAM,QACFC,OAA+C,EAChB;QAC/BA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA+CnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;gBAAiBC;gBAAgBC;aAAkB;YAClE,UAAU,CACNC,iBACAC,gBACAC,oBAEO,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMC,WAAWJ,gBAAgB,WAAW;oBAC5C,IAAI,CAACI,SAAS,OAAO,IACjB,OAAO,IAAIC;oBAIf,OAAO,MAAML,gBAAgB,oBAAoB,CAAC;wBAC9C,MAAMM,gBAAgB,MAAML,eAAe,OAAO,CAAC;4BAAE,IAAIG,SAAS,EAAE;wBAAC;wBACrE,IAAIE,cAAc,MAAM,IAGpB,OAAO,IAAIC,iBAAiB;wBAGhC,MAAMC,OAAOF,cAAc,KAAK;wBAGhC,MAAMG,eAAe,MAAMP,kBAAkB,OAAO,CAACM,KAAK,EAAE,EAAEL,KAAK,IAAI;wBACvE,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C,oBACA,OAAO,EAAEb,IAAI,EAAE;oBAClB,MAAMW,SAAS,MAAME,kBAAkB,OAAO,CAACb,KAAK,EAAE;oBACtD,IAAIW,OAAO,MAAM,IACb,OAAO,IAAIJ,cAAc;wBACrB,SAASI,OAAO,KAAK,CAAC,OAAO;wBAC7B,MAAMA,OAAO,KAAK,CAAC,IAAI;wBACvB,MAAMA,OAAO,KAAK,CAAC,IAAI;oBAC3B;oBAGJ,OAAO,IAAIH,SAAS;gBACxB;QAER;QAEA,OAAOf;IACX;;aAnKO,YAAY,GAAGqB,gBAAgB;;AAoK1C;AAEO,MAAMC,mBAAmBC,yBAAyB,oBAAoB,CAAC;IAC1E,gBAAgBxB;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -3,6 +3,6 @@ declare class CognitoFederationPulumiImpl implements CorePulumi.Interface {
|
|
|
3
3
|
execute(app: CorePulumi.Params): void;
|
|
4
4
|
}
|
|
5
5
|
declare const _default: typeof CognitoFederationPulumiImpl & {
|
|
6
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-aws/abstractions").ICorePulumi>;
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/project-aws/abstractions/features/pulumi/CorePulumi").ICorePulumi>;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/cognito",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.a85ef555b2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -13,35 +13,32 @@
|
|
|
13
13
|
"description": "Security plugins for Cognito",
|
|
14
14
|
"author": "Webiny Ltd.",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webiny/admin-ui": "0.0.0-unstable.
|
|
17
|
-
"@webiny/api-core": "0.0.0-unstable.
|
|
18
|
-
"@webiny/
|
|
19
|
-
"@webiny/app
|
|
20
|
-
"@webiny/
|
|
21
|
-
"@webiny/
|
|
22
|
-
"@webiny/feature": "0.0.0-unstable.
|
|
23
|
-
"@webiny/form": "0.0.0-unstable.
|
|
24
|
-
"@webiny/
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"
|
|
29
|
-
"@webiny/validation": "0.0.0-unstable.a4f3e4ea8b",
|
|
30
|
-
"aws-amplify": "6.19.0",
|
|
16
|
+
"@webiny/admin-ui": "0.0.0-unstable.a85ef555b2",
|
|
17
|
+
"@webiny/api-core": "0.0.0-unstable.a85ef555b2",
|
|
18
|
+
"@webiny/api-graphql": "0.0.0-unstable.a85ef555b2",
|
|
19
|
+
"@webiny/app": "0.0.0-unstable.a85ef555b2",
|
|
20
|
+
"@webiny/app-admin": "0.0.0-unstable.a85ef555b2",
|
|
21
|
+
"@webiny/aws-sdk": "0.0.0-unstable.a85ef555b2",
|
|
22
|
+
"@webiny/feature": "0.0.0-unstable.a85ef555b2",
|
|
23
|
+
"@webiny/form": "0.0.0-unstable.a85ef555b2",
|
|
24
|
+
"@webiny/project": "0.0.0-unstable.a85ef555b2",
|
|
25
|
+
"@webiny/project-aws": "0.0.0-unstable.a85ef555b2",
|
|
26
|
+
"@webiny/react-properties": "0.0.0-unstable.a85ef555b2",
|
|
27
|
+
"@webiny/validation": "0.0.0-unstable.a85ef555b2",
|
|
28
|
+
"aws-amplify": "6.20.0",
|
|
31
29
|
"graphql": "16.14.2",
|
|
32
30
|
"jsonwebtoken": "9.0.3",
|
|
33
31
|
"lodash": "4.18.1",
|
|
34
|
-
"mobx": "
|
|
35
|
-
"mobx-react-lite": "
|
|
32
|
+
"mobx": "7.0.3",
|
|
33
|
+
"mobx-react-lite": "5.0.3",
|
|
36
34
|
"react": "18.3.1",
|
|
37
35
|
"zod": "4.4.3"
|
|
38
36
|
},
|
|
39
37
|
"devDependencies": {
|
|
40
38
|
"@types/react": "18.3.31",
|
|
41
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
42
|
-
"@webiny/
|
|
43
|
-
"
|
|
44
|
-
"vitest": "4.1.10"
|
|
39
|
+
"@webiny/build-tools": "0.0.0-unstable.a85ef555b2",
|
|
40
|
+
"@webiny/wcp": "0.0.0-unstable.a85ef555b2",
|
|
41
|
+
"vitest": "4.1.11"
|
|
45
42
|
},
|
|
46
43
|
"publishConfig": {
|
|
47
44
|
"access": "public"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import react from "react";
|
|
2
|
-
import { AdminConfig } from "@webiny/app-admin";
|
|
3
|
-
import { ReactComponent } from "@webiny/icons/group.svg";
|
|
4
|
-
import { COGNITO_PERMISSIONS_SCHEMA } from "./domain/permissionsSchema.js";
|
|
5
|
-
const { Security: Security } = AdminConfig;
|
|
6
|
-
const SecurityPermission = ()=>/*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Security.Permissions, {
|
|
7
|
-
name: "admin-users",
|
|
8
|
-
title: "Admin Users",
|
|
9
|
-
description: "Manage Admin Users permissions.",
|
|
10
|
-
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
11
|
-
schema: COGNITO_PERMISSIONS_SCHEMA
|
|
12
|
-
}));
|
|
13
|
-
export { SecurityPermission };
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=SecurityPermission.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin/SecurityPermission.js","sources":["../../src/admin/SecurityPermission.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"@webiny/app-admin\";\nimport { ReactComponent as PermissionsIcon } from \"@webiny/icons/group.svg\";\nimport { COGNITO_PERMISSIONS_SCHEMA } from \"~/admin/domain/permissionsSchema.js\";\n\nconst { Security } = AdminConfig;\n\nexport const SecurityPermission = () => {\n return (\n <AdminConfig>\n <Security.Permissions\n name=\"admin-users\"\n title=\"Admin Users\"\n description=\"Manage Admin Users permissions.\"\n icon={<PermissionsIcon />}\n schema={COGNITO_PERMISSIONS_SCHEMA}\n />\n </AdminConfig>\n );\n};\n"],"names":["Security","AdminConfig","SecurityPermission","PermissionsIcon","COGNITO_PERMISSIONS_SCHEMA"],"mappings":";;;;AAKA,MAAM,EAAEA,UAAAA,QAAQ,EAAE,GAAGC;AAEd,MAAMC,qBAAqB,IACvB,WAAP,GACI,oBAACD,aAAWA,MAAAA,WAAAA,GACR,oBAACD,SAAS,WAAW;QACjB,MAAK;QACL,OAAM;QACN,aAAY;QACZ,oBAAM,oBAACG,gBAAeA;QACtB,QAAQC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const COGNITO_PERMISSIONS_SCHEMA: {
|
|
2
|
-
readonly prefix: "adminUsers";
|
|
3
|
-
readonly fullAccess: true;
|
|
4
|
-
readonly entities: [{
|
|
5
|
-
readonly id: "user";
|
|
6
|
-
readonly title: "Users";
|
|
7
|
-
readonly permission: "adminUsers.user";
|
|
8
|
-
readonly scopes: ["full"];
|
|
9
|
-
}];
|
|
10
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createPermissionSchema } from "@webiny/app-admin";
|
|
2
|
-
const COGNITO_PERMISSIONS_SCHEMA = createPermissionSchema({
|
|
3
|
-
prefix: "adminUsers",
|
|
4
|
-
fullAccess: true,
|
|
5
|
-
entities: [
|
|
6
|
-
{
|
|
7
|
-
id: "user",
|
|
8
|
-
title: "Users",
|
|
9
|
-
permission: "adminUsers.user",
|
|
10
|
-
scopes: [
|
|
11
|
-
"full"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
});
|
|
16
|
-
export { COGNITO_PERMISSIONS_SCHEMA };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=permissionsSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin/domain/permissionsSchema.js","sources":["../../../src/admin/domain/permissionsSchema.ts"],"sourcesContent":["import { createPermissionSchema } from \"@webiny/app-admin\";\n\nexport const COGNITO_PERMISSIONS_SCHEMA = createPermissionSchema({\n prefix: \"adminUsers\",\n fullAccess: true,\n entities: [\n {\n id: \"user\",\n title: \"Users\",\n permission: \"adminUsers.user\",\n scopes: [\"full\"]\n }\n ]\n});\n"],"names":["COGNITO_PERMISSIONS_SCHEMA","createPermissionSchema"],"mappings":";AAEO,MAAMA,6BAA6BC,uBAAuB;IAC7D,QAAQ;IACR,YAAY;IACZ,UAAU;QACN;YACI,IAAI;YACJ,OAAO;YACP,YAAY;YACZ,QAAQ;gBAAC;aAAO;QACpB;KACH;AACL"}
|
|
@@ -1,11 +0,0 @@
|
|
|
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 {};
|