@purpleschool/gptbot 0.5.27 → 0.5.29
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/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/models/user-task.schema.js +1 -1
- package/commands/chat/check-limit.command.v2.ts +0 -1
- 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/models/user-task.schema.ts +1 -1
- 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/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 = {}));
|
|
@@ -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
|
};
|
|
@@ -9,7 +9,7 @@ exports.UserTaskSchema = zod_1.z.object({
|
|
|
9
9
|
reward: zod_1.z.number(),
|
|
10
10
|
icon: zod_1.z.string(),
|
|
11
11
|
type: zod_1.z.nativeEnum(constants_1.TASK_TYPE),
|
|
12
|
+
status: zod_1.z.nativeEnum(constants_1.USER_TO_TASK_STATUS),
|
|
12
13
|
content: zod_1.z.string().nullable().optional(),
|
|
13
14
|
description: zod_1.z.string().nullable(),
|
|
14
|
-
status: zod_1.z.nativeEnum(constants_1.USER_TO_TASK_STATUS),
|
|
15
15
|
});
|
|
@@ -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
|
};
|
|
@@ -6,7 +6,7 @@ export const UserTaskSchema = z.object({
|
|
|
6
6
|
reward: z.number(),
|
|
7
7
|
icon: z.string(),
|
|
8
8
|
type: z.nativeEnum(TASK_TYPE),
|
|
9
|
+
status: z.nativeEnum(USER_TO_TASK_STATUS),
|
|
9
10
|
content: z.string().nullable().optional(),
|
|
10
11
|
description: z.string().nullable(),
|
|
11
|
-
status: z.nativeEnum(USER_TO_TASK_STATUS),
|
|
12
12
|
});
|
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
|
-
};
|