@purpleschool/gptbot 0.5.30 → 0.5.32
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/telegram-connect.ts +1 -0
- package/api/controllers/http/user-to-task-private.ts +1 -0
- package/api/controllers/index.ts +0 -1
- package/build/api/controllers/http/telegram-connect.js +1 -0
- package/build/api/controllers/http/user-to-task-private.js +1 -0
- package/build/api/controllers/index.js +0 -1
- package/build/commands/index.js +1 -0
- package/build/commands/telegram/get-telegram-config.command.js +11 -0
- package/build/{api/controllers/amqp → commands/telegram}/index.js +1 -2
- package/build/commands/telegram-profile/check-telegram-profile-exists.command.js +3 -5
- package/build/commands/telegram-profile/index.js +0 -3
- package/build/commands/user-to-task/check-task-completion.command.js +14 -0
- package/build/commands/user-to-task/index.js +1 -0
- package/build/constants/errors/errors.js +15 -0
- package/commands/index.ts +1 -0
- package/commands/telegram/get-telegram-config.command.ts +12 -0
- package/commands/telegram/index.ts +1 -0
- package/commands/telegram-profile/check-telegram-profile-exists.command.ts +3 -5
- package/commands/telegram-profile/index.ts +0 -3
- package/commands/user-to-task/check-task-completion.command.ts +14 -0
- package/commands/user-to-task/index.ts +1 -0
- package/constants/errors/errors.ts +15 -0
- package/package.json +1 -1
- package/api/controllers/amqp/index.ts +0 -2
- package/api/controllers/amqp/telegram-connect.ts +0 -3
- package/api/controllers/amqp/telegram-profile.ts +0 -3
- package/build/api/controllers/amqp/telegram-connect.js +0 -6
- package/build/api/controllers/amqp/telegram-profile.js +0 -6
- package/build/commands/telegram-profile/check-my-telegram-profile-connected.command.js +0 -12
- package/build/commands/telegram-profile/connect-telegram-profile-with-verification-code.command.js +0 -15
- package/build/commands/telegram-profile/create-new-user-from-telegram-bot.command.js +0 -12
- package/commands/telegram-profile/check-my-telegram-profile-connected.command.ts +0 -11
- package/commands/telegram-profile/connect-telegram-profile-with-verification-code.command.ts +0 -16
- package/commands/telegram-profile/create-new-user-from-telegram-bot.command.ts +0 -13
package/api/controllers/index.ts
CHANGED
|
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./amqp"), exports);
|
|
18
17
|
__exportStar(require("./http"), exports);
|
package/build/commands/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __exportStar(require("./question"), exports);
|
|
|
29
29
|
__exportStar(require("./referral"), exports);
|
|
30
30
|
__exportStar(require("./subscription"), exports);
|
|
31
31
|
__exportStar(require("./task"), exports);
|
|
32
|
+
__exportStar(require("./telegram"), exports);
|
|
32
33
|
__exportStar(require("./telegram-profile"), exports);
|
|
33
34
|
__exportStar(require("./unregistered-user"), exports);
|
|
34
35
|
__exportStar(require("./user"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetTelegramConfigCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var GetTelegramConfigCommand;
|
|
6
|
+
(function (GetTelegramConfigCommand) {
|
|
7
|
+
GetTelegramConfigCommand.RequestSchema = zod_1.z.void();
|
|
8
|
+
GetTelegramConfigCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
tmaLink: zod_1.z.string(),
|
|
10
|
+
});
|
|
11
|
+
})(GetTelegramConfigCommand || (exports.GetTelegramConfigCommand = GetTelegramConfigCommand = {}));
|
|
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./telegram-
|
|
18
|
-
__exportStar(require("./telegram-profile"), exports);
|
|
17
|
+
__exportStar(require("./get-telegram-config.command"), exports);
|
|
@@ -5,12 +5,10 @@ const zod_1 = require("zod");
|
|
|
5
5
|
var CheckTelegramProfileExistsCommand;
|
|
6
6
|
(function (CheckTelegramProfileExistsCommand) {
|
|
7
7
|
CheckTelegramProfileExistsCommand.RequestBodySchema = zod_1.z.object({
|
|
8
|
-
|
|
9
|
-
platform: zod_1.z.string().nullable(),
|
|
8
|
+
telegramId: zod_1.z.number(),
|
|
10
9
|
});
|
|
11
10
|
CheckTelegramProfileExistsCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}),
|
|
11
|
+
isSuccess: zod_1.z.boolean(),
|
|
12
|
+
exists: zod_1.z.boolean(),
|
|
15
13
|
});
|
|
16
14
|
})(CheckTelegramProfileExistsCommand || (exports.CheckTelegramProfileExistsCommand = CheckTelegramProfileExistsCommand = {}));
|
|
@@ -15,8 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./auth-with-telegram-web-app.command"), exports);
|
|
18
|
-
__exportStar(require("./check-my-telegram-profile-connected.command"), exports);
|
|
19
18
|
__exportStar(require("./check-telegram-profile-exists.command"), exports);
|
|
20
|
-
__exportStar(require("./connect-telegram-profile-with-verification-code.command"), exports);
|
|
21
19
|
__exportStar(require("./create-telegram-profile-connection-link.command"), exports);
|
|
22
|
-
__exportStar(require("./create-new-user-from-telegram-bot.command"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckTaskCompletionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var CheckTaskCompletionCommand;
|
|
7
|
+
(function (CheckTaskCompletionCommand) {
|
|
8
|
+
CheckTaskCompletionCommand.RequestParamsSchema = models_1.UserTaskSchema.pick({
|
|
9
|
+
taskId: true,
|
|
10
|
+
});
|
|
11
|
+
CheckTaskCompletionCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.UserTaskSchema,
|
|
13
|
+
});
|
|
14
|
+
})(CheckTaskCompletionCommand || (exports.CheckTaskCompletionCommand = CheckTaskCompletionCommand = {}));
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./check-task-completion.command"), exports);
|
|
17
18
|
__exportStar(require("./claim-task-reward.command"), exports);
|
|
18
19
|
__exportStar(require("./get-my-tasks.command"), exports);
|
|
19
20
|
__exportStar(require("./start-task.command"), exports);
|
|
@@ -795,4 +795,19 @@ exports.ERRORS = {
|
|
|
795
795
|
message: 'Произошла ошибка при обновлении Telegram профиля',
|
|
796
796
|
httpCode: 500,
|
|
797
797
|
},
|
|
798
|
+
TASK_NOT_READY_FOR_CHECK: {
|
|
799
|
+
code: 'A184',
|
|
800
|
+
message: 'Задание не готово к проверке',
|
|
801
|
+
httpCode: 400,
|
|
802
|
+
},
|
|
803
|
+
TASK_CHECK_ERROR: {
|
|
804
|
+
code: 'A185',
|
|
805
|
+
message: 'Произошла ошибка при проверке задания',
|
|
806
|
+
httpCode: 500,
|
|
807
|
+
},
|
|
808
|
+
TASK_TELEGRAM_CHANNEL_NOT_SUBSCRIBED: {
|
|
809
|
+
code: 'A186',
|
|
810
|
+
message: 'Пользователь не подписан на канал',
|
|
811
|
+
httpCode: 400,
|
|
812
|
+
},
|
|
798
813
|
};
|
package/commands/index.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace GetTelegramConfigCommand {
|
|
4
|
+
export const RequestSchema = z.void();
|
|
5
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
6
|
+
|
|
7
|
+
export const ResponseSchema = z.object({
|
|
8
|
+
tmaLink: z.string(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-telegram-config.command';
|
|
@@ -2,16 +2,14 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
export namespace CheckTelegramProfileExistsCommand {
|
|
4
4
|
export const RequestBodySchema = z.object({
|
|
5
|
-
|
|
6
|
-
platform: z.string().nullable(),
|
|
5
|
+
telegramId: z.number(),
|
|
7
6
|
});
|
|
8
7
|
|
|
9
8
|
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
10
9
|
|
|
11
10
|
export const ResponseSchema = z.object({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}),
|
|
11
|
+
isSuccess: z.boolean(),
|
|
12
|
+
exists: z.boolean(),
|
|
15
13
|
});
|
|
16
14
|
|
|
17
15
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
export * from './auth-with-telegram-web-app.command';
|
|
2
|
-
export * from './check-my-telegram-profile-connected.command';
|
|
3
2
|
export * from './check-telegram-profile-exists.command';
|
|
4
|
-
export * from './connect-telegram-profile-with-verification-code.command';
|
|
5
3
|
export * from './create-telegram-profile-connection-link.command';
|
|
6
|
-
export * from './create-new-user-from-telegram-bot.command';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UserTaskSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace CheckTaskCompletionCommand {
|
|
5
|
+
export const RequestParamsSchema = UserTaskSchema.pick({
|
|
6
|
+
taskId: true,
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: UserTaskSchema,
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -795,4 +795,19 @@ export const ERRORS = {
|
|
|
795
795
|
message: 'Произошла ошибка при обновлении Telegram профиля',
|
|
796
796
|
httpCode: 500,
|
|
797
797
|
},
|
|
798
|
+
TASK_NOT_READY_FOR_CHECK: {
|
|
799
|
+
code: 'A184',
|
|
800
|
+
message: 'Задание не готово к проверке',
|
|
801
|
+
httpCode: 400,
|
|
802
|
+
},
|
|
803
|
+
TASK_CHECK_ERROR: {
|
|
804
|
+
code: 'A185',
|
|
805
|
+
message: 'Произошла ошибка при проверке задания',
|
|
806
|
+
httpCode: 500,
|
|
807
|
+
},
|
|
808
|
+
TASK_TELEGRAM_CHANNEL_NOT_SUBSCRIBED: {
|
|
809
|
+
code: 'A186',
|
|
810
|
+
message: 'Пользователь не подписан на канал',
|
|
811
|
+
httpCode: 400,
|
|
812
|
+
},
|
|
798
813
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckMyTelegramProfileConnectedCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
var CheckMyTelegramProfileConnectedCommand;
|
|
6
|
-
(function (CheckMyTelegramProfileConnectedCommand) {
|
|
7
|
-
CheckMyTelegramProfileConnectedCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
-
data: zod_1.z.object({
|
|
9
|
-
connected: zod_1.z.boolean(),
|
|
10
|
-
}),
|
|
11
|
-
});
|
|
12
|
-
})(CheckMyTelegramProfileConnectedCommand || (exports.CheckMyTelegramProfileConnectedCommand = CheckMyTelegramProfileConnectedCommand = {}));
|
package/build/commands/telegram-profile/connect-telegram-profile-with-verification-code.command.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConnectTelegramProfileWithVerificationCodeCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../models");
|
|
6
|
-
var ConnectTelegramProfileWithVerificationCodeCommand;
|
|
7
|
-
(function (ConnectTelegramProfileWithVerificationCodeCommand) {
|
|
8
|
-
ConnectTelegramProfileWithVerificationCodeCommand.RequestSchema = models_1.TelegramUserDataSchema.extend({
|
|
9
|
-
code: zod_1.z.string(),
|
|
10
|
-
});
|
|
11
|
-
ConnectTelegramProfileWithVerificationCodeCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
isSuccess: zod_1.z.boolean(),
|
|
13
|
-
message: zod_1.z.string().optional(),
|
|
14
|
-
});
|
|
15
|
-
})(ConnectTelegramProfileWithVerificationCodeCommand || (exports.ConnectTelegramProfileWithVerificationCodeCommand = ConnectTelegramProfileWithVerificationCodeCommand = {}));
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateNewUserFromTelegramBotCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../models");
|
|
6
|
-
var CreateNewUserFromTelegramBotCommand;
|
|
7
|
-
(function (CreateNewUserFromTelegramBotCommand) {
|
|
8
|
-
CreateNewUserFromTelegramBotCommand.RequestSchema = models_1.TelegramUserDataSchema.extend({
|
|
9
|
-
partnerId: zod_1.z.string().uuid().optional(),
|
|
10
|
-
});
|
|
11
|
-
CreateNewUserFromTelegramBotCommand.ResponseSchema = zod_1.z.void();
|
|
12
|
-
})(CreateNewUserFromTelegramBotCommand || (exports.CreateNewUserFromTelegramBotCommand = CreateNewUserFromTelegramBotCommand = {}));
|
package/commands/telegram-profile/connect-telegram-profile-with-verification-code.command.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { TelegramUserDataSchema } from '../../models';
|
|
3
|
-
|
|
4
|
-
export namespace ConnectTelegramProfileWithVerificationCodeCommand {
|
|
5
|
-
export const RequestSchema = TelegramUserDataSchema.extend({
|
|
6
|
-
code: z.string(),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
-
|
|
11
|
-
export const ResponseSchema = z.object({
|
|
12
|
-
isSuccess: z.boolean(),
|
|
13
|
-
message: z.string().optional(),
|
|
14
|
-
});
|
|
15
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { TelegramUserDataSchema } from '../../models';
|
|
3
|
-
|
|
4
|
-
export namespace CreateNewUserFromTelegramBotCommand {
|
|
5
|
-
export const RequestSchema = TelegramUserDataSchema.extend({
|
|
6
|
-
partnerId: z.string().uuid().optional(),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
-
|
|
11
|
-
export const ResponseSchema = z.void();
|
|
12
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
-
}
|