@floristcloud/api-lib 1.2.45 → 1.2.46

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.
@@ -94,6 +94,8 @@ exports.ERRORS = {
94
94
  USER_MISSING_EMAIL_OR_PHONE: { code: 'U012', message: 'Не указан email или телефон ', httpCode: 400 },
95
95
  USER_ROLE_MISMATCH_CLIENT: { code: 'U013', message: 'User does not have BUYER role required for client login', httpCode: 403 },
96
96
  USER_ROLE_MISMATCH_EMPLOYEE: { code: 'U014', message: 'User does not have employee role required for employee login', httpCode: 403 },
97
+ USER_CANNOT_DEACTIVATE_SELF: { code: 'U015', message: 'You cannot deactivate your own account', httpCode: 400 },
98
+ USER_CANNOT_REMOVE_OWN_ADMIN_ROLE: { code: 'U016', message: 'You cannot remove the ADMIN role from your own account', httpCode: 400 },
97
99
  //AUTH
98
100
  FAILED_TO_UPDATE: { code: 'A010', message: 'User update failed', httpCode: 500 },
99
101
  RESTORE_TOKEN_ERROR: { code: 'A012', message: 'Invalid recovery token', httpCode: 500 },
package/constant/error.ts CHANGED
@@ -97,6 +97,8 @@ export const ERRORS = {
97
97
  USER_MISSING_EMAIL_OR_PHONE: { code: 'U012', message: 'Не указан email или телефон ', httpCode: 400 },
98
98
  USER_ROLE_MISMATCH_CLIENT: { code: 'U013', message: 'User does not have BUYER role required for client login', httpCode: 403 },
99
99
  USER_ROLE_MISMATCH_EMPLOYEE: { code: 'U014', message: 'User does not have employee role required for employee login', httpCode: 403 },
100
+ USER_CANNOT_DEACTIVATE_SELF: { code: 'U015', message: 'You cannot deactivate your own account', httpCode: 400 },
101
+ USER_CANNOT_REMOVE_OWN_ADMIN_ROLE: { code: 'U016', message: 'You cannot remove the ADMIN role from your own account', httpCode: 400 },
100
102
 
101
103
  //AUTH
102
104
  FAILED_TO_UPDATE: { code: 'A010', message: 'User update failed', httpCode: 500 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.45",
3
+ "version": "1.2.46",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {