@purpleschool/gptbot 0.7.63 → 0.7.65

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 (107) hide show
  1. package/api/controllers/http/index.ts +2 -0
  2. package/api/controllers/http/promocode.ts +1 -0
  3. package/api/controllers/http/video-editor.ts +14 -0
  4. package/api/controllers/http/webmaster.ts +10 -0
  5. package/api/routes.ts +6 -0
  6. package/build/api/controllers/http/index.js +2 -0
  7. package/build/api/controllers/http/promocode.js +1 -0
  8. package/build/api/controllers/http/video-editor.js +16 -0
  9. package/build/api/controllers/http/webmaster.js +12 -0
  10. package/build/api/routes.js +5 -0
  11. package/build/commands/index.js +1 -0
  12. package/build/commands/promocode/get-webmaster-promocode.command.js +17 -0
  13. package/build/commands/promocode/index.js +1 -0
  14. package/build/commands/tools/index.js +1 -0
  15. package/build/commands/tools/video-editor/delete-all-video-editor-jobs.command.js +11 -0
  16. package/build/commands/tools/video-editor/delete-video-editor-job-by-uuid.command.js +14 -0
  17. package/build/commands/tools/video-editor/edit-video.command.js +16 -0
  18. package/build/commands/tools/video-editor/find-video-editor-job-by-id.command.js +14 -0
  19. package/build/commands/tools/video-editor/find-video-editor-jobs.command.js +18 -0
  20. package/build/commands/tools/video-editor/get-video-editor-config.command.js +14 -0
  21. package/build/commands/tools/video-editor/index.js +25 -0
  22. package/build/commands/tools/video-editor/retry-video-editor-job.command.js +14 -0
  23. package/build/commands/tools/video-editor/set-reaction-to-video-editor-job.command.js +18 -0
  24. package/build/commands/tools/video-editor/update-video-editor-job-title.command.js +17 -0
  25. package/build/commands/webmaster/confirm-withdrawal.command.js +14 -0
  26. package/build/commands/webmaster/create-webmaster.command.js +16 -0
  27. package/build/commands/webmaster/create-withdrawal-request.command.js +16 -0
  28. package/build/commands/webmaster/get-my-webmaster.command.js +11 -0
  29. package/build/commands/webmaster/get-webmaster-balance-overview.command.js +26 -0
  30. package/build/commands/webmaster/index.js +22 -0
  31. package/build/commands/webmaster/update-webmaster.command.js +13 -0
  32. package/build/constants/errors/errors.js +155 -0
  33. package/build/constants/file/enums/file-type.enum.js +1 -0
  34. package/build/constants/file/file.constants.js +4 -1
  35. package/build/constants/index.js +3 -0
  36. package/build/constants/promocode/enums/promocode-promotion.enum.js +1 -0
  37. package/build/constants/tool-video-editor/enums/index.js +17 -0
  38. package/build/constants/tool-video-editor/enums/video-editor-model-strategy.enum.js +7 -0
  39. package/build/constants/tool-video-editor/index.js +17 -0
  40. package/build/constants/webmaster/enums/index.js +17 -0
  41. package/build/constants/webmaster/enums/organization-type.enum.js +9 -0
  42. package/build/constants/webmaster/index.js +17 -0
  43. package/build/constants/webmaster-balance/enums/index.js +18 -0
  44. package/build/constants/webmaster-balance/enums/webmaster-balance-status.enum.js +10 -0
  45. package/build/constants/webmaster-balance/enums/webmaster-balance-type.enum.js +8 -0
  46. package/build/constants/webmaster-balance/index.js +17 -0
  47. package/build/helpers/index.js +1 -0
  48. package/build/helpers/video-editor/calculate-video-editing-price.helper.js +6 -0
  49. package/build/helpers/video-editor/index.js +17 -0
  50. package/build/models/index.js +2 -0
  51. package/build/models/promocode.schema.js +1 -0
  52. package/build/models/tools/index.js +1 -0
  53. package/build/models/tools/video-editor/index.js +19 -0
  54. package/build/models/tools/video-editor/video-editor-config.schema.js +8 -0
  55. package/build/models/tools/video-editor/video-editor-job.schema.js +14 -0
  56. package/build/models/tools/video-editor/video-editor-model.schema.js +25 -0
  57. package/build/models/webmaster-balance.schema.js +20 -0
  58. package/build/models/webmaster.schema.js +21 -0
  59. package/commands/index.ts +1 -0
  60. package/commands/promocode/get-webmaster-promocode.command.ts +19 -0
  61. package/commands/promocode/index.ts +1 -0
  62. package/commands/tools/index.ts +1 -0
  63. package/commands/tools/video-editor/delete-all-video-editor-jobs.command.ts +13 -0
  64. package/commands/tools/video-editor/delete-video-editor-job-by-uuid.command.ts +16 -0
  65. package/commands/tools/video-editor/edit-video.command.ts +18 -0
  66. package/commands/tools/video-editor/find-video-editor-job-by-id.command.ts +16 -0
  67. package/commands/tools/video-editor/find-video-editor-jobs.command.ts +18 -0
  68. package/commands/tools/video-editor/get-video-editor-config.command.ts +16 -0
  69. package/commands/tools/video-editor/index.ts +9 -0
  70. package/commands/tools/video-editor/retry-video-editor-job.command.ts +16 -0
  71. package/commands/tools/video-editor/set-reaction-to-video-editor-job.command.ts +21 -0
  72. package/commands/tools/video-editor/update-video-editor-job-title.command.ts +20 -0
  73. package/commands/webmaster/confirm-withdrawal.command.ts +16 -0
  74. package/commands/webmaster/create-webmaster.command.ts +18 -0
  75. package/commands/webmaster/create-withdrawal-request.command.ts +18 -0
  76. package/commands/webmaster/get-my-webmaster.command.ts +12 -0
  77. package/commands/webmaster/get-webmaster-balance-overview.command.ts +29 -0
  78. package/commands/webmaster/index.ts +6 -0
  79. package/commands/webmaster/update-webmaster.command.ts +18 -0
  80. package/constants/errors/errors.ts +155 -0
  81. package/constants/file/enums/file-type.enum.ts +1 -0
  82. package/constants/file/file.constants.ts +4 -0
  83. package/constants/index.ts +3 -0
  84. package/constants/promocode/enums/promocode-promotion.enum.ts +1 -0
  85. package/constants/tool-video-editor/enums/index.ts +1 -0
  86. package/constants/tool-video-editor/enums/video-editor-model-strategy.enum.ts +3 -0
  87. package/constants/tool-video-editor/index.ts +1 -0
  88. package/constants/webmaster/enums/index.ts +1 -0
  89. package/constants/webmaster/enums/organization-type.enum.ts +5 -0
  90. package/constants/webmaster/index.ts +1 -0
  91. package/constants/webmaster-balance/enums/index.ts +2 -0
  92. package/constants/webmaster-balance/enums/webmaster-balance-status.enum.ts +6 -0
  93. package/constants/webmaster-balance/enums/webmaster-balance-type.enum.ts +4 -0
  94. package/constants/webmaster-balance/index.ts +1 -0
  95. package/helpers/index.ts +1 -0
  96. package/helpers/video-editor/calculate-video-editing-price.helper.ts +9 -0
  97. package/helpers/video-editor/index.ts +1 -0
  98. package/models/index.ts +2 -0
  99. package/models/promocode.schema.ts +1 -0
  100. package/models/tools/index.ts +1 -0
  101. package/models/tools/video-editor/index.ts +3 -0
  102. package/models/tools/video-editor/video-editor-config.schema.ts +6 -0
  103. package/models/tools/video-editor/video-editor-job.schema.ts +14 -0
  104. package/models/tools/video-editor/video-editor-model.schema.ts +24 -0
  105. package/models/webmaster-balance.schema.ts +16 -0
  106. package/models/webmaster.schema.ts +18 -0
  107. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DELETE_UNUSED_FILES_AFTER_HOURS = exports.SUPPORTED_FILES = exports.MAX_DOC_UPLOAD_SIZE = exports.MAX_TEXT_UPLOAD_SIZE = exports.MAX_AUDIO_UPLOAD_SIZE = exports.MAX_IMAGE_UPLOAD_SIZE = void 0;
3
+ exports.DELETE_UNUSED_FILES_AFTER_HOURS = exports.SUPPORTED_FILES = exports.MAX_VIDEO_UPLOAD_SIZE = exports.MAX_DOC_UPLOAD_SIZE = exports.MAX_TEXT_UPLOAD_SIZE = exports.MAX_AUDIO_UPLOAD_SIZE = exports.MAX_IMAGE_UPLOAD_SIZE = void 0;
4
4
  const enums_1 = require("./enums");
5
5
  exports.MAX_IMAGE_UPLOAD_SIZE = 5 * 1024 * 1024; // 5 MB
6
6
  exports.MAX_AUDIO_UPLOAD_SIZE = 500 * 1024 * 1024; // 500 MB
7
7
  exports.MAX_TEXT_UPLOAD_SIZE = 10 * 1024 * 1024; // 10 MB
8
8
  exports.MAX_DOC_UPLOAD_SIZE = 20 * 1024 * 1024; // 20 MB
9
+ exports.MAX_VIDEO_UPLOAD_SIZE = 500 * 1024 * 1024; // 500 MB
9
10
  exports.SUPPORTED_FILES = new Map([
10
11
  ['image/jpeg', { type: enums_1.FILE_TYPE.IMAGE, size: exports.MAX_IMAGE_UPLOAD_SIZE }],
11
12
  ['image/png', { type: enums_1.FILE_TYPE.IMAGE, size: exports.MAX_IMAGE_UPLOAD_SIZE }],
@@ -53,5 +54,7 @@ exports.SUPPORTED_FILES = new Map([
53
54
  { type: enums_1.FILE_TYPE.DOCUMENT, size: exports.MAX_DOC_UPLOAD_SIZE },
54
55
  ], //.xlsx
55
56
  ['application/pdf', { type: enums_1.FILE_TYPE.DOCUMENT, size: exports.MAX_DOC_UPLOAD_SIZE }],
57
+ // Video formats
58
+ ['video/mp4', { type: enums_1.FILE_TYPE.VIDEO, size: exports.MAX_VIDEO_UPLOAD_SIZE }],
56
59
  ]);
57
60
  exports.DELETE_UNUSED_FILES_AFTER_HOURS = 12;
@@ -47,8 +47,11 @@ __exportStar(require("./promocode"), exports);
47
47
  __exportStar(require("./ui-notification"), exports);
48
48
  __exportStar(require("./review"), exports);
49
49
  __exportStar(require("./tool-video"), exports);
50
+ __exportStar(require("./tool-video-editor"), exports);
50
51
  __exportStar(require("./writer"), exports);
51
52
  __exportStar(require("./tool-image-editor"), exports);
52
53
  __exportStar(require("./feedback"), exports);
53
54
  __exportStar(require("./daily-streak"), exports);
54
55
  __exportStar(require("./cabinet"), exports);
56
+ __exportStar(require("./webmaster"), exports);
57
+ __exportStar(require("./webmaster-balance"), exports);
@@ -6,4 +6,5 @@ var PROMOCODE_PROMOTION;
6
6
  PROMOCODE_PROMOTION["BONUS"] = "bonus";
7
7
  PROMOCODE_PROMOTION["CHAT_UPSELL"] = "chat_upsell";
8
8
  PROMOCODE_PROMOTION["DAILY_STREAK"] = "daily_streak";
9
+ PROMOCODE_PROMOTION["WEBMASTER"] = "webmaster";
9
10
  })(PROMOCODE_PROMOTION || (exports.PROMOCODE_PROMOTION = PROMOCODE_PROMOTION = {}));
@@ -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("./video-editor-model-strategy.enum"), exports);
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VIDEO_EDITOR_MODEL_STRATEGY = void 0;
4
+ var VIDEO_EDITOR_MODEL_STRATEGY;
5
+ (function (VIDEO_EDITOR_MODEL_STRATEGY) {
6
+ VIDEO_EDITOR_MODEL_STRATEGY["LUMA_MODIFY_POLLING"] = "LUMA_MODIFY_POLLING";
7
+ })(VIDEO_EDITOR_MODEL_STRATEGY || (exports.VIDEO_EDITOR_MODEL_STRATEGY = VIDEO_EDITOR_MODEL_STRATEGY = {}));
@@ -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("./organization-type.enum"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ORGANIZATION_TYPE = void 0;
4
+ var ORGANIZATION_TYPE;
5
+ (function (ORGANIZATION_TYPE) {
6
+ ORGANIZATION_TYPE["INDIVIDUAL_ENTREPRENEUR"] = "\u0418\u041F";
7
+ ORGANIZATION_TYPE["LEGAL_ENTITY"] = "\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0435 \u043B\u0438\u0446\u043E";
8
+ ORGANIZATION_TYPE["SELF_EMPLOYED"] = "\u0421\u0430\u043C\u043E\u0437\u0430\u043D\u044F\u0442\u044B\u0439";
9
+ })(ORGANIZATION_TYPE || (exports.ORGANIZATION_TYPE = ORGANIZATION_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,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("./webmaster-balance-type.enum"), exports);
18
+ __exportStar(require("./webmaster-balance-status.enum"), exports);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WEBMASTER_BALANCE_STATUS = void 0;
4
+ var WEBMASTER_BALANCE_STATUS;
5
+ (function (WEBMASTER_BALANCE_STATUS) {
6
+ WEBMASTER_BALANCE_STATUS["SUCCESS"] = "success";
7
+ WEBMASTER_BALANCE_STATUS["AWAITING_CONFIRMATION"] = "awaiting_confirmation";
8
+ WEBMASTER_BALANCE_STATUS["CANCELLED"] = "cancelled";
9
+ WEBMASTER_BALANCE_STATUS["TELEGRAM_ERROR"] = "telegram_error";
10
+ })(WEBMASTER_BALANCE_STATUS || (exports.WEBMASTER_BALANCE_STATUS = WEBMASTER_BALANCE_STATUS = {}));
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WEBMASTER_BALANCE_TYPE = void 0;
4
+ var WEBMASTER_BALANCE_TYPE;
5
+ (function (WEBMASTER_BALANCE_TYPE) {
6
+ WEBMASTER_BALANCE_TYPE["DEPOSIT"] = "deposit";
7
+ WEBMASTER_BALANCE_TYPE["WITHDRAWAL"] = "withdrawal";
8
+ })(WEBMASTER_BALANCE_TYPE || (exports.WEBMASTER_BALANCE_TYPE = WEBMASTER_BALANCE_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);
@@ -19,4 +19,5 @@ __exportStar(require("./stt"), exports);
19
19
  __exportStar(require("./subscription"), exports);
20
20
  __exportStar(require("./tts"), exports);
21
21
  __exportStar(require("./video"), exports);
22
+ __exportStar(require("./video-editor"), exports);
22
23
  __exportStar(require("./writer"), exports);
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateVideoEditingPrice = calculateVideoEditingPrice;
4
+ function calculateVideoEditingPrice({ duration, pricePerSecond, }) {
5
+ return Math.ceil(duration * pricePerSecond);
6
+ }
@@ -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("./calculate-video-editing-price.helper"), exports);
@@ -66,3 +66,5 @@ __exportStar(require("./folder.schema"), exports);
66
66
  __exportStar(require("./filters.schema"), exports);
67
67
  __exportStar(require("./users-filter-notification.schema"), exports);
68
68
  __exportStar(require("./daily-streak"), exports);
69
+ __exportStar(require("./webmaster.schema"), exports);
70
+ __exportStar(require("./webmaster-balance.schema"), exports);
@@ -15,6 +15,7 @@ exports.PromocodeSchema = zod_1.z.object({
15
15
  endDate: zod_1.z.date().nullable(),
16
16
  userId: zod_1.z.string().uuid().nullable(),
17
17
  unregisteredUserId: zod_1.z.string().uuid().nullable(),
18
+ webmasterId: zod_1.z.string().uuid().nullable(),
18
19
  createdAt: zod_1.z.date(),
19
20
  updatedAt: zod_1.z.date(),
20
21
  });
@@ -21,3 +21,4 @@ __exportStar(require("./tts"), exports);
21
21
  __exportStar(require("./video"), exports);
22
22
  __exportStar(require("./writer"), exports);
23
23
  __exportStar(require("./image-editor"), exports);
24
+ __exportStar(require("./video-editor"), exports);
@@ -0,0 +1,19 @@
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("./video-editor-config.schema"), exports);
18
+ __exportStar(require("./video-editor-job.schema"), exports);
19
+ __exportStar(require("./video-editor-model.schema"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VideoEditorConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const video_editor_model_schema_1 = require("./video-editor-model.schema");
6
+ exports.VideoEditorConfigSchema = zod_1.z.object({
7
+ models: zod_1.z.array(video_editor_model_schema_1.VideoEditorModelSchema),
8
+ });
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VideoEditorJobSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const tool_job_schema_1 = require("../../tool-job.schema");
6
+ const constants_1 = require("../../../constants");
7
+ exports.VideoEditorJobSchema = tool_job_schema_1.ToolJobSchema.extend({
8
+ title: zod_1.z.string(),
9
+ prompt: zod_1.z.string(),
10
+ reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
11
+ inputVideoUrl: zod_1.z.string(),
12
+ outputVideoUrl: zod_1.z.string().nullable(),
13
+ modelId: zod_1.z.string(),
14
+ });
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VideoEditorModelSchema = exports.VideoEditorModelParamsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
6
+ const unlocked_by_subscription_schema_1 = require("../../unlocked-by-subscription.schema");
7
+ exports.VideoEditorModelParamsSchema = zod_1.z.object({
8
+ supportedFormats: zod_1.z.array(zod_1.z.string()),
9
+ });
10
+ exports.VideoEditorModelSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string(),
12
+ title: zod_1.z.string(),
13
+ description: zod_1.z.string(),
14
+ aiModel: zod_1.z.string(),
15
+ pricePerSecond: zod_1.z.number(),
16
+ order: zod_1.z.number(),
17
+ icons: icon_variants_schema_1.IconVariantsSchema,
18
+ maxPromptLength: zod_1.z.number(),
19
+ maxInputVideoSizeBytes: zod_1.z.number(),
20
+ supportedFormats: zod_1.z.array(zod_1.z.string()),
21
+ createdAt: zod_1.z.date(),
22
+ updatedAt: zod_1.z.date(),
23
+ unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
24
+ canUse: zod_1.z.boolean(),
25
+ });
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WebmasterBalanceSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const constants_1 = require("../constants");
9
+ exports.WebmasterBalanceSchema = zod_1.default.object({
10
+ uuid: zod_1.default.string().uuid(),
11
+ webmasterId: zod_1.default.string().uuid(),
12
+ orderId: zod_1.default.string().uuid().nullable(),
13
+ promocodeId: zod_1.default.string().uuid().nullable(),
14
+ sourceUserId: zod_1.default.string().uuid().nullable(),
15
+ amount: zod_1.default.number(),
16
+ type: zod_1.default.nativeEnum(constants_1.WEBMASTER_BALANCE_TYPE),
17
+ status: zod_1.default.nativeEnum(constants_1.WEBMASTER_BALANCE_STATUS),
18
+ createdAt: zod_1.default.date(),
19
+ updatedAt: zod_1.default.date(),
20
+ });
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WebmasterWithBalanceSchema = exports.WebmasterSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const webmaster_1 = require("../constants/webmaster");
9
+ exports.WebmasterSchema = zod_1.default.object({
10
+ uuid: zod_1.default.string().uuid(),
11
+ userId: zod_1.default.string().uuid(),
12
+ organization: zod_1.default.string(),
13
+ organizationType: zod_1.default.nativeEnum(webmaster_1.ORGANIZATION_TYPE),
14
+ tin: zod_1.default.string().regex(/^\d{10}$|^\d{12}$/, 'ИНН должен быть длинной в 10 или 12 цифр'),
15
+ alias: zod_1.default.string(),
16
+ createdAt: zod_1.default.date(),
17
+ updatedAt: zod_1.default.date(),
18
+ });
19
+ exports.WebmasterWithBalanceSchema = exports.WebmasterSchema.extend({
20
+ balance: zod_1.default.number(),
21
+ });
package/commands/index.ts CHANGED
@@ -37,3 +37,4 @@ export * from './folder';
37
37
  export * from './user-to-product';
38
38
  export * from './daily-streak';
39
39
  export * from './cabinet';
40
+ export * from './webmaster';
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { WebmasterSchema } from '../../models';
3
+
4
+ export namespace GetWebmasterPromocodeCommand {
5
+ export const RequestSchema = WebmasterSchema.pick({ alias: true });
6
+
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
9
+ export const ResponseSchema = z.object({
10
+ data: z.object({
11
+ isEligible: z.boolean(),
12
+ promocode: z.string().nullable(),
13
+ amount: z.number().nullable(),
14
+ endDate: z.date().nullable(),
15
+ }),
16
+ });
17
+
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -4,3 +4,4 @@ export * from './find-promocode.command';
4
4
  export * from './get-upsell-offer.command';
5
5
  export * from './update-promocode.command';
6
6
  export * from './validate-promocode.command';
7
+ export * from './get-webmaster-promocode.command';
@@ -6,3 +6,4 @@ export * from './tts';
6
6
  export * from './video';
7
7
  export * from './writer';
8
8
  export * from './image-editor';
9
+ export * from './video-editor';
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllVideoEditorJobsCommand {
4
+ export const RequestSchema = z.object({});
5
+
6
+ export type Request = z.infer<typeof RequestSchema>;
7
+
8
+ export const ResponseSchema = z.object({
9
+ data: z.boolean(),
10
+ });
11
+
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { ToolJobSchema } from '../../../models';
3
+
4
+ export namespace DeleteVideoEditorJobByUUIDCommand {
5
+ export const RequestParamsSchema = ToolJobSchema.pick({
6
+ uuid: true,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.boolean(),
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { VideoEditorJobSchema } from '../../../models';
3
+
4
+ export namespace EditVideoCommand {
5
+ export const RequestSchema = z.object({
6
+ modelId: z.string().uuid(),
7
+ prompt: z.string(),
8
+ fileId: z.string().uuid(),
9
+ });
10
+
11
+ export type Request = z.infer<typeof RequestSchema>;
12
+
13
+ export const ResponseSchema = z.object({
14
+ data: VideoEditorJobSchema,
15
+ });
16
+
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { VideoEditorJobSchema, ToolJobSchema } from '../../../models';
3
+
4
+ export namespace FindVideoEditorJobByIdCommand {
5
+ export const RequestParamsSchema = ToolJobSchema.pick({
6
+ uuid: true,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: VideoEditorJobSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { VideoEditorJobSchema } from '../../../models';
3
+
4
+ export namespace FindVideoEditorJobsCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ limit: z.coerce.number().min(1).optional(),
7
+ offset: z.coerce.number().min(0).default(0).optional(),
8
+ title: z.string().optional(),
9
+ });
10
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: z.array(VideoEditorJobSchema),
14
+ totalPages: z.number(),
15
+ page: z.number(),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { VideoEditorModelSchema } from '../../../models';
3
+
4
+ export namespace GetVideoEditorConfigCommand {
5
+ export const RequestSchema = z.object({});
6
+
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
9
+ export const ResponseSchema = z.object({
10
+ data: z.object({
11
+ models: z.array(VideoEditorModelSchema),
12
+ }),
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,9 @@
1
+ export * from './delete-all-video-editor-jobs.command';
2
+ export * from './delete-video-editor-job-by-uuid.command';
3
+ export * from './edit-video.command';
4
+ export * from './find-video-editor-job-by-id.command';
5
+ export * from './find-video-editor-jobs.command';
6
+ export * from './get-video-editor-config.command';
7
+ export * from './retry-video-editor-job.command';
8
+ export * from './set-reaction-to-video-editor-job.command';
9
+ export * from './update-video-editor-job-title.command';
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { VideoEditorJobSchema, ToolJobSchema } from '../../../models';
3
+
4
+ export namespace RetryVideoEditorJobCommand {
5
+ export const RequestParamsSchema = ToolJobSchema.pick({
6
+ uuid: true,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: VideoEditorJobSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { VideoEditorJobSchema } from '../../../models';
3
+ import { USER_REACTION } from '../../../constants';
4
+
5
+ export namespace SetReactionToVideoEditorJobCommand {
6
+ export const RequestSchema = z.object({
7
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
8
+ });
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const RequestParamsSchema = z.object({
12
+ uuid: z.string().uuid(),
13
+ });
14
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
15
+
16
+ export const ResponseSchema = z.object({
17
+ data: VideoEditorJobSchema,
18
+ });
19
+
20
+ export type Response = z.infer<typeof ResponseSchema>;
21
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { VideoEditorJobSchema } from '../../../models';
3
+
4
+ export namespace UpdateVideoEditorJobTitleCommand {
5
+ export const RequestSchema = z.object({
6
+ title: z.string(),
7
+ });
8
+ export type Request = z.infer<typeof RequestSchema>;
9
+
10
+ export const RequestParamsSchema = z.object({
11
+ uuid: z.string().uuid(),
12
+ });
13
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: VideoEditorJobSchema,
17
+ });
18
+
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { WebmasterBalanceSchema } from '../../models';
3
+
4
+ export namespace ConfirmWithdrawalCommand {
5
+ export const RequestSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: WebmasterBalanceSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { WebmasterSchema } from '../../models';
3
+
4
+ export namespace CreateWebmasterCommand {
5
+ export const RequestSchema = WebmasterSchema.pick({
6
+ organization: true,
7
+ organizationType: true,
8
+ tin: true,
9
+ });
10
+
11
+ export type Request = z.infer<typeof RequestSchema>;
12
+
13
+ export const ResponseSchema = z.object({
14
+ data: WebmasterSchema,
15
+ });
16
+
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }