@purpleschool/gptbot 0.7.58 → 0.7.59-presentations

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 (274) hide show
  1. package/api/controllers/http/cabinet.ts +3 -2
  2. package/api/controllers/http/index.ts +3 -0
  3. package/api/controllers/http/music.ts +16 -0
  4. package/api/controllers/http/presentation.ts +10 -0
  5. package/api/controllers/http/video-editor.ts +14 -0
  6. package/api/controllers/http/webmaster.ts +10 -0
  7. package/api/controllers/http/writer.ts +1 -0
  8. package/api/routes.ts +8 -1
  9. package/build/api/controllers/http/cabinet.js +3 -2
  10. package/build/api/controllers/http/index.js +3 -0
  11. package/build/api/controllers/http/music.js +18 -0
  12. package/build/api/controllers/http/presentation.js +7 -0
  13. package/build/api/controllers/http/video-editor.js +16 -0
  14. package/build/api/controllers/http/webmaster.js +12 -0
  15. package/build/api/controllers/http/writer.js +1 -0
  16. package/build/api/routes.js +7 -1
  17. package/build/commands/auth/register-user.command.js +2 -4
  18. package/build/commands/auth/vk-login.command.js +5 -2
  19. package/build/commands/auth/yandex-login.command.js +5 -2
  20. package/build/commands/cabinet/get-user-statistics-by-month.command.js +25 -0
  21. package/build/commands/cabinet/get-user-statistics-overview.command.js +26 -0
  22. package/build/commands/cabinet/index.js +2 -1
  23. package/build/commands/chat/create-chat.command.js +1 -3
  24. package/build/commands/chat/find-chat-by-uuid.command.js +1 -1
  25. package/build/commands/chat/find-chats.command.js +1 -3
  26. package/build/commands/chat/get-last-active-chat-command.js +1 -1
  27. package/build/commands/folder/find-folder-by-uuid-with-chats.command.js +1 -3
  28. package/build/commands/index.js +1 -0
  29. package/build/commands/product/buy-product.command.js +4 -0
  30. package/build/commands/subscription/buy-subscription.command.js +4 -0
  31. package/build/commands/telegram-auth/create-telegram-auth-link.command.js +2 -0
  32. package/build/commands/telegram-profile/auth-with-telegram-web-app.command.js +4 -0
  33. package/build/commands/telegram-profile/bot-was-blocked-by-user.command.js +11 -0
  34. package/build/commands/telegram-profile/index.js +2 -0
  35. package/build/commands/telegram-profile/user-joined-telegram.command.js +11 -0
  36. package/build/commands/tools/index.js +2 -0
  37. package/build/commands/tools/music/convert-to-wav.command.js +16 -0
  38. package/build/commands/tools/music/delete-all-music-jobs.command.js +8 -0
  39. package/build/commands/tools/music/delete-music-job-by-uuid.command.js +11 -0
  40. package/build/commands/tools/music/find-music-job-by-uuid.command.js +14 -0
  41. package/build/commands/tools/music/find-music-jobs.command.js +18 -0
  42. package/build/commands/tools/music/generate-lyrics.command.js +16 -0
  43. package/build/commands/tools/music/generate-music.command.js +15 -0
  44. package/build/commands/tools/music/get-music-tool-config.command.js +11 -0
  45. package/build/commands/tools/music/index.js +27 -0
  46. package/build/commands/tools/music/retry-music-job.command.js +14 -0
  47. package/build/commands/tools/music/set-reaction-to-music-job.command.js +18 -0
  48. package/build/commands/tools/music/update-music-job-title.command.js +17 -0
  49. package/build/commands/tools/presentation/build-blank-slide.command.js +21 -0
  50. package/build/commands/tools/presentation/generate-and-insert-slide.command.js +22 -0
  51. package/build/commands/tools/presentation/index.js +7 -0
  52. package/build/commands/tools/presentation/presentation-generate-report.command.js +17 -0
  53. package/build/commands/tools/presentation/presentation-paraphrase.command.js +20 -0
  54. package/build/commands/tools/presentation/update-presentation-slides.command.js +25 -0
  55. package/build/commands/tools/presentation/update-presentation.command.js +4 -3
  56. package/build/commands/tools/presentation/update-slide-image-slot.command.js +34 -0
  57. package/build/commands/tools/presentation/update-slide.command.js +19 -0
  58. package/build/commands/tools/video-editor/delete-all-video-editor-jobs.command.js +11 -0
  59. package/build/commands/tools/video-editor/delete-video-editor-job-by-uuid.command.js +14 -0
  60. package/build/commands/tools/video-editor/edit-video.command.js +16 -0
  61. package/build/commands/tools/video-editor/find-video-editor-job-by-id.command.js +14 -0
  62. package/build/commands/tools/video-editor/find-video-editor-jobs.command.js +18 -0
  63. package/build/commands/tools/video-editor/get-video-editor-config.command.js +14 -0
  64. package/build/commands/tools/video-editor/index.js +25 -0
  65. package/build/commands/tools/video-editor/retry-video-editor-job.command.js +14 -0
  66. package/build/commands/tools/video-editor/set-reaction-to-video-editor-job.command.js +18 -0
  67. package/build/commands/tools/video-editor/update-video-editor-job-title.command.js +17 -0
  68. package/build/commands/tools/writer/generate-writer-document-contents.command.js +3 -0
  69. package/build/commands/tools/writer/index.js +1 -0
  70. package/build/commands/tools/writer/set-reaction.writer-document.command.js +18 -0
  71. package/build/commands/user/get-aggregated-user-data.command.js +1 -1
  72. package/build/commands/user/get-me.command.js +1 -0
  73. package/build/commands/webmaster/confirm-withdrawal.command.js +14 -0
  74. package/build/commands/webmaster/create-webmaster.command.js +16 -0
  75. package/build/commands/webmaster/create-withdrawal-request.command.js +16 -0
  76. package/build/commands/webmaster/get-my-webmaster.command.js +11 -0
  77. package/build/commands/webmaster/get-webmaster-balance-overview.command.js +26 -0
  78. package/build/commands/webmaster/index.js +22 -0
  79. package/build/commands/webmaster/update-webmaster.command.js +13 -0
  80. package/build/constants/ai-model/enums/ai-model-config-selector-type.enum.js +1 -0
  81. package/build/constants/cabinet/enums/group-by.enum.js +9 -0
  82. package/build/constants/cabinet/enums/index.js +17 -0
  83. package/build/constants/cabinet/index.js +17 -0
  84. package/build/constants/errors/errors.js +278 -0
  85. package/build/constants/file/enums/file-type.enum.js +1 -0
  86. package/build/constants/file/file.constants.js +4 -1
  87. package/build/constants/index.js +5 -0
  88. package/build/constants/presentation/enums/index.js +4 -0
  89. package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
  90. package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
  91. package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +8 -0
  92. package/build/constants/presentation/enums/slide-image-slot-action.enum.js +8 -0
  93. package/build/constants/tool-music/enums/index.js +21 -0
  94. package/build/constants/tool-music/enums/music-pricing-rule-type.enum.js +7 -0
  95. package/build/constants/tool-music/enums/music-strategy.enum.js +7 -0
  96. package/build/constants/tool-music/enums/music-vocal-gender.enum.js +8 -0
  97. package/build/constants/tool-music/enums/suno-mode-type.enum.js +10 -0
  98. package/build/constants/tool-music/enums/suno-model-type.enum.js +10 -0
  99. package/build/constants/tool-music/index.js +17 -0
  100. package/build/constants/tool-video-editor/enums/index.js +17 -0
  101. package/build/constants/tool-video-editor/enums/video-editor-model-strategy.enum.js +7 -0
  102. package/build/constants/tool-video-editor/index.js +17 -0
  103. package/build/constants/webmaster/enums/index.js +17 -0
  104. package/build/constants/webmaster/enums/organization-type.enum.js +9 -0
  105. package/build/constants/webmaster/index.js +17 -0
  106. package/build/constants/webmaster-balance/enums/index.js +18 -0
  107. package/build/constants/webmaster-balance/enums/webmaster-balance-status.enum.js +10 -0
  108. package/build/constants/webmaster-balance/enums/webmaster-balance-type.enum.js +8 -0
  109. package/build/constants/webmaster-balance/index.js +17 -0
  110. package/build/constants/writer/enums/index.js +1 -0
  111. package/build/constants/writer/enums/tool-model-status.enum.js +8 -0
  112. package/build/helpers/index.js +2 -0
  113. package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +16 -0
  114. package/build/helpers/presentation/index.js +17 -0
  115. package/build/helpers/video-editor/calculate-video-editing-price.helper.js +6 -0
  116. package/build/helpers/video-editor/index.js +17 -0
  117. package/build/helpers/writer/calculate-writer-content-generation-price.util.js +2 -2
  118. package/build/models/chat-with-messages.schema.js +9 -0
  119. package/build/models/chat.schema.js +0 -2
  120. package/build/models/index.js +4 -0
  121. package/build/models/tools/index.js +3 -0
  122. package/build/models/tools/music/index.js +20 -0
  123. package/build/models/tools/music/music-config.schema.js +8 -0
  124. package/build/models/tools/music/music-job.schema.js +40 -0
  125. package/build/models/tools/music/music-model.schema.js +32 -0
  126. package/build/models/tools/music/music-track.schema.js +17 -0
  127. package/build/models/tools/presentation/index.js +1 -0
  128. package/build/models/tools/presentation/presentation-ai-action.schema.js +27 -0
  129. package/build/models/tools/presentation/presentation-config.schema.js +3 -0
  130. package/build/models/tools/presentation/presentation.schema.js +2 -0
  131. package/build/models/tools/presentation/slide-content-edit.schema.js +129 -0
  132. package/build/models/tools/presentation/slide-content.schema.js +22 -20
  133. package/build/models/tools/presentation/slide.schema.js +39 -1
  134. package/build/models/tools/video-editor/index.js +19 -0
  135. package/build/models/tools/video-editor/video-editor-config.schema.js +8 -0
  136. package/build/models/tools/video-editor/video-editor-job.schema.js +14 -0
  137. package/build/models/tools/video-editor/video-editor-model.schema.js +25 -0
  138. package/build/models/tools/writer/writer-config.schema.js +2 -0
  139. package/build/models/tools/writer/writer-document.schema.js +2 -0
  140. package/build/models/tools/writer/writer-model.schema.js +21 -0
  141. package/build/models/user-referrals.schema.js +15 -0
  142. package/build/models/user-to-subscription.schema.js +1 -0
  143. package/build/models/webmaster-balance.schema.js +19 -0
  144. package/build/models/webmaster.schema.js +21 -0
  145. package/commands/auth/register-user.command.ts +3 -5
  146. package/commands/auth/vk-login.command.ts +9 -6
  147. package/commands/auth/yandex-login.command.ts +7 -4
  148. package/commands/cabinet/get-user-statistics-by-month.command.ts +25 -0
  149. package/commands/cabinet/{get-user-statistics.command.ts → get-user-statistics-overview.command.ts} +5 -12
  150. package/commands/cabinet/index.ts +2 -1
  151. package/commands/chat/create-chat.command.ts +2 -4
  152. package/commands/chat/find-chat-by-uuid.command.ts +2 -2
  153. package/commands/chat/find-chats.command.ts +2 -6
  154. package/commands/chat/get-last-active-chat-command.ts +2 -2
  155. package/commands/folder/find-folder-by-uuid-with-chats.command.ts +2 -6
  156. package/commands/index.ts +1 -0
  157. package/commands/product/buy-product.command.ts +4 -0
  158. package/commands/subscription/buy-subscription.command.ts +4 -0
  159. package/commands/telegram-auth/create-telegram-auth-link.command.ts +5 -0
  160. package/commands/telegram-profile/auth-with-telegram-web-app.command.ts +4 -0
  161. package/commands/telegram-profile/bot-was-blocked-by-user.command.ts +13 -0
  162. package/commands/telegram-profile/index.ts +2 -0
  163. package/commands/telegram-profile/user-joined-telegram.command.ts +13 -0
  164. package/commands/tools/index.ts +2 -0
  165. package/commands/tools/music/convert-to-wav.command.ts +17 -0
  166. package/commands/tools/music/delete-all-music-jobs.command.ts +6 -0
  167. package/commands/tools/music/delete-music-job-by-uuid.command.ts +11 -0
  168. package/commands/tools/music/find-music-job-by-uuid.command.ts +16 -0
  169. package/commands/tools/music/find-music-jobs.command.ts +18 -0
  170. package/commands/tools/music/generate-lyrics.command.ts +17 -0
  171. package/commands/tools/music/generate-music.command.ts +16 -0
  172. package/commands/tools/music/get-music-tool-config.command.ts +10 -0
  173. package/commands/tools/music/index.ts +11 -0
  174. package/commands/tools/music/retry-music-job.command.ts +14 -0
  175. package/commands/tools/music/set-reaction-to-music-job.command.ts +20 -0
  176. package/commands/tools/music/update-music-job-title.command.ts +19 -0
  177. package/commands/tools/presentation/build-blank-slide.command.ts +23 -0
  178. package/commands/tools/presentation/generate-and-insert-slide.command.ts +27 -0
  179. package/commands/tools/presentation/index.ts +7 -0
  180. package/commands/tools/presentation/presentation-generate-report.command.ts +21 -0
  181. package/commands/tools/presentation/presentation-paraphrase.command.ts +26 -0
  182. package/commands/tools/presentation/update-presentation-slides.command.ts +32 -0
  183. package/commands/tools/presentation/update-presentation.command.ts +5 -4
  184. package/commands/tools/presentation/update-slide-image-slot.command.ts +40 -0
  185. package/commands/tools/presentation/update-slide.command.ts +25 -0
  186. package/commands/tools/video-editor/delete-all-video-editor-jobs.command.ts +13 -0
  187. package/commands/tools/video-editor/delete-video-editor-job-by-uuid.command.ts +16 -0
  188. package/commands/tools/video-editor/edit-video.command.ts +18 -0
  189. package/commands/tools/video-editor/find-video-editor-job-by-id.command.ts +16 -0
  190. package/commands/tools/video-editor/find-video-editor-jobs.command.ts +18 -0
  191. package/commands/tools/video-editor/get-video-editor-config.command.ts +16 -0
  192. package/commands/tools/video-editor/index.ts +9 -0
  193. package/commands/tools/video-editor/retry-video-editor-job.command.ts +16 -0
  194. package/commands/tools/video-editor/set-reaction-to-video-editor-job.command.ts +21 -0
  195. package/commands/tools/video-editor/update-video-editor-job-title.command.ts +20 -0
  196. package/commands/tools/writer/generate-writer-document-contents.command.ts +5 -0
  197. package/commands/tools/writer/index.ts +1 -0
  198. package/commands/tools/writer/set-reaction.writer-document.command.ts +21 -0
  199. package/commands/user/get-aggregated-user-data.command.ts +1 -1
  200. package/commands/user/get-me.command.ts +1 -0
  201. package/commands/webmaster/confirm-withdrawal.command.ts +16 -0
  202. package/commands/webmaster/create-webmaster.command.ts +18 -0
  203. package/commands/webmaster/create-withdrawal-request.command.ts +18 -0
  204. package/commands/webmaster/get-my-webmaster.command.ts +12 -0
  205. package/commands/webmaster/get-webmaster-balance-overview.command.ts +29 -0
  206. package/commands/webmaster/index.ts +6 -0
  207. package/commands/webmaster/update-webmaster.command.ts +18 -0
  208. package/constants/ai-model/enums/ai-model-config-selector-type.enum.ts +1 -0
  209. package/constants/cabinet/enums/group-by.enum.ts +5 -0
  210. package/constants/cabinet/enums/index.ts +1 -0
  211. package/constants/cabinet/index.ts +1 -0
  212. package/constants/errors/errors.ts +278 -0
  213. package/constants/file/enums/file-type.enum.ts +1 -0
  214. package/constants/file/file.constants.ts +4 -0
  215. package/constants/index.ts +5 -0
  216. package/constants/presentation/enums/index.ts +4 -0
  217. package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
  218. package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
  219. package/constants/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
  220. package/constants/presentation/enums/slide-image-slot-action.enum.ts +4 -0
  221. package/constants/tool-music/enums/index.ts +5 -0
  222. package/constants/tool-music/enums/music-pricing-rule-type.enum.ts +3 -0
  223. package/constants/tool-music/enums/music-strategy.enum.ts +3 -0
  224. package/constants/tool-music/enums/music-vocal-gender.enum.ts +4 -0
  225. package/constants/tool-music/enums/suno-mode-type.enum.ts +6 -0
  226. package/constants/tool-music/enums/suno-model-type.enum.ts +6 -0
  227. package/constants/tool-music/index.ts +1 -0
  228. package/constants/tool-video-editor/enums/index.ts +1 -0
  229. package/constants/tool-video-editor/enums/video-editor-model-strategy.enum.ts +3 -0
  230. package/constants/tool-video-editor/index.ts +1 -0
  231. package/constants/webmaster/enums/index.ts +1 -0
  232. package/constants/webmaster/enums/organization-type.enum.ts +5 -0
  233. package/constants/webmaster/index.ts +1 -0
  234. package/constants/webmaster-balance/enums/index.ts +2 -0
  235. package/constants/webmaster-balance/enums/webmaster-balance-status.enum.ts +6 -0
  236. package/constants/webmaster-balance/enums/webmaster-balance-type.enum.ts +4 -0
  237. package/constants/webmaster-balance/index.ts +1 -0
  238. package/constants/writer/enums/index.ts +1 -0
  239. package/constants/writer/enums/tool-model-status.enum.ts +4 -0
  240. package/helpers/index.ts +2 -0
  241. package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +20 -0
  242. package/helpers/presentation/index.ts +1 -0
  243. package/helpers/video-editor/calculate-video-editing-price.helper.ts +9 -0
  244. package/helpers/video-editor/index.ts +1 -0
  245. package/helpers/writer/calculate-writer-content-generation-price.util.ts +4 -2
  246. package/models/chat-with-messages.schema.ts +7 -0
  247. package/models/chat.schema.ts +0 -2
  248. package/models/index.ts +4 -0
  249. package/models/tools/index.ts +3 -0
  250. package/models/tools/music/index.ts +4 -0
  251. package/models/tools/music/music-config.schema.ts +6 -0
  252. package/models/tools/music/music-job.schema.ts +43 -0
  253. package/models/tools/music/music-model.schema.ts +33 -0
  254. package/models/tools/music/music-track.schema.ts +19 -0
  255. package/models/tools/presentation/index.ts +1 -0
  256. package/models/tools/presentation/presentation-ai-action.schema.ts +33 -0
  257. package/models/tools/presentation/presentation-config.schema.ts +3 -0
  258. package/models/tools/presentation/presentation.schema.ts +2 -0
  259. package/models/tools/presentation/slide-content-edit.schema.ts +154 -0
  260. package/models/tools/presentation/slide-content.schema.ts +119 -32
  261. package/models/tools/presentation/slide.schema.ts +47 -0
  262. package/models/tools/video-editor/index.ts +3 -0
  263. package/models/tools/video-editor/video-editor-config.schema.ts +6 -0
  264. package/models/tools/video-editor/video-editor-job.schema.ts +14 -0
  265. package/models/tools/video-editor/video-editor-model.schema.ts +24 -0
  266. package/models/tools/writer/writer-config.schema.ts +2 -0
  267. package/models/tools/writer/writer-document.schema.ts +3 -1
  268. package/models/tools/writer/writer-model.schema.ts +21 -0
  269. package/models/user-referrals.schema.ts +10 -0
  270. package/models/user-to-subscription.schema.ts +1 -0
  271. package/models/webmaster-balance.schema.ts +15 -0
  272. package/models/webmaster.schema.ts +18 -0
  273. package/package.json +1 -1
  274. package/build/commands/cabinet/get-user-statistics.command.js +0 -30
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlideSchema = void 0;
3
+ exports.SlideBulkUpdateSchema = exports.SlideUpdateSchema = exports.SlideSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const slide_content_schema_1 = require("./slide-content.schema");
6
6
  const constants_1 = require("../../../constants");
7
7
  const slide_icon_slot_schema_1 = require("./slide-icon-slot.schema");
8
8
  const slide_image_slot_schema_1 = require("./slide-image-slot.schema");
9
+ const slide_content_edit_schema_1 = require("./slide-content-edit.schema");
9
10
  exports.SlideSchema = zod_1.z.object({
10
11
  uuid: zod_1.z.string().uuid(),
11
12
  order: zod_1.z.number(),
@@ -18,3 +19,40 @@ exports.SlideSchema = zod_1.z.object({
18
19
  createdAt: zod_1.z.date(),
19
20
  updatedAt: zod_1.z.date(),
20
21
  });
22
+ exports.SlideUpdateSchema = exports.SlideSchema.pick({
23
+ layoutId: true,
24
+ })
25
+ .extend({
26
+ content: slide_content_edit_schema_1.SlideContentUserEditSchema,
27
+ })
28
+ .partial();
29
+ exports.SlideBulkUpdateSchema = exports.SlideSchema.pick({
30
+ order: true,
31
+ contentTypeId: true,
32
+ layoutId: true,
33
+ presentationId: true,
34
+ })
35
+ .extend({
36
+ uuid: zod_1.z.string().uuid().optional(),
37
+ content: slide_content_edit_schema_1.SlideContentUserEditSchema,
38
+ })
39
+ .array()
40
+ .min(1, 'Must include at least one slide')
41
+ .refine((arr) => {
42
+ const orders = arr.map((s) => s.order);
43
+ const unique = new Set(orders);
44
+ if (unique.size !== orders.length)
45
+ return false;
46
+ const sorted = [...orders].sort((a, b) => a - b);
47
+ return sorted.every((val, idx) => val === idx);
48
+ }, {
49
+ message: 'Slide orders must be unique and sequential starting at 0',
50
+ path: ['order'],
51
+ })
52
+ .refine((arr) => {
53
+ const [firstId, ...rest] = arr.map((s) => s.presentationId);
54
+ return rest.every((id) => id === firstId);
55
+ }, {
56
+ message: 'All slides must belong to the same presentation',
57
+ path: ['presentationId'],
58
+ });
@@ -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
+ });
@@ -4,8 +4,10 @@ exports.WriterConfigSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const writer_document_type_schema_1 = require("./writer-document-type.schema");
6
6
  const writer_ai_action_schema_1 = require("./writer-ai-action.schema");
7
+ const writer_model_schema_1 = require("./writer-model.schema");
7
8
  exports.WriterConfigSchema = zod_1.z.object({
8
9
  maxPromptLength: zod_1.z.number(),
9
10
  documentTypes: zod_1.z.array(writer_document_type_schema_1.WriterDocumentTypeSchema),
10
11
  aiActions: zod_1.z.array(writer_ai_action_schema_1.WriterAiActionSchema),
12
+ models: zod_1.z.array(writer_model_schema_1.WriterModelSchema),
11
13
  });
@@ -15,6 +15,8 @@ exports.WriterDocumentSchema = zod_1.z.object({
15
15
  finalMd: zod_1.z.string().nullable(),
16
16
  userId: zod_1.z.string().nullable(),
17
17
  unregisteredUserId: zod_1.z.string().nullable(),
18
+ modelId: zod_1.z.string().nullable(),
19
+ reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
18
20
  pages: zod_1.z.number(),
19
21
  createdAt: zod_1.z.date(),
20
22
  updatedAt: zod_1.z.date(),
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WriterModelSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
6
+ const constants_1 = require("../../../constants");
7
+ const unlocked_by_subscription_schema_1 = require("../../unlocked-by-subscription.schema");
8
+ exports.WriterModelSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string(),
10
+ title: zod_1.z.string(),
11
+ description: zod_1.z.string(),
12
+ pricePerPage: zod_1.z.number(),
13
+ order: zod_1.z.number(),
14
+ icons: icon_variants_schema_1.IconVariantsSchema,
15
+ maxInputLength: zod_1.z.number(),
16
+ status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
17
+ createdAt: zod_1.z.date(),
18
+ updatedAt: zod_1.z.date(),
19
+ unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
20
+ canUse: zod_1.z.boolean(),
21
+ });
@@ -0,0 +1,15 @@
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.UserReferralsSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.UserReferralsSchema = zod_1.default.object({
9
+ partnerId: zod_1.default.string().uuid().optional(),
10
+ webmasterAlias: zod_1.default.string().optional(),
11
+ webmasterReferralProvidedAt: zod_1.default
12
+ .string()
13
+ .transform((date) => new Date(date))
14
+ .optional(),
15
+ });
@@ -16,6 +16,7 @@ exports.UserToSubscriptionSchema = zod_1.z.object({
16
16
  marks: zod_1.z.array(zod_1.z.string()),
17
17
  intervalEndDate: zod_1.z.date().nullable(),
18
18
  carriedOverTokenBalance: zod_1.z.number(),
19
+ initCarriedOverTokenBalance: zod_1.z.number(),
19
20
  createdAt: zod_1.z.date(),
20
21
  updatedAt: zod_1.z.date(),
21
22
  });
@@ -0,0 +1,19 @@
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
+ sourceUserId: zod_1.default.string().uuid().nullable(),
14
+ amount: zod_1.default.number(),
15
+ type: zod_1.default.nativeEnum(constants_1.WEBMASTER_BALANCE_TYPE),
16
+ status: zod_1.default.nativeEnum(constants_1.WEBMASTER_BALANCE_STATUS),
17
+ createdAt: zod_1.default.date(),
18
+ updatedAt: zod_1.default.date(),
19
+ });
@@ -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
+ });
@@ -1,14 +1,12 @@
1
- import { UserSchema, UtmSchema } from '../../models';
1
+ import { UserReferralsSchema, UserSchema, UtmSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace RegisterUserCommand {
5
5
  export const RequestSchema = UserSchema.pick({ email: true, password: true })
6
- .extend({
7
- partnerId: z.string().optional(),
8
- })
9
6
  .extend({
10
7
  utm: UtmSchema.optional(),
11
- });
8
+ })
9
+ .merge(UserReferralsSchema);
12
10
 
13
11
  export type Request = z.infer<typeof RequestSchema>;
14
12
 
@@ -1,12 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { UserReferralsSchema } from '../../models';
2
3
 
3
4
  export namespace VKLoginCommand {
4
- export const RequestSchema = z.object({
5
- code: z.string(),
6
- code_verifier: z.string(),
7
- device_id: z.string(),
8
- state: z.string(),
9
- });
5
+ export const RequestSchema = z
6
+ .object({
7
+ code: z.string(),
8
+ code_verifier: z.string(),
9
+ device_id: z.string(),
10
+ state: z.string(),
11
+ })
12
+ .merge(UserReferralsSchema);
10
13
 
11
14
  export type Request = z.infer<typeof RequestSchema>;
12
15
 
@@ -1,10 +1,13 @@
1
1
  import { z } from 'zod';
2
+ import { UserReferralsSchema } from '../../models';
2
3
 
3
4
  export namespace YandexLoginCommand {
4
- export const RequestSchema = z.object({
5
- code: z.string(),
6
- code_verifier: z.string(),
7
- });
5
+ export const RequestSchema = z
6
+ .object({
7
+ code: z.string(),
8
+ code_verifier: z.string(),
9
+ })
10
+ .merge(UserReferralsSchema);
8
11
 
9
12
  export type Request = z.infer<typeof RequestSchema>;
10
13
 
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace GetUserStatisticsByMonthCommand {
4
+ export const UserStatisticsByMonthResponseSchema = z.object({
5
+ month: z.string(),
6
+ total_texts: z.number(),
7
+ total_audios: z.number(),
8
+ total_images: z.number(),
9
+ total_videos: z.number(),
10
+ total_presentations: z.number(),
11
+ total_paraphrases: z.number(),
12
+ writers: z.object({
13
+ total_writers: z.number(),
14
+ total_writer_actions: z.number(),
15
+ }),
16
+ total_video_edits: z.number(),
17
+ total_musics: z.number(),
18
+ });
19
+
20
+ export const ResponseSchema = z.object({
21
+ data: z.array(UserStatisticsByMonthResponseSchema),
22
+ });
23
+
24
+ export type Response = z.infer<typeof ResponseSchema>;
25
+ }
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
+ import { GROUP_BY } from '../../constants';
2
3
 
3
- export namespace GetUserStatisticsCommand {
4
+ export namespace GetUserStatisticsOverviewCommand {
4
5
  export const RequestSchema = z.object({
5
6
  startDate: z.string().refine((v) => !isNaN(Date.parse(v)), {
6
7
  message: 'from must be a valid date string',
@@ -8,28 +9,20 @@ export namespace GetUserStatisticsCommand {
8
9
  endDate: z.string().refine((v) => !isNaN(Date.parse(v)), {
9
10
  message: 'to must be a valid date string',
10
11
  }),
11
- groupByDays: z
12
- .preprocess(
13
- (val) => (val === undefined ? 1 : Number(val)),
14
- z.number().int().positive().max(31),
15
- )
16
- .default(1),
12
+ groupBy: z.nativeEnum(GROUP_BY).default(GROUP_BY.DAY),
17
13
  });
18
14
 
19
15
  export type Request = z.infer<typeof RequestSchema>;
20
16
 
21
- export const UserStatisticsResponseSchema = z.object({
17
+ export const UserStatisticsOverviewResponseSchema = z.object({
22
18
  startDate: z.string(),
23
19
  endDate: z.string(),
24
20
  total_tokens: z.number(),
25
21
  total_messages: z.number(),
26
- total_images: z.number(),
27
- total_videos: z.number(),
28
- total_presentations: z.number(),
29
22
  });
30
23
 
31
24
  export const ResponseSchema = z.object({
32
- data: z.array(UserStatisticsResponseSchema),
25
+ data: z.array(UserStatisticsOverviewResponseSchema),
33
26
  });
34
27
 
35
28
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1 +1,2 @@
1
- export * from './get-user-statistics.command';
1
+ export * from './get-user-statistics-overview.command';
2
+ export * from './get-user-statistics-by-month.command';
@@ -1,4 +1,4 @@
1
- import { ChatSchema, MessageSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace CreateChatCommand {
@@ -12,9 +12,7 @@ export namespace CreateChatCommand {
12
12
  export type RequestSchema = z.infer<typeof RequestSchema>;
13
13
 
14
14
  export const ResponseSchema = z.object({
15
- data: ChatSchema.extend({
16
- messages: z.array(MessageSchema),
17
- }),
15
+ data: ChatWithMessagesSchema,
18
16
  });
19
17
 
20
18
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1,4 +1,4 @@
1
- import { ChatSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace FindChatByUUIDCommand {
@@ -9,7 +9,7 @@ export namespace FindChatByUUIDCommand {
9
9
  export type Request = z.infer<typeof RequestParamsSchema>;
10
10
 
11
11
  export const ResponseSchema = z.object({
12
- data: ChatSchema,
12
+ data: ChatWithMessagesSchema,
13
13
  });
14
14
 
15
15
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1,4 +1,4 @@
1
- import { AiModelSchema, ChatSchema, MessageSchema } from '../../models';
1
+ import { AiModelSchema, ChatSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace FindChatsCommand {
@@ -18,11 +18,7 @@ export namespace FindChatsCommand {
18
18
  export type RequestQuery = z.infer<typeof RequestQuerySchema>;
19
19
 
20
20
  export const ResponseSchema = z.object({
21
- data: z.array(
22
- ChatSchema.extend({
23
- messages: z.array(MessageSchema),
24
- }),
25
- ),
21
+ data: z.array(ChatSchema),
26
22
  page: z.number(),
27
23
  totalPages: z.number(),
28
24
  });
@@ -1,4 +1,4 @@
1
- import { ChatSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace GetLastActiveChatCommand {
@@ -8,7 +8,7 @@ export namespace GetLastActiveChatCommand {
8
8
  });
9
9
 
10
10
  export const Response = z.object({
11
- data: ChatSchema,
11
+ data: ChatWithMessagesSchema,
12
12
  });
13
13
 
14
14
  export type Response = z.infer<typeof Response>;
@@ -1,5 +1,5 @@
1
1
  import z from 'zod';
2
- import { ChatSchema, FolderSchema, MessageSchema } from '../../models';
2
+ import { ChatSchema, FolderSchema } from '../../models';
3
3
 
4
4
  export namespace FindFolderByUuidWithChatsCommand {
5
5
  export const RequestParamSchema = FolderSchema.pick({
@@ -17,11 +17,7 @@ export namespace FindFolderByUuidWithChatsCommand {
17
17
 
18
18
  export const ResponseSchema = z.object({
19
19
  data: FolderSchema.extend({
20
- chats: z.array(
21
- ChatSchema.extend({
22
- messages: z.array(MessageSchema),
23
- }),
24
- ),
20
+ chats: z.array(ChatSchema),
25
21
  }),
26
22
  page: z.number(),
27
23
  totalPages: z.number(),
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';
@@ -36,6 +36,10 @@ export namespace BuyProductCommand {
36
36
  email: z.string().email(),
37
37
  partnerId: z.string().uuid().optional(),
38
38
  promocode: z.string().optional(),
39
+ webmasterAlias: z.string().optional(),
40
+ webmasterReferralProvidedAt: z
41
+ .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
42
+ .optional(),
39
43
  });
40
44
 
41
45
  export type RequestFast = z.infer<typeof RequestFastSchema>;
@@ -16,6 +16,10 @@ export namespace BuySubscriptionCommand {
16
16
  email: z.string().email(),
17
17
  partnerId: z.string().uuid().optional(),
18
18
  promocode: z.string().optional(),
19
+ webmasterAlias: z.string().optional(),
20
+ webmasterReferralProvidedAt: z
21
+ .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
22
+ .optional(),
19
23
  });
20
24
 
21
25
  export type RequestFast = z.infer<typeof RequestFastSchema>;
@@ -1,6 +1,11 @@
1
1
  import { z } from 'zod';
2
+ import { UserReferralsSchema } from '../../models';
2
3
 
3
4
  export namespace CreateTelegramAuthLinkCommand {
5
+ export const RequestSchema = UserReferralsSchema;
6
+
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
4
9
  export const ResponseSchema = z.object({
5
10
  data: z.object({
6
11
  uuid: z.string().uuid(),
@@ -6,6 +6,10 @@ export namespace AuthWithTelegramWebAppCommand {
6
6
  initData: z.string(),
7
7
  platform: z.string().nullable(),
8
8
  partnerId: z.string().optional(),
9
+ webmasterAlias: z.string().optional(),
10
+ webmasterReferralProvidedAt: z
11
+ .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
12
+ .optional(),
9
13
  utm: UtmSchema.optional(),
10
14
  });
11
15
 
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace BotWasBlockedByUserCommand {
4
+ export const RequestBodySchema = z.object({
5
+ telegramId: z.number(),
6
+ });
7
+
8
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
9
+
10
+ export const ResponseSchema = z.void();
11
+
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -1,3 +1,5 @@
1
1
  export * from './auth-with-telegram-web-app.command';
2
2
  export * from './check-telegram-profile-exists.command';
3
3
  export * from './create-telegram-profile-connection-link.command';
4
+ export * from './bot-was-blocked-by-user.command';
5
+ export * from './user-joined-telegram.command';
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace UserJoinedTelegramCommand {
4
+ export const RequestBodySchema = z.object({
5
+ telegramId: z.number(),
6
+ });
7
+
8
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
9
+
10
+ export const ResponseSchema = z.void();
11
+
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -6,3 +6,5 @@ export * from './tts';
6
6
  export * from './video';
7
7
  export * from './writer';
8
8
  export * from './image-editor';
9
+ export * from './video-editor';
10
+ export * from './music';
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export namespace ConvertToWavCommand {
3
+ export const RequestSchema = z.object({
4
+ taskId: z.string(),
5
+ audioId: z.string(),
6
+ });
7
+
8
+ export type Request = z.infer<typeof RequestSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: z.object({
12
+ url: z.string().url(),
13
+ }),
14
+ });
15
+
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllMusicJobsCommand {
4
+ export const ResponseSchema = z.void();
5
+ export type Response = z.infer<typeof ResponseSchema>;
6
+ }
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteMusicJobByUUIDCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const ResponseSchema = z.void();
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { MusicJobSchema, ToolJobSchema } from '../../../models';
3
+
4
+ export namespace FindMusicJobByUUIDCommand {
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: MusicJobSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { MusicJobSchema } from '../../../models';
3
+
4
+ export namespace FindMusicJobsCommand {
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(MusicJobSchema),
14
+ totalPages: z.number(),
15
+ page: z.number(),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }