@purpleschool/gptbot 0.5.28 → 0.5.30

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.
Files changed (109) hide show
  1. package/api/controllers/amqp/index.ts +2 -0
  2. package/api/controllers/amqp/telegram-connect.ts +3 -0
  3. package/api/controllers/amqp/telegram-profile.ts +3 -0
  4. package/api/controllers/http/index.ts +24 -0
  5. package/api/controllers/http/telegram-connect.ts +5 -0
  6. package/api/controllers/http/telegram-profile.ts +5 -0
  7. package/api/controllers/index.ts +2 -22
  8. package/api/index.ts +1 -1
  9. package/build/api/controllers/amqp/index.js +18 -0
  10. package/build/api/controllers/amqp/telegram-connect.js +6 -0
  11. package/build/api/controllers/amqp/telegram-profile.js +6 -0
  12. package/build/api/controllers/http/index.js +40 -0
  13. package/build/api/controllers/http/telegram-connect.js +7 -0
  14. package/build/api/controllers/http/telegram-profile.js +7 -0
  15. package/build/api/controllers/index.js +2 -22
  16. package/build/api/index.js +1 -1
  17. package/build/commands/index.js +1 -0
  18. package/build/commands/task/get-potential-tasks-rewards.command.js +1 -0
  19. package/build/commands/telegram-profile/auth-with-telegram-web-app.command.js +17 -0
  20. package/build/commands/telegram-profile/check-my-telegram-profile-connected.command.js +12 -0
  21. package/build/commands/telegram-profile/check-telegram-profile-exists.command.js +16 -0
  22. package/build/commands/telegram-profile/connect-telegram-profile-with-verification-code.command.js +15 -0
  23. package/build/commands/telegram-profile/create-new-user-from-telegram-bot.command.js +12 -0
  24. package/build/commands/telegram-profile/create-telegram-profile-connection-link.command.js +14 -0
  25. package/build/commands/telegram-profile/index.js +22 -0
  26. package/build/commands/user/get-me.command.js +18 -0
  27. package/build/commands/user/index.js +1 -0
  28. package/build/constants/errors/errors.js +81 -6
  29. package/build/constants/index.js +1 -0
  30. package/build/constants/telegram/index.js +18 -0
  31. package/build/constants/telegram/telegram-auth-log/enums/index.js +17 -0
  32. package/build/constants/telegram/telegram-auth-log/enums/telegram-auth-log-type.enum.js +8 -0
  33. package/build/constants/telegram/telegram-auth-log/index.js +17 -0
  34. package/build/constants/telegram/telegram-connect/enums/index.js +17 -0
  35. package/build/constants/telegram/telegram-connect/enums/telegram-connect-status.enum.js +9 -0
  36. package/build/constants/telegram/telegram-connect/index.js +17 -0
  37. package/build/constants/user/enums/user-status.js +1 -0
  38. package/build/models/index.js +1 -0
  39. package/build/models/telegram-user-data.schema.js +12 -0
  40. package/build/models/user-task.schema.js +1 -0
  41. package/commands/index.ts +1 -0
  42. package/commands/task/get-potential-tasks-rewards.command.ts +1 -0
  43. package/commands/telegram-profile/auth-with-telegram-web-app.command.ts +18 -0
  44. package/commands/telegram-profile/check-my-telegram-profile-connected.command.ts +11 -0
  45. package/commands/telegram-profile/check-telegram-profile-exists.command.ts +18 -0
  46. package/commands/telegram-profile/connect-telegram-profile-with-verification-code.command.ts +16 -0
  47. package/commands/telegram-profile/create-new-user-from-telegram-bot.command.ts +13 -0
  48. package/commands/telegram-profile/create-telegram-profile-connection-link.command.ts +14 -0
  49. package/commands/telegram-profile/index.ts +6 -0
  50. package/commands/user/get-me.command.ts +20 -0
  51. package/commands/user/index.ts +1 -0
  52. package/constants/errors/errors.ts +81 -6
  53. package/constants/index.ts +1 -0
  54. package/constants/telegram/index.ts +2 -0
  55. package/constants/telegram/telegram-auth-log/enums/index.ts +1 -0
  56. package/constants/telegram/telegram-auth-log/enums/telegram-auth-log-type.enum.ts +4 -0
  57. package/constants/telegram/telegram-auth-log/index.ts +1 -0
  58. package/constants/telegram/telegram-connect/enums/index.ts +1 -0
  59. package/constants/telegram/telegram-connect/enums/telegram-connect-status.enum.ts +5 -0
  60. package/constants/telegram/telegram-connect/index.ts +1 -0
  61. package/constants/user/enums/user-status.ts +1 -0
  62. package/models/index.ts +1 -0
  63. package/models/telegram-user-data.schema.ts +12 -0
  64. package/models/user-task.schema.ts +2 -1
  65. package/package.json +1 -1
  66. /package/api/controllers/{ai-model.ts → http/ai-model.ts} +0 -0
  67. /package/api/controllers/{auth.ts → http/auth.ts} +0 -0
  68. /package/api/controllers/{blog.ts → http/blog.ts} +0 -0
  69. /package/api/controllers/{category.ts → http/category.ts} +0 -0
  70. /package/api/controllers/{chat-private.ts → http/chat-private.ts} +0 -0
  71. /package/api/controllers/{chat-public.ts → http/chat-public.ts} +0 -0
  72. /package/api/controllers/{cloud-payments.ts → http/cloud-payments.ts} +0 -0
  73. /package/api/controllers/{course.ts → http/course.ts} +0 -0
  74. /package/api/controllers/{feedback.ts → http/feedback.ts} +0 -0
  75. /package/api/controllers/{files.ts → http/files.ts} +0 -0
  76. /package/api/controllers/{message.ts → http/message.ts} +0 -0
  77. /package/api/controllers/{page.ts → http/page.ts} +0 -0
  78. /package/api/controllers/{payment.ts → http/payment.ts} +0 -0
  79. /package/api/controllers/{product.ts → http/product.ts} +0 -0
  80. /package/api/controllers/{question.ts → http/question.ts} +0 -0
  81. /package/api/controllers/{referral.ts → http/referral.ts} +0 -0
  82. /package/api/controllers/{subscription.ts → http/subscription.ts} +0 -0
  83. /package/api/controllers/{task.ts → http/task.ts} +0 -0
  84. /package/api/controllers/{unregistered-user.ts → http/unregistered-user.ts} +0 -0
  85. /package/api/controllers/{user-to-task-private.ts → http/user-to-task-private.ts} +0 -0
  86. /package/api/controllers/{user-to-task-public.ts → http/user-to-task-public.ts} +0 -0
  87. /package/api/controllers/{user.ts → http/user.ts} +0 -0
  88. /package/build/api/controllers/{ai-model.js → http/ai-model.js} +0 -0
  89. /package/build/api/controllers/{auth.js → http/auth.js} +0 -0
  90. /package/build/api/controllers/{blog.js → http/blog.js} +0 -0
  91. /package/build/api/controllers/{category.js → http/category.js} +0 -0
  92. /package/build/api/controllers/{chat-private.js → http/chat-private.js} +0 -0
  93. /package/build/api/controllers/{chat-public.js → http/chat-public.js} +0 -0
  94. /package/build/api/controllers/{cloud-payments.js → http/cloud-payments.js} +0 -0
  95. /package/build/api/controllers/{course.js → http/course.js} +0 -0
  96. /package/build/api/controllers/{feedback.js → http/feedback.js} +0 -0
  97. /package/build/api/controllers/{files.js → http/files.js} +0 -0
  98. /package/build/api/controllers/{message.js → http/message.js} +0 -0
  99. /package/build/api/controllers/{page.js → http/page.js} +0 -0
  100. /package/build/api/controllers/{payment.js → http/payment.js} +0 -0
  101. /package/build/api/controllers/{product.js → http/product.js} +0 -0
  102. /package/build/api/controllers/{question.js → http/question.js} +0 -0
  103. /package/build/api/controllers/{referral.js → http/referral.js} +0 -0
  104. /package/build/api/controllers/{subscription.js → http/subscription.js} +0 -0
  105. /package/build/api/controllers/{task.js → http/task.js} +0 -0
  106. /package/build/api/controllers/{unregistered-user.js → http/unregistered-user.js} +0 -0
  107. /package/build/api/controllers/{user-to-task-private.js → http/user-to-task-private.js} +0 -0
  108. /package/build/api/controllers/{user-to-task-public.js → http/user-to-task-public.js} +0 -0
  109. /package/build/api/controllers/{user.js → http/user.js} +0 -0
@@ -0,0 +1,2 @@
1
+ export * from './telegram-connect';
2
+ export * from './telegram-profile';
@@ -0,0 +1,3 @@
1
+ export const TELEGRAM_CONNECT_AMQP_ROUTES = {
2
+ CONNECT_WITH_CODE: 'tg.connect.connect-with-code.rpc',
3
+ };
@@ -0,0 +1,3 @@
1
+ export const TELEGRAM_PROFILE_AMQP_ROUTES = {
2
+ CREATE_NEW_USER_FROM_BOT: 'tg.profile.create-new-user-from-bot',
3
+ };
@@ -0,0 +1,24 @@
1
+ export * from './ai-model';
2
+ export * from './auth';
3
+ export * from './blog';
4
+ export * from './category';
5
+ export * from './chat-private';
6
+ export * from './chat-public';
7
+ export * from './cloud-payments';
8
+ export * from './course';
9
+ export * from './feedback';
10
+ export * from './files';
11
+ export * from './referral';
12
+ export * from './message';
13
+ export * from './page';
14
+ export * from './payment';
15
+ export * from './product';
16
+ export * from './question';
17
+ export * from './subscription';
18
+ export * from './task';
19
+ export * from './telegram-connect';
20
+ export * from './telegram-profile';
21
+ export * from './unregistered-user';
22
+ export * from './user-to-task-private';
23
+ export * from './user-to-task-public';
24
+ export * from './user';
@@ -0,0 +1,5 @@
1
+ export const TELEGRAM_CONNECT_CONTROLLER = 'telegram-connect' as const;
2
+
3
+ export const TELEGRAM_CONNECT_ROUTES = {
4
+ CREATE_CONNECTION_LINK: 'connect',
5
+ } as const;
@@ -0,0 +1,5 @@
1
+ export const TELEGRAM_PROFILE_CONTROLLER = 'telegram-profile' as const;
2
+
3
+ export const TELEGRAM_PROFILE_ROUTES = {
4
+ AUTH: 'auth',
5
+ } as const;
@@ -1,22 +1,2 @@
1
- export * from './ai-model';
2
- export * from './auth';
3
- export * from './blog';
4
- export * from './category';
5
- export * from './chat-private';
6
- export * from './chat-public';
7
- export * from './cloud-payments';
8
- export * from './course';
9
- export * from './feedback';
10
- export * from './files';
11
- export * from './referral';
12
- export * from './message';
13
- export * from './page';
14
- export * from './payment';
15
- export * from './product';
16
- export * from './question';
17
- export * from './subscription';
18
- export * from './task';
19
- export * from './unregistered-user';
20
- export * from './user-to-task-public';
21
- export * from './user-to-task-private';
22
- export * from './user';
1
+ export * from './amqp';
2
+ export * from './http';
package/api/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './routes';
2
1
  export * from './controllers';
2
+ export * from './routes';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./telegram-connect"), exports);
18
+ __exportStar(require("./telegram-profile"), exports);
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TELEGRAM_CONNECT_AMQP_ROUTES = void 0;
4
+ exports.TELEGRAM_CONNECT_AMQP_ROUTES = {
5
+ CONNECT_WITH_CODE: 'tg.connect.connect-with-code.rpc',
6
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TELEGRAM_PROFILE_AMQP_ROUTES = void 0;
4
+ exports.TELEGRAM_PROFILE_AMQP_ROUTES = {
5
+ CREATE_NEW_USER_FROM_BOT: 'tg.profile.create-new-user-from-bot',
6
+ };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ai-model"), exports);
18
+ __exportStar(require("./auth"), exports);
19
+ __exportStar(require("./blog"), exports);
20
+ __exportStar(require("./category"), exports);
21
+ __exportStar(require("./chat-private"), exports);
22
+ __exportStar(require("./chat-public"), exports);
23
+ __exportStar(require("./cloud-payments"), exports);
24
+ __exportStar(require("./course"), exports);
25
+ __exportStar(require("./feedback"), exports);
26
+ __exportStar(require("./files"), exports);
27
+ __exportStar(require("./referral"), exports);
28
+ __exportStar(require("./message"), exports);
29
+ __exportStar(require("./page"), exports);
30
+ __exportStar(require("./payment"), exports);
31
+ __exportStar(require("./product"), exports);
32
+ __exportStar(require("./question"), exports);
33
+ __exportStar(require("./subscription"), exports);
34
+ __exportStar(require("./task"), exports);
35
+ __exportStar(require("./telegram-connect"), exports);
36
+ __exportStar(require("./telegram-profile"), exports);
37
+ __exportStar(require("./unregistered-user"), exports);
38
+ __exportStar(require("./user-to-task-private"), exports);
39
+ __exportStar(require("./user-to-task-public"), exports);
40
+ __exportStar(require("./user"), exports);
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TELEGRAM_CONNECT_ROUTES = exports.TELEGRAM_CONNECT_CONTROLLER = void 0;
4
+ exports.TELEGRAM_CONNECT_CONTROLLER = 'telegram-connect';
5
+ exports.TELEGRAM_CONNECT_ROUTES = {
6
+ CREATE_CONNECTION_LINK: 'connect',
7
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TELEGRAM_PROFILE_ROUTES = exports.TELEGRAM_PROFILE_CONTROLLER = void 0;
4
+ exports.TELEGRAM_PROFILE_CONTROLLER = 'telegram-profile';
5
+ exports.TELEGRAM_PROFILE_ROUTES = {
6
+ AUTH: 'auth',
7
+ };
@@ -14,25 +14,5 @@ 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("./ai-model"), exports);
18
- __exportStar(require("./auth"), exports);
19
- __exportStar(require("./blog"), exports);
20
- __exportStar(require("./category"), exports);
21
- __exportStar(require("./chat-private"), exports);
22
- __exportStar(require("./chat-public"), exports);
23
- __exportStar(require("./cloud-payments"), exports);
24
- __exportStar(require("./course"), exports);
25
- __exportStar(require("./feedback"), exports);
26
- __exportStar(require("./files"), exports);
27
- __exportStar(require("./referral"), exports);
28
- __exportStar(require("./message"), exports);
29
- __exportStar(require("./page"), exports);
30
- __exportStar(require("./payment"), exports);
31
- __exportStar(require("./product"), exports);
32
- __exportStar(require("./question"), exports);
33
- __exportStar(require("./subscription"), exports);
34
- __exportStar(require("./task"), exports);
35
- __exportStar(require("./unregistered-user"), exports);
36
- __exportStar(require("./user-to-task-public"), exports);
37
- __exportStar(require("./user-to-task-private"), exports);
38
- __exportStar(require("./user"), exports);
17
+ __exportStar(require("./amqp"), exports);
18
+ __exportStar(require("./http"), exports);
@@ -14,5 +14,5 @@ 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("./routes"), exports);
18
17
  __exportStar(require("./controllers"), exports);
18
+ __exportStar(require("./routes"), exports);
@@ -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-profile"), exports);
32
33
  __exportStar(require("./unregistered-user"), exports);
33
34
  __exportStar(require("./user"), exports);
34
35
  __exportStar(require("./user-to-subscription"), exports);
@@ -8,6 +8,7 @@ var GetPotentialTasksRewardsCommand;
8
8
  data: zod_1.z.object({
9
9
  potentialTasksRewards: zod_1.z.number(),
10
10
  registrationReward: zod_1.z.number(),
11
+ telegramConnectReward: zod_1.z.number(),
11
12
  }),
12
13
  });
13
14
  })(GetPotentialTasksRewardsCommand || (exports.GetPotentialTasksRewardsCommand = GetPotentialTasksRewardsCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthWithTelegramWebAppCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var AuthWithTelegramWebAppCommand;
6
+ (function (AuthWithTelegramWebAppCommand) {
7
+ AuthWithTelegramWebAppCommand.RequestBodySchema = zod_1.z.object({
8
+ initData: zod_1.z.string(),
9
+ platform: zod_1.z.string().nullable(),
10
+ partnerId: zod_1.z.string().optional(),
11
+ });
12
+ AuthWithTelegramWebAppCommand.ResponseSchema = zod_1.z.object({
13
+ data: zod_1.z.object({
14
+ accessToken: zod_1.z.string(),
15
+ }),
16
+ });
17
+ })(AuthWithTelegramWebAppCommand || (exports.AuthWithTelegramWebAppCommand = AuthWithTelegramWebAppCommand = {}));
@@ -0,0 +1,12 @@
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 = {}));
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CheckTelegramProfileExistsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var CheckTelegramProfileExistsCommand;
6
+ (function (CheckTelegramProfileExistsCommand) {
7
+ CheckTelegramProfileExistsCommand.RequestBodySchema = zod_1.z.object({
8
+ initData: zod_1.z.string(),
9
+ platform: zod_1.z.string().nullable(),
10
+ });
11
+ CheckTelegramProfileExistsCommand.ResponseSchema = zod_1.z.object({
12
+ data: zod_1.z.object({
13
+ exists: zod_1.z.boolean(),
14
+ }),
15
+ });
16
+ })(CheckTelegramProfileExistsCommand || (exports.CheckTelegramProfileExistsCommand = CheckTelegramProfileExistsCommand = {}));
@@ -0,0 +1,15 @@
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 = {}));
@@ -0,0 +1,12 @@
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 = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateTelegramConnectionLinkCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var CreateTelegramConnectionLinkCommand;
7
+ (function (CreateTelegramConnectionLinkCommand) {
8
+ CreateTelegramConnectionLinkCommand.RequestSchema = models_1.TelegramUserDataSchema.extend({
9
+ code: zod_1.z.string(),
10
+ });
11
+ CreateTelegramConnectionLinkCommand.ResponseSchema = zod_1.z.object({
12
+ link: zod_1.z.string(),
13
+ });
14
+ })(CreateTelegramConnectionLinkCommand || (exports.CreateTelegramConnectionLinkCommand = CreateTelegramConnectionLinkCommand = {}));
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./auth-with-telegram-web-app.command"), exports);
18
+ __exportStar(require("./check-my-telegram-profile-connected.command"), exports);
19
+ __exportStar(require("./check-telegram-profile-exists.command"), exports);
20
+ __exportStar(require("./connect-telegram-profile-with-verification-code.command"), exports);
21
+ __exportStar(require("./create-telegram-profile-connection-link.command"), exports);
22
+ __exportStar(require("./create-new-user-from-telegram-bot.command"), exports);
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetMeCommand = void 0;
4
+ const constants_1 = require("../../constants");
5
+ const zod_1 = require("zod");
6
+ var GetMeCommand;
7
+ (function (GetMeCommand) {
8
+ GetMeCommand.RequestSchema = zod_1.z.object({});
9
+ GetMeCommand.ResponseSchema = zod_1.z.object({
10
+ data: zod_1.z.object({
11
+ uuid: zod_1.z.string().uuid(),
12
+ email: zod_1.z.string().email(),
13
+ status: zod_1.z.nativeEnum(constants_1.USER_STATUS),
14
+ role: zod_1.z.nativeEnum(constants_1.ROLE),
15
+ telegramId: zod_1.z.number().nullable(),
16
+ }),
17
+ });
18
+ })(GetMeCommand || (exports.GetMeCommand = GetMeCommand = {}));
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./check-email.command"), exports);
18
18
  __exportStar(require("./find-user.command"), exports);
19
+ __exportStar(require("./get-me.command"), exports);
19
20
  __exportStar(require("./up-token-bonus-balance.command"), exports);
@@ -691,33 +691,108 @@ exports.ERRORS = {
691
691
  httpCode: 400,
692
692
  },
693
693
  TASK_CREATE_ERROR: {
694
- code: 'A152',
694
+ code: 'A153',
695
695
  message: 'Произовшла ошибка при создании задания',
696
696
  httpCode: 500,
697
697
  },
698
698
  TASK_UPDATE_ERROR: {
699
- code: 'A153',
699
+ code: 'A154',
700
700
  message: 'Произовшла ошибка при обновлении задания',
701
701
  httpCode: 500,
702
702
  },
703
703
  TASK_DELETE_ERROR: {
704
- code: 'A154',
704
+ code: 'A155',
705
705
  message: 'Произовшла ошибка при удалении задания',
706
706
  httpCode: 500,
707
707
  },
708
708
  TASK_GET_POTENTIAL_REWARDS_ERROR: {
709
- code: 'A155',
709
+ code: 'A156',
710
710
  message: 'Произовшла ошибка при списка наград за выполение доступных заданий',
711
711
  httpCode: 500,
712
712
  },
713
713
  USER_BALANCE_CALCULATION_ERROR: {
714
- code: 'A156',
714
+ code: 'A157',
715
715
  message: 'Произовшла ошибка при расчете баланса пользователя',
716
716
  httpCode: 500,
717
717
  },
718
718
  TASK_REQUIRES_VERIFICATION: {
719
- code: 'A157',
719
+ code: 'A158',
720
720
  message: 'Для доступа к задачам необходимо подтвердить электронную почту',
721
721
  httpCode: 401,
722
722
  },
723
+ TELEGRAM_AUTH_ERROR: {
724
+ code: 'A159',
725
+ message: 'Не удалось авторизоваться через Telegram',
726
+ httpCode: 500,
727
+ },
728
+ TELEGRAM_PROFILE_NOT_FOUND: {
729
+ code: 'A160',
730
+ message: 'Telegram профиль не найден',
731
+ httpCode: 404,
732
+ },
733
+ TELEGRAM_PROFILE_FIND_ERROR: {
734
+ code: 'A170',
735
+ message: 'Ошибка при поиске Telegram профиля',
736
+ httpCode: 500,
737
+ },
738
+ TELEGRAM_PROFILE_CHECK_ERROR: {
739
+ code: 'A171',
740
+ message: 'Произошла ошибка при проверке существования Telegram профиля',
741
+ httpCode: 500,
742
+ },
743
+ TELEGRAM_PROFILE_VALIDATION_FAILED: {
744
+ code: 'A172',
745
+ message: 'Данные не прошли валидацию',
746
+ httpCode: 400,
747
+ },
748
+ TELEGRAM_PROFILE_CREATE_ERROR: {
749
+ code: 'A173',
750
+ message: 'Произошла ошибка при создании Telegram профиля',
751
+ httpCode: 500,
752
+ },
753
+ TELEGRAM_PROFILE_CHECK_CONNECTED_ERROR: {
754
+ code: 'A174',
755
+ message: 'Произошла ошибка при проверке привязки Telegram профиля',
756
+ httpCode: 500,
757
+ },
758
+ TELEGRAM_CONNECT_CREATE_ERROR: {
759
+ code: 'A175',
760
+ message: 'Произошла ошибка при формировании ссылки для привязки Telegram профиля',
761
+ httpCode: 500,
762
+ },
763
+ TELEGRAM_PROFILE_ALREADY_CONNECTED_TO_THIS_USER: {
764
+ code: 'A176',
765
+ message: 'К данной учетной записи уже привязан Telegram профиль',
766
+ httpCode: 400,
767
+ },
768
+ TELEGRAM_PROFILE_ALREADY_CONNECTED_TO_SOME_USER: {
769
+ code: 'A178',
770
+ message: 'Данный Telegram профиль уже привязан к учетной записи',
771
+ httpCode: 400,
772
+ },
773
+ TELEGRAM_CONNECT_INVALID: {
774
+ code: 'A179',
775
+ message: 'Ссылка для привязки Telegram профиля недействительна или устарела',
776
+ httpCode: 400,
777
+ },
778
+ TELEGRAM_CONNECT_UPDATE_ERROR: {
779
+ code: 'A180',
780
+ message: 'Произошла ошибка при обновлении ссылки для привязки Telegram профиля',
781
+ httpCode: 500,
782
+ },
783
+ TELEGRAM_CONNECT_EXPIRED: {
784
+ code: 'A181',
785
+ message: 'Срок действия ссылки для привязки Telegram профиля истек',
786
+ httpCode: 400,
787
+ },
788
+ TELEGRAM_CONNECT_FIND_ERROR: {
789
+ code: 'A182',
790
+ message: 'Произошла ошибка при поиске ссылки для привязки Telegram профиля',
791
+ httpCode: 500,
792
+ },
793
+ TELEGRAM_PROFILE_UPDATE_ERROR: {
794
+ code: 'A183',
795
+ message: 'Произошла ошибка при обновлении Telegram профиля',
796
+ httpCode: 500,
797
+ },
723
798
  };
@@ -31,5 +31,6 @@ __exportStar(require("./referral"), exports);
31
31
  __exportStar(require("./roles"), exports);
32
32
  __exportStar(require("./subscription"), exports);
33
33
  __exportStar(require("./task"), exports);
34
+ __exportStar(require("./telegram"), exports);
34
35
  __exportStar(require("./transaction"), exports);
35
36
  __exportStar(require("./user"), exports);
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./telegram-auth-log"), exports);
18
+ __exportStar(require("./telegram-connect"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./telegram-auth-log-type.enum"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TELEGRAM_AUTH_LOG_TYPE = void 0;
4
+ var TELEGRAM_AUTH_LOG_TYPE;
5
+ (function (TELEGRAM_AUTH_LOG_TYPE) {
6
+ TELEGRAM_AUTH_LOG_TYPE["LOGIN"] = "LOGIN";
7
+ TELEGRAM_AUTH_LOG_TYPE["REGISTER"] = "REGISTER";
8
+ })(TELEGRAM_AUTH_LOG_TYPE || (exports.TELEGRAM_AUTH_LOG_TYPE = TELEGRAM_AUTH_LOG_TYPE = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./enums"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./telegram-connect-status.enum"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TELEGRAM_CONNECT_STATUS = void 0;
4
+ var TELEGRAM_CONNECT_STATUS;
5
+ (function (TELEGRAM_CONNECT_STATUS) {
6
+ TELEGRAM_CONNECT_STATUS["PENDING"] = "pending";
7
+ TELEGRAM_CONNECT_STATUS["CONNECTED"] = "connected";
8
+ TELEGRAM_CONNECT_STATUS["EXPIRED"] = "expired";
9
+ })(TELEGRAM_CONNECT_STATUS || (exports.TELEGRAM_CONNECT_STATUS = TELEGRAM_CONNECT_STATUS = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./enums"), exports);
@@ -5,4 +5,5 @@ var USER_STATUS;
5
5
  (function (USER_STATUS) {
6
6
  USER_STATUS["ACTIVE"] = "active";
7
7
  USER_STATUS["INACTIVE"] = "inactive";
8
+ USER_STATUS["TG_AUTO_REGISTERED"] = "tg_auto_registered";
8
9
  })(USER_STATUS || (exports.USER_STATUS = USER_STATUS = {}));
@@ -34,6 +34,7 @@ __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("./telegram-user-data.schema"), exports);
37
38
  __exportStar(require("./unregistered-user.schema"), exports);
38
39
  __exportStar(require("./user-task.schema"), exports);
39
40
  __exportStar(require("./user-to-subscription.schema"), exports);