@webiny/cognito 6.0.0 → 6.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cognito.d.ts +1 -5
- package/api/features/CreateUser/CreateUserUseCase.js +1 -1
- package/api/features/CreateUser/CreateUserUseCase.js.map +1 -1
- package/api/features/CreateUser/schema.d.ts +4 -36
- package/api/features/UpdateUser/UpdateUserUseCase.js +1 -1
- package/api/features/UpdateUser/UpdateUserUseCase.js.map +1 -1
- package/api/features/UpdateUser/schema.d.ts +4 -34
- package/package.json +24 -24
package/Cognito.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const Cognito: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<z.ZodObject<{
|
|
3
3
|
apiConfig: z.ZodOptional<z.ZodString>;
|
|
4
|
-
},
|
|
5
|
-
apiConfig?: string | undefined;
|
|
6
|
-
}, {
|
|
7
|
-
apiConfig?: string | undefined;
|
|
8
|
-
}>>;
|
|
4
|
+
}, z.core.$strip>>;
|
|
@@ -26,7 +26,7 @@ class CreateUserUseCaseImpl {
|
|
|
26
26
|
// Validate input (including password)
|
|
27
27
|
const validation = createAdminUserValidation.safeParse(input);
|
|
28
28
|
if (!validation.success) {
|
|
29
|
-
return Result.fail(new UserValidationError(validation.error.
|
|
29
|
+
return Result.fail(new UserValidationError(validation.error.issues[0].message));
|
|
30
30
|
}
|
|
31
31
|
const data = validation.data;
|
|
32
32
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Result","AdminUsersRepository","NotAuthorizedError","UserValidationError","IdentityContext","CreateUserUseCase","CoreCreateUser","ListUsersUseCase","UseCaseAbstraction","Username","CognitoAccountExistsError","CognitoCreateUserError","createAdminUserValidation","CognitoService","CreateUserUseCaseImpl","constructor","identityContext","cognitoService","createUserUseCase","listUsersUseCase","repository","execute","input","permission","getPermission","fail","validation","safeParse","success","error","
|
|
1
|
+
{"version":3,"names":["Result","AdminUsersRepository","NotAuthorizedError","UserValidationError","IdentityContext","CreateUserUseCase","CoreCreateUser","ListUsersUseCase","UseCaseAbstraction","Username","CognitoAccountExistsError","CognitoCreateUserError","createAdminUserValidation","CognitoService","CreateUserUseCaseImpl","constructor","identityContext","cognitoService","createUserUseCase","listUsersUseCase","repository","execute","input","permission","getPermission","fail","validation","safeParse","success","error","issues","message","data","password","userDataWithoutPassword","username","fromUser","existingUserResult","get","email","isOk","user","undefined","userExists","createUserResult","isFail","value","createUser","temporaryPassword","attributes","givenName","firstName","familyName","lastName","preferredUsername","customId","id","setEmailVerified","usersResult","console","users","length","setPermanentPassword","ok","cognitoError","delete","rollbackError","createImplementation","implementation","dependencies"],"sources":["CreateUserUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { AdminUsersRepository } from \"@webiny/api-core/features/users/shared/abstractions.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 { CreateUserUseCase as CoreCreateUser } from \"@webiny/api-core/features/users/CreateUser/index.js\";\nimport { ListUsersUseCase } from \"@webiny/api-core/features/users/ListUsers/index.js\";\n\nimport { CreateUserUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { Username } from \"~/api/domain/Username.js\";\nimport { CognitoAccountExistsError, CognitoCreateUserError } from \"~/api/domain/errors.js\";\nimport { createAdminUserValidation } from \"./schema.js\";\nimport type { CreateAdminUserInput } from \"./abstractions.js\";\nimport { CognitoService } from \"~/api/features/CognitoService/index.js\";\n\nclass CreateUserUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private identityContext: IdentityContext.Interface,\n private cognitoService: CognitoService.Interface,\n private createUserUseCase: CoreCreateUser.Interface,\n private listUsersUseCase: ListUsersUseCase.Interface,\n private repository: AdminUsersRepository.Interface\n ) {}\n\n async execute(\n input: CreateAdminUserInput\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 = createAdminUserValidation.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 const username = Username.fromUser(data);\n\n // Check if user exists in database (faster than Cognito check)\n const existingUserResult = await this.repository.get({ email: data.email });\n if (existingUserResult.isOk()) {\n return Result.fail(new CognitoAccountExistsError(data.email));\n }\n\n let user: AdminUser | undefined = undefined;\n\n try {\n // Check if user exists in Cognito\n const userExists = await this.cognitoService.userExists(username);\n if (userExists) {\n return Result.fail(new CognitoAccountExistsError(data.email));\n }\n // Create user in api-core\n const createUserResult = await this.createUserUseCase.execute(userDataWithoutPassword);\n if (createUserResult.isFail()) {\n return Result.fail(createUserResult.error);\n }\n\n user = createUserResult.value;\n\n // Create user in Cognito\n await this.cognitoService.createUser({\n username,\n temporaryPassword: password,\n attributes: {\n givenName: data.firstName,\n familyName: data.lastName,\n preferredUsername: username,\n email: username,\n customId: user.id\n }\n });\n\n // Set email as verified\n await this.cognitoService.setEmailVerified(username);\n\n // Check if this is the first user in the system, and if so, set permanent password\n const usersResult = await this.listUsersUseCase.execute();\n if (usersResult.isFail()) {\n // Log error but don't fail the operation\n console.error(`Failed to list users: ${usersResult.error.message}`);\n } else {\n const users = usersResult.value;\n if (users.length <= 1) {\n // This is the first user, set permanent password\n await this.cognitoService.setPermanentPassword(username, password);\n }\n }\n\n return Result.ok(user);\n } catch (cognitoError) {\n if (user) {\n // Rollback: Delete user from api-core if Cognito creation failed\n try {\n await this.repository.delete(user);\n } catch (rollbackError) {\n console.error(\"Failed to rollback user creation:\", rollbackError);\n }\n }\n return Result.fail(new CognitoCreateUserError(cognitoError as Error));\n }\n }\n}\n\nexport const CreateUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: CreateUserUseCaseImpl,\n dependencies: [\n IdentityContext,\n CognitoService,\n CoreCreateUser,\n ListUsersUseCase,\n AdminUsersRepository\n ]\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,oBAAoB,QAAQ,wDAAwD;AAC7F,SACIC,kBAAkB,EAClBC,mBAAmB,QAChB,kDAAkD;AAEzD,SAASC,eAAe,QAAQ,6DAA6D;AAC7F,SAASC,iBAAiB,IAAIC,cAAc,QAAQ,qDAAqD;AACzG,SAASC,gBAAgB,QAAQ,oDAAoD;AAErF,SAASF,iBAAiB,IAAIG,kBAAkB;AAChD,SAASC,QAAQ;AACjB,SAASC,yBAAyB,EAAEC,sBAAsB;AAC1D,SAASC,yBAAyB;AAElC,SAASC,cAAc;AAEvB,MAAMC,qBAAqB,CAAyC;EAChEC,WAAWA,CACCC,eAA0C,EAC1CC,cAAwC,EACxCC,iBAA2C,EAC3CC,gBAA4C,EAC5CC,UAA0C,EACpD;IAAA,KALUJ,eAA0C,GAA1CA,eAA0C;IAAA,KAC1CC,cAAwC,GAAxCA,cAAwC;IAAA,KACxCC,iBAA2C,GAA3CA,iBAA2C;IAAA,KAC3CC,gBAA4C,GAA5CA,gBAA4C;IAAA,KAC5CC,UAA0C,GAA1CA,UAA0C;EACnD;EAEH,MAAMC,OAAOA,CACTC,KAA2B,EACyB;IACpD,MAAMC,UAAU,GAAG,MAAM,IAAI,CAACP,eAAe,CAACQ,aAAa,CAAC,iBAAiB,CAAC;IAC9E,IAAI,CAACD,UAAU,EAAE;MACb,OAAOvB,MAAM,CAACyB,IAAI,CAAC,IAAIvB,kBAAkB,CAAC,CAAC,CAAC;IAChD;;IAEA;IACA,MAAMwB,UAAU,GAAGd,yBAAyB,CAACe,SAAS,CAACL,KAAK,CAAC;IAC7D,IAAI,CAACI,UAAU,CAACE,OAAO,EAAE;MACrB,OAAO5B,MA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EACrCuD,YAAY,EAAE,CACVjE,eAAe,EACfS,cAAc,EACdP,cAAc,EACdC,gBAAgB,EAChBN,oBAAoB;AAE5B,CAAC,CAAC","ignoreList":[]}
|
|
@@ -9,39 +9,7 @@ export declare const createAdminUserValidation: z.ZodObject<{
|
|
|
9
9
|
avatar: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
10
10
|
id: z.ZodString;
|
|
11
11
|
src: z.ZodString;
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
src: string;
|
|
17
|
-
id: string;
|
|
18
|
-
}>>>;
|
|
19
|
-
roles: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
20
|
-
teams: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
21
|
-
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
roles: string[];
|
|
23
|
-
teams: string[];
|
|
24
|
-
email: string;
|
|
25
|
-
password: string;
|
|
26
|
-
displayName?: string | undefined;
|
|
27
|
-
id?: string | undefined;
|
|
28
|
-
firstName?: string | undefined;
|
|
29
|
-
lastName?: string | undefined;
|
|
30
|
-
avatar?: {
|
|
31
|
-
src: string;
|
|
32
|
-
id: string;
|
|
33
|
-
} | null | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
email: string;
|
|
36
|
-
password: string;
|
|
37
|
-
displayName?: string | undefined;
|
|
38
|
-
id?: string | undefined;
|
|
39
|
-
roles?: string[] | undefined;
|
|
40
|
-
teams?: string[] | undefined;
|
|
41
|
-
firstName?: string | undefined;
|
|
42
|
-
lastName?: string | undefined;
|
|
43
|
-
avatar?: {
|
|
44
|
-
src: string;
|
|
45
|
-
id: string;
|
|
46
|
-
} | null | undefined;
|
|
47
|
-
}>;
|
|
12
|
+
}, z.core.$strip>>>;
|
|
13
|
+
roles: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
14
|
+
teams: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
@@ -30,7 +30,7 @@ class UpdateUserUseCaseImpl {
|
|
|
30
30
|
// Validate input (including password)
|
|
31
31
|
const validation = updateAdminUserValidation.safeParse(input);
|
|
32
32
|
if (!validation.success) {
|
|
33
|
-
return Result.fail(new UserValidationError(validation.error.
|
|
33
|
+
return Result.fail(new UserValidationError(validation.error.issues[0].message));
|
|
34
34
|
}
|
|
35
35
|
const data = validation.data;
|
|
36
36
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Result","UpdateUserUseCase","CoreUpdateUser","GetUserUseCase","NotAuthorizedError","UserValidationError","IdentityContext","UseCaseAbstraction","Username","CognitoUpdateUserError","updateAdminUserValidation","CognitoService","defaultUpdateAttributes","family_name","given_name","preferred_username","UpdateUserUseCaseImpl","constructor","identityContext","cognitoService","updateUserUseCase","getUserUseCase","updateAttributes","execute","id","input","permission","getPermission","fail","validation","safeParse","success","error","
|
|
1
|
+
{"version":3,"names":["Result","UpdateUserUseCase","CoreUpdateUser","GetUserUseCase","NotAuthorizedError","UserValidationError","IdentityContext","UseCaseAbstraction","Username","CognitoUpdateUserError","updateAdminUserValidation","CognitoService","defaultUpdateAttributes","family_name","given_name","preferred_username","UpdateUserUseCaseImpl","constructor","identityContext","cognitoService","updateUserUseCase","getUserUseCase","updateAttributes","execute","id","input","permission","getPermission","fail","validation","safeParse","success","error","issues","message","data","password","userDataWithoutPassword","getUserResult","isFail","originalUser","value","updateUserResult","updatedUser","attributes","Object","keys","forEach","attr","mappedAttr","attrValue","email","updateUserAttributes","fromUser","setPermanentPassword","ok","cognitoError","createImplementation","implementation","dependencies"],"sources":["UpdateUserUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { UpdateUserUseCase as CoreUpdateUser } from \"@webiny/api-core/features/UpdateUser\";\nimport { GetUserUseCase } from \"@webiny/api-core/features/GetUser\";\nimport {\n NotAuthorizedError,\n UserValidationError\n} from \"@webiny/api-core/features/users/shared/errors.js\";\nimport type { AdminUser } from \"@webiny/api-core/types/users.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { UpdateUserUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { Username } from \"~/api/domain/Username.js\";\nimport { CognitoUpdateUserError } from \"~/api/domain/errors.js\";\nimport { updateAdminUserValidation } from \"./schema.js\";\nimport type { UpdateAdminUserInput } from \"./abstractions.js\";\nimport { CognitoService } from \"~/api/features/CognitoService/index.js\";\n\ntype MappedAttrType = (user: AdminUser) => string | keyof AdminUser;\n\nconst defaultUpdateAttributes = {\n family_name: \"lastName\",\n given_name: \"firstName\",\n preferred_username: \"email\"\n};\n\nclass UpdateUserUseCaseImpl implements UseCaseAbstraction.Interface {\n private updateAttributes: Record<string, string | MappedAttrType>;\n\n constructor(\n private identityContext: IdentityContext.Interface,\n private cognitoService: CognitoService.Interface,\n private updateUserUseCase: CoreUpdateUser.Interface,\n private getUserUseCase: GetUserUseCase.Interface\n ) {\n this.updateAttributes = defaultUpdateAttributes;\n }\n\n async execute(\n id: string,\n input: UpdateAdminUserInput\n ): Promise<Result<AdminUser, UseCaseAbstraction.Error>> {\n const permission = await this.identityContext.getPermission(\"adminUsers.user\");\n if (!permission) {\n return Result.fail(new NotAuthorizedError());\n }\n\n // Validate input (including password)\n const validation = updateAdminUserValidation.safeParse(input);\n if (!validation.success) {\n return Result.fail(new UserValidationError(validation.error.issues[0].message));\n }\n\n const data = validation.data;\n const { password, ...userDataWithoutPassword } = data;\n\n // Get original user to know the email before update\n const getUserResult = await this.getUserUseCase.execute({ id });\n if (getUserResult.isFail()) {\n return Result.fail(getUserResult.error);\n }\n\n const originalUser = getUserResult.value;\n\n // Update user in api-core\n const updateUserResult = await this.updateUserUseCase.execute(id, userDataWithoutPassword);\n if (updateUserResult.isFail()) {\n return Result.fail(updateUserResult.error);\n }\n\n const updatedUser = updateUserResult.value;\n\n // Update user in Cognito\n try {\n // Build new attributes\n const attributes: Record<string, string> = {};\n\n Object.keys(this.updateAttributes).forEach(attr => {\n const mappedAttr = this.updateAttributes[\n attr as keyof typeof this.updateAttributes\n ] as MappedAttrType;\n const attrValue =\n typeof mappedAttr === \"function\"\n ? mappedAttr(updatedUser)\n : updatedUser[mappedAttr];\n attributes[attr] = attrValue;\n });\n\n // If email changed, set email_verified to true\n if (originalUser.email !== updatedUser.email) {\n attributes[\"email_verified\"] = \"true\";\n }\n\n await this.cognitoService.updateUserAttributes(\n Username.fromUser(originalUser),\n attributes\n );\n\n // Update password if provided\n if (password) {\n await this.cognitoService.setPermanentPassword(\n Username.fromUser(updatedUser),\n password\n );\n }\n\n return Result.ok(updatedUser);\n } catch (cognitoError) {\n return Result.fail(new CognitoUpdateUserError(cognitoError as Error));\n }\n }\n}\n\nexport const UpdateUserUseCase = UseCaseAbstraction.createImplementation({\n implementation: UpdateUserUseCaseImpl,\n dependencies: [IdentityContext, CognitoService, CoreUpdateUser, GetUserUseCase]\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,iBAAiB,IAAIC,cAAc,QAAQ,sCAAsC;AAC1F,SAASC,cAAc,QAAQ,mCAAmC;AAClE,SACIC,kBAAkB,EAClBC,mBAAmB,QAChB,kDAAkD;AAEzD,SAASC,eAAe,QAAQ,6DAA6D;AAC7F,SAASL,iBAAiB,IAAIM,kBAAkB;AAChD,SAASC,QAAQ;AACjB,SAASC,sBAAsB;AAC/B,SAASC,yBAAyB;AAElC,SAASC,cAAc;AAIvB,MAAMC,uBAAuB,GAAG;EAC5BC,WAAW,EAAE,UAAU;EACvBC,UAAU,EAAE,WAAW;EACvBC,kBAAkB,EAAE;AACxB,CAAC;AAED,MAAMC,qBAAqB,CAAyC;EAGhEC,WAAWA,CACCC,eAA0C,EAC1CC,cAAwC,EACxCC,iBAA2C,EAC3CC,cAAwC,EAClD;IAAA,KAJUH,eAA0C,GAA1CA,eAA0C;IAA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,EAAEC,cAAc;AAClF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -8,37 +8,7 @@ export declare const updateAdminUserValidation: z.ZodObject<{
|
|
|
8
8
|
avatar: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
9
9
|
id: z.ZodString;
|
|
10
10
|
src: z.ZodString;
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
src: string;
|
|
16
|
-
id: string;
|
|
17
|
-
}>>>;
|
|
18
|
-
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
-
teams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
displayName?: string | undefined;
|
|
22
|
-
roles?: string[] | undefined;
|
|
23
|
-
teams?: string[] | undefined;
|
|
24
|
-
firstName?: string | undefined;
|
|
25
|
-
lastName?: string | undefined;
|
|
26
|
-
email?: string | undefined;
|
|
27
|
-
avatar?: {
|
|
28
|
-
src: string;
|
|
29
|
-
id: string;
|
|
30
|
-
} | null | undefined;
|
|
31
|
-
password?: string | undefined;
|
|
32
|
-
}, {
|
|
33
|
-
displayName?: string | undefined;
|
|
34
|
-
roles?: string[] | undefined;
|
|
35
|
-
teams?: string[] | undefined;
|
|
36
|
-
firstName?: string | undefined;
|
|
37
|
-
lastName?: string | undefined;
|
|
38
|
-
email?: string | undefined;
|
|
39
|
-
avatar?: {
|
|
40
|
-
src: string;
|
|
41
|
-
id: string;
|
|
42
|
-
} | null | undefined;
|
|
43
|
-
password?: string | undefined;
|
|
44
|
-
}>;
|
|
11
|
+
}, z.core.$strip>>>;
|
|
12
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
teams: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
}, z.core.$strip>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/cognito",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.1.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,40 +9,40 @@
|
|
|
9
9
|
"author": "Webiny Ltd.",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@apollo/react-hooks": "3.1.5",
|
|
12
|
-
"@aws-amplify/auth": "5.6.
|
|
13
|
-
"@webiny/admin-ui": "6.0.
|
|
14
|
-
"@webiny/api-core": "6.0.
|
|
15
|
-
"@webiny/app": "6.0.
|
|
16
|
-
"@webiny/app-admin": "6.0.
|
|
17
|
-
"@webiny/aws-sdk": "6.0.
|
|
18
|
-
"@webiny/di": "
|
|
19
|
-
"@webiny/feature": "6.0.
|
|
20
|
-
"@webiny/form": "6.0.
|
|
21
|
-
"@webiny/handler-graphql": "6.0.
|
|
22
|
-
"@webiny/icons": "6.0.
|
|
23
|
-
"@webiny/project": "6.0.
|
|
24
|
-
"@webiny/project-aws": "6.0.
|
|
25
|
-
"@webiny/ui": "6.0.
|
|
26
|
-
"@webiny/validation": "6.0.
|
|
27
|
-
"graphql": "16.13.
|
|
12
|
+
"@aws-amplify/auth": "5.6.19",
|
|
13
|
+
"@webiny/admin-ui": "6.1.0-beta.1",
|
|
14
|
+
"@webiny/api-core": "6.1.0-beta.1",
|
|
15
|
+
"@webiny/app": "6.1.0-beta.1",
|
|
16
|
+
"@webiny/app-admin": "6.1.0-beta.1",
|
|
17
|
+
"@webiny/aws-sdk": "6.1.0-beta.1",
|
|
18
|
+
"@webiny/di": "0.2.3",
|
|
19
|
+
"@webiny/feature": "6.1.0-beta.1",
|
|
20
|
+
"@webiny/form": "6.1.0-beta.1",
|
|
21
|
+
"@webiny/handler-graphql": "6.1.0-beta.1",
|
|
22
|
+
"@webiny/icons": "6.1.0-beta.1",
|
|
23
|
+
"@webiny/project": "6.1.0-beta.1",
|
|
24
|
+
"@webiny/project-aws": "6.1.0-beta.1",
|
|
25
|
+
"@webiny/ui": "6.1.0-beta.1",
|
|
26
|
+
"@webiny/validation": "6.1.0-beta.1",
|
|
27
|
+
"graphql": "16.13.2",
|
|
28
28
|
"graphql-tag": "2.12.6",
|
|
29
29
|
"jsonwebtoken": "9.0.3",
|
|
30
30
|
"lodash": "4.17.23",
|
|
31
31
|
"mobx": "6.15.0",
|
|
32
|
-
"mobx-react-lite": "
|
|
32
|
+
"mobx-react-lite": "4.1.1",
|
|
33
33
|
"react": "18.2.0",
|
|
34
|
-
"zod": "3.
|
|
34
|
+
"zod": "4.3.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/react": "18.2.79",
|
|
38
|
-
"@webiny/build-tools": "6.0.
|
|
39
|
-
"@webiny/project-utils": "6.0.
|
|
40
|
-
"@webiny/wcp": "6.0.
|
|
41
|
-
"vitest": "4.
|
|
38
|
+
"@webiny/build-tools": "6.1.0-beta.1",
|
|
39
|
+
"@webiny/project-utils": "6.1.0-beta.1",
|
|
40
|
+
"@webiny/wcp": "6.1.0-beta.1",
|
|
41
|
+
"vitest": "4.1.2"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public",
|
|
45
45
|
"directory": "dist"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "3c1293ba17a14f239fb1cbf5d80cd66846849309"
|
|
48
48
|
}
|