@purpleschool/gptbot-tools 0.1.134 → 0.2.0-stage

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/account-merge/commands/index.ts +1 -0
  2. package/account-merge/commands/transfer-user-jobs.command.ts +13 -0
  3. package/account-merge/index.ts +2 -0
  4. package/account-merge/routes/account-merge.amqp.routes.ts +3 -0
  5. package/account-merge/routes/index.ts +1 -0
  6. package/analytics/index.ts +1 -0
  7. package/analytics/job-model-analytics/commands/get-job-model-analytics.command.ts +12 -0
  8. package/analytics/job-model-analytics/commands/index.ts +1 -0
  9. package/analytics/job-model-analytics/index.ts +2 -0
  10. package/analytics/job-model-analytics/routes/index.ts +1 -0
  11. package/analytics/job-model-analytics/routes/job-model-analytics.http.routes.ts +5 -0
  12. package/build/account-merge/commands/index.js +17 -0
  13. package/build/account-merge/commands/transfer-user-jobs.command.js +13 -0
  14. package/build/account-merge/index.js +18 -0
  15. package/build/account-merge/routes/account-merge.amqp.routes.js +6 -0
  16. package/build/account-merge/routes/index.js +17 -0
  17. package/build/analytics/index.js +17 -0
  18. package/build/analytics/job-model-analytics/commands/get-job-model-analytics.command.js +11 -0
  19. package/build/analytics/job-model-analytics/commands/index.js +17 -0
  20. package/build/analytics/job-model-analytics/index.js +18 -0
  21. package/build/analytics/job-model-analytics/routes/index.js +17 -0
  22. package/build/analytics/job-model-analytics/routes/job-model-analytics.http.routes.js +7 -0
  23. package/build/common/enums/file-type.enum.js +8 -0
  24. package/build/common/enums/index.js +1 -0
  25. package/build/common/enums/reasoning-effort.enum.js +6 -1
  26. package/build/image-editor/commands/image-editor.command.js +1 -0
  27. package/build/image-editor/models/image-editor-job.schema.js +2 -0
  28. package/build/image-editor/models/image-editor-model.schema.js +6 -0
  29. package/build/image-generation/models/image-generation-job.schema.js +1 -0
  30. package/build/image-generation/models/image-generation-model.schema.js +1 -0
  31. package/build/image-generation/queries/find-image-generation-jobs.query.js +2 -0
  32. package/build/index.js +15 -0
  33. package/build/marketplace-card/commands/execute-marketplace-card.command.js +7 -0
  34. package/build/marketplace-card/commands/index.js +2 -0
  35. package/build/marketplace-card/commands/soft-delete-all-marketplace-card-jobs.command.js +13 -0
  36. package/build/marketplace-card/commands/update-title-marketplace-card-job.command.js +16 -0
  37. package/build/marketplace-card/models/index.js +1 -0
  38. package/build/marketplace-card/models/marketplace-card-config.schema.js +2 -0
  39. package/build/marketplace-card/routes/marketplace-card.amqp.routes.js +2 -0
  40. package/build/presentation/commands/create-presentation.command.js +3 -0
  41. package/build/presentation/commands/generate-slides.command.js +1 -0
  42. package/build/presentation/commands/get-presentation-slides-generation-price.command.js +1 -0
  43. package/build/presentation/commands/index.js +1 -0
  44. package/build/presentation/commands/reposition-slide.command.js +16 -0
  45. package/build/presentation/enums/index.js +1 -0
  46. package/build/presentation/enums/presentation-target-audience.enum.js +10 -0
  47. package/build/presentation/models/index.js +1 -0
  48. package/build/presentation/models/presentation-template.schema.js +2 -0
  49. package/build/presentation/models/presentation-title-page.schema.js +9 -0
  50. package/build/presentation/models/presentation.schema.js +4 -0
  51. package/build/presentation/models/slide-content-edit.schema.js +24 -12
  52. package/build/presentation/models/slide-content.schema.js +215 -73
  53. package/build/presentation/routes/presentation.routes.js +4 -1
  54. package/build/solving-edu-task/commands/delete-all-solving-edu-task-jobs.command.js +13 -0
  55. package/build/solving-edu-task/commands/delete-solving-edu-task-job-by-uuid.command.js +14 -0
  56. package/build/solving-edu-task/commands/get-solving-edu-task-price.command.js +15 -0
  57. package/build/solving-edu-task/commands/index.js +23 -0
  58. package/build/solving-edu-task/commands/retry-solving-edu-task-job.command.js +25 -0
  59. package/build/solving-edu-task/commands/set-reaction-to-solving-edu-task-job.command.js +27 -0
  60. package/build/solving-edu-task/commands/solving-edu-task.command.js +22 -0
  61. package/build/solving-edu-task/commands/update-solving-edu-task-job-title.command.js +16 -0
  62. package/build/solving-edu-task/index.js +20 -0
  63. package/build/solving-edu-task/models/index.js +19 -0
  64. package/build/solving-edu-task/models/solving-edu-task-config.schema.js +8 -0
  65. package/build/solving-edu-task/models/solving-edu-task-job.schema.js +32 -0
  66. package/build/solving-edu-task/models/solving-edu-task-model.schema.js +27 -0
  67. package/build/solving-edu-task/queries/find-solving-edu-task-job-by-id.query.js +15 -0
  68. package/build/solving-edu-task/queries/find-solving-edu-task-jobs.query.js +28 -0
  69. package/build/solving-edu-task/queries/get-solving-edu-task-config.query.js +11 -0
  70. package/build/solving-edu-task/queries/index.js +19 -0
  71. package/build/solving-edu-task/routes/index.js +17 -0
  72. package/build/solving-edu-task/routes/solving-edu-task.amqp.routes.js +15 -0
  73. package/build/spell-corrector/commands/delete-all-spell-corrector-jobs.command.js +13 -0
  74. package/build/spell-corrector/commands/delete-spell-corrector-job-by-uuid.command.js +14 -0
  75. package/build/spell-corrector/commands/get-spell-corrector-price.command.js +15 -0
  76. package/build/spell-corrector/commands/index.js +23 -0
  77. package/build/spell-corrector/commands/retry-spell-corrector-job.command.js +17 -0
  78. package/build/spell-corrector/commands/set-reaction-to-spell-corrector-job.command.js +27 -0
  79. package/build/spell-corrector/commands/spell-corrector.command.js +18 -0
  80. package/build/spell-corrector/commands/update-spell-corrector-job-title.command.js +16 -0
  81. package/build/spell-corrector/index.js +20 -0
  82. package/build/spell-corrector/models/index.js +19 -0
  83. package/build/spell-corrector/models/spell-corrector-job.schema.js +25 -0
  84. package/build/spell-corrector/models/spell-corrector-model.schema.js +18 -0
  85. package/build/spell-corrector/models/spell-corrector-tool-config.schema.js +9 -0
  86. package/build/spell-corrector/queries/find-spell-corrector-job-by-uuid.query.js +10 -0
  87. package/build/spell-corrector/queries/find-spell-corrector-jobs.query.js +28 -0
  88. package/build/spell-corrector/queries/get-spell-corrector-tool-config.query.js +9 -0
  89. package/build/spell-corrector/queries/index.js +19 -0
  90. package/build/spell-corrector/routes/index.js +17 -0
  91. package/build/spell-corrector/routes/spell-corrector.amqp.routes.js +15 -0
  92. package/build/stt/models/stt-response.schema.js +2 -0
  93. package/build/tool-workspace/commands/index.js +18 -0
  94. package/build/tool-workspace/commands/soft-delete-tool-workspace.command.js +21 -0
  95. package/build/tool-workspace/commands/update-tool-workspace.command.js +26 -0
  96. package/build/tool-workspace/enums/index.js +18 -0
  97. package/build/tool-workspace/enums/tool-workspace-item-slot.enum.js +9 -0
  98. package/build/tool-workspace/enums/tool-workspace-status.enum.js +8 -0
  99. package/build/tool-workspace/index.js +21 -0
  100. package/build/tool-workspace/models/index.js +20 -0
  101. package/build/tool-workspace/models/tool-workspace-contents.schema.js +10 -0
  102. package/build/tool-workspace/models/tool-workspace-item.schema.js +17 -0
  103. package/build/tool-workspace/models/tool-workspace-job.schema.js +17 -0
  104. package/build/tool-workspace/models/tool-workspace.schema.js +17 -0
  105. package/build/tool-workspace/queries/find-tool-workspace-by-uuid.query.js +22 -0
  106. package/build/tool-workspace/queries/find-tool-workspaces.query.js +30 -0
  107. package/build/tool-workspace/queries/index.js +18 -0
  108. package/build/tool-workspace/routes/index.js +17 -0
  109. package/build/tool-workspace/routes/tool-workspace.amqp.routes.js +9 -0
  110. package/build/tools/enums/tool-content-type.enum.js +3 -1
  111. package/build/tools/enums/tool-type.enum.js +2 -0
  112. package/build/tools/models/global-tools-config.schema.js +4 -0
  113. package/build/tools/models/tools-with-configs.schema.js +10 -0
  114. package/build/video/commands/video.command.js +7 -0
  115. package/build/video/const/videoMaxDuration.js +1 -1
  116. package/build/video/enums/video-resolution.enum.js +1 -0
  117. package/build/video/enums/video-strategy.enum.js +1 -0
  118. package/build/video/models/video-config.schema.js +2 -0
  119. package/build/video/models/video-model.schema.js +1 -0
  120. package/build/video-editor/commands/edit-video.command.js +1 -0
  121. package/build/video-editor/commands/get-video-editor-price.command.js +2 -0
  122. package/build/video-editor/commands/retry-video-editor-job.command.js +1 -0
  123. package/build/video-editor/enums/index.js +1 -0
  124. package/build/video-editor/enums/video-editor-pricing-rule-type.enum.js +8 -0
  125. package/build/video-editor/models/video-editor-job.schema.js +7 -1
  126. package/build/video-editor/models/video-editor-model.schema.js +28 -1
  127. package/build/video-editor/utils/calculate-video-editing-price.js +24 -2
  128. package/build/writer/commands/collect-sources.command.js +15 -0
  129. package/build/writer/commands/confirm-source-citation-metadata.command.js +18 -0
  130. package/build/writer/commands/discard-writer-source.command.js +16 -0
  131. package/build/writer/commands/generate-document-outline.command.js +17 -0
  132. package/build/writer/commands/index.js +5 -0
  133. package/build/writer/commands/update-writer-document-outline.command.js +1 -0
  134. package/build/writer/commands/upload-writer-source.command.js +18 -0
  135. package/build/writer/enums/index.js +3 -0
  136. package/build/writer/enums/writer-document-stage.enum.js +6 -0
  137. package/build/writer/enums/writer-source-origin.enum.js +8 -0
  138. package/build/writer/enums/writer-source-status.enum.js +9 -0
  139. package/build/writer/enums/writer-source-type.enum.js +8 -0
  140. package/build/writer/models/index.js +2 -0
  141. package/build/writer/models/writer-document-type.schema.js +1 -1
  142. package/build/writer/models/writer-document.schema.js +3 -0
  143. package/build/writer/models/writer-source-bibliographic-metadata.schema.js +27 -0
  144. package/build/writer/models/writer-source.schema.js +22 -0
  145. package/build/writer/queries/get-writer-document-sources.query.js +15 -0
  146. package/build/writer/queries/index.js +1 -0
  147. package/build/writer/routes/writer.routes.js +6 -0
  148. package/common/enums/file-type.enum.ts +4 -0
  149. package/common/enums/index.ts +1 -0
  150. package/common/enums/reasoning-effort.enum.ts +5 -0
  151. package/image-editor/commands/image-editor.command.ts +1 -0
  152. package/image-editor/models/image-editor-job.schema.ts +2 -0
  153. package/image-editor/models/image-editor-model.schema.ts +9 -0
  154. package/image-generation/models/image-generation-job.schema.ts +2 -1
  155. package/image-generation/models/image-generation-model.schema.ts +1 -0
  156. package/image-generation/queries/find-image-generation-jobs.query.ts +2 -0
  157. package/index.ts +15 -0
  158. package/marketplace-card/commands/execute-marketplace-card.command.ts +7 -0
  159. package/marketplace-card/commands/index.ts +2 -0
  160. package/marketplace-card/commands/soft-delete-all-marketplace-card-jobs.command.ts +13 -0
  161. package/marketplace-card/commands/update-title-marketplace-card-job.command.ts +16 -0
  162. package/marketplace-card/models/index.ts +1 -0
  163. package/marketplace-card/models/marketplace-card-config.schema.ts +2 -0
  164. package/marketplace-card/models/marketplace-card-job.schema.ts +1 -1
  165. package/marketplace-card/routes/marketplace-card.amqp.routes.ts +2 -0
  166. package/package.json +1 -1
  167. package/presentation/commands/create-presentation.command.ts +3 -0
  168. package/presentation/commands/generate-slides.command.ts +2 -1
  169. package/presentation/commands/get-presentation-slides-generation-price.command.ts +1 -0
  170. package/presentation/commands/index.ts +1 -0
  171. package/presentation/commands/reposition-slide.command.ts +16 -0
  172. package/presentation/enums/index.ts +1 -0
  173. package/presentation/enums/presentation-target-audience.enum.ts +6 -0
  174. package/presentation/models/index.ts +1 -0
  175. package/presentation/models/presentation-template.schema.ts +2 -0
  176. package/presentation/models/presentation-title-page.schema.ts +9 -0
  177. package/presentation/models/presentation.schema.ts +5 -1
  178. package/presentation/models/slide-content-edit.schema.ts +36 -24
  179. package/presentation/models/slide-content.schema.ts +294 -90
  180. package/presentation/routes/presentation.routes.ts +4 -0
  181. package/solving-edu-task/commands/delete-all-solving-edu-task-jobs.command.ts +13 -0
  182. package/solving-edu-task/commands/delete-solving-edu-task-job-by-uuid.command.ts +14 -0
  183. package/solving-edu-task/commands/get-solving-edu-task-price.command.ts +17 -0
  184. package/solving-edu-task/commands/index.ts +7 -0
  185. package/solving-edu-task/commands/retry-solving-edu-task-job.command.ts +25 -0
  186. package/solving-edu-task/commands/set-reaction-to-solving-edu-task-job.command.ts +31 -0
  187. package/solving-edu-task/commands/solving-edu-task.command.ts +22 -0
  188. package/solving-edu-task/commands/update-solving-edu-task-job-title.command.ts +16 -0
  189. package/solving-edu-task/index.ts +4 -0
  190. package/solving-edu-task/models/index.ts +3 -0
  191. package/solving-edu-task/models/solving-edu-task-config.schema.ts +8 -0
  192. package/solving-edu-task/models/solving-edu-task-job.schema.ts +35 -0
  193. package/solving-edu-task/models/solving-edu-task-model.schema.ts +30 -0
  194. package/solving-edu-task/queries/find-solving-edu-task-job-by-id.query.ts +16 -0
  195. package/solving-edu-task/queries/find-solving-edu-task-jobs.query.ts +33 -0
  196. package/solving-edu-task/queries/get-solving-edu-task-config.query.ts +11 -0
  197. package/solving-edu-task/queries/index.ts +3 -0
  198. package/solving-edu-task/routes/index.ts +1 -0
  199. package/solving-edu-task/routes/solving-edu-task.amqp.routes.ts +12 -0
  200. package/spell-corrector/commands/delete-all-spell-corrector-jobs.command.ts +13 -0
  201. package/spell-corrector/commands/delete-spell-corrector-job-by-uuid.command.ts +14 -0
  202. package/spell-corrector/commands/get-spell-corrector-price.command.ts +16 -0
  203. package/spell-corrector/commands/index.ts +7 -0
  204. package/spell-corrector/commands/retry-spell-corrector-job.command.ts +17 -0
  205. package/spell-corrector/commands/set-reaction-to-spell-corrector-job.command.ts +30 -0
  206. package/spell-corrector/commands/spell-corrector.command.ts +18 -0
  207. package/spell-corrector/commands/update-spell-corrector-job-title.command.ts +16 -0
  208. package/spell-corrector/index.ts +4 -0
  209. package/spell-corrector/models/index.ts +3 -0
  210. package/spell-corrector/models/spell-corrector-job.schema.ts +25 -0
  211. package/spell-corrector/models/spell-corrector-model.schema.ts +18 -0
  212. package/spell-corrector/models/spell-corrector-tool-config.schema.ts +9 -0
  213. package/spell-corrector/queries/find-spell-corrector-job-by-uuid.query.ts +11 -0
  214. package/spell-corrector/queries/find-spell-corrector-jobs.query.ts +33 -0
  215. package/spell-corrector/queries/get-spell-corrector-tool-config.query.ts +8 -0
  216. package/spell-corrector/queries/index.ts +3 -0
  217. package/spell-corrector/routes/index.ts +1 -0
  218. package/spell-corrector/routes/spell-corrector.amqp.routes.ts +12 -0
  219. package/stt/models/stt-response.schema.ts +2 -0
  220. package/tool-workspace/commands/index.ts +2 -0
  221. package/tool-workspace/commands/soft-delete-tool-workspace.command.ts +25 -0
  222. package/tool-workspace/commands/update-tool-workspace.command.ts +30 -0
  223. package/tool-workspace/enums/index.ts +2 -0
  224. package/tool-workspace/enums/tool-workspace-item-slot.enum.ts +5 -0
  225. package/tool-workspace/enums/tool-workspace-status.enum.ts +4 -0
  226. package/tool-workspace/index.ts +5 -0
  227. package/tool-workspace/models/index.ts +4 -0
  228. package/tool-workspace/models/tool-workspace-contents.schema.ts +10 -0
  229. package/tool-workspace/models/tool-workspace-item.schema.ts +17 -0
  230. package/tool-workspace/models/tool-workspace-job.schema.ts +17 -0
  231. package/tool-workspace/models/tool-workspace.schema.ts +17 -0
  232. package/tool-workspace/queries/find-tool-workspace-by-uuid.query.ts +26 -0
  233. package/tool-workspace/queries/find-tool-workspaces.query.ts +37 -0
  234. package/tool-workspace/queries/index.ts +2 -0
  235. package/tool-workspace/routes/index.ts +1 -0
  236. package/tool-workspace/routes/tool-workspace.amqp.routes.ts +6 -0
  237. package/tools/enums/tool-content-type.enum.ts +3 -1
  238. package/tools/enums/tool-type.enum.ts +2 -0
  239. package/tools/models/global-tools-config.schema.ts +4 -0
  240. package/tools/models/tools-with-configs.schema.ts +14 -0
  241. package/video/commands/video.command.ts +7 -0
  242. package/video/const/videoMaxDuration.ts +1 -1
  243. package/video/enums/video-resolution.enum.ts +1 -0
  244. package/video/enums/video-strategy.enum.ts +1 -0
  245. package/video/models/video-config.schema.ts +2 -0
  246. package/video/models/video-model.schema.ts +1 -0
  247. package/video-editor/commands/edit-video.command.ts +2 -1
  248. package/video-editor/commands/get-video-editor-price.command.ts +2 -0
  249. package/video-editor/commands/retry-video-editor-job.command.ts +5 -1
  250. package/video-editor/enums/index.ts +1 -0
  251. package/video-editor/enums/video-editor-pricing-rule-type.enum.ts +4 -0
  252. package/video-editor/models/video-editor-job.schema.ts +9 -0
  253. package/video-editor/models/video-editor-model.schema.ts +45 -1
  254. package/video-editor/utils/calculate-video-editing-price.ts +45 -2
  255. package/writer/commands/collect-sources.command.ts +15 -0
  256. package/writer/commands/confirm-source-citation-metadata.command.ts +18 -0
  257. package/writer/commands/discard-writer-source.command.ts +18 -0
  258. package/writer/commands/generate-document-outline.command.ts +17 -0
  259. package/writer/commands/index.ts +5 -0
  260. package/writer/commands/update-writer-document-outline.command.ts +1 -0
  261. package/writer/commands/upload-writer-source.command.ts +18 -0
  262. package/writer/enums/index.ts +3 -0
  263. package/writer/enums/writer-document-stage.enum.ts +8 -0
  264. package/writer/enums/writer-source-origin.enum.ts +4 -0
  265. package/writer/enums/writer-source-status.enum.ts +5 -0
  266. package/writer/enums/writer-source-type.enum.ts +4 -0
  267. package/writer/models/index.ts +2 -0
  268. package/writer/models/writer-document-type.schema.ts +1 -1
  269. package/writer/models/writer-document.schema.ts +3 -0
  270. package/writer/models/writer-source-bibliographic-metadata.schema.ts +31 -0
  271. package/writer/models/writer-source.schema.ts +22 -0
  272. package/writer/queries/get-writer-document-sources.query.ts +15 -0
  273. package/writer/queries/index.ts +1 -0
  274. package/writer/routes/writer.routes.ts +6 -0
@@ -0,0 +1,7 @@
1
+ export * from './delete-all-solving-edu-task-jobs.command';
2
+ export * from './delete-solving-edu-task-job-by-uuid.command';
3
+ export * from './get-solving-edu-task-price.command';
4
+ export * from './retry-solving-edu-task-job.command';
5
+ export * from './set-reaction-to-solving-edu-task-job.command';
6
+ export * from './solving-edu-task.command';
7
+ export * from './update-solving-edu-task-job-title.command';
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SolvingEduTaskJobSchema } from '../models';
4
+ import { AttachedFileSchema } from '../../common';
5
+
6
+ export namespace RetrySolvingEduTaskJobCommand {
7
+ export const RequestSchema = z.object({
8
+ uuid: z.string().uuid(),
9
+ tokenReservationId: z.string().uuid().optional(),
10
+ precalculatedPrice: z.number().optional(),
11
+ userId: z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: z.string().uuid().nullable().optional(),
13
+ prompt: z.string().optional(),
14
+ modelId: z.string().uuid().optional(),
15
+ params: z
16
+ .object({
17
+ attachedFiles: z.array(AttachedFileSchema),
18
+ })
19
+ .optional(),
20
+ });
21
+ export type Request = z.infer<typeof RequestSchema>;
22
+
23
+ export const ResponseSchema = ICommandResponseSchema(SolvingEduTaskJobSchema);
24
+ export type Response = z.infer<typeof ResponseSchema>;
25
+ }
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { USER_REACTION } from '../../common';
3
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
4
+ import { SolvingEduTaskJobSchema } from '../models';
5
+
6
+ export namespace SetReactionToSolvingEduTaskJobCommand {
7
+ export const RequestSchema = z
8
+ .object({
9
+ userId: z.string().uuid().nullable().optional(),
10
+ unregisteredUserId: z.string().uuid().nullable().optional(),
11
+ uuid: z.string().uuid(),
12
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
13
+ dislikeReason: z.string().nullable().default(null),
14
+ })
15
+ .refine(
16
+ (data) => {
17
+ if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
18
+ return false;
19
+ }
20
+ return true;
21
+ },
22
+ {
23
+ message: 'Dislike reason is not allowed when reaction is not disliked',
24
+ },
25
+ );
26
+
27
+ export type Request = z.infer<typeof RequestSchema>;
28
+
29
+ export const ResponseSchema = ICommandResponseSchema(SolvingEduTaskJobSchema);
30
+ export type Response = z.infer<typeof ResponseSchema>;
31
+ }
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SolvingEduTaskJobSchema } from '../models';
4
+ import { AttachedFileSchema } from '../../common';
5
+
6
+ export namespace SolvingEduTaskCommand {
7
+ export const RequestSchema = z.object({
8
+ userId: z.string().uuid().nullable().optional(),
9
+ unregisteredUserId: z.string().uuid().nullable().optional(),
10
+ prompt: z.string(),
11
+ modelId: z.string().uuid(),
12
+ params: z.object({
13
+ attachedFiles: z.array(AttachedFileSchema),
14
+ }),
15
+ tokenReservationId: z.string().uuid().optional(),
16
+ precalculatedPrice: z.number().optional(),
17
+ });
18
+ export type Request = z.infer<typeof RequestSchema>;
19
+
20
+ export const ResponseSchema = ICommandResponseSchema(SolvingEduTaskJobSchema);
21
+ export type Response = z.infer<typeof ResponseSchema>;
22
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { SolvingEduTaskJobSchema } from '../models';
3
+ import { ICommandResponseSchema } from '../../common';
4
+
5
+ export namespace UpdateSolvingEduTaskJobTitleCommand {
6
+ export const RequestSchema = z.object({
7
+ userId: z.string().uuid().nullable().optional(),
8
+ unregisteredUserId: z.string().uuid().nullable().optional(),
9
+ uuid: z.string().uuid(),
10
+ title: z.string(),
11
+ });
12
+ export type Request = z.infer<typeof RequestSchema>;
13
+
14
+ export const ResponseSchema = ICommandResponseSchema(SolvingEduTaskJobSchema);
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,4 @@
1
+ export * from './commands';
2
+ export * from './models';
3
+ export * from './queries';
4
+ export * from './routes';
@@ -0,0 +1,3 @@
1
+ export * from './solving-edu-task-config.schema';
2
+ export * from './solving-edu-task-job.schema';
3
+ export * from './solving-edu-task-model.schema';
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { SolvingEduTaskModelSchema } from './solving-edu-task-model.schema';
3
+
4
+ export const SolvingEduTaskConfigSchema = z.object({
5
+ models: z.array(SolvingEduTaskModelSchema),
6
+ });
7
+
8
+ export type SolvingEduTaskConfig = z.infer<typeof SolvingEduTaskConfigSchema>;
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ import { JOB_STATUS } from '../../tools';
3
+ import { AttachedFileSchema, USER_REACTION } from '../../common';
4
+
5
+ export const SolvingEduTaskJobParamsSchema = z.object({
6
+ attachedFiles: z.array(AttachedFileSchema),
7
+ });
8
+
9
+ export type SolvingEduTaskJobParams = z.infer<typeof SolvingEduTaskJobParamsSchema>;
10
+
11
+ export const SolvingEduTaskJobSchema = z.object({
12
+ uuid: z.string(),
13
+ prompt: z.string(),
14
+ aiOutput: z.string().nullable().optional(),
15
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
16
+ dislikeReason: z.string().nullable(),
17
+ externalId: z.string().nullable(),
18
+ title: z.string(),
19
+ status: z.nativeEnum(JOB_STATUS),
20
+ error: z.string().nullable(),
21
+ internalError: z.string().nullable().optional(),
22
+ modelId: z.string(),
23
+ price: z.number(),
24
+ params: SolvingEduTaskJobParamsSchema,
25
+ attempts: z.array(z.any()),
26
+ userId: z.string().nullable().optional(),
27
+ unregisteredUserId: z.string().nullable().optional(),
28
+ tokenReservationId: z.string().nullable().optional(),
29
+ isDeleted: z.boolean(),
30
+ createdAt: z.date(),
31
+ completedAt: z.date().nullable().optional(),
32
+ updatedAt: z.date(),
33
+ });
34
+
35
+ export type SolvingEduTaskJob = z.infer<typeof SolvingEduTaskJobSchema>;
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ import { IconVariantsSchema, TOOL_MODEL_STATUS } from '../../common';
3
+
4
+ export const SolvingEduTaskModelParamsSchema = z.object({
5
+ imageAttachment: z.object({
6
+ supported: z.boolean(),
7
+ maxImages: z.number(),
8
+ acceptedTypes: z.array(z.string()),
9
+ }),
10
+ });
11
+
12
+ export type SolvingEduTaskModelParams = z.infer<typeof SolvingEduTaskModelParamsSchema>;
13
+
14
+ export const SolvingEduTaskModelSchema = z.object({
15
+ uuid: z.string(),
16
+ title: z.string(),
17
+ description: z.string(),
18
+ aiModel: z.string(),
19
+ price: z.number(),
20
+ order: z.number(),
21
+ status: z.nativeEnum(TOOL_MODEL_STATUS),
22
+ icons: IconVariantsSchema,
23
+ strategy: z.string(),
24
+ maxPromptLength: z.number(),
25
+ params: SolvingEduTaskModelParamsSchema,
26
+ createdAt: z.date(),
27
+ updatedAt: z.date(),
28
+ });
29
+
30
+ export type SolvingEduTaskModel = z.infer<typeof SolvingEduTaskModelSchema>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common';
3
+ import { SolvingEduTaskJobSchema } from '../models';
4
+
5
+ export namespace FindSolvingEduTaskJobByIdQuery {
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string().uuid(),
8
+ userId: z.string().uuid().nullable().optional(),
9
+ unregisteredUserId: z.string().uuid().nullable().optional(),
10
+ });
11
+
12
+ export type Request = z.infer<typeof RequestSchema>;
13
+
14
+ export const ResponseSchema = ICommandResponseSchema(SolvingEduTaskJobSchema);
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SolvingEduTaskJobSchema } from '../models';
4
+
5
+ export namespace FindSolvingEduTaskJobsQuery {
6
+ export const RequestSchema = z
7
+ .object({
8
+ userId: z.string().uuid().optional(),
9
+ unregisteredUserId: z.string().uuid().optional(),
10
+ title: z.string().optional(),
11
+ limit: z.coerce.number().min(1).optional(),
12
+ offset: z.coerce.number().min(0).default(0).optional(),
13
+ })
14
+ .refine(
15
+ (data) => {
16
+ return !(data.userId && data.unregisteredUserId);
17
+ },
18
+ {
19
+ message: 'userId and unregisteredUserId cannot be used together',
20
+ path: ['userId', 'unregisteredUserId'],
21
+ },
22
+ );
23
+ export type Request = z.infer<typeof RequestSchema>;
24
+
25
+ export const ResponseSchema = ICommandResponseSchema(
26
+ z.object({
27
+ data: z.array(SolvingEduTaskJobSchema),
28
+ page: z.number(),
29
+ totalPages: z.number(),
30
+ }),
31
+ );
32
+ export type Response = z.infer<typeof ResponseSchema>;
33
+ }
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common';
3
+ import { SolvingEduTaskConfigSchema } from '../models';
4
+
5
+ export namespace GetSolvingEduTaskConfigQuery {
6
+ export const RequestSchema = z.object({});
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
9
+ export const ResponseSchema = ICommandResponseSchema(SolvingEduTaskConfigSchema);
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -0,0 +1,3 @@
1
+ export * from './find-solving-edu-task-job-by-id.query';
2
+ export * from './find-solving-edu-task-jobs.query';
3
+ export * from './get-solving-edu-task-config.query';
@@ -0,0 +1 @@
1
+ export * from './solving-edu-task.amqp.routes';
@@ -0,0 +1,12 @@
1
+ export const SOLVING_EDU_TASK_AMQP_ROUTES = {
2
+ EXECUTE: 'tools.solving-edu-task.execute.rpc',
3
+ GET_PRICE: 'tools.solving-edu-task.get-price.rpc',
4
+ CONFIG: 'tools.solving-edu-task.config.rpc',
5
+ GET_JOB: 'tools.solving-edu-task.jobs.get.rpc',
6
+ LIST_JOBS: 'tools.solving-edu-task.jobs.list.rpc',
7
+ SET_REACTION: 'tools.solving-edu-task.jobs.set-reaction.rpc',
8
+ UPDATE_TITLE: 'tools.solving-edu-task.jobs.update-title.rpc',
9
+ SOFT_DELETE: 'tools.solving-edu-task.jobs.soft-delete.rpc',
10
+ SOFT_DELETE_ALL: 'tools.solving-edu-task.jobs.soft-delete-all.rpc',
11
+ RETRY: 'tools.solving-edu-task.jobs.retry.rpc',
12
+ } as const;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+
4
+ export namespace DeleteAllSpellCorrectorJobsCommand {
5
+ export const RequestSchema = z.object({
6
+ userId: z.string().uuid().nullable().optional(),
7
+ unregisteredUserId: z.string().uuid().nullable().optional(),
8
+ });
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = ICommandResponseSchema(z.boolean());
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+
4
+ export namespace DeleteSpellCorrectorJobByUuidCommand {
5
+ export const RequestSchema = z.object({
6
+ userId: z.string().uuid().nullable().optional(),
7
+ unregisteredUserId: z.string().uuid().nullable().optional(),
8
+ uuid: z.string(),
9
+ });
10
+ export type Request = z.infer<typeof RequestSchema>;
11
+
12
+ export const ResponseSchema = ICommandResponseSchema(z.boolean());
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+
4
+ export namespace GetSpellCorrectorPriceCommand {
5
+ export const RequestSchema = z.object({
6
+ modelId: z.string().uuid(),
7
+ });
8
+ export type Request = z.infer<typeof RequestSchema>;
9
+
10
+ export const ResponseDataSchema = z.object({
11
+ price: z.number(),
12
+ });
13
+
14
+ export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,7 @@
1
+ export * from './spell-corrector.command';
2
+ export * from './get-spell-corrector-price.command';
3
+ export * from './retry-spell-corrector-job.command';
4
+ export * from './set-reaction-to-spell-corrector-job.command';
5
+ export * from './update-spell-corrector-job-title.command';
6
+ export * from './delete-all-spell-corrector-jobs.command';
7
+ export * from './delete-spell-corrector-job-by-uuid.command';
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SpellCorrectorJobSchema } from '../models';
4
+
5
+ export namespace RetrySpellCorrectorJobCommand {
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string().uuid(),
8
+ userId: z.string().uuid().nullable().optional(),
9
+ unregisteredUserId: z.string().uuid().nullable().optional(),
10
+ tokenReservationId: z.string().uuid(),
11
+ precalculatedPrice: z.number(),
12
+ });
13
+ export type Request = z.infer<typeof RequestSchema>;
14
+
15
+ export const ResponseSchema = ICommandResponseSchema(SpellCorrectorJobSchema);
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SpellCorrectorJobSchema } from '../models';
4
+ import { USER_REACTION } from '../../common';
5
+
6
+ export namespace SetReactionToSpellCorrectorJobCommand {
7
+ export const RequestSchema = z
8
+ .object({
9
+ userId: z.string().uuid().nullable().optional(),
10
+ unregisteredUserId: z.string().uuid().nullable().optional(),
11
+ uuid: z.string().uuid(),
12
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
13
+ dislikeReason: z.string().nullable().default(null),
14
+ })
15
+ .refine(
16
+ (data) => {
17
+ if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
18
+ return false;
19
+ }
20
+ return true;
21
+ },
22
+ {
23
+ message: 'Dislike reason is not allowed when reaction is not disliked',
24
+ },
25
+ );
26
+ export type Request = z.infer<typeof RequestSchema>;
27
+
28
+ export const ResponseSchema = ICommandResponseSchema(SpellCorrectorJobSchema);
29
+ export type Response = z.infer<typeof ResponseSchema>;
30
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SpellCorrectorJobSchema } from '../models';
4
+
5
+ export namespace SpellCorrectorCommand {
6
+ export const RequestSchema = z.object({
7
+ userId: z.string().uuid().nullable().optional(),
8
+ unregisteredUserId: z.string().uuid().nullable().optional(),
9
+ prompt: z.string(),
10
+ modelId: z.string().uuid(),
11
+ tokenReservationId: z.string().uuid(),
12
+ precalculatedPrice: z.number(),
13
+ });
14
+ export type Request = z.infer<typeof RequestSchema>;
15
+
16
+ export const ResponseSchema = ICommandResponseSchema(SpellCorrectorJobSchema);
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SpellCorrectorJobSchema } from '../models';
4
+
5
+ export namespace UpdateSpellCorrectorJobTitleCommand {
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string().uuid(),
8
+ userId: z.string().uuid().nullable().optional(),
9
+ unregisteredUserId: z.string().uuid().nullable().optional(),
10
+ title: z.string().min(1).max(40),
11
+ });
12
+ export type Request = z.infer<typeof RequestSchema>;
13
+
14
+ export const ResponseSchema = ICommandResponseSchema(SpellCorrectorJobSchema);
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,4 @@
1
+ export * from './routes';
2
+ export * from './commands';
3
+ export * from './models';
4
+ export * from './queries';
@@ -0,0 +1,3 @@
1
+ export * from './spell-corrector-model.schema';
2
+ export * from './spell-corrector-job.schema';
3
+ export * from './spell-corrector-tool-config.schema';
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { JOB_STATUS } from '../../tools';
3
+ import { USER_REACTION } from '../../common';
4
+
5
+ export const SpellCorrectorJobSchema = z.object({
6
+ uuid: z.string(),
7
+ userId: z.string().nullable(),
8
+ unregisteredUserId: z.string().nullable(),
9
+ userInput: z.string(),
10
+ aiOutput: z.string().nullable(),
11
+ aiTokenUsage: z.number().nullable(),
12
+ price: z.number(),
13
+ status: z.nativeEnum(JOB_STATUS),
14
+ title: z.string(),
15
+ error: z.string().nullable(),
16
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
17
+ dislikeReason: z.string().nullable(),
18
+ modelId: z.string(),
19
+ tokenReservationId: z.string().nullable().optional(),
20
+ createdAt: z.date(),
21
+ updatedAt: z.date(),
22
+ completedAt: z.date().nullable(),
23
+ });
24
+
25
+ export type SpellCorrectorJob = z.infer<typeof SpellCorrectorJobSchema>;
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { IconVariantsSchema, REASONING_EFFORT } from '../../common';
3
+
4
+ export const SpellCorrectorModelSchema = z.object({
5
+ uuid: z.string(),
6
+ title: z.string(),
7
+ description: z.string(),
8
+ icon: z.string(),
9
+ icons: IconVariantsSchema,
10
+ price: z.number(),
11
+ aiModel: z.string(),
12
+ reasoningEffort: z.nativeEnum(REASONING_EFFORT).nullable().optional(),
13
+ order: z.number(),
14
+ createdAt: z.date(),
15
+ updatedAt: z.date(),
16
+ });
17
+
18
+ export type SpellCorrectorModel = z.infer<typeof SpellCorrectorModelSchema>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { SpellCorrectorModelSchema } from './spell-corrector-model.schema';
3
+
4
+ export const SpellCorrectorToolConfigSchema = z.object({
5
+ models: z.array(SpellCorrectorModelSchema),
6
+ maxSymbols: z.number(),
7
+ });
8
+
9
+ export type SpellCorrectorTool = z.infer<typeof SpellCorrectorToolConfigSchema>;
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SpellCorrectorJobSchema } from '../models';
4
+
5
+ export namespace FindSpellCorrectorJobByUuidQuery {
6
+ export const RequestSchema = SpellCorrectorJobSchema.pick({ uuid: true });
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
9
+ export const ResponseSchema = ICommandResponseSchema(SpellCorrectorJobSchema);
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SpellCorrectorJobSchema } from '../models';
4
+
5
+ export namespace FindSpellCorrectorJobsQuery {
6
+ export const RequestSchema = z
7
+ .object({
8
+ userId: z.string().uuid().optional(),
9
+ unregisteredUserId: z.string().uuid().optional(),
10
+ title: z.string().optional(),
11
+ limit: z.coerce.number().min(1).optional(),
12
+ offset: z.coerce.number().min(0).default(0).optional(),
13
+ })
14
+ .refine(
15
+ (data) => {
16
+ return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
17
+ },
18
+ {
19
+ message: 'At least userId or unregisteredUserId must be present',
20
+ path: ['userId', 'unregisteredUserId'],
21
+ },
22
+ );
23
+ export type Request = z.infer<typeof RequestSchema>;
24
+
25
+ export const ResponseSchema = ICommandResponseSchema(
26
+ z.object({
27
+ data: z.array(SpellCorrectorJobSchema),
28
+ page: z.number(),
29
+ totalPages: z.number(),
30
+ }),
31
+ );
32
+ export type Response = z.infer<typeof ResponseSchema>;
33
+ }
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { SpellCorrectorToolConfigSchema } from '../models';
4
+
5
+ export namespace GetSpellCorrectorToolConfigQuery {
6
+ export const ResponseSchema = ICommandResponseSchema(SpellCorrectorToolConfigSchema);
7
+ export type Response = z.infer<typeof ResponseSchema>;
8
+ }
@@ -0,0 +1,3 @@
1
+ export * from './find-spell-corrector-job-by-uuid.query';
2
+ export * from './get-spell-corrector-tool-config.query';
3
+ export * from './find-spell-corrector-jobs.query';
@@ -0,0 +1 @@
1
+ export * from './spell-corrector.amqp.routes';
@@ -0,0 +1,12 @@
1
+ export const SPELL_CORRECTOR_AMQP_ROUTES = {
2
+ EXECUTE: 'tools.spell_corrector.execute.rpc',
3
+ GET_PRICE: 'tools.spell_corrector.get-price.rpc',
4
+ CONFIG: 'tools.spell_corrector.config.rpc',
5
+ GET_JOB: 'tools.spell_corrector.jobs.get.rpc',
6
+ LIST_JOBS: 'tools.spell_corrector.jobs.list.rpc',
7
+ SET_REACTION: 'tools.spell_corrector.jobs.set-reaction.rpc',
8
+ UPDATE_TITLE: 'tools.spell_corrector.jobs.update-title.rpc',
9
+ SOFT_DELETE: 'tools.spell_corrector.jobs.soft-delete.rpc',
10
+ SOFT_DELETE_ALL: 'tools.spell_corrector.jobs.soft-delete-all.rpc',
11
+ RETRY: 'tools.spell_corrector.jobs.retry.rpc',
12
+ } as const;
@@ -3,6 +3,8 @@ import { z } from 'zod';
3
3
  export const STTResponseSchema = z.object({
4
4
  raw: z.object({}),
5
5
  md: z.string(),
6
+ txtUrl: z.string().optional(),
7
+ srtUrl: z.string().optional(),
6
8
  });
7
9
 
8
10
  export type STTResponse = z.infer<typeof STTResponseSchema>;
@@ -0,0 +1,2 @@
1
+ export * from './update-tool-workspace.command';
2
+ export * from './soft-delete-tool-workspace.command';
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+
4
+ export namespace SoftDeleteToolWorkspaceCommand {
5
+ export const RequestSchema = z
6
+ .object({
7
+ uuid: z.string().uuid(),
8
+ userId: z.string().uuid().optional(),
9
+ unregisteredUserId: z.string().uuid().optional(),
10
+ })
11
+ .refine(
12
+ (data) => {
13
+ return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
14
+ },
15
+ {
16
+ message: 'At least userId or unregisteredUserId must be present',
17
+ path: ['userId', 'unregisteredUserId'],
18
+ },
19
+ );
20
+
21
+ export type Request = z.infer<typeof RequestSchema>;
22
+
23
+ export const ResponseSchema = ICommandResponseSchema(z.object({ success: z.boolean() }));
24
+ export type Response = z.infer<typeof ResponseSchema>;
25
+ }
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { TOOL_WORKSPACE_STATUS } from '../enums';
4
+ import { ToolWorkspaceSchema } from '../models';
5
+
6
+ export namespace UpdateToolWorkspaceCommand {
7
+ export const RequestSchema = z
8
+ .object({
9
+ uuid: z.string().uuid(),
10
+ title: z.string().min(1).optional(),
11
+ coverUrl: z.string().nullable().optional(),
12
+ status: z.nativeEnum(TOOL_WORKSPACE_STATUS).optional(),
13
+ userId: z.string().uuid().optional(),
14
+ unregisteredUserId: z.string().uuid().optional(),
15
+ })
16
+ .refine(
17
+ (data) => {
18
+ return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
19
+ },
20
+ {
21
+ message: 'At least userId or unregisteredUserId must be present',
22
+ path: ['userId', 'unregisteredUserId'],
23
+ },
24
+ );
25
+
26
+ export type Request = z.infer<typeof RequestSchema>;
27
+
28
+ export const ResponseSchema = ICommandResponseSchema(ToolWorkspaceSchema);
29
+ export type Response = z.infer<typeof ResponseSchema>;
30
+ }
@@ -0,0 +1,2 @@
1
+ export * from './tool-workspace-status.enum';
2
+ export * from './tool-workspace-item-slot.enum';