@purpleschool/gptbot 0.5.13 → 0.5.14

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 (77) hide show
  1. package/api/controllers/index.ts +10 -8
  2. package/api/controllers/referral.ts +5 -0
  3. package/build/api/controllers/index.js +10 -8
  4. package/build/api/controllers/referral.js +7 -0
  5. package/build/commands/ai-model/index.js +2 -2
  6. package/build/commands/auth/index.js +4 -3
  7. package/build/commands/auth/register-user.command.js +3 -4
  8. package/build/commands/blog/index.js +2 -2
  9. package/build/commands/category/index.js +2 -2
  10. package/build/commands/chat/index.js +9 -8
  11. package/build/commands/index.js +8 -7
  12. package/build/commands/message/index.js +1 -1
  13. package/build/commands/page/index.js +3 -3
  14. package/build/commands/product/buy-product.command.js +1 -0
  15. package/build/commands/product/index.js +3 -3
  16. package/build/commands/question/index.js +2 -2
  17. package/build/commands/referral/get-by-bonuses.command.js +15 -0
  18. package/build/commands/referral/index.js +17 -0
  19. package/build/commands/subscription/buy-subscription.command.js +1 -0
  20. package/build/commands/subscription/index.js +6 -5
  21. package/build/commands/user/index.js +1 -1
  22. package/build/constants/category/enums/index.js +1 -1
  23. package/build/constants/chat/enums/index.js +1 -1
  24. package/build/constants/domains/index.js +17 -0
  25. package/build/constants/email/index.js +18 -0
  26. package/build/constants/errors/errors.js +25 -0
  27. package/build/constants/index.js +13 -7
  28. package/build/constants/payment/enums/index.js +1 -1
  29. package/build/constants/referral/enums/index.js +17 -0
  30. package/build/constants/referral/enums/referral-bonus-type.enum.js +8 -0
  31. package/build/constants/referral/index.js +17 -0
  32. package/build/constants/subscription/enums/index.js +3 -3
  33. package/build/constants/transaction/enums/index.js +17 -0
  34. package/build/constants/transaction/enums/user-balance-status.enum.js +1 -0
  35. package/build/constants/transaction/index.js +17 -0
  36. package/build/constants/user/enums/index.js +17 -0
  37. package/build/constants/user/index.js +18 -0
  38. package/build/index.js +3 -3
  39. package/build/models/index.js +11 -7
  40. package/build/models/referral-bonus.schema.js +19 -0
  41. package/commands/ai-model/index.ts +2 -2
  42. package/commands/auth/index.ts +4 -3
  43. package/commands/auth/register-user.command.ts +6 -4
  44. package/commands/blog/index.ts +2 -2
  45. package/commands/category/index.ts +2 -2
  46. package/commands/chat/index.ts +9 -8
  47. package/commands/index.ts +8 -7
  48. package/commands/message/index.ts +1 -1
  49. package/commands/page/index.ts +3 -3
  50. package/commands/product/buy-product.command.ts +1 -0
  51. package/commands/product/index.ts +3 -3
  52. package/commands/question/index.ts +2 -2
  53. package/commands/referral/get-by-bonuses.command.ts +14 -0
  54. package/commands/referral/index.ts +1 -0
  55. package/commands/subscription/buy-subscription.command.ts +1 -0
  56. package/commands/subscription/index.ts +6 -5
  57. package/commands/user/index.ts +1 -1
  58. package/constants/category/enums/index.ts +1 -1
  59. package/constants/chat/enums/index.ts +1 -1
  60. package/constants/domains/index.ts +1 -0
  61. package/constants/email/index.ts +2 -0
  62. package/constants/errors/errors.ts +25 -0
  63. package/constants/index.ts +13 -7
  64. package/constants/payment/enums/index.ts +1 -1
  65. package/constants/referral/enums/index.ts +1 -0
  66. package/constants/referral/enums/referral-bonus-type.enum.ts +4 -0
  67. package/constants/referral/index.ts +1 -0
  68. package/constants/subscription/enums/index.ts +3 -3
  69. package/constants/transaction/enums/index.ts +2 -0
  70. package/constants/transaction/enums/user-balance-status.enum.ts +1 -0
  71. package/constants/transaction/index.ts +1 -0
  72. package/constants/user/enums/index.ts +1 -0
  73. package/constants/user/index.ts +2 -0
  74. package/index.ts +3 -3
  75. package/models/index.ts +11 -7
  76. package/models/referral-bonus.schema.ts +18 -0
  77. package/package.json +1 -1
@@ -1,15 +1,17 @@
1
+ export * from './ai-model';
1
2
  export * from './auth';
2
- export * from './user';
3
- export * from './page';
3
+ export * from './blog';
4
4
  export * from './category';
5
- export * from './question';
6
- export * from './unregistered-user';
7
- export * from './ai-model';
8
5
  export * from './chat-private';
9
6
  export * from './chat-public';
10
- export * from './product';
11
- export * from './subscription';
7
+ export * from './cloud-payments';
12
8
  export * from './files';
13
- export * from './blog';
9
+ export * from './referral';
14
10
  export * from './message';
11
+ export * from './page';
15
12
  export * from './payment';
13
+ export * from './product';
14
+ export * from './question';
15
+ export * from './subscription';
16
+ export * from './unregistered-user';
17
+ export * from './user';
@@ -0,0 +1,5 @@
1
+ export const REFERRAL_CONTROLLER = 'referral' as const;
2
+
3
+ export const REFERRAL_ROUTES = {
4
+ GET_MY_BONUSES: 'bonuses/my',
5
+ } as const;
@@ -14,18 +14,20 @@ 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);
17
18
  __exportStar(require("./auth"), exports);
18
- __exportStar(require("./user"), exports);
19
- __exportStar(require("./page"), exports);
19
+ __exportStar(require("./blog"), exports);
20
20
  __exportStar(require("./category"), exports);
21
- __exportStar(require("./question"), exports);
22
- __exportStar(require("./unregistered-user"), exports);
23
- __exportStar(require("./ai-model"), exports);
24
21
  __exportStar(require("./chat-private"), exports);
25
22
  __exportStar(require("./chat-public"), exports);
26
- __exportStar(require("./product"), exports);
27
- __exportStar(require("./subscription"), exports);
23
+ __exportStar(require("./cloud-payments"), exports);
28
24
  __exportStar(require("./files"), exports);
29
- __exportStar(require("./blog"), exports);
25
+ __exportStar(require("./referral"), exports);
30
26
  __exportStar(require("./message"), exports);
27
+ __exportStar(require("./page"), exports);
31
28
  __exportStar(require("./payment"), exports);
29
+ __exportStar(require("./product"), exports);
30
+ __exportStar(require("./question"), exports);
31
+ __exportStar(require("./subscription"), exports);
32
+ __exportStar(require("./unregistered-user"), exports);
33
+ __exportStar(require("./user"), exports);
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REFERRAL_ROUTES = exports.REFERRAL_CONTROLLER = void 0;
4
+ exports.REFERRAL_CONTROLLER = 'referral';
5
+ exports.REFERRAL_ROUTES = {
6
+ GET_MY_BONUSES: 'bonuses/my',
7
+ };
@@ -14,7 +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("./update-ai-model.command"), exports);
18
- __exportStar(require("./delete-ai-model.command"), exports);
19
17
  __exportStar(require("./create-ai-model.command"), exports);
18
+ __exportStar(require("./delete-ai-model.command"), exports);
20
19
  __exportStar(require("./find-ai-model.command"), exports);
20
+ __exportStar(require("./update-ai-model.command"), exports);
@@ -14,9 +14,10 @@ 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("./reset-password.command"), exports);
18
- __exportStar(require("./restore-password.command"), exports);
17
+ __exportStar(require("./create-user.command"), exports);
19
18
  __exportStar(require("./login.command"), exports);
20
19
  __exportStar(require("./register-user.command"), exports);
21
- __exportStar(require("./create-user.command"), exports);
20
+ __exportStar(require("./reset-password.command"), exports);
21
+ __exportStar(require("./restore-password.command"), exports);
22
+ __exportStar(require("./verify-email-retry.command"), exports);
22
23
  __exportStar(require("./verify-email.command"), exports);
@@ -5,10 +5,9 @@ const models_1 = require("../../models");
5
5
  const zod_1 = require("zod");
6
6
  var RegisterUserCommand;
7
7
  (function (RegisterUserCommand) {
8
- RegisterUserCommand.RequestSchema = models_1.UserSchema.pick({
9
- email: true,
10
- password: true,
11
- });
8
+ RegisterUserCommand.RequestSchema = zod_1.z.intersection(models_1.UserSchema.pick({ email: true, password: true }), zod_1.z.object({
9
+ partnerId: zod_1.z.string().uuid().optional(),
10
+ }));
12
11
  RegisterUserCommand.ResponseSchema = zod_1.z.object({
13
12
  data: zod_1.z.object({
14
13
  accessToken: zod_1.z.string(),
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./create-post.command"), exports);
18
- __exportStar(require("./update-post.command"), exports);
19
18
  __exportStar(require("./delete-post.command"), exports);
20
- __exportStar(require("./find-post-by-uuid.command"), exports);
21
19
  __exportStar(require("./find-post-by-alias.command"), exports);
20
+ __exportStar(require("./find-post-by-uuid.command"), exports);
22
21
  __exportStar(require("./find-post.command"), exports);
22
+ __exportStar(require("./update-post.command"), exports);
@@ -14,7 +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("./update-category.command"), exports);
18
- __exportStar(require("./delete-category.command"), exports);
19
17
  __exportStar(require("./create-category.command"), exports);
18
+ __exportStar(require("./delete-category.command"), exports);
20
19
  __exportStar(require("./find-category.command"), exports);
20
+ __exportStar(require("./update-category.command"), exports);
@@ -14,15 +14,16 @@ 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("./update-chat.command"), exports);
18
- __exportStar(require("./delete-chat.command"), exports);
19
- __exportStar(require("./create-chat.command"), exports);
20
- __exportStar(require("./find-chat.command"), exports);
21
- __exportStar(require("./get-my-last-active-chat.command"), exports);
17
+ __exportStar(require("./archive-all.command"), exports);
22
18
  __exportStar(require("./check-limit.command"), exports);
23
19
  __exportStar(require("./check-limit.command.v2"), exports);
24
- __exportStar(require("./get-my-last-active-chat-command.v2"), exports);
20
+ __exportStar(require("./create-chat.command"), exports);
25
21
  __exportStar(require("./create-chat.command.v2"), exports);
26
- __exportStar(require("./find-chat-by-uuid.command"), exports);
27
- __exportStar(require("./archive-all.command"), exports);
22
+ __exportStar(require("./delete-chat.command"), exports);
28
23
  __exportStar(require("./delete-chat.command.v2"), exports);
24
+ __exportStar(require("./find-chat-by-uuid.command"), exports);
25
+ __exportStar(require("./find-chat.command"), exports);
26
+ __exportStar(require("./find-chats.command"), exports);
27
+ __exportStar(require("./get-my-last-active-chat-command.v2"), exports);
28
+ __exportStar(require("./get-my-last-active-chat.command"), exports);
29
+ __exportStar(require("./update-chat.command"), exports);
@@ -14,17 +14,18 @@ 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);
17
18
  __exportStar(require("./auth"), exports);
18
- __exportStar(require("./user"), exports);
19
- __exportStar(require("./page"), exports);
19
+ __exportStar(require("./blog"), exports);
20
20
  __exportStar(require("./category"), exports);
21
- __exportStar(require("./question"), exports);
22
- __exportStar(require("./unregistered-user"), exports);
23
- __exportStar(require("./ai-model"), exports);
24
21
  __exportStar(require("./chat"), exports);
25
22
  __exportStar(require("./message"), exports);
23
+ __exportStar(require("./page"), exports);
24
+ __exportStar(require("./payment"), exports);
26
25
  __exportStar(require("./product"), exports);
26
+ __exportStar(require("./question"), exports);
27
+ __exportStar(require("./referral"), exports);
27
28
  __exportStar(require("./subscription"), exports);
28
- __exportStar(require("./blog"), exports);
29
+ __exportStar(require("./unregistered-user"), exports);
30
+ __exportStar(require("./user"), exports);
29
31
  __exportStar(require("./user-to-subscription"), exports);
30
- __exportStar(require("./payment"), exports);
@@ -14,7 +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("./create-image-message.command"), exports);
17
18
  __exportStar(require("./create-message.command"), exports);
18
19
  __exportStar(require("./create-text-message.command"), exports);
19
- __exportStar(require("./create-image-message.command"), exports);
20
20
  __exportStar(require("./rate-message.command"), exports);
@@ -14,8 +14,8 @@ 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("./update-page.command"), exports);
18
- __exportStar(require("./delete-page.command"), exports);
19
17
  __exportStar(require("./create-page.command"), exports);
20
- __exportStar(require("./find-page.command"), exports);
18
+ __exportStar(require("./delete-page.command"), exports);
21
19
  __exportStar(require("./find-page-by-alias.command"), exports);
20
+ __exportStar(require("./find-page.command"), exports);
21
+ __exportStar(require("./update-page.command"), exports);
@@ -27,6 +27,7 @@ var BuyProductCommand;
27
27
  });
28
28
  BuyProductCommand.RequestFastSchema = zod_1.z.object({
29
29
  email: zod_1.z.string().email(),
30
+ partnerId: zod_1.z.string().uuid().optional(),
30
31
  });
31
32
  BuyProductCommand.ResponseSchema = zod_1.z.object({
32
33
  publicId: zod_1.z.string(),
@@ -14,8 +14,8 @@ 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("./update-product.command"), exports);
18
- __exportStar(require("./delete-product.command"), exports);
17
+ __exportStar(require("./buy-product.command"), exports);
19
18
  __exportStar(require("./create-product.command"), exports);
19
+ __exportStar(require("./delete-product.command"), exports);
20
20
  __exportStar(require("./find-product.command"), exports);
21
- __exportStar(require("./buy-product.command"), exports);
21
+ __exportStar(require("./update-product.command"), exports);
@@ -14,7 +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("./update-question.command"), exports);
18
- __exportStar(require("./delete-question.command"), exports);
19
17
  __exportStar(require("./create-question.command"), exports);
18
+ __exportStar(require("./delete-question.command"), exports);
20
19
  __exportStar(require("./find-question.command"), exports);
20
+ __exportStar(require("./update-question.command"), exports);
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetMyBonusesCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const zod_1 = require("zod");
6
+ var GetMyBonusesCommand;
7
+ (function (GetMyBonusesCommand) {
8
+ GetMyBonusesCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.object({
10
+ sumTotal: zod_1.z.number(),
11
+ sumInitial: zod_1.z.number(),
12
+ statistics: zod_1.z.array(models_1.ReferralBonusStatisticsSchema),
13
+ }),
14
+ });
15
+ })(GetMyBonusesCommand || (exports.GetMyBonusesCommand = GetMyBonusesCommand = {}));
@@ -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("./get-by-bonuses.command"), exports);
@@ -13,6 +13,7 @@ var BuySubscriptionCommand;
13
13
  });
14
14
  BuySubscriptionCommand.RequestFastSchema = zod_1.z.object({
15
15
  email: zod_1.z.string().email(),
16
+ partnerId: zod_1.z.string().uuid().optional(),
16
17
  });
17
18
  const IReceiptOrderSchema = zod_1.z.object({
18
19
  items: zod_1.z.array(zod_1.z.object({
@@ -14,12 +14,13 @@ 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("./update-subscription.command"), exports);
18
- __exportStar(require("./delete-subscription.command"), exports);
17
+ __exportStar(require("./buy-subscription.command"), exports);
18
+ __exportStar(require("./cancel-subscription.command"), exports);
19
+ __exportStar(require("./create-custom-subscription-plan.command"), exports);
19
20
  __exportStar(require("./create-subscription.command"), exports);
21
+ __exportStar(require("./delete-subscription.command"), exports);
20
22
  __exportStar(require("./find-subscription.command"), exports);
21
- __exportStar(require("./cancel-subscription.command"), exports);
22
- __exportStar(require("./recover-subscription.command"), exports);
23
23
  __exportStar(require("./get-available-upgrades.command"), exports);
24
+ __exportStar(require("./recover-subscription.command"), exports);
24
25
  __exportStar(require("./update-subscription.command"), exports);
25
- __exportStar(require("./create-custom-subscription-plan.command"), exports);
26
+ __exportStar(require("./upgrade-subscription.command"), exports);
@@ -14,6 +14,6 @@ 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-email.command"), exports);
17
18
  __exportStar(require("./find-user.command"), exports);
18
19
  __exportStar(require("./up-token-bonus-balance.command"), exports);
19
- __exportStar(require("./check-email.command"), 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("./category-type.enum"), exports);
18
17
  __exportStar(require("./category-content-type.enum"), exports);
18
+ __exportStar(require("./category-type.enum"), exports);
@@ -15,5 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./chat-status.enum"), exports);
18
- __exportStar(require("./dalle-image-size.enum"), exports);
19
18
  __exportStar(require("./dalle-image-format.enum"), exports);
19
+ __exportStar(require("./dalle-image-size.enum"), 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("./white-list"), 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("./email-endpoint"), exports);
18
+ __exportStar(require("./subjects"), exports);
@@ -555,4 +555,29 @@ exports.ERRORS = {
555
555
  message: 'Невозможно улучшить подписку с данными параметрами',
556
556
  httpCode: 400,
557
557
  },
558
+ PARTNER_NOT_FOUND: {
559
+ code: 'A125',
560
+ message: 'Не удалось найти партнера по реферальной программе',
561
+ httpCode: 404,
562
+ },
563
+ REFERRAL_BONUSES_NOT_FOUND: {
564
+ code: 'A126',
565
+ message: 'Не удалось найти бонусы по реферальной программе',
566
+ httpCode: 404,
567
+ },
568
+ REFERRAL_BONUS_UPDATE_ERROR: {
569
+ code: 'A127',
570
+ message: 'Не удалось обновить бонусы по реферальной программе',
571
+ httpCode: 500,
572
+ },
573
+ REFERRAL_BONUS_STATS_ERROR: {
574
+ code: 'A128',
575
+ message: 'Не удалось получить статистику по бонусам по реферальной программе',
576
+ httpCode: 500,
577
+ },
578
+ REFERRAL_BONUS_APPLY_ERROR: {
579
+ code: 'A129',
580
+ message: 'Не удалось применить бонусы по реферальной программе',
581
+ httpCode: 500,
582
+ },
558
583
  };
@@ -14,13 +14,19 @@ 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("./category"), exports);
19
+ __exportStar(require("./chat"), exports);
20
+ __exportStar(require("./cloud-payments"), exports);
21
+ __exportStar(require("./domains"), exports);
22
+ __exportStar(require("./email"), exports);
17
23
  __exportStar(require("./errors"), exports);
18
- __exportStar(require("./roles"), exports);
19
- __exportStar(require("./payment"), exports);
24
+ __exportStar(require("./message"), exports);
20
25
  __exportStar(require("./order"), exports);
21
- __exportStar(require("./chat"), exports);
22
- __exportStar(require("./subscription"), exports);
26
+ __exportStar(require("./payment"), exports);
23
27
  __exportStar(require("./product"), exports);
24
- __exportStar(require("./category"), exports);
25
- __exportStar(require("./ai-model"), exports);
26
- __exportStar(require("./message"), exports);
28
+ __exportStar(require("./referral"), exports);
29
+ __exportStar(require("./roles"), exports);
30
+ __exportStar(require("./subscription"), exports);
31
+ __exportStar(require("./transaction"), exports);
32
+ __exportStar(require("./user"), 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("./payment-status.enum"), exports);
18
17
  __exportStar(require("./payment-history-item-type.enum"), exports);
18
+ __exportStar(require("./payment-status.enum"), 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("./referral-bonus-type.enum"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReferralBonusType = void 0;
4
+ var ReferralBonusType;
5
+ (function (ReferralBonusType) {
6
+ ReferralBonusType["PARTNER"] = "partner";
7
+ ReferralBonusType["REFERRAL"] = "referral";
8
+ })(ReferralBonusType || (exports.ReferralBonusType = ReferralBonusType = {}));
@@ -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);
@@ -14,8 +14,8 @@ 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("./subscription-status.enum"), exports);
17
+ __exportStar(require("./subscription-action.enum"), exports);
18
18
  __exportStar(require("./subscription-plan.enum"), exports);
19
- __exportStar(require("./user-to-subscription-type.enum"), exports);
19
+ __exportStar(require("./subscription-status.enum"), exports);
20
20
  __exportStar(require("./subscription-type.enum"), exports);
21
- __exportStar(require("./subscription-action.enum"), exports);
21
+ __exportStar(require("./user-to-subscription-type.enum"), exports);
@@ -1 +1,18 @@
1
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("./transaction-status.enum"), exports);
18
+ __exportStar(require("./user-balance-status.enum"), exports);
@@ -6,4 +6,5 @@ var USER_BALANCE_STATUS;
6
6
  USER_BALANCE_STATUS["bonus_balance"] = "bonus_balance";
7
7
  USER_BALANCE_STATUS["subscription_balance"] = "subscription_balance";
8
8
  USER_BALANCE_STATUS["product_balance"] = "product_balance";
9
+ USER_BALANCE_STATUS["referral_bonus_balance"] = "referral_bonus_balance";
9
10
  })(USER_BALANCE_STATUS || (exports.USER_BALANCE_STATUS = USER_BALANCE_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);
@@ -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("./user-status"), 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("./enums"), exports);
18
+ __exportStar(require("./user-public"), exports);
package/build/index.js CHANGED
@@ -14,8 +14,8 @@ 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("./constants"), exports);
18
- __exportStar(require("./commands"), exports);
19
17
  __exportStar(require("./api"), exports);
20
- __exportStar(require("./models"), exports);
18
+ __exportStar(require("./commands"), exports);
19
+ __exportStar(require("./constants"), exports);
21
20
  __exportStar(require("./helpers"), exports);
21
+ __exportStar(require("./models"), exports);
@@ -14,16 +14,20 @@ 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("./user.schema"), exports);
18
- __exportStar(require("./page.schema"), exports);
17
+ __exportStar(require("./ai-model.schema"), exports);
19
18
  __exportStar(require("./category.schema"), exports);
20
- __exportStar(require("./question.schema"), exports);
21
- __exportStar(require("./unregistered-user.schema"), exports);
22
19
  __exportStar(require("./chat.schema"), exports);
23
20
  __exportStar(require("./message.schema"), exports);
24
- __exportStar(require("./ai-model.schema"), exports);
25
- __exportStar(require("./product.schema"), exports);
26
- __exportStar(require("./subscription.schema"), exports);
27
21
  __exportStar(require("./order.schema"), exports);
22
+ __exportStar(require("./page.schema"), exports);
23
+ __exportStar(require("./payment-history-item.schema"), exports);
24
+ __exportStar(require("./payment.schema"), exports);
28
25
  __exportStar(require("./post.schema"), exports);
26
+ __exportStar(require("./product.schema"), exports);
27
+ __exportStar(require("./question.schema"), exports);
28
+ __exportStar(require("./referral-bonus.schema"), exports);
29
+ __exportStar(require("./subscription-upgrade-schema"), exports);
30
+ __exportStar(require("./subscription.schema"), exports);
31
+ __exportStar(require("./unregistered-user.schema"), exports);
29
32
  __exportStar(require("./user-to-subscription.schema"), exports);
33
+ __exportStar(require("./user.schema"), exports);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReferralBonusStatisticsSchema = exports.ReferralBonusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const referral_1 = require("../constants/referral");
6
+ exports.ReferralBonusSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ partnerId: zod_1.z.string().uuid(),
9
+ referralId: zod_1.z.string().uuid(),
10
+ initial: zod_1.z.number(),
11
+ total: zod_1.z.number(),
12
+ type: zod_1.z.nativeEnum(referral_1.ReferralBonusType),
13
+ createdAt: zod_1.z.date(),
14
+ updatedAt: zod_1.z.date(),
15
+ });
16
+ exports.ReferralBonusStatisticsSchema = zod_1.z.object({
17
+ initial: zod_1.z.number(),
18
+ weekStart: zod_1.z.date(),
19
+ });
@@ -1,4 +1,4 @@
1
- export * from './update-ai-model.command';
2
- export * from './delete-ai-model.command';
3
1
  export * from './create-ai-model.command';
2
+ export * from './delete-ai-model.command';
4
3
  export * from './find-ai-model.command';
4
+ export * from './update-ai-model.command';
@@ -1,6 +1,7 @@
1
- export * from './reset-password.command';
2
- export * from './restore-password.command';
1
+ export * from './create-user.command';
3
2
  export * from './login.command';
4
3
  export * from './register-user.command';
5
- export * from './create-user.command';
4
+ export * from './reset-password.command';
5
+ export * from './restore-password.command';
6
+ export * from './verify-email-retry.command';
6
7
  export * from './verify-email.command';
@@ -2,10 +2,12 @@ import { UserSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace RegisterUserCommand {
5
- export const RequestSchema = UserSchema.pick({
6
- email: true,
7
- password: true,
8
- });
5
+ export const RequestSchema = z.intersection(
6
+ UserSchema.pick({ email: true, password: true }),
7
+ z.object({
8
+ partnerId: z.string().uuid().optional(),
9
+ }),
10
+ );
9
11
 
10
12
  export type Request = z.infer<typeof RequestSchema>;
11
13
 
@@ -1,6 +1,6 @@
1
1
  export * from './create-post.command';
2
- export * from './update-post.command';
3
2
  export * from './delete-post.command';
4
- export * from './find-post-by-uuid.command';
5
3
  export * from './find-post-by-alias.command';
4
+ export * from './find-post-by-uuid.command';
6
5
  export * from './find-post.command';
6
+ export * from './update-post.command';
@@ -1,4 +1,4 @@
1
- export * from './update-category.command';
2
- export * from './delete-category.command';
3
1
  export * from './create-category.command';
2
+ export * from './delete-category.command';
4
3
  export * from './find-category.command';
4
+ export * from './update-category.command';
@@ -1,12 +1,13 @@
1
- export * from './update-chat.command';
2
- export * from './delete-chat.command';
3
- export * from './create-chat.command';
4
- export * from './find-chat.command';
5
- export * from './get-my-last-active-chat.command';
1
+ export * from './archive-all.command';
6
2
  export * from './check-limit.command';
7
3
  export * from './check-limit.command.v2';
8
- export * from './get-my-last-active-chat-command.v2';
4
+ export * from './create-chat.command';
9
5
  export * from './create-chat.command.v2';
10
- export * from './find-chat-by-uuid.command';
11
- export * from './archive-all.command';
6
+ export * from './delete-chat.command';
12
7
  export * from './delete-chat.command.v2';
8
+ export * from './find-chat-by-uuid.command';
9
+ export * from './find-chat.command';
10
+ export * from './find-chats.command';
11
+ export * from './get-my-last-active-chat-command.v2';
12
+ export * from './get-my-last-active-chat.command';
13
+ export * from './update-chat.command';
package/commands/index.ts CHANGED
@@ -1,14 +1,15 @@
1
+ export * from './ai-model';
1
2
  export * from './auth';
2
- export * from './user';
3
- export * from './page';
3
+ export * from './blog';
4
4
  export * from './category';
5
- export * from './question';
6
- export * from './unregistered-user';
7
- export * from './ai-model';
8
5
  export * from './chat';
9
6
  export * from './message';
7
+ export * from './page';
8
+ export * from './payment';
10
9
  export * from './product';
10
+ export * from './question';
11
+ export * from './referral';
11
12
  export * from './subscription';
12
- export * from './blog';
13
+ export * from './unregistered-user';
14
+ export * from './user';
13
15
  export * from './user-to-subscription';
14
- export * from './payment';
@@ -1,4 +1,4 @@
1
+ export * from './create-image-message.command';
1
2
  export * from './create-message.command';
2
3
  export * from './create-text-message.command';
3
- export * from './create-image-message.command';
4
4
  export * from './rate-message.command';
@@ -1,5 +1,5 @@
1
- export * from './update-page.command';
2
- export * from './delete-page.command';
3
1
  export * from './create-page.command';
4
- export * from './find-page.command';
2
+ export * from './delete-page.command';
5
3
  export * from './find-page-by-alias.command';
4
+ export * from './find-page.command';
5
+ export * from './update-page.command';
@@ -33,6 +33,7 @@ export namespace BuyProductCommand {
33
33
 
34
34
  export const RequestFastSchema = z.object({
35
35
  email: z.string().email(),
36
+ partnerId: z.string().uuid().optional(),
36
37
  });
37
38
 
38
39
  export type RequestFast = z.infer<typeof RequestFastSchema>;
@@ -1,5 +1,5 @@
1
- export * from './update-product.command';
2
- export * from './delete-product.command';
1
+ export * from './buy-product.command';
3
2
  export * from './create-product.command';
3
+ export * from './delete-product.command';
4
4
  export * from './find-product.command';
5
- export * from './buy-product.command';
5
+ export * from './update-product.command';
@@ -1,4 +1,4 @@
1
- export * from './update-question.command';
2
- export * from './delete-question.command';
3
1
  export * from './create-question.command';
2
+ export * from './delete-question.command';
4
3
  export * from './find-question.command';
4
+ export * from './update-question.command';
@@ -0,0 +1,14 @@
1
+ import { ReferralBonusStatisticsSchema } from '../../models';
2
+ import { z } from 'zod';
3
+
4
+ export namespace GetMyBonusesCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: z.object({
7
+ sumTotal: z.number(),
8
+ sumInitial: z.number(),
9
+ statistics: z.array(ReferralBonusStatisticsSchema),
10
+ }),
11
+ });
12
+
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1 @@
1
+ export * from './get-by-bonuses.command';
@@ -13,6 +13,7 @@ export namespace BuySubscriptionCommand {
13
13
  export type Request = z.infer<typeof RequestSchema>;
14
14
  export const RequestFastSchema = z.object({
15
15
  email: z.string().email(),
16
+ partnerId: z.string().uuid().optional(),
16
17
  });
17
18
 
18
19
  export type RequestFast = z.infer<typeof RequestFastSchema>;
@@ -1,9 +1,10 @@
1
- export * from './update-subscription.command';
2
- export * from './delete-subscription.command';
1
+ export * from './buy-subscription.command';
2
+ export * from './cancel-subscription.command';
3
+ export * from './create-custom-subscription-plan.command';
3
4
  export * from './create-subscription.command';
5
+ export * from './delete-subscription.command';
4
6
  export * from './find-subscription.command';
5
- export * from './cancel-subscription.command';
6
- export * from './recover-subscription.command';
7
7
  export * from './get-available-upgrades.command';
8
+ export * from './recover-subscription.command';
8
9
  export * from './update-subscription.command';
9
- export * from './create-custom-subscription-plan.command';
10
+ export * from './upgrade-subscription.command';
@@ -1,3 +1,3 @@
1
+ export * from './check-email.command';
1
2
  export * from './find-user.command';
2
3
  export * from './up-token-bonus-balance.command';
3
- export * from './check-email.command';
@@ -1,2 +1,2 @@
1
- export * from './category-type.enum';
2
1
  export * from './category-content-type.enum';
2
+ export * from './category-type.enum';
@@ -1,3 +1,3 @@
1
1
  export * from './chat-status.enum';
2
- export * from './dalle-image-size.enum';
3
2
  export * from './dalle-image-format.enum';
3
+ export * from './dalle-image-size.enum';
@@ -0,0 +1 @@
1
+ export * from './white-list';
@@ -0,0 +1,2 @@
1
+ export * from './email-endpoint';
2
+ export * from './subjects';
@@ -555,4 +555,29 @@ export const ERRORS = {
555
555
  message: 'Невозможно улучшить подписку с данными параметрами',
556
556
  httpCode: 400,
557
557
  },
558
+ PARTNER_NOT_FOUND: {
559
+ code: 'A125',
560
+ message: 'Не удалось найти партнера по реферальной программе',
561
+ httpCode: 404,
562
+ },
563
+ REFERRAL_BONUSES_NOT_FOUND: {
564
+ code: 'A126',
565
+ message: 'Не удалось найти бонусы по реферальной программе',
566
+ httpCode: 404,
567
+ },
568
+ REFERRAL_BONUS_UPDATE_ERROR: {
569
+ code: 'A127',
570
+ message: 'Не удалось обновить бонусы по реферальной программе',
571
+ httpCode: 500,
572
+ },
573
+ REFERRAL_BONUS_STATS_ERROR: {
574
+ code: 'A128',
575
+ message: 'Не удалось получить статистику по бонусам по реферальной программе',
576
+ httpCode: 500,
577
+ },
578
+ REFERRAL_BONUS_APPLY_ERROR: {
579
+ code: 'A129',
580
+ message: 'Не удалось применить бонусы по реферальной программе',
581
+ httpCode: 500,
582
+ },
558
583
  };
@@ -1,10 +1,16 @@
1
+ export * from './ai-model';
2
+ export * from './category';
3
+ export * from './chat';
4
+ export * from './cloud-payments';
5
+ export * from './domains';
6
+ export * from './email';
1
7
  export * from './errors';
2
- export * from './roles';
3
- export * from './payment';
8
+ export * from './message';
4
9
  export * from './order';
5
- export * from './chat';
6
- export * from './subscription';
10
+ export * from './payment';
7
11
  export * from './product';
8
- export * from './category';
9
- export * from './ai-model';
10
- export * from './message';
12
+ export * from './referral';
13
+ export * from './roles';
14
+ export * from './subscription';
15
+ export * from './transaction';
16
+ export * from './user';
@@ -1,2 +1,2 @@
1
- export * from './payment-status.enum';
2
1
  export * from './payment-history-item-type.enum';
2
+ export * from './payment-status.enum';
@@ -0,0 +1 @@
1
+ export * from './referral-bonus-type.enum';
@@ -0,0 +1,4 @@
1
+ export enum ReferralBonusType {
2
+ PARTNER = 'partner',
3
+ REFERRAL = 'referral',
4
+ }
@@ -0,0 +1 @@
1
+ export * from './enums';
@@ -1,5 +1,5 @@
1
- export * from './subscription-status.enum';
1
+ export * from './subscription-action.enum';
2
2
  export * from './subscription-plan.enum';
3
- export * from './user-to-subscription-type.enum';
3
+ export * from './subscription-status.enum';
4
4
  export * from './subscription-type.enum';
5
- export * from './subscription-action.enum';
5
+ export * from './user-to-subscription-type.enum';
@@ -0,0 +1,2 @@
1
+ export * from './transaction-status.enum';
2
+ export * from './user-balance-status.enum';
@@ -2,4 +2,5 @@ export enum USER_BALANCE_STATUS {
2
2
  bonus_balance = 'bonus_balance',
3
3
  subscription_balance = 'subscription_balance',
4
4
  product_balance = 'product_balance',
5
+ referral_bonus_balance = 'referral_bonus_balance',
5
6
  }
@@ -0,0 +1 @@
1
+ export * from './enums';
@@ -0,0 +1 @@
1
+ export * from './user-status';
@@ -0,0 +1,2 @@
1
+ export * from './enums';
2
+ export * from './user-public';
package/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './constants';
2
- export * from './commands';
3
1
  export * from './api';
4
- export * from './models';
2
+ export * from './commands';
3
+ export * from './constants';
5
4
  export * from './helpers';
5
+ export * from './models';
package/models/index.ts CHANGED
@@ -1,13 +1,17 @@
1
- export * from './user.schema';
2
- export * from './page.schema';
1
+ export * from './ai-model.schema';
3
2
  export * from './category.schema';
4
- export * from './question.schema';
5
- export * from './unregistered-user.schema';
6
3
  export * from './chat.schema';
7
4
  export * from './message.schema';
8
- export * from './ai-model.schema';
9
- export * from './product.schema';
10
- export * from './subscription.schema';
11
5
  export * from './order.schema';
6
+ export * from './page.schema';
7
+ export * from './payment-history-item.schema';
8
+ export * from './payment.schema';
12
9
  export * from './post.schema';
10
+ export * from './product.schema';
11
+ export * from './question.schema';
12
+ export * from './referral-bonus.schema';
13
+ export * from './subscription-upgrade-schema';
14
+ export * from './subscription.schema';
15
+ export * from './unregistered-user.schema';
13
16
  export * from './user-to-subscription.schema';
17
+ export * from './user.schema';
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { ReferralBonusType } from '../constants/referral';
3
+
4
+ export const ReferralBonusSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ partnerId: z.string().uuid(),
7
+ referralId: z.string().uuid(),
8
+ initial: z.number(),
9
+ total: z.number(),
10
+ type: z.nativeEnum(ReferralBonusType),
11
+ createdAt: z.date(),
12
+ updatedAt: z.date(),
13
+ });
14
+
15
+ export const ReferralBonusStatisticsSchema = z.object({
16
+ initial: z.number(),
17
+ weekStart: z.date(),
18
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.5.13",
3
+ "version": "0.5.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {