@purpleschool/gptbot-tools 0.0.77-ai-proxy → 0.0.78-ai-proxy

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 (215) hide show
  1. package/ai-vendor/index.ts +1 -0
  2. package/ai-vendor/models/ai-vendor.schema.ts +13 -0
  3. package/ai-vendor/models/index.ts +1 -0
  4. package/build/ai-vendor/index.js +17 -0
  5. package/build/ai-vendor/models/ai-vendor.schema.js +13 -0
  6. package/build/ai-vendor/models/index.js +17 -0
  7. package/build/common/errors/errors.js +163 -0
  8. package/build/common/models/attached-file.schema.js +13 -0
  9. package/build/common/models/index.js +1 -0
  10. package/build/image-editor/commands/image-editor-model/get-image-editor-model-by-uuid.command.js +13 -0
  11. package/build/image-editor/commands/image-editor-model/index.js +17 -0
  12. package/build/image-editor/commands/image-editor.command.js +3 -1
  13. package/build/image-editor/commands/index.js +1 -0
  14. package/build/image-editor/commands/retry-image-editor-job.command.js +4 -0
  15. package/build/image-editor/commands/set-reaction-to-image-editor-job.command.js +12 -2
  16. package/build/image-editor/enums/image-editor-model-type.enum.js +2 -0
  17. package/build/image-editor/enums/image-editor-strategy.enum.js +4 -0
  18. package/build/image-editor/models/image-editor-config.schema.js +1 -0
  19. package/build/image-editor/models/image-editor-job.schema.js +2 -0
  20. package/build/image-editor/models/image-editor-model.schema.js +9 -1
  21. package/build/image-editor/routes/image-editor-model.amqp.routes.js +6 -0
  22. package/build/image-editor/routes/image-editor.http.routes.js +1 -0
  23. package/build/image-editor/routes/index.js +1 -0
  24. package/build/image-generation/commands/execute-image-generation.command.js +20 -0
  25. package/build/image-generation/commands/forward-image-generation-job.command.js +32 -0
  26. package/build/image-generation/commands/index.js +23 -0
  27. package/build/image-generation/commands/save-image-generation-job.command.js +17 -0
  28. package/build/image-generation/commands/set-reaction-to-image-generation-job.command.js +27 -0
  29. package/build/image-generation/commands/soft-delete-image-generation-job-by-uuid.command.js +14 -0
  30. package/build/image-generation/commands/soft-delete-image-generation-jobs-by-criteria.command.js +13 -0
  31. package/build/image-generation/commands/update-image-generation-job-title.command.js +16 -0
  32. package/build/image-generation/enums/image-generation-model-strategy.enum.js +23 -0
  33. package/build/image-generation/enums/image-generation-models.enum.js +8 -0
  34. package/build/image-generation/enums/image-generation-resolution.enum.js +9 -0
  35. package/build/image-generation/enums/index.js +19 -0
  36. package/build/image-generation/index.js +21 -0
  37. package/build/image-generation/models/image-generation-config.schema.js +12 -0
  38. package/build/image-generation/models/image-generation-job.schema.js +35 -0
  39. package/build/image-generation/models/image-generation-model.schema.js +51 -0
  40. package/build/image-generation/models/image-generation-preset.schema.js +13 -0
  41. package/build/image-generation/models/index.js +20 -0
  42. package/build/image-generation/queries/find-image-generation-job-by-id.query.js +19 -0
  43. package/build/image-generation/queries/find-image-generation-jobs.query.js +28 -0
  44. package/build/image-generation/queries/get-image-generation-config.query.js +11 -0
  45. package/build/image-generation/queries/index.js +19 -0
  46. package/build/image-generation/routes/image-generation.amqp.routes.js +14 -0
  47. package/build/image-generation/routes/image-generation.http.routes.js +9 -0
  48. package/build/image-generation/routes/index.js +18 -0
  49. package/build/index.js +6 -0
  50. package/build/music/commands/index.js +1 -0
  51. package/build/music/commands/music-model/get-music-model-by-uuid.command.js +13 -0
  52. package/build/music/commands/music-model/index.js +17 -0
  53. package/build/music/commands/retry-music-job.command.js +2 -0
  54. package/build/music/commands/set-reaction-to-music-job.command.js +12 -2
  55. package/build/music/models/music-job.schema.js +1 -0
  56. package/build/music/models/music-track.schema.js +1 -0
  57. package/build/music/routes/index.js +1 -0
  58. package/build/music/routes/music-model.amqp.routes.js +6 -0
  59. package/build/paraphrase/commands/delete-all-paraphrase-jobs.command.js +13 -0
  60. package/build/paraphrase/commands/delete-paraphrase-job-by-uuid.command.js +14 -0
  61. package/build/paraphrase/commands/index.js +5 -0
  62. package/build/paraphrase/commands/retry-paraphrase-job.command.js +16 -0
  63. package/build/paraphrase/commands/set-reaction-to-paraphrase-job.command.js +27 -0
  64. package/build/paraphrase/commands/update-paraphrase-job-title.command.js +16 -0
  65. package/build/paraphrase/models/paraphrase-job.schema.js +7 -0
  66. package/build/paraphrase/queries/find-paraphrase-jobs.query.js +28 -0
  67. package/build/paraphrase/queries/index.js +1 -0
  68. package/build/paraphrase/routes/paraphrase.amqp.routes.js +6 -0
  69. package/build/presentation/commands/index.js +1 -0
  70. package/build/presentation/commands/set-reaction-to-presentation.command.js +26 -0
  71. package/build/presentation/constants/slide-layout-map.constant.js +1 -0
  72. package/build/presentation/enums/slide-content-type.enum.js +1 -0
  73. package/build/presentation/models/pptx-export-payload.js +19 -1
  74. package/build/presentation/models/presentation.schema.js +3 -0
  75. package/build/presentation/models/slide-content-edit.schema.js +18 -1
  76. package/build/presentation/models/slide-content.schema.js +30 -1
  77. package/build/presentation/routes/presentation.routes.js +1 -0
  78. package/build/stt/commands/set-reaction-to-stt-job.command.js +12 -2
  79. package/build/stt/models/stt-job.schema.js +2 -0
  80. package/build/tools/enums/tool-content-type.enum.js +1 -0
  81. package/build/tools/enums/tool-type.enum.js +1 -0
  82. package/build/tools/models/global-tools-config.schema.js +2 -0
  83. package/build/tools/models/tool.schema.js +3 -0
  84. package/build/tools/models/tools-with-configs.schema.js +5 -0
  85. package/build/tts/commands/set-reaction-to-tts-job.command.js +12 -2
  86. package/build/tts/models/tts-job.schema.js +2 -0
  87. package/build/video/commands/index.js +1 -0
  88. package/build/video/commands/retry-video-job.command.js +4 -0
  89. package/build/video/commands/set-reaction-to-video-job.command.js +12 -2
  90. package/build/video/commands/video-model/get-video-model-by-uuid.command.js +13 -0
  91. package/build/video/commands/video-model/index.js +17 -0
  92. package/build/video/enums/video-pricing-rule-type.enum.js +1 -0
  93. package/build/video/enums/video-strategy.enum.js +1 -0
  94. package/build/video/models/video-job.schema.js +3 -0
  95. package/build/video/models/video-model.schema.js +9 -1
  96. package/build/video/routes/index.js +1 -0
  97. package/build/video/routes/video-model.amqp.routes.js +6 -0
  98. package/build/video/routes/video.http.routes.js +1 -0
  99. package/build/video/utils/calculate-video-generation-price.util.js +5 -1
  100. package/build/video-editor/commands/edit-video.command.js +2 -1
  101. package/build/video-editor/commands/index.js +1 -0
  102. package/build/video-editor/commands/retry-video-editor-job.command.js +5 -0
  103. package/build/video-editor/commands/set-reaction-to-video-editor-job.command.js +12 -2
  104. package/build/video-editor/commands/video-editor-model/get-video-editor-model.command.js +13 -0
  105. package/build/video-editor/commands/video-editor-model/index.js +17 -0
  106. package/build/video-editor/models/video-editor-job.schema.js +3 -0
  107. package/build/video-editor/routes/index.js +1 -0
  108. package/build/video-editor/routes/video-editor-model.amqp.routes.js +6 -0
  109. package/build/writer/commands/set-reaction-writer-document.command.js +11 -1
  110. package/build/writer/models/writer-document.schema.js +1 -0
  111. package/common/errors/errors.ts +163 -0
  112. package/common/models/attached-file.schema.ts +11 -0
  113. package/common/models/index.ts +1 -0
  114. package/image-editor/commands/image-editor-model/get-image-editor-model-by-uuid.command.ts +13 -0
  115. package/image-editor/commands/image-editor-model/index.ts +1 -0
  116. package/image-editor/commands/image-editor.command.ts +3 -1
  117. package/image-editor/commands/index.ts +1 -0
  118. package/image-editor/commands/retry-image-editor-job.command.ts +5 -1
  119. package/image-editor/commands/set-reaction-to-image-editor-job.command.ts +19 -6
  120. package/image-editor/enums/image-editor-model-type.enum.ts +2 -0
  121. package/image-editor/enums/image-editor-strategy.enum.ts +4 -0
  122. package/image-editor/models/image-editor-config.schema.ts +1 -0
  123. package/image-editor/models/image-editor-job.schema.ts +3 -1
  124. package/image-editor/models/image-editor-model.schema.ts +16 -0
  125. package/image-editor/routes/image-editor-model.amqp.routes.ts +3 -0
  126. package/image-editor/routes/image-editor.http.routes.ts +1 -0
  127. package/image-editor/routes/index.ts +1 -0
  128. package/image-generation/commands/execute-image-generation.command.ts +20 -0
  129. package/image-generation/commands/forward-image-generation-job.command.ts +32 -0
  130. package/image-generation/commands/index.ts +7 -0
  131. package/image-generation/commands/save-image-generation-job.command.ts +17 -0
  132. package/image-generation/commands/set-reaction-to-image-generation-job.command.ts +30 -0
  133. package/image-generation/commands/soft-delete-image-generation-job-by-uuid.command.ts +14 -0
  134. package/image-generation/commands/soft-delete-image-generation-jobs-by-criteria.command.ts +13 -0
  135. package/image-generation/commands/update-image-generation-job-title.command.ts +16 -0
  136. package/image-generation/enums/image-generation-model-strategy.enum.ts +24 -0
  137. package/image-generation/enums/image-generation-models.enum.ts +4 -0
  138. package/image-generation/enums/image-generation-resolution.enum.ts +5 -0
  139. package/image-generation/enums/index.ts +3 -0
  140. package/image-generation/index.ts +5 -0
  141. package/image-generation/models/image-generation-config.schema.ts +11 -0
  142. package/image-generation/models/image-generation-job.schema.ts +37 -0
  143. package/image-generation/models/image-generation-model.schema.ts +64 -0
  144. package/image-generation/models/image-generation-preset.schema.ts +13 -0
  145. package/image-generation/models/index.ts +4 -0
  146. package/image-generation/queries/find-image-generation-job-by-id.query.ts +19 -0
  147. package/image-generation/queries/find-image-generation-jobs.query.ts +33 -0
  148. package/image-generation/queries/get-image-generation-config.query.ts +11 -0
  149. package/image-generation/queries/index.ts +3 -0
  150. package/image-generation/routes/image-generation.amqp.routes.ts +11 -0
  151. package/image-generation/routes/image-generation.http.routes.ts +7 -0
  152. package/image-generation/routes/index.ts +2 -0
  153. package/index.ts +6 -0
  154. package/music/commands/index.ts +1 -0
  155. package/music/commands/music-model/get-music-model-by-uuid.command.ts +13 -0
  156. package/music/commands/music-model/index.ts +1 -0
  157. package/music/commands/retry-music-job.command.ts +3 -1
  158. package/music/commands/set-reaction-to-music-job.command.ts +19 -6
  159. package/music/models/music-job.schema.ts +1 -0
  160. package/music/models/music-track.schema.ts +1 -0
  161. package/music/routes/index.ts +1 -0
  162. package/music/routes/music-model.amqp.routes.ts +3 -0
  163. package/package.json +1 -1
  164. package/paraphrase/commands/delete-all-paraphrase-jobs.command.ts +13 -0
  165. package/paraphrase/commands/delete-paraphrase-job-by-uuid.command.ts +14 -0
  166. package/paraphrase/commands/index.ts +5 -0
  167. package/paraphrase/commands/retry-paraphrase-job.command.ts +16 -0
  168. package/paraphrase/commands/set-reaction-to-paraphrase-job.command.ts +30 -0
  169. package/paraphrase/commands/update-paraphrase-job-title.command.ts +16 -0
  170. package/paraphrase/models/paraphrase-job.schema.ts +7 -0
  171. package/paraphrase/queries/find-paraphrase-jobs.query.ts +33 -0
  172. package/paraphrase/queries/index.ts +1 -0
  173. package/paraphrase/routes/paraphrase.amqp.routes.ts +6 -0
  174. package/presentation/commands/index.ts +1 -0
  175. package/presentation/commands/set-reaction-to-presentation.command.ts +29 -0
  176. package/presentation/constants/slide-layout-map.constant.ts +1 -0
  177. package/presentation/enums/slide-content-type.enum.ts +1 -0
  178. package/presentation/models/pptx-export-payload.ts +20 -0
  179. package/presentation/models/presentation.schema.ts +3 -0
  180. package/presentation/models/slide-content-edit.schema.ts +21 -0
  181. package/presentation/models/slide-content.schema.ts +51 -0
  182. package/presentation/routes/presentation.routes.ts +1 -0
  183. package/stt/commands/set-reaction-to-stt-job.command.ts +19 -6
  184. package/stt/models/stt-job.schema.ts +2 -0
  185. package/tools/enums/tool-content-type.enum.ts +1 -0
  186. package/tools/enums/tool-type.enum.ts +1 -0
  187. package/tools/models/global-tools-config.schema.ts +2 -0
  188. package/tools/models/tool.schema.ts +3 -0
  189. package/tools/models/tools-with-configs.schema.ts +7 -0
  190. package/tts/commands/set-reaction-to-tts-job.command.ts +19 -6
  191. package/tts/models/tts-job.schema.ts +2 -0
  192. package/video/commands/index.ts +1 -0
  193. package/video/commands/retry-video-job.command.ts +4 -0
  194. package/video/commands/set-reaction-to-video-job.command.ts +19 -6
  195. package/video/commands/video-model/get-video-model-by-uuid.command.ts +13 -0
  196. package/video/commands/video-model/index.ts +1 -0
  197. package/video/enums/video-pricing-rule-type.enum.ts +1 -0
  198. package/video/enums/video-strategy.enum.ts +1 -0
  199. package/video/models/video-job.schema.ts +3 -0
  200. package/video/models/video-model.schema.ts +9 -1
  201. package/video/routes/index.ts +1 -0
  202. package/video/routes/video-model.amqp.routes.ts +3 -0
  203. package/video/routes/video.http.routes.ts +1 -0
  204. package/video/utils/calculate-video-generation-price.util.ts +7 -1
  205. package/video-editor/commands/edit-video.command.ts +2 -1
  206. package/video-editor/commands/index.ts +1 -0
  207. package/video-editor/commands/retry-video-editor-job.command.ts +5 -0
  208. package/video-editor/commands/set-reaction-to-video-editor-job.command.ts +19 -6
  209. package/video-editor/commands/video-editor-model/get-video-editor-model.command.ts +13 -0
  210. package/video-editor/commands/video-editor-model/index.ts +1 -0
  211. package/video-editor/models/video-editor-job.schema.ts +3 -0
  212. package/video-editor/routes/index.ts +1 -0
  213. package/video-editor/routes/video-editor-model.amqp.routes.ts +3 -0
  214. package/writer/commands/set-reaction-writer-document.command.ts +19 -6
  215. package/writer/models/writer-document.schema.ts +1 -0
@@ -0,0 +1 @@
1
+ export * from './models';
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { IconVariantsSchema } from '../../common';
3
+
4
+ export const AiVendorSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ title: z.string(),
7
+ iconVariants: IconVariantsSchema,
8
+ order: z.number(),
9
+ createdAt: z.date(),
10
+ updatedAt: z.date(),
11
+ });
12
+
13
+ export type AiVendor = z.infer<typeof AiVendorSchema>;
@@ -0,0 +1 @@
1
+ export * from './ai-vendor.schema';
@@ -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("./models"), exports);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AiVendorSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_1 = require("../../common");
6
+ exports.AiVendorSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ title: zod_1.z.string(),
9
+ iconVariants: common_1.IconVariantsSchema,
10
+ order: zod_1.z.number(),
11
+ createdAt: zod_1.z.date(),
12
+ updatedAt: zod_1.z.date(),
13
+ });
@@ -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("./ai-vendor.schema"), exports);
@@ -102,6 +102,21 @@ exports.ERRORS = {
102
102
  message: 'Задание на перефразирование не найдено',
103
103
  httpCode: 404,
104
104
  },
105
+ DELETE_ERROR: {
106
+ code: 'PARAPHRASE_JOB.DELETE_ERROR',
107
+ message: 'Произошла ошибка при удалении задания на перефразирование',
108
+ httpCode: 500,
109
+ },
110
+ NOT_AN_OWNER: {
111
+ code: 'PARAPHRASE_JOB.NOT_AN_OWNER',
112
+ message: 'Пользователь не является владельцем задания на перефразирование',
113
+ httpCode: 403,
114
+ },
115
+ NOT_IN_FAILED_STATE_TO_RETRY: {
116
+ code: 'PARAPHRASE_JOB.NOT_IN_FAILED_STATE_TO_RETRY',
117
+ message: 'Задание на перефразирование не в состоянии "failed". Невозможно повторить',
118
+ httpCode: 400,
119
+ },
105
120
  },
106
121
  S3: {
107
122
  GET_FILE_STREAM_ERROR: {
@@ -578,6 +593,11 @@ exports.ERRORS = {
578
593
  message: 'Некорректное соотношение сторон',
579
594
  httpCode: 400,
580
595
  },
596
+ INVALID_RESOLUTION: {
597
+ code: 'VIDEO.INVALID_RESOLUTION',
598
+ message: 'Некорректное разрешение видео',
599
+ httpCode: 400,
600
+ },
581
601
  RUNWAY_CONTENT_POLICY: {
582
602
  code: 'VIDEO.RUNWAY_CONTENT_POLICY',
583
603
  message: 'Запрос на создание видео был отклонен, т.к. он не соответствует требованиям политики безопасности Runway.',
@@ -652,6 +672,11 @@ exports.ERRORS = {
652
672
  message: 'Произошла ошибка при удалении задания на генерацию видео',
653
673
  httpCode: 500,
654
674
  },
675
+ UPDATE_ERROR: {
676
+ code: 'VIDEO_JOB.UPDATE_ERROR',
677
+ message: 'Произошла ошибка при обновлении задания на генерацию видео',
678
+ httpCode: 500,
679
+ },
655
680
  },
656
681
  WRITER_DOCUMENT: {
657
682
  SET_REACTION_TO_WRITER_DOCUMENT_ERROR: {
@@ -925,6 +950,11 @@ exports.ERRORS = {
925
950
  message: 'Произошла ошибка при удалении задания на редактирование картинки',
926
951
  httpCode: 500,
927
952
  },
953
+ UPDATE_ERROR: {
954
+ code: 'IMAGE_EDITOR_JOB.UPDATE_ERROR',
955
+ message: 'Произошла ошибка при обновлении задания на редактирование картинки',
956
+ httpCode: 500,
957
+ },
928
958
  },
929
959
  VIDEO_EDITOR: {
930
960
  AI_ERROR: {
@@ -1021,6 +1051,11 @@ exports.ERRORS = {
1021
1051
  message: 'Произошла ошибка при удалении задания на редактирование видео',
1022
1052
  httpCode: 500,
1023
1053
  },
1054
+ UPDATE_ERROR: {
1055
+ code: 'VIDEO_EDITOR_JOB.UPDATE_ERROR',
1056
+ message: 'Произошла ошибка при обновлении задания на редактирование видео',
1057
+ httpCode: 500,
1058
+ },
1024
1059
  },
1025
1060
  MUSIC_EDITOR: {
1026
1061
  AI_ERROR: {
@@ -1187,6 +1222,126 @@ exports.ERRORS = {
1187
1222
  httpCode: 500,
1188
1223
  },
1189
1224
  },
1225
+ IMAGE_GENERATION: {
1226
+ AI_ERROR: {
1227
+ code: 'IMAGE_GENERATION.AI_ERROR',
1228
+ message: 'Произошла ошибка во время запроса к ИИ',
1229
+ httpCode: 500,
1230
+ },
1231
+ INSUFFICIENT_BALANCE: {
1232
+ code: 'IMAGE_GENERATION.INSUFFICIENT_BALANCE',
1233
+ message: 'У пользователя недостаточно средств',
1234
+ httpCode: 400,
1235
+ },
1236
+ INVALID_PARAMS: {
1237
+ code: 'IMAGE_GENERATION.INVALID_PARAMS',
1238
+ message: 'Некорректные параметры изображения',
1239
+ httpCode: 400,
1240
+ },
1241
+ DELETE_ERROR: {
1242
+ code: 'IMAGE_GENERATION.DELETE_ERROR',
1243
+ message: 'Произошла ошибка при удалении генерации изображения',
1244
+ httpCode: 500,
1245
+ },
1246
+ MAX_PROMPT_LENGTH_EXCEEDED: {
1247
+ code: 'IMAGE_GENERATION.MAX_PROMPT_LENGTH_EXCEEDED',
1248
+ message: 'Превышена максимальная длина запроса',
1249
+ httpCode: 400,
1250
+ },
1251
+ POLL_TIMEOUT: {
1252
+ code: 'IMAGE_GENERATION.POLL_TIMEOUT',
1253
+ message: 'Превышено время ожидания генерации изображения',
1254
+ httpCode: 500,
1255
+ },
1256
+ IMAGE_ATTACHMENT_NOT_SUPPORTED: {
1257
+ code: 'IMAGE_GENERATION.IMAGE_ATTACHMENT_NOT_SUPPORTED',
1258
+ message: 'Выбранная модель не поддерживает вложение изображений',
1259
+ httpCode: 400,
1260
+ },
1261
+ TOO_MANY_ATTACHED_IMAGES: {
1262
+ code: 'IMAGE_GENERATION.TOO_MANY_ATTACHED_IMAGES',
1263
+ message: 'Слишком много вложенных изображений',
1264
+ httpCode: 400,
1265
+ },
1266
+ },
1267
+ IMAGE_GENERATION_MODEL: {
1268
+ SAVE_ERROR: {
1269
+ code: 'IMAGE_GENERATION_MODEL.SAVE_ERROR',
1270
+ message: 'Произошла ошибка при сохранении модели для генерации изображений',
1271
+ httpCode: 500,
1272
+ },
1273
+ FIND_ERROR: {
1274
+ code: 'IMAGE_GENERATION_MODEL.FIND_ERROR',
1275
+ message: 'Произошла ошибка при поиске модели для генерации изображений',
1276
+ httpCode: 500,
1277
+ },
1278
+ NOT_FOUND: {
1279
+ code: 'IMAGE_GENERATION_MODEL.NOT_FOUND',
1280
+ message: 'Модель для генерации изображений не найдена',
1281
+ httpCode: 404,
1282
+ },
1283
+ MODEL_INACTIVE: {
1284
+ code: 'IMAGE_GENERATION_MODEL.MODEL_INACTIVE',
1285
+ message: 'Модель для генерации изображений неактивна',
1286
+ httpCode: 400,
1287
+ },
1288
+ },
1289
+ IMAGE_GENERATION_JOB: {
1290
+ SAVE_ERROR: {
1291
+ code: 'IMAGE_GENERATION_JOB.SAVE_ERROR',
1292
+ message: 'Произошла ошибка при сохранении задания на генерацию изображения',
1293
+ httpCode: 500,
1294
+ },
1295
+ FIND_ERROR: {
1296
+ code: 'IMAGE_GENERATION_JOB.FIND_ERROR',
1297
+ message: 'Произошла ошибка при поиске задания на генерацию изображения',
1298
+ httpCode: 500,
1299
+ },
1300
+ NOT_FOUND: {
1301
+ code: 'IMAGE_GENERATION_JOB.NOT_FOUND',
1302
+ message: 'Задание на генерацию изображения не найдено',
1303
+ httpCode: 404,
1304
+ },
1305
+ NOT_AN_OWNER: {
1306
+ code: 'IMAGE_GENERATION_JOB.NOT_AN_OWNER',
1307
+ message: 'Пользователь не является владельцем задания на генерацию изображения',
1308
+ httpCode: 403,
1309
+ },
1310
+ DELETE_ERROR: {
1311
+ code: 'IMAGE_GENERATION_JOB.DELETE_ERROR',
1312
+ message: 'Произошла ошибка при удалении задания на генерацию изображения',
1313
+ httpCode: 500,
1314
+ },
1315
+ UPDATE_ERROR: {
1316
+ code: 'IMAGE_GENERATION_JOB.UPDATE_ERROR',
1317
+ message: 'Произошла ошибка при обновлении задания на генерацию изображения',
1318
+ httpCode: 500,
1319
+ },
1320
+ },
1321
+ IMAGE_GENERATION_PRESET: {
1322
+ FIND_ERROR: {
1323
+ code: 'IMAGE_GENERATION_PRESET.FIND_ERROR',
1324
+ message: 'Произошла ошибка при поиске пресета генерации изображения',
1325
+ httpCode: 500,
1326
+ },
1327
+ NOT_FOUND: {
1328
+ code: 'IMAGE_GENERATION_PRESET.NOT_FOUND',
1329
+ message: 'Пресет генерации изображения не найден',
1330
+ httpCode: 404,
1331
+ },
1332
+ },
1333
+ AI_VENDOR: {
1334
+ FIND_ERROR: {
1335
+ code: 'AI_VENDOR.FIND_ERROR',
1336
+ message: 'Произошла ошибка при поиске поставщика ИИ',
1337
+ httpCode: 500,
1338
+ },
1339
+ NOT_FOUND: {
1340
+ code: 'AI_VENDOR.NOT_FOUND',
1341
+ message: 'Поставщик ИИ не найден',
1342
+ httpCode: 404,
1343
+ },
1344
+ },
1190
1345
  CONTENT_POLICY: {
1191
1346
  PHOTOREALISTIC_PEOPLE: {
1192
1347
  code: 'CONTENT_POLICY.PHOTOREALISTIC_PEOPLE',
@@ -1239,4 +1394,12 @@ exports.ERRORS = {
1239
1394
  httpCode: 400,
1240
1395
  },
1241
1396
  },
1397
+ // KIE
1398
+ KIE: {
1399
+ AI_ERROR: {
1400
+ code: 'KIE.GET_TASK_BY_ID_RESPONSE_ERROR',
1401
+ message: 'Произошла ошибка при получении ответа от KIE',
1402
+ httpCode: 500,
1403
+ },
1404
+ },
1242
1405
  };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachedFileSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.AttachedFileSchema = zod_1.z.object({
6
+ uuid: zod_1.z.string(),
7
+ url: zod_1.z.string(),
8
+ name: zod_1.z.string(),
9
+ mimeType: zod_1.z.string(),
10
+ type: zod_1.z.string(),
11
+ size: zod_1.z.number(),
12
+ duration: zod_1.z.number().optional().nullable(),
13
+ });
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./command-response.schema"), exports);
18
18
  __exportStar(require("./icon-variants.schema"), exports);
19
+ __exportStar(require("./attached-file.schema"), exports);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetImageEditorModelByUuidCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ const common_1 = require("../../../common");
7
+ var GetImageEditorModelByUuidCommand;
8
+ (function (GetImageEditorModelByUuidCommand) {
9
+ GetImageEditorModelByUuidCommand.RequestSchema = zod_1.z.object({
10
+ uuid: zod_1.z.string().uuid(),
11
+ });
12
+ GetImageEditorModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.ImageEditorModelSchema);
13
+ })(GetImageEditorModelByUuidCommand || (exports.GetImageEditorModelByUuidCommand = GetImageEditorModelByUuidCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-image-editor-model-by-uuid.command"), exports);
@@ -4,6 +4,7 @@ exports.ImageEditorCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const command_response_schema_1 = require("../../common/models/command-response.schema");
6
6
  const models_1 = require("../models");
7
+ const common_1 = require("../../common");
7
8
  var ImageEditorCommand;
8
9
  (function (ImageEditorCommand) {
9
10
  ImageEditorCommand.RequestSchema = zod_1.z.object({
@@ -13,9 +14,10 @@ var ImageEditorCommand;
13
14
  userBalance: zod_1.z.number(),
14
15
  modelId: zod_1.z.string(),
15
16
  params: zod_1.z.object({
16
- imageUrls: zod_1.z.array(zod_1.z.string()),
17
+ attachedFiles: zod_1.z.array(common_1.AttachedFileSchema),
17
18
  systemPromptId: zod_1.z.string().optional(),
18
19
  }),
20
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
19
21
  });
20
22
  ImageEditorCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageEditorJobSchema);
21
23
  })(ImageEditorCommand || (exports.ImageEditorCommand = ImageEditorCommand = {}));
@@ -20,3 +20,4 @@ __exportStar(require("./retry-image-editor-job.command"), exports);
20
20
  __exportStar(require("./set-reaction-to-image-editor-job.command"), exports);
21
21
  __exportStar(require("./image-editor.command"), exports);
22
22
  __exportStar(require("./update-image-editor-job-title.command"), exports);
23
+ __exportStar(require("./image-editor-model"), exports);
@@ -11,6 +11,10 @@ var RetryImageEditorJobCommand;
11
11
  userBalance: zod_1.z.number(),
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
15
+ modelId: zod_1.z.string().optional(),
16
+ prompt: zod_1.z.string().optional(),
17
+ params: models_1.ImageEditorJobParamsSchema.optional(),
14
18
  });
15
19
  RetryImageEditorJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageEditorJobSchema);
16
20
  })(RetryImageEditorJobCommand || (exports.RetryImageEditorJobCommand = RetryImageEditorJobCommand = {}));
@@ -7,11 +7,21 @@ const models_1 = require("../models");
7
7
  const common_1 = require("../../common");
8
8
  var SetReactionToImageEditorJobCommand;
9
9
  (function (SetReactionToImageEditorJobCommand) {
10
- SetReactionToImageEditorJobCommand.RequestSchema = zod_1.z.object({
10
+ SetReactionToImageEditorJobCommand.RequestSchema = zod_1.z
11
+ .object({
11
12
  userId: zod_1.z.string().uuid().nullable().optional(),
12
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
- uuid: zod_1.z.string(),
14
+ uuid: zod_1.z.string().uuid(),
14
15
  reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
16
+ dislikeReason: zod_1.z.string().nullable().default(null),
17
+ })
18
+ .refine((data) => {
19
+ if (data.reaction !== common_1.USER_REACTION.DISLIKED && data.dislikeReason) {
20
+ return false;
21
+ }
22
+ return true;
23
+ }, {
24
+ message: 'Dislike reason is not allowed when reaction is not disliked',
15
25
  });
16
26
  SetReactionToImageEditorJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageEditorJobSchema);
17
27
  })(SetReactionToImageEditorJobCommand || (exports.SetReactionToImageEditorJobCommand = SetReactionToImageEditorJobCommand = {}));
@@ -4,4 +4,6 @@ exports.IMAGE_EDITOR_MODEL_TYPE = void 0;
4
4
  var IMAGE_EDITOR_MODEL_TYPE;
5
5
  (function (IMAGE_EDITOR_MODEL_TYPE) {
6
6
  IMAGE_EDITOR_MODEL_TYPE["NANO_BANANA_EDIT"] = "NANO_BANANA_EDIT";
7
+ IMAGE_EDITOR_MODEL_TYPE["RECRAFT_REMOVE_BACKGROUND"] = "RECRAFT_REMOVE_BACKGROUND";
8
+ IMAGE_EDITOR_MODEL_TYPE["NANO_BANANA_PRO_EDIT"] = "NANO_BANANA_PRO_EDIT";
7
9
  })(IMAGE_EDITOR_MODEL_TYPE || (exports.IMAGE_EDITOR_MODEL_TYPE = IMAGE_EDITOR_MODEL_TYPE = {}));
@@ -5,4 +5,8 @@ var IMAGE_EDITING_STRATEGY;
5
5
  (function (IMAGE_EDITING_STRATEGY) {
6
6
  IMAGE_EDITING_STRATEGY["NANO_BANANA_POLLING"] = "NANO_BANANA_POLLING";
7
7
  IMAGE_EDITING_STRATEGY["NANO_BANANA_CALLBACK"] = "NANO_BANANA_CALLBACK";
8
+ IMAGE_EDITING_STRATEGY["RECRAFT_REMOVE_BACKGROUND_CALLBACK"] = "RECRAFT_REMOVE_BACKGROUND_CALLBACK";
9
+ IMAGE_EDITING_STRATEGY["RECRAFT_REMOVE_BACKGROUND_POLLING"] = "RECRAFT_REMOVE_BACKGROUND_POLLING";
10
+ IMAGE_EDITING_STRATEGY["NANO_BANANA_PRO_CALLBACK"] = "NANO_BANANA_PRO_CALLBACK";
11
+ IMAGE_EDITING_STRATEGY["NANO_BANANA_PRO_POLLING"] = "NANO_BANANA_PRO_POLLING";
8
12
  })(IMAGE_EDITING_STRATEGY || (exports.IMAGE_EDITING_STRATEGY = IMAGE_EDITING_STRATEGY = {}));
@@ -25,6 +25,7 @@ exports.SystemPromptSchema = zod_1.z.object({
25
25
  })
26
26
  .nullable(),
27
27
  order: zod_1.z.number(),
28
+ placeholder: zod_1.z.string().nullable(),
28
29
  });
29
30
  exports.ImageEditorActionGroup = zod_1.z.object({
30
31
  uuid: zod_1.z.string(),
@@ -5,6 +5,7 @@ const zod_1 = require("zod");
5
5
  const tools_1 = require("../../tools");
6
6
  const common_1 = require("../../common");
7
7
  exports.ImageEditorJobParamsSchema = zod_1.z.object({
8
+ attachedFiles: zod_1.z.array(common_1.AttachedFileSchema).optional(),
8
9
  imageUrls: zod_1.z.array(zod_1.z.string()).optional(),
9
10
  systemPromptId: zod_1.z.string().optional(),
10
11
  });
@@ -12,6 +13,7 @@ exports.ImageEditorJobSchema = zod_1.z.object({
12
13
  uuid: zod_1.z.string(),
13
14
  prompt: zod_1.z.string(),
14
15
  reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
16
+ dislikeReason: zod_1.z.string().nullable(),
15
17
  externalId: zod_1.z.string().nullable(),
16
18
  title: zod_1.z.string(),
17
19
  status: zod_1.z.nativeEnum(tools_1.JOB_STATUS),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImageEditorModelSchema = exports.ImageEditorModelParamsSchema = void 0;
3
+ exports.ImageEditorModelSchema = exports.ImageEditorModelPricingRulesSchema = exports.ImageEditorModelPricingRuleConditionSchema = exports.ImageEditorModelParamsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const common_1 = require("../../common");
6
6
  const enums_1 = require("../enums");
@@ -11,6 +11,13 @@ exports.ImageEditorModelParamsSchema = zod_1.z.object({
11
11
  acceptedTypes: zod_1.z.array(zod_1.z.string()),
12
12
  }),
13
13
  });
14
+ exports.ImageEditorModelPricingRuleConditionSchema = zod_1.z.object({
15
+ withoutSub: zod_1.z.boolean().optional(),
16
+ });
17
+ exports.ImageEditorModelPricingRulesSchema = zod_1.z.array(zod_1.z.object({
18
+ condition: exports.ImageEditorModelPricingRuleConditionSchema,
19
+ value: zod_1.z.number(),
20
+ }));
14
21
  exports.ImageEditorModelSchema = zod_1.z.object({
15
22
  uuid: zod_1.z.string(),
16
23
  title: zod_1.z.string(),
@@ -23,6 +30,7 @@ exports.ImageEditorModelSchema = zod_1.z.object({
23
30
  strategy: zod_1.z.nativeEnum(enums_1.IMAGE_EDITING_STRATEGY),
24
31
  maxInputLength: zod_1.z.number(),
25
32
  params: exports.ImageEditorModelParamsSchema,
33
+ pricingRules: exports.ImageEditorModelPricingRulesSchema,
26
34
  createdAt: zod_1.z.date(),
27
35
  updatedAt: zod_1.z.date(),
28
36
  });
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IMAGE_EDITOR_MODEL_AMQP_ROUTES = void 0;
4
+ exports.IMAGE_EDITOR_MODEL_AMQP_ROUTES = {
5
+ GET_MODEL_BY_UUID: 'tools.image-editor.model.get-by-uuid.rpc',
6
+ };
@@ -4,4 +4,5 @@ exports.IMAGE_EDITOR_ROUTES = exports.IMAGE_EDITOR_CONTROLLER = void 0;
4
4
  exports.IMAGE_EDITOR_CONTROLLER = 'image-editor';
5
5
  exports.IMAGE_EDITOR_ROUTES = {
6
6
  KIE_NANO_BANANA_CALLBACK: '/kie/nano-banana/callback',
7
+ KIE_RECRAFT_REMOVE_BACKGROUND: '/kie/recraft-remove-background/callback',
7
8
  };
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./image-editor.amqp.routes"), exports);
18
18
  __exportStar(require("./image-editor.http.routes"), exports);
19
+ __exportStar(require("./image-editor-model.amqp.routes"), exports);
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExecuteImageGenerationCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const models_1 = require("../models");
7
+ var ExecuteImageGenerationCommand;
8
+ (function (ExecuteImageGenerationCommand) {
9
+ ExecuteImageGenerationCommand.RequestSchema = zod_1.z.object({
10
+ userId: zod_1.z.string().uuid().nullable().optional(),
11
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
12
+ prompt: zod_1.z.string(),
13
+ userBalance: zod_1.z.number(),
14
+ modelId: zod_1.z.string().uuid(),
15
+ params: models_1.ImageGenerationRequestParamsSchema,
16
+ presetId: zod_1.z.string().uuid().nullable().optional(),
17
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
18
+ });
19
+ ExecuteImageGenerationCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
20
+ })(ExecuteImageGenerationCommand || (exports.ExecuteImageGenerationCommand = ExecuteImageGenerationCommand = {}));
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ForwardImageGenerationJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const models_1 = require("../models");
7
+ const job_status_enum_1 = require("../../tools/enums/job-status.enum");
8
+ const user_reaction_enum_1 = require("../../common/enums/user-reaction.enum");
9
+ var ForwardImageGenerationJobCommand;
10
+ (function (ForwardImageGenerationJobCommand) {
11
+ ForwardImageGenerationJobCommand.RequestSchema = zod_1.z.object({
12
+ uuid: zod_1.z.string().uuid(),
13
+ prompt: zod_1.z.string(),
14
+ title: zod_1.z.string(),
15
+ status: zod_1.z.nativeEnum(job_status_enum_1.JOB_STATUS),
16
+ error: zod_1.z.string().nullable(),
17
+ price: zod_1.z.number(),
18
+ reaction: zod_1.z.nativeEnum(user_reaction_enum_1.USER_REACTION).nullable(),
19
+ externalId: zod_1.z.string().nullable(),
20
+ output: zod_1.z.array(zod_1.z.string()),
21
+ params: models_1.ImageGenerationJobParamsSchema,
22
+ modelId: zod_1.z.string().uuid(),
23
+ presetId: zod_1.z.string().uuid().nullable().optional(),
24
+ userId: zod_1.z.string().uuid().nullable().optional(),
25
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
26
+ isDeleted: zod_1.z.boolean(),
27
+ internalError: zod_1.z.string().nullable(),
28
+ createdAt: zod_1.z.coerce.date(),
29
+ updatedAt: zod_1.z.coerce.date(),
30
+ });
31
+ ForwardImageGenerationJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
32
+ })(ForwardImageGenerationJobCommand || (exports.ForwardImageGenerationJobCommand = ForwardImageGenerationJobCommand = {}));
@@ -0,0 +1,23 @@
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("./execute-image-generation.command"), exports);
18
+ __exportStar(require("./forward-image-generation-job.command"), exports);
19
+ __exportStar(require("./save-image-generation-job.command"), exports);
20
+ __exportStar(require("./soft-delete-image-generation-job-by-uuid.command"), exports);
21
+ __exportStar(require("./soft-delete-image-generation-jobs-by-criteria.command"), exports);
22
+ __exportStar(require("./set-reaction-to-image-generation-job.command"), exports);
23
+ __exportStar(require("./update-image-generation-job-title.command"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SaveImageGenerationJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const models_1 = require("../models");
7
+ var SaveImageGenerationJobCommand;
8
+ (function (SaveImageGenerationJobCommand) {
9
+ SaveImageGenerationJobCommand.RequestSchema = zod_1.z.object({
10
+ userId: zod_1.z.string().uuid().nullable().optional(),
11
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
12
+ prompt: zod_1.z.string(),
13
+ modelId: zod_1.z.string().uuid(),
14
+ userBalance: zod_1.z.number(),
15
+ });
16
+ SaveImageGenerationJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
17
+ })(SaveImageGenerationJobCommand || (exports.SaveImageGenerationJobCommand = SaveImageGenerationJobCommand = {}));
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetReactionToImageGenerationJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_1 = require("../../common");
6
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
7
+ const models_1 = require("../models");
8
+ var SetReactionToImageGenerationJobCommand;
9
+ (function (SetReactionToImageGenerationJobCommand) {
10
+ SetReactionToImageGenerationJobCommand.RequestSchema = zod_1.z
11
+ .object({
12
+ userId: zod_1.z.string().uuid().nullable().optional(),
13
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
+ uuid: zod_1.z.string().uuid(),
15
+ reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
16
+ dislikeReason: zod_1.z.string().nullable().default(null),
17
+ })
18
+ .refine((data) => {
19
+ if (data.reaction !== common_1.USER_REACTION.DISLIKED && data.dislikeReason) {
20
+ return false;
21
+ }
22
+ return true;
23
+ }, {
24
+ message: 'Dislike reason is not allowed when reaction is not disliked',
25
+ });
26
+ SetReactionToImageGenerationJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
27
+ })(SetReactionToImageGenerationJobCommand || (exports.SetReactionToImageGenerationJobCommand = SetReactionToImageGenerationJobCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SoftDeleteImageGenerationJobByUuidCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ var SoftDeleteImageGenerationJobByUuidCommand;
7
+ (function (SoftDeleteImageGenerationJobByUuidCommand) {
8
+ SoftDeleteImageGenerationJobByUuidCommand.RequestSchema = zod_1.z.object({
9
+ userId: zod_1.z.string().uuid().nullable().optional(),
10
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
11
+ uuid: zod_1.z.string(),
12
+ });
13
+ SoftDeleteImageGenerationJobByUuidCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(zod_1.z.boolean());
14
+ })(SoftDeleteImageGenerationJobByUuidCommand || (exports.SoftDeleteImageGenerationJobByUuidCommand = SoftDeleteImageGenerationJobByUuidCommand = {}));