@purpleschool/gptbot 0.7.27 → 0.7.28
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/api/controllers/http/user.ts +1 -0
- package/api/routes.ts +1 -0
- package/build/api/controllers/http/user.js +1 -0
- package/build/api/routes.js +1 -0
- package/build/commands/user/delete-account.command.js +12 -0
- package/build/commands/user/find-users-by-criteria.command.js +1 -0
- package/build/commands/user/index.js +1 -0
- package/build/constants/errors/errors.js +15 -0
- package/build/constants/user/enums/user-status.js +1 -0
- package/build/models/user.schema.js +1 -0
- package/commands/user/delete-account.command.ts +13 -0
- package/commands/user/find-users-by-criteria.command.ts +1 -0
- package/commands/user/index.ts +1 -0
- package/constants/errors/errors.ts +15 -0
- package/constants/user/enums/user-status.ts +1 -0
- package/models/user.schema.ts +1 -0
- package/package.json +1 -1
package/api/routes.ts
CHANGED
|
@@ -29,6 +29,7 @@ export const REST_API = {
|
|
|
29
29
|
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
30
30
|
GET_COUNT: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_COUNT_NOTIFICATION}`,
|
|
31
31
|
SEND_NOTIFICATION: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.SEND_NOTIFICATION}`,
|
|
32
|
+
DELETE_ACCOUNT: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.DELETE_ACCOUNT}`,
|
|
32
33
|
},
|
|
33
34
|
PAGE: {
|
|
34
35
|
GET: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL}`,
|
package/build/api/routes.js
CHANGED
|
@@ -58,6 +58,7 @@ exports.REST_API = {
|
|
|
58
58
|
GET_PRODUCTS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
59
59
|
GET_COUNT: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_COUNT_NOTIFICATION}`,
|
|
60
60
|
SEND_NOTIFICATION: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.SEND_NOTIFICATION}`,
|
|
61
|
+
DELETE_ACCOUNT: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.DELETE_ACCOUNT}`,
|
|
61
62
|
},
|
|
62
63
|
PAGE: {
|
|
63
64
|
GET: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL}`,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAccountCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteAccountCommand;
|
|
6
|
+
(function (DeleteAccountCommand) {
|
|
7
|
+
DeleteAccountCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
data: zod_1.z.object({
|
|
9
|
+
isDeleted: zod_1.z.boolean(),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
})(DeleteAccountCommand || (exports.DeleteAccountCommand = DeleteAccountCommand = {}));
|
|
@@ -41,6 +41,7 @@ var FindUsersByCriteriaCommand;
|
|
|
41
41
|
telegramId: zod_1.default.coerce.number().optional(),
|
|
42
42
|
createdAt: models_1.DateFilter.optional(),
|
|
43
43
|
updatedAt: models_1.DateFilter.optional(),
|
|
44
|
+
deletedAt: models_1.DateFilter.optional(),
|
|
44
45
|
tokenBonusBalance: models_1.NumberFilter.optional(),
|
|
45
46
|
sortBy: zod_1.default.nativeEnum(constants_1.USER_SORT_BY).optional(),
|
|
46
47
|
sortOrder: zod_1.default.nativeEnum(constants_1.SORT_ORDER).default(constants_1.SORT_ORDER.DESC).optional(),
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./get-user-balance.command"), exports);
|
|
|
23
23
|
__exportStar(require("./get-user-orders.command"), exports);
|
|
24
24
|
__exportStar(require("./get-user-subscriptions.command"), exports);
|
|
25
25
|
__exportStar(require("./get-user-products.command"), exports);
|
|
26
|
+
__exportStar(require("./delete-account.command"), exports);
|
|
@@ -1697,4 +1697,19 @@ exports.ERRORS = {
|
|
|
1697
1697
|
message: 'Ошибка при обновлении ежедневного стрика',
|
|
1698
1698
|
httpCode: 500,
|
|
1699
1699
|
},
|
|
1700
|
+
ACCOUNT_DELETE_ERROR: {
|
|
1701
|
+
code: 'A360',
|
|
1702
|
+
message: 'Аккаунт не был удалён',
|
|
1703
|
+
httpCode: 500,
|
|
1704
|
+
},
|
|
1705
|
+
ACCOUNT_DELETED: {
|
|
1706
|
+
code: 'A361',
|
|
1707
|
+
message: 'Операция невозможна, аккаунт был удалён',
|
|
1708
|
+
httpCode: 400,
|
|
1709
|
+
},
|
|
1710
|
+
TELEGRAM_PROFILE_DELETE_ERROR: {
|
|
1711
|
+
code: 'A362',
|
|
1712
|
+
message: 'Произошла ошибка при удалении Telegram профиля',
|
|
1713
|
+
httpCode: 500,
|
|
1714
|
+
},
|
|
1700
1715
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteAccountCommand {
|
|
4
|
+
export type Request = void;
|
|
5
|
+
|
|
6
|
+
export const ResponseSchema = z.object({
|
|
7
|
+
data: z.object({
|
|
8
|
+
isDeleted: z.boolean(),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
package/commands/user/index.ts
CHANGED
|
@@ -1704,4 +1704,19 @@ export const ERRORS = {
|
|
|
1704
1704
|
message: 'Ошибка при обновлении ежедневного стрика',
|
|
1705
1705
|
httpCode: 500,
|
|
1706
1706
|
},
|
|
1707
|
+
ACCOUNT_DELETE_ERROR: {
|
|
1708
|
+
code: 'A360',
|
|
1709
|
+
message: 'Аккаунт не был удалён',
|
|
1710
|
+
httpCode: 500,
|
|
1711
|
+
},
|
|
1712
|
+
ACCOUNT_DELETED: {
|
|
1713
|
+
code: 'A361',
|
|
1714
|
+
message: 'Операция невозможна, аккаунт был удалён',
|
|
1715
|
+
httpCode: 400,
|
|
1716
|
+
},
|
|
1717
|
+
TELEGRAM_PROFILE_DELETE_ERROR: {
|
|
1718
|
+
code: 'A362',
|
|
1719
|
+
message: 'Произошла ошибка при удалении Telegram профиля',
|
|
1720
|
+
httpCode: 500,
|
|
1721
|
+
},
|
|
1707
1722
|
};
|
package/models/user.schema.ts
CHANGED