@purpleschool/gptbot 0.5.26 → 0.5.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/index.ts +2 -1
- package/api/controllers/user-to-task-private.ts +7 -0
- package/api/controllers/user-to-task-public.ts +5 -0
- package/build/api/controllers/index.js +2 -1
- package/build/api/controllers/user-to-task-private.js +9 -0
- package/build/api/controllers/user-to-task-public.js +7 -0
- package/build/commands/chat/check-limit.command.v2.js +0 -1
- package/build/commands/task/find-all-active-tasks.command.js +1 -1
- package/build/commands/task/get-potential-tasks-rewards.command.js +13 -0
- package/build/commands/task/index.js +1 -0
- package/build/constants/errors/errors.js +5 -0
- package/build/constants/task/enums/user-to-task-status.enum.js +1 -0
- package/build/models/index.js +0 -1
- package/build/models/user-task.schema.js +0 -1
- package/commands/chat/check-limit.command.v2.ts +0 -1
- package/commands/task/find-all-active-tasks.command.ts +2 -2
- package/commands/task/get-potential-tasks-rewards.command.ts +12 -0
- package/commands/task/index.ts +1 -0
- package/constants/errors/errors.ts +5 -0
- package/constants/task/enums/user-to-task-status.enum.ts +1 -0
- package/models/index.ts +0 -1
- package/models/user-task.schema.ts +1 -2
- package/package.json +1 -1
- package/api/controllers/user-to-task.ts +0 -7
- package/build/api/controllers/user-to-task.js +0 -9
- package/build/models/task.schema.js +0 -16
- package/models/task.schema.ts +0 -14
package/api/controllers/index.ts
CHANGED
|
@@ -17,5 +17,6 @@ export * from './question';
|
|
|
17
17
|
export * from './subscription';
|
|
18
18
|
export * from './task';
|
|
19
19
|
export * from './unregistered-user';
|
|
20
|
-
export * from './user-to-task';
|
|
20
|
+
export * from './user-to-task-public';
|
|
21
|
+
export * from './user-to-task-private';
|
|
21
22
|
export * from './user';
|
|
@@ -33,5 +33,6 @@ __exportStar(require("./question"), exports);
|
|
|
33
33
|
__exportStar(require("./subscription"), exports);
|
|
34
34
|
__exportStar(require("./task"), exports);
|
|
35
35
|
__exportStar(require("./unregistered-user"), exports);
|
|
36
|
-
__exportStar(require("./user-to-task"), exports);
|
|
36
|
+
__exportStar(require("./user-to-task-public"), exports);
|
|
37
|
+
__exportStar(require("./user-to-task-private"), exports);
|
|
37
38
|
__exportStar(require("./user"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_TO_TASK_PRIVATE_ROUTES = exports.USER_TO_TASK_PRIVATE_CONTROLLER = void 0;
|
|
4
|
+
exports.USER_TO_TASK_PRIVATE_CONTROLLER = 'user-to-task/private';
|
|
5
|
+
exports.USER_TO_TASK_PRIVATE_ROUTES = {
|
|
6
|
+
MY: 'my',
|
|
7
|
+
START: (uuid) => `${uuid}/start`,
|
|
8
|
+
REWARDS: 'rewards',
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_TO_TASK_PUBLIC_ROUTES = exports.USER_TO_TASK_PUBLIC_CONTROLLER = void 0;
|
|
4
|
+
exports.USER_TO_TASK_PUBLIC_CONTROLLER = 'user-to-task/public';
|
|
5
|
+
exports.USER_TO_TASK_PUBLIC_ROUTES = {
|
|
6
|
+
REWARDS: 'rewards',
|
|
7
|
+
};
|
|
@@ -7,7 +7,6 @@ var CheckLimitV2Command;
|
|
|
7
7
|
CheckLimitV2Command.ResponseSchema = zod_1.z.object({
|
|
8
8
|
data: zod_1.z.object({
|
|
9
9
|
totalTokenBalance: zod_1.z.number(),
|
|
10
|
-
potentialTasksRewards: zod_1.z.number(),
|
|
11
10
|
}),
|
|
12
11
|
});
|
|
13
12
|
})(CheckLimitV2Command || (exports.CheckLimitV2Command = CheckLimitV2Command = {}));
|
|
@@ -6,6 +6,6 @@ const zod_1 = require("zod");
|
|
|
6
6
|
var FindAllActiveTasksCommand;
|
|
7
7
|
(function (FindAllActiveTasksCommand) {
|
|
8
8
|
FindAllActiveTasksCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
-
data: zod_1.z.array(models_1.
|
|
9
|
+
data: zod_1.z.array(models_1.UserTaskSchema),
|
|
10
10
|
});
|
|
11
11
|
})(FindAllActiveTasksCommand || (exports.FindAllActiveTasksCommand = FindAllActiveTasksCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPotentialTasksRewardsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var GetPotentialTasksRewardsCommand;
|
|
6
|
+
(function (GetPotentialTasksRewardsCommand) {
|
|
7
|
+
GetPotentialTasksRewardsCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
data: zod_1.z.object({
|
|
9
|
+
potentialTasksRewards: zod_1.z.number(),
|
|
10
|
+
registrationReward: zod_1.z.number(),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
})(GetPotentialTasksRewardsCommand || (exports.GetPotentialTasksRewardsCommand = GetPotentialTasksRewardsCommand = {}));
|
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./find-all-active-tasks.command"), exports);
|
|
18
|
+
__exportStar(require("./get-potential-tasks-rewards.command"), exports);
|
|
@@ -715,4 +715,9 @@ exports.ERRORS = {
|
|
|
715
715
|
message: 'Произовшла ошибка при расчете баланса пользователя',
|
|
716
716
|
httpCode: 500,
|
|
717
717
|
},
|
|
718
|
+
TASK_REQUIRES_VERIFICATION: {
|
|
719
|
+
code: 'A157',
|
|
720
|
+
message: 'Для доступа к задачам необходимо подтвердить электронную почту',
|
|
721
|
+
httpCode: 401,
|
|
722
|
+
},
|
|
718
723
|
};
|
|
@@ -5,5 +5,6 @@ var USER_TO_TASK_STATUS;
|
|
|
5
5
|
(function (USER_TO_TASK_STATUS) {
|
|
6
6
|
USER_TO_TASK_STATUS["IDLE"] = "idle";
|
|
7
7
|
USER_TO_TASK_STATUS["READY_FOR_CHECK"] = "ready_for_check";
|
|
8
|
+
USER_TO_TASK_STATUS["BLOCK"] = "block";
|
|
8
9
|
USER_TO_TASK_STATUS["COMPLETED"] = "completed";
|
|
9
10
|
})(USER_TO_TASK_STATUS || (exports.USER_TO_TASK_STATUS = USER_TO_TASK_STATUS = {}));
|
package/build/models/index.js
CHANGED
|
@@ -34,7 +34,6 @@ __exportStar(require("./referral-bonus.schema"), exports);
|
|
|
34
34
|
__exportStar(require("./section.schema"), exports);
|
|
35
35
|
__exportStar(require("./subscription-upgrade-schema"), exports);
|
|
36
36
|
__exportStar(require("./subscription.schema"), exports);
|
|
37
|
-
__exportStar(require("./task.schema"), exports);
|
|
38
37
|
__exportStar(require("./unregistered-user.schema"), exports);
|
|
39
38
|
__exportStar(require("./user-task.schema"), exports);
|
|
40
39
|
__exportStar(require("./user-to-subscription.schema"), exports);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserTaskSchema } from '../../models';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
export namespace FindAllActiveTasksCommand {
|
|
5
5
|
export const ResponseSchema = z.object({
|
|
6
|
-
data: z.array(
|
|
6
|
+
data: z.array(UserTaskSchema),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace GetPotentialTasksRewardsCommand {
|
|
4
|
+
export const ResponseSchema = z.object({
|
|
5
|
+
data: z.object({
|
|
6
|
+
potentialTasksRewards: z.number(),
|
|
7
|
+
registrationReward: z.number(),
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
package/commands/task/index.ts
CHANGED
|
@@ -715,4 +715,9 @@ export const ERRORS = {
|
|
|
715
715
|
message: 'Произовшла ошибка при расчете баланса пользователя',
|
|
716
716
|
httpCode: 500,
|
|
717
717
|
},
|
|
718
|
+
TASK_REQUIRES_VERIFICATION: {
|
|
719
|
+
code: 'A157',
|
|
720
|
+
message: 'Для доступа к задачам необходимо подтвердить электронную почту',
|
|
721
|
+
httpCode: 401,
|
|
722
|
+
},
|
|
718
723
|
};
|
package/models/index.ts
CHANGED
|
@@ -18,7 +18,6 @@ export * from './referral-bonus.schema';
|
|
|
18
18
|
export * from './section.schema';
|
|
19
19
|
export * from './subscription-upgrade-schema';
|
|
20
20
|
export * from './subscription.schema';
|
|
21
|
-
export * from './task.schema';
|
|
22
21
|
export * from './unregistered-user.schema';
|
|
23
22
|
export * from './user-task.schema';
|
|
24
23
|
export * from './user-to-subscription.schema';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { TASK_TYPE
|
|
2
|
+
import { TASK_TYPE } from '../constants';
|
|
3
3
|
export const UserTaskSchema = z.object({
|
|
4
4
|
taskId: z.string().uuid(),
|
|
5
5
|
title: z.string(),
|
|
@@ -8,5 +8,4 @@ export const UserTaskSchema = z.object({
|
|
|
8
8
|
type: z.nativeEnum(TASK_TYPE),
|
|
9
9
|
content: z.string().nullable().optional(),
|
|
10
10
|
description: z.string().nullable(),
|
|
11
|
-
status: z.nativeEnum(USER_TO_TASK_STATUS),
|
|
12
11
|
});
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.USER_TO_TASK_ROUTES = exports.USER_TO_TASK_CONTROLLER = void 0;
|
|
4
|
-
exports.USER_TO_TASK_CONTROLLER = 'user-to-task';
|
|
5
|
-
exports.USER_TO_TASK_ROUTES = {
|
|
6
|
-
MY: 'my',
|
|
7
|
-
START: (uuid) => `${uuid}/start`,
|
|
8
|
-
CLAIM_REWARD: (uuid) => `${uuid}/claim-reward`,
|
|
9
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
exports.TaskSchema = zod_1.z.object({
|
|
7
|
-
uuid: zod_1.z.string().uuid(),
|
|
8
|
-
title: zod_1.z.string(),
|
|
9
|
-
icon: zod_1.z.string(),
|
|
10
|
-
reward: zod_1.z.number(),
|
|
11
|
-
type: zod_1.z.nativeEnum(constants_1.TASK_TYPE),
|
|
12
|
-
status: zod_1.z.nativeEnum(constants_1.TASK_STATUS),
|
|
13
|
-
description: zod_1.z.string(),
|
|
14
|
-
startAt: zod_1.z.date(),
|
|
15
|
-
endAt: zod_1.z.date().nullable().optional(),
|
|
16
|
-
});
|
package/models/task.schema.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { TASK_STATUS, TASK_TYPE } from '../constants';
|
|
3
|
-
|
|
4
|
-
export const TaskSchema = z.object({
|
|
5
|
-
uuid: z.string().uuid(),
|
|
6
|
-
title: z.string(),
|
|
7
|
-
icon: z.string(),
|
|
8
|
-
reward: z.number(),
|
|
9
|
-
type: z.nativeEnum(TASK_TYPE),
|
|
10
|
-
status: z.nativeEnum(TASK_STATUS),
|
|
11
|
-
description: z.string(),
|
|
12
|
-
startAt: z.date(),
|
|
13
|
-
endAt: z.date().nullable().optional(),
|
|
14
|
-
});
|