@purpleschool/gptbot-tools 0.0.78 → 0.0.79-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.
- package/ai-proxy/index.ts +1 -0
- package/ai-proxy/routes/ai-proxy.routes.ts +8 -0
- package/ai-proxy/routes/index.ts +1 -0
- package/ai-vendor/index.ts +1 -0
- package/ai-vendor/models/ai-vendor.schema.ts +13 -0
- package/ai-vendor/models/index.ts +1 -0
- package/build/ai-proxy/index.js +17 -0
- package/build/ai-proxy/routes/ai-proxy.routes.js +10 -0
- package/build/ai-proxy/routes/index.js +17 -0
- package/build/ai-vendor/index.js +17 -0
- package/build/ai-vendor/models/ai-vendor.schema.js +13 -0
- package/build/ai-vendor/models/index.js +17 -0
- package/build/common/errors/errors.js +158 -0
- package/build/common/models/attached-file.schema.js +13 -0
- package/build/common/models/index.js +1 -0
- package/build/image-editor/commands/image-editor.command.js +3 -1
- package/build/image-editor/commands/retry-image-editor-job.command.js +4 -0
- package/build/image-editor/commands/set-reaction-to-image-editor-job.command.js +12 -2
- package/build/image-editor/enums/image-editor-model-type.enum.js +2 -0
- package/build/image-editor/enums/image-editor-strategy.enum.js +4 -0
- package/build/image-editor/models/image-editor-config.schema.js +1 -0
- package/build/image-editor/models/image-editor-job.schema.js +2 -0
- package/build/image-editor/models/image-editor-model.schema.js +9 -1
- package/build/image-editor/routes/image-editor.http.routes.js +1 -0
- package/build/image-generation/commands/execute-image-generation.command.js +20 -0
- package/build/image-generation/commands/forward-image-generation-job.command.js +32 -0
- package/build/image-generation/commands/index.js +23 -0
- package/build/image-generation/commands/save-image-generation-job.command.js +17 -0
- package/build/image-generation/commands/set-reaction-to-image-generation-job.command.js +27 -0
- package/build/image-generation/commands/soft-delete-image-generation-job-by-uuid.command.js +14 -0
- package/build/image-generation/commands/soft-delete-image-generation-jobs-by-criteria.command.js +13 -0
- package/build/image-generation/commands/update-image-generation-job-title.command.js +16 -0
- package/build/image-generation/enums/image-generation-model-strategy.enum.js +23 -0
- package/build/image-generation/enums/image-generation-models.enum.js +8 -0
- package/build/image-generation/enums/image-generation-resolution.enum.js +9 -0
- package/build/image-generation/enums/index.js +19 -0
- package/build/image-generation/index.js +21 -0
- package/build/image-generation/models/image-generation-config.schema.js +12 -0
- package/build/image-generation/models/image-generation-job.schema.js +35 -0
- package/build/image-generation/models/image-generation-model.schema.js +51 -0
- package/build/image-generation/models/image-generation-preset.schema.js +13 -0
- package/build/image-generation/models/index.js +20 -0
- package/build/image-generation/queries/find-image-generation-job-by-id.query.js +19 -0
- package/build/image-generation/queries/find-image-generation-jobs.query.js +28 -0
- package/build/image-generation/queries/get-image-generation-config.query.js +11 -0
- package/build/image-generation/queries/index.js +19 -0
- package/build/image-generation/routes/image-generation.amqp.routes.js +14 -0
- package/build/image-generation/routes/image-generation.http.routes.js +9 -0
- package/build/image-generation/routes/index.js +18 -0
- package/build/index.js +7 -0
- package/build/music/commands/retry-music-job.command.js +2 -0
- package/build/music/commands/set-reaction-to-music-job.command.js +12 -2
- package/build/music/models/music-job.schema.js +1 -0
- package/build/music/models/music-track.schema.js +1 -0
- package/build/music/routes/music.http.routes.js +1 -4
- package/build/paraphrase/commands/delete-all-paraphrase-jobs.command.js +13 -0
- package/build/paraphrase/commands/delete-paraphrase-job-by-uuid.command.js +14 -0
- package/build/paraphrase/commands/index.js +5 -0
- package/build/paraphrase/commands/retry-paraphrase-job.command.js +16 -0
- package/build/paraphrase/commands/set-reaction-to-paraphrase-job.command.js +27 -0
- package/build/paraphrase/commands/update-paraphrase-job-title.command.js +16 -0
- package/build/paraphrase/models/paraphrase-job.schema.js +7 -0
- package/build/paraphrase/queries/find-paraphrase-jobs.query.js +28 -0
- package/build/paraphrase/queries/index.js +1 -0
- package/build/paraphrase/routes/paraphrase.amqp.routes.js +6 -0
- package/build/presentation/commands/index.js +1 -0
- package/build/presentation/commands/set-reaction-to-presentation.command.js +26 -0
- package/build/presentation/models/pptx-export-payload.js +19 -1
- package/build/presentation/models/presentation.schema.js +3 -0
- package/build/presentation/models/slide-content.schema.js +7 -3
- package/build/presentation/routes/presentation.routes.js +1 -0
- package/build/stt/commands/set-reaction-to-stt-job.command.js +12 -2
- package/build/stt/models/stt-job.schema.js +2 -0
- package/build/tools/enums/tool-content-type.enum.js +1 -0
- package/build/tools/enums/tool-type.enum.js +1 -0
- package/build/tools/models/global-tools-config.schema.js +2 -0
- package/build/tools/models/tools-with-configs.schema.js +5 -0
- package/build/tts/commands/set-reaction-to-tts-job.command.js +12 -2
- package/build/tts/models/tts-job.schema.js +2 -0
- package/build/video/commands/retry-video-job.command.js +4 -0
- package/build/video/commands/set-reaction-to-video-job.command.js +12 -2
- package/build/video/models/video-job.schema.js +3 -0
- package/build/video/models/video-model.schema.js +1 -0
- package/build/video-editor/commands/edit-video.command.js +2 -1
- package/build/video-editor/commands/retry-video-editor-job.command.js +5 -0
- package/build/video-editor/commands/set-reaction-to-video-editor-job.command.js +12 -2
- package/build/video-editor/models/video-editor-job.schema.js +3 -0
- package/build/writer/commands/set-reaction-writer-document.command.js +11 -1
- package/build/writer/models/writer-document.schema.js +1 -0
- package/common/errors/errors.ts +158 -0
- package/common/models/attached-file.schema.ts +11 -0
- package/common/models/index.ts +1 -0
- package/image-editor/commands/image-editor.command.ts +3 -1
- package/image-editor/commands/retry-image-editor-job.command.ts +5 -1
- package/image-editor/commands/set-reaction-to-image-editor-job.command.ts +19 -6
- package/image-editor/enums/image-editor-model-type.enum.ts +2 -0
- package/image-editor/enums/image-editor-strategy.enum.ts +4 -0
- package/image-editor/models/image-editor-config.schema.ts +1 -0
- package/image-editor/models/image-editor-job.schema.ts +3 -1
- package/image-editor/models/image-editor-model.schema.ts +16 -0
- package/image-editor/routes/image-editor.http.routes.ts +1 -0
- package/image-generation/commands/execute-image-generation.command.ts +20 -0
- package/image-generation/commands/forward-image-generation-job.command.ts +32 -0
- package/image-generation/commands/index.ts +7 -0
- package/image-generation/commands/save-image-generation-job.command.ts +17 -0
- package/image-generation/commands/set-reaction-to-image-generation-job.command.ts +30 -0
- package/image-generation/commands/soft-delete-image-generation-job-by-uuid.command.ts +14 -0
- package/image-generation/commands/soft-delete-image-generation-jobs-by-criteria.command.ts +13 -0
- package/image-generation/commands/update-image-generation-job-title.command.ts +16 -0
- package/image-generation/enums/image-generation-model-strategy.enum.ts +24 -0
- package/image-generation/enums/image-generation-models.enum.ts +4 -0
- package/image-generation/enums/image-generation-resolution.enum.ts +5 -0
- package/image-generation/enums/index.ts +3 -0
- package/image-generation/index.ts +5 -0
- package/image-generation/models/image-generation-config.schema.ts +11 -0
- package/image-generation/models/image-generation-job.schema.ts +37 -0
- package/image-generation/models/image-generation-model.schema.ts +64 -0
- package/image-generation/models/image-generation-preset.schema.ts +13 -0
- package/image-generation/models/index.ts +4 -0
- package/image-generation/queries/find-image-generation-job-by-id.query.ts +19 -0
- package/image-generation/queries/find-image-generation-jobs.query.ts +33 -0
- package/image-generation/queries/get-image-generation-config.query.ts +11 -0
- package/image-generation/queries/index.ts +3 -0
- package/image-generation/routes/image-generation.amqp.routes.ts +11 -0
- package/image-generation/routes/image-generation.http.routes.ts +7 -0
- package/image-generation/routes/index.ts +2 -0
- package/index.ts +7 -0
- package/music/commands/retry-music-job.command.ts +3 -1
- package/music/commands/set-reaction-to-music-job.command.ts +19 -6
- package/music/models/music-job.schema.ts +1 -0
- package/music/models/music-track.schema.ts +1 -0
- package/music/routes/music.http.routes.ts +0 -4
- package/package.json +1 -1
- package/paraphrase/commands/delete-all-paraphrase-jobs.command.ts +13 -0
- package/paraphrase/commands/delete-paraphrase-job-by-uuid.command.ts +14 -0
- package/paraphrase/commands/index.ts +5 -0
- package/paraphrase/commands/retry-paraphrase-job.command.ts +16 -0
- package/paraphrase/commands/set-reaction-to-paraphrase-job.command.ts +30 -0
- package/paraphrase/commands/update-paraphrase-job-title.command.ts +16 -0
- package/paraphrase/models/paraphrase-job.schema.ts +7 -0
- package/paraphrase/queries/find-paraphrase-jobs.query.ts +33 -0
- package/paraphrase/queries/index.ts +1 -0
- package/paraphrase/routes/paraphrase.amqp.routes.ts +6 -0
- package/presentation/commands/index.ts +1 -0
- package/presentation/commands/set-reaction-to-presentation.command.ts +29 -0
- package/presentation/models/pptx-export-payload.ts +20 -0
- package/presentation/models/presentation.schema.ts +3 -0
- package/presentation/models/slide-content.schema.ts +9 -3
- package/presentation/routes/presentation.routes.ts +1 -0
- package/stt/commands/set-reaction-to-stt-job.command.ts +19 -6
- package/stt/models/stt-job.schema.ts +2 -0
- package/tools/enums/tool-content-type.enum.ts +1 -0
- package/tools/enums/tool-type.enum.ts +1 -0
- package/tools/models/global-tools-config.schema.ts +2 -0
- package/tools/models/tools-with-configs.schema.ts +7 -0
- package/tts/commands/set-reaction-to-tts-job.command.ts +19 -6
- package/tts/models/tts-job.schema.ts +2 -0
- package/video/commands/retry-video-job.command.ts +4 -0
- package/video/commands/set-reaction-to-video-job.command.ts +19 -6
- package/video/models/video-job.schema.ts +3 -0
- package/video/models/video-model.schema.ts +1 -0
- package/video-editor/commands/edit-video.command.ts +2 -1
- package/video-editor/commands/retry-video-editor-job.command.ts +5 -0
- package/video-editor/commands/set-reaction-to-video-editor-job.command.ts +19 -6
- package/video-editor/models/video-editor-job.schema.ts +3 -0
- package/writer/commands/set-reaction-writer-document.command.ts +19 -6
- package/writer/models/writer-document.schema.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './routes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ai-proxy.routes';
|
|
@@ -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("./routes"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AI_PROXY_ROUTES = exports.AI_PROXY_CONTROLLER = void 0;
|
|
4
|
+
exports.AI_PROXY_CONTROLLER = 'ai-proxy';
|
|
5
|
+
exports.AI_PROXY_ROUTES = {
|
|
6
|
+
VIDEO_CALLBACK: 'video/callback',
|
|
7
|
+
VIDEO_EDITOR_CALLBACK: 'video-editor/callback',
|
|
8
|
+
MUSIC_CALLBACK: 'music/callback',
|
|
9
|
+
IMAGE_CALLBACK: 'image-generation/callback',
|
|
10
|
+
};
|
|
@@ -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-proxy.routes"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./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: {
|
|
@@ -657,6 +672,11 @@ exports.ERRORS = {
|
|
|
657
672
|
message: 'Произошла ошибка при удалении задания на генерацию видео',
|
|
658
673
|
httpCode: 500,
|
|
659
674
|
},
|
|
675
|
+
UPDATE_ERROR: {
|
|
676
|
+
code: 'VIDEO_JOB.UPDATE_ERROR',
|
|
677
|
+
message: 'Произошла ошибка при обновлении задания на генерацию видео',
|
|
678
|
+
httpCode: 500,
|
|
679
|
+
},
|
|
660
680
|
},
|
|
661
681
|
WRITER_DOCUMENT: {
|
|
662
682
|
SET_REACTION_TO_WRITER_DOCUMENT_ERROR: {
|
|
@@ -930,6 +950,11 @@ exports.ERRORS = {
|
|
|
930
950
|
message: 'Произошла ошибка при удалении задания на редактирование картинки',
|
|
931
951
|
httpCode: 500,
|
|
932
952
|
},
|
|
953
|
+
UPDATE_ERROR: {
|
|
954
|
+
code: 'IMAGE_EDITOR_JOB.UPDATE_ERROR',
|
|
955
|
+
message: 'Произошла ошибка при обновлении задания на редактирование картинки',
|
|
956
|
+
httpCode: 500,
|
|
957
|
+
},
|
|
933
958
|
},
|
|
934
959
|
VIDEO_EDITOR: {
|
|
935
960
|
AI_ERROR: {
|
|
@@ -1026,6 +1051,11 @@ exports.ERRORS = {
|
|
|
1026
1051
|
message: 'Произошла ошибка при удалении задания на редактирование видео',
|
|
1027
1052
|
httpCode: 500,
|
|
1028
1053
|
},
|
|
1054
|
+
UPDATE_ERROR: {
|
|
1055
|
+
code: 'VIDEO_EDITOR_JOB.UPDATE_ERROR',
|
|
1056
|
+
message: 'Произошла ошибка при обновлении задания на редактирование видео',
|
|
1057
|
+
httpCode: 500,
|
|
1058
|
+
},
|
|
1029
1059
|
},
|
|
1030
1060
|
MUSIC_EDITOR: {
|
|
1031
1061
|
AI_ERROR: {
|
|
@@ -1192,6 +1222,126 @@ exports.ERRORS = {
|
|
|
1192
1222
|
httpCode: 500,
|
|
1193
1223
|
},
|
|
1194
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
|
+
},
|
|
1195
1345
|
CONTENT_POLICY: {
|
|
1196
1346
|
PHOTOREALISTIC_PEOPLE: {
|
|
1197
1347
|
code: 'CONTENT_POLICY.PHOTOREALISTIC_PEOPLE',
|
|
@@ -1244,4 +1394,12 @@ exports.ERRORS = {
|
|
|
1244
1394
|
httpCode: 400,
|
|
1245
1395
|
},
|
|
1246
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
|
+
},
|
|
1247
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);
|
|
@@ -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
|
-
|
|
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 = {}));
|
|
@@ -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
|
|
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 = {}));
|
|
@@ -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
|
});
|
|
@@ -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
|
};
|
|
@@ -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 = {}));
|