@purpleschool/gptbot-tools 0.0.128 → 0.0.130-stage-2
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/build/image-editor/commands/get-image-editor-price.command.js +24 -0
- package/build/image-editor/commands/image-editor.command.js +2 -1
- package/build/image-editor/commands/index.js +1 -0
- package/build/image-editor/commands/retry-image-editor-job.command.js +2 -1
- package/build/image-editor/models/image-editor-job.schema.js +1 -0
- package/build/image-editor/routes/image-editor.amqp.routes.js +1 -0
- package/build/image-generation/commands/execute-image-generation.command.js +3 -2
- package/build/image-generation/commands/get-image-generation-price.command.js +22 -0
- package/build/image-generation/commands/index.js +1 -0
- package/build/image-generation/commands/retry-image-generation-job.command.js +4 -3
- package/build/image-generation/models/image-generation-job.schema.js +1 -0
- package/build/image-generation/routes/image-generation.amqp.routes.js +1 -0
- package/build/music/commands/generate-music.command.js +3 -1
- package/build/music/commands/get-music-price.command.js +20 -0
- package/build/music/commands/index.js +1 -0
- package/build/music/commands/retry-music-job.command.js +3 -1
- package/build/music/models/music-job.schema.js +1 -0
- package/build/music/models/music-model.schema.js +9 -1
- package/build/music/models/music-track.schema.js +1 -0
- package/build/music/routes/music.amqp.routes.js +1 -0
- package/build/paraphrase/commands/get-paraphrase-price.command.js +15 -0
- package/build/paraphrase/commands/index.js +1 -0
- package/build/paraphrase/commands/paraphrase.command.js +2 -1
- package/build/paraphrase/commands/retry-paraphrase-job.command.js +2 -1
- package/build/paraphrase/models/paraphrase-job.schema.js +1 -0
- package/build/paraphrase/routes/paraphrase.amqp.routes.js +1 -0
- package/build/presentation/commands/generate-slides.command.js +2 -1
- package/build/presentation/commands/get-presentation-slides-generation-price.command.js +15 -0
- package/build/presentation/commands/index.js +1 -0
- package/build/presentation/models/presentation.schema.js +1 -0
- package/build/presentation/routes/presentation.routes.js +1 -0
- package/build/stt/commands/get-stt-price.command.js +16 -0
- package/build/stt/commands/index.js +1 -0
- package/build/stt/commands/retry-stt-job.command.js +2 -1
- package/build/stt/commands/stt.command.js +2 -1
- package/build/stt/models/stt-job.schema.js +1 -0
- package/build/stt/routes/stt.amqp.routes.js +1 -0
- package/build/tools/events/index.js +1 -0
- package/build/tools/events/tool-job-failed.event.js +14 -0
- package/build/tools/models/tool-job.schema.js +1 -0
- package/build/tools/routes/tools.aqmp.routes.js +1 -0
- package/build/tts/commands/get-tts-price.command.js +16 -0
- package/build/tts/commands/index.js +1 -0
- package/build/tts/commands/retry-tts-job.command.js +2 -1
- package/build/tts/commands/tts.command.js +2 -1
- package/build/tts/models/tts-job.schema.js +1 -0
- package/build/tts/routes/tts.amqp.routes.js +1 -0
- package/build/video/commands/get-video-price.command.js +17 -0
- package/build/video/commands/index.js +1 -0
- package/build/video/commands/retry-video-job.command.js +2 -1
- package/build/video/commands/video.command.js +2 -1
- package/build/video/models/video-job.schema.js +1 -0
- package/build/video/routes/video.amqp.routes.js +1 -0
- package/build/video-editor/commands/edit-video.command.js +2 -1
- package/build/video-editor/commands/get-video-editor-price.command.js +15 -0
- package/build/video-editor/commands/index.js +1 -0
- package/build/video-editor/commands/retry-video-editor-job.command.js +2 -1
- package/build/video-editor/models/video-editor-job.schema.js +1 -0
- package/build/video-editor/routes/video-editor.amqp.routes.js +1 -0
- package/build/writer/commands/generate-document-contents.command.js +2 -1
- package/build/writer/commands/get-writer-content-generation-price.command.js +16 -0
- package/build/writer/commands/index.js +1 -0
- package/build/writer/models/writer-document.schema.js +1 -0
- package/build/writer/routes/writer.routes.js +1 -0
- package/image-editor/commands/get-image-editor-price.command.ts +26 -0
- package/image-editor/commands/image-editor.command.ts +2 -1
- package/image-editor/commands/index.ts +1 -0
- package/image-editor/commands/retry-image-editor-job.command.ts +2 -1
- package/image-editor/models/image-editor-job.schema.ts +1 -0
- package/image-editor/routes/image-editor.amqp.routes.ts +1 -0
- package/image-generation/commands/execute-image-generation.command.ts +3 -2
- package/image-generation/commands/get-image-generation-price.command.ts +24 -0
- package/image-generation/commands/index.ts +1 -0
- package/image-generation/commands/retry-image-generation-job.command.ts +4 -3
- package/image-generation/models/image-generation-job.schema.ts +1 -0
- package/image-generation/routes/image-generation.amqp.routes.ts +1 -0
- package/music/commands/generate-music.command.ts +3 -1
- package/music/commands/get-music-price.command.ts +22 -0
- package/music/commands/index.ts +1 -0
- package/music/commands/retry-music-job.command.ts +3 -1
- package/music/models/music-job.schema.ts +1 -0
- package/music/models/music-model.schema.ts +14 -0
- package/music/models/music-track.schema.ts +1 -0
- package/music/routes/music.amqp.routes.ts +1 -0
- package/package.json +1 -1
- package/paraphrase/commands/get-paraphrase-price.command.ts +16 -0
- package/paraphrase/commands/index.ts +1 -0
- package/paraphrase/commands/paraphrase.command.ts +2 -1
- package/paraphrase/commands/retry-paraphrase-job.command.ts +2 -1
- package/paraphrase/models/paraphrase-job.schema.ts +1 -0
- package/paraphrase/routes/paraphrase.amqp.routes.ts +1 -0
- package/presentation/commands/generate-slides.command.ts +2 -1
- package/presentation/commands/get-presentation-slides-generation-price.command.ts +16 -0
- package/presentation/commands/index.ts +1 -0
- package/presentation/models/presentation.schema.ts +1 -0
- package/presentation/routes/presentation.routes.ts +1 -0
- package/stt/commands/get-stt-price.command.ts +17 -0
- package/stt/commands/index.ts +1 -0
- package/stt/commands/retry-stt-job.command.ts +2 -1
- package/stt/commands/stt.command.ts +2 -1
- package/stt/models/stt-job.schema.ts +1 -0
- package/stt/routes/stt.amqp.routes.ts +1 -0
- package/tools/events/index.ts +1 -0
- package/tools/events/tool-job-failed.event.ts +13 -0
- package/tools/models/tool-job.schema.ts +1 -0
- package/tools/routes/tools.aqmp.routes.ts +1 -0
- package/tts/commands/get-tts-price.command.ts +17 -0
- package/tts/commands/index.ts +1 -0
- package/tts/commands/retry-tts-job.command.ts +2 -1
- package/tts/commands/tts.command.ts +2 -1
- package/tts/models/tts-job.schema.ts +1 -0
- package/tts/routes/tts.amqp.routes.ts +1 -0
- package/video/commands/get-video-price.command.ts +18 -0
- package/video/commands/index.ts +1 -0
- package/video/commands/retry-video-job.command.ts +2 -1
- package/video/commands/video.command.ts +2 -1
- package/video/models/video-job.schema.ts +1 -0
- package/video/routes/video.amqp.routes.ts +1 -0
- package/video-editor/commands/edit-video.command.ts +2 -1
- package/video-editor/commands/get-video-editor-price.command.ts +16 -0
- package/video-editor/commands/index.ts +1 -0
- package/video-editor/commands/retry-video-editor-job.command.ts +2 -1
- package/video-editor/models/video-editor-job.schema.ts +1 -0
- package/video-editor/routes/video-editor.amqp.routes.ts +1 -0
- package/writer/commands/generate-document-contents.command.ts +2 -1
- package/writer/commands/get-writer-content-generation-price.command.ts +17 -0
- package/writer/commands/index.ts +1 -0
- package/writer/models/writer-document.schema.ts +1 -0
- package/writer/routes/writer.routes.ts +1 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetVideoPriceCommand = 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 GetVideoPriceCommand;
|
|
8
|
+
(function (GetVideoPriceCommand) {
|
|
9
|
+
GetVideoPriceCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
modelId: zod_1.z.string(),
|
|
11
|
+
params: models_1.VideoGenerationRequestParamsSchema,
|
|
12
|
+
});
|
|
13
|
+
GetVideoPriceCommand.ResponseDataSchema = zod_1.z.object({
|
|
14
|
+
price: zod_1.z.number(),
|
|
15
|
+
});
|
|
16
|
+
GetVideoPriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetVideoPriceCommand.ResponseDataSchema);
|
|
17
|
+
})(GetVideoPriceCommand || (exports.GetVideoPriceCommand = GetVideoPriceCommand = {}));
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./delete-all-video-jobs.command"), exports);
|
|
|
19
19
|
__exportStar(require("./retry-video-job.command"), exports);
|
|
20
20
|
__exportStar(require("./set-reaction-to-video-job.command"), exports);
|
|
21
21
|
__exportStar(require("./video.command"), exports);
|
|
22
|
+
__exportStar(require("./get-video-price.command"), exports);
|
|
22
23
|
__exportStar(require("./update-video-job-title.command"), exports);
|
|
23
24
|
__exportStar(require("./video-model"), exports);
|
|
24
25
|
__exportStar(require("./update-published-status-video-jobs.command"), exports);
|
|
@@ -9,12 +9,13 @@ var RetryVideoJobCommand;
|
|
|
9
9
|
(function (RetryVideoJobCommand) {
|
|
10
10
|
RetryVideoJobCommand.RequestSchema = zod_1.z.object({
|
|
11
11
|
uuid: zod_1.z.string().uuid(),
|
|
12
|
-
userBalance: zod_1.z.number(),
|
|
13
12
|
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
14
13
|
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
15
14
|
prompt: zod_1.z.string().optional(),
|
|
16
15
|
modelId: zod_1.z.string().uuid().optional(),
|
|
17
16
|
params: models_1.VideoGenerationRequestParamsSchema.optional(),
|
|
17
|
+
tokenReservationId: zod_1.z.string().uuid(),
|
|
18
|
+
precalculatedPrice: zod_1.z.number(),
|
|
18
19
|
});
|
|
19
20
|
RetryVideoJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(video_job_schema_1.VideoJobSchema);
|
|
20
21
|
})(RetryVideoJobCommand || (exports.RetryVideoJobCommand = RetryVideoJobCommand = {}));
|
|
@@ -11,9 +11,10 @@ var VideoCommand;
|
|
|
11
11
|
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
12
12
|
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
13
13
|
prompt: zod_1.z.string(),
|
|
14
|
-
userBalance: zod_1.z.number(),
|
|
15
14
|
modelId: zod_1.z.string(),
|
|
16
15
|
params: models_1.VideoGenerationRequestParamsSchema,
|
|
16
|
+
tokenReservationId: zod_1.z.string().uuid(),
|
|
17
|
+
precalculatedPrice: zod_1.z.number(),
|
|
17
18
|
});
|
|
18
19
|
VideoCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(video_job_schema_1.VideoJobSchema);
|
|
19
20
|
})(VideoCommand || (exports.VideoCommand = VideoCommand = {}));
|
|
@@ -33,6 +33,7 @@ exports.VideoJobSchema = zod_1.z.object({
|
|
|
33
33
|
attempts: zod_1.z.array(zod_1.z.any()),
|
|
34
34
|
userId: zod_1.z.string().nullable().optional(),
|
|
35
35
|
unregisteredUserId: zod_1.z.string().nullable().optional(),
|
|
36
|
+
tokenReservationId: zod_1.z.string().nullable().optional(),
|
|
36
37
|
isDeleted: zod_1.z.boolean(),
|
|
37
38
|
createdAt: zod_1.z.date(),
|
|
38
39
|
completedAt: zod_1.z.date().nullable().optional(),
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VIDEO_AMQP_ROUTES = void 0;
|
|
4
4
|
exports.VIDEO_AMQP_ROUTES = {
|
|
5
5
|
EXECUTE: 'tools.video.execute.rpc',
|
|
6
|
+
GET_PRICE: 'tools.video.get-price.rpc',
|
|
6
7
|
CONFIG: 'tools.video.config.rpc',
|
|
7
8
|
GET_JOB: 'tools.video.jobs.get.rpc',
|
|
8
9
|
LIST_JOBS: 'tools.video.jobs.list.rpc',
|
|
@@ -13,8 +13,9 @@ var EditVideoCommand;
|
|
|
13
13
|
inputVideoId: zod_1.z.string().uuid(),
|
|
14
14
|
inputVideoUrl: zod_1.z.string(),
|
|
15
15
|
duration: zod_1.z.number(),
|
|
16
|
-
userBalance: zod_1.z.number(),
|
|
17
16
|
modelId: zod_1.z.string().uuid(),
|
|
17
|
+
tokenReservationId: zod_1.z.string().uuid(),
|
|
18
|
+
precalculatedPrice: zod_1.z.number(),
|
|
18
19
|
});
|
|
19
20
|
EditVideoCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.VideoEditorJobSchema);
|
|
20
21
|
})(EditVideoCommand || (exports.EditVideoCommand = EditVideoCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetVideoEditorPriceCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const command_response_schema_1 = require("../../common/models/command-response.schema");
|
|
6
|
+
var GetVideoEditorPriceCommand;
|
|
7
|
+
(function (GetVideoEditorPriceCommand) {
|
|
8
|
+
GetVideoEditorPriceCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
modelId: zod_1.z.string(),
|
|
10
|
+
});
|
|
11
|
+
GetVideoEditorPriceCommand.ResponseDataSchema = zod_1.z.object({
|
|
12
|
+
price: zod_1.z.number(),
|
|
13
|
+
});
|
|
14
|
+
GetVideoEditorPriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetVideoEditorPriceCommand.ResponseDataSchema);
|
|
15
|
+
})(GetVideoEditorPriceCommand || (exports.GetVideoEditorPriceCommand = GetVideoEditorPriceCommand = {}));
|
|
@@ -21,4 +21,5 @@ __exportStar(require("./set-reaction-to-video-editor-job.command"), exports);
|
|
|
21
21
|
__exportStar(require("./update-video-editor-job-title.command"), exports);
|
|
22
22
|
__exportStar(require("./update-published-status-video-editor-jobs.command"), exports);
|
|
23
23
|
__exportStar(require("./edit-video.command"), exports);
|
|
24
|
+
__exportStar(require("./get-video-editor-price.command"), exports);
|
|
24
25
|
__exportStar(require("./video-editor-model"), exports);
|
|
@@ -8,7 +8,6 @@ var RetryVideoEditorJobCommand;
|
|
|
8
8
|
(function (RetryVideoEditorJobCommand) {
|
|
9
9
|
RetryVideoEditorJobCommand.RequestSchema = zod_1.z.object({
|
|
10
10
|
uuid: zod_1.z.string().uuid(),
|
|
11
|
-
userBalance: zod_1.z.number(),
|
|
12
11
|
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
13
12
|
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
14
13
|
prompt: zod_1.z.string().optional(),
|
|
@@ -16,6 +15,8 @@ var RetryVideoEditorJobCommand;
|
|
|
16
15
|
inputVideoUrl: zod_1.z.string().optional(),
|
|
17
16
|
duration: zod_1.z.number().optional(),
|
|
18
17
|
modelId: zod_1.z.string().uuid().optional(),
|
|
18
|
+
tokenReservationId: zod_1.z.string().uuid(),
|
|
19
|
+
precalculatedPrice: zod_1.z.number(),
|
|
19
20
|
});
|
|
20
21
|
RetryVideoEditorJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(video_editor_job_schema_1.VideoEditorJobSchema);
|
|
21
22
|
})(RetryVideoEditorJobCommand || (exports.RetryVideoEditorJobCommand = RetryVideoEditorJobCommand = {}));
|
|
@@ -23,6 +23,7 @@ exports.VideoEditorJobSchema = zod_1.z.object({
|
|
|
23
23
|
attempts: zod_1.z.array(zod_1.z.any()),
|
|
24
24
|
userId: zod_1.z.string().nullable().optional(),
|
|
25
25
|
unregisteredUserId: zod_1.z.string().nullable().optional(),
|
|
26
|
+
tokenReservationId: zod_1.z.string().nullable().optional(),
|
|
26
27
|
isPublished: zod_1.z.boolean(),
|
|
27
28
|
postId: zod_1.z.string().nullable(),
|
|
28
29
|
isDeleted: zod_1.z.boolean(),
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VIDEO_EDITOR_AMQP_ROUTES = void 0;
|
|
4
4
|
exports.VIDEO_EDITOR_AMQP_ROUTES = {
|
|
5
5
|
EXECUTE: 'tools.video-editor.execute.rpc',
|
|
6
|
+
GET_PRICE: 'tools.video-editor.get-price.rpc',
|
|
6
7
|
CONFIG: 'tools.video-editor.config.rpc',
|
|
7
8
|
GET_JOB: 'tools.video-editor.jobs.get.rpc',
|
|
8
9
|
LIST_JOBS: 'tools.video-editor.jobs.list.rpc',
|
|
@@ -10,7 +10,8 @@ var GenerateWriterDocumentContentsCommand;
|
|
|
10
10
|
documentId: zod_1.z.string().uuid(),
|
|
11
11
|
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
12
12
|
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
13
|
-
|
|
13
|
+
tokenReservationId: zod_1.z.string().uuid(),
|
|
14
|
+
precalculatedPrice: zod_1.z.number(),
|
|
14
15
|
modelId: zod_1.z.string(),
|
|
15
16
|
});
|
|
16
17
|
GenerateWriterDocumentContentsCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.WriterDocumentSchema);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetWriterContentGenerationPriceCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
var GetWriterContentGenerationPriceCommand;
|
|
7
|
+
(function (GetWriterContentGenerationPriceCommand) {
|
|
8
|
+
GetWriterContentGenerationPriceCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
documentId: zod_1.z.string().uuid(),
|
|
10
|
+
modelId: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
GetWriterContentGenerationPriceCommand.ResponseDataSchema = zod_1.z.object({
|
|
13
|
+
price: zod_1.z.number(),
|
|
14
|
+
});
|
|
15
|
+
GetWriterContentGenerationPriceCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(GetWriterContentGenerationPriceCommand.ResponseDataSchema);
|
|
16
|
+
})(GetWriterContentGenerationPriceCommand || (exports.GetWriterContentGenerationPriceCommand = GetWriterContentGenerationPriceCommand = {}));
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./delete-all-user-writer-documents.command"), exports);
|
|
|
20
20
|
__exportStar(require("./update-writer-document-outline.command"), exports);
|
|
21
21
|
__exportStar(require("./export-writer-document-as-docx.command"), exports);
|
|
22
22
|
__exportStar(require("./generate-document-contents.command"), exports);
|
|
23
|
+
__exportStar(require("./get-writer-content-generation-price.command"), exports);
|
|
23
24
|
__exportStar(require("./writer-paraphrase.command"), exports);
|
|
24
25
|
__exportStar(require("./writer-extend-text.command"), exports);
|
|
25
26
|
__exportStar(require("./writer-shorten-text.command"), exports);
|
|
@@ -23,6 +23,7 @@ exports.WriterDocumentSchema = zod_1.z.object({
|
|
|
23
23
|
dislikeReason: zod_1.z.string().nullable(),
|
|
24
24
|
pages: zod_1.z.number(),
|
|
25
25
|
isDeleted: zod_1.z.boolean(),
|
|
26
|
+
tokenReservationId: zod_1.z.string().nullable().optional(),
|
|
26
27
|
createdAt: zod_1.z.date(),
|
|
27
28
|
updatedAt: zod_1.z.date(),
|
|
28
29
|
completedAt: zod_1.z.date().nullable(),
|
|
@@ -11,6 +11,7 @@ exports.WRITER_AMQP_ROUTES = {
|
|
|
11
11
|
UPDATE_DOCUMENT_OUTLINE: 'tools.writer.update-document-outline.rpc',
|
|
12
12
|
UPDATE_DOCUMENT_CONTENTS: 'tools.writer.update-document-contents.rpc',
|
|
13
13
|
GENERATE_DOCUMENT_CONTENTS: 'tools.writer.generate-document-contents.rpc',
|
|
14
|
+
GET_CONTENT_GENERATION_PRICE: 'tools.writer.content-generation.get-price.rpc',
|
|
14
15
|
PARAPHRASE: 'tools.writer.actions.paraphrase.rpc',
|
|
15
16
|
EXTEND_TEXT: 'tools.writer.actions.extend-text.rpc',
|
|
16
17
|
SHORTEN_TEXT: 'tools.writer.actions.shorten-text.rpc',
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { AttachedFileSchema } from '../../common';
|
|
4
|
+
|
|
5
|
+
export namespace GetImageEditorPriceCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
modelId: z.string().uuid(),
|
|
8
|
+
userId: z.string().uuid().nullable().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
+
prompt: z.string(),
|
|
11
|
+
params: z.object({
|
|
12
|
+
attachedFiles: z.array(AttachedFileSchema),
|
|
13
|
+
systemPromptId: z.string().optional(),
|
|
14
|
+
}),
|
|
15
|
+
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
16
|
+
});
|
|
17
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
18
|
+
|
|
19
|
+
export const ResponseDataSchema = z.object({
|
|
20
|
+
price: z.number(),
|
|
21
|
+
});
|
|
22
|
+
export type ResponseData = z.infer<typeof ResponseDataSchema>;
|
|
23
|
+
|
|
24
|
+
export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -8,13 +8,14 @@ export namespace ImageEditorCommand {
|
|
|
8
8
|
userId: z.string().uuid().nullable().optional(),
|
|
9
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
10
|
prompt: z.string(),
|
|
11
|
-
userBalance: z.number(),
|
|
12
11
|
modelId: z.string(),
|
|
13
12
|
params: z.object({
|
|
14
13
|
attachedFiles: z.array(AttachedFileSchema),
|
|
15
14
|
systemPromptId: z.string().optional(),
|
|
16
15
|
}),
|
|
17
16
|
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
17
|
+
tokenReservationId: z.string().uuid(),
|
|
18
|
+
precalculatedPrice: z.number(),
|
|
18
19
|
});
|
|
19
20
|
export type Request = z.infer<typeof RequestSchema>;
|
|
20
21
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './delete-image-editor-job-by-uuid.command';
|
|
2
2
|
export * from './delete-all-image-editor-jobs.command';
|
|
3
|
+
export * from './get-image-editor-price.command';
|
|
3
4
|
export * from './retry-image-editor-job.command';
|
|
4
5
|
export * from './set-reaction-to-image-editor-job.command';
|
|
5
6
|
export * from './image-editor.command';
|
|
@@ -5,10 +5,11 @@ import { ImageEditorJobParamsSchema, ImageEditorJobSchema } from '../models';
|
|
|
5
5
|
export namespace RetryImageEditorJobCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
userBalance: z.number(),
|
|
9
8
|
userId: z.string().uuid().nullable().optional(),
|
|
10
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
11
10
|
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
11
|
+
tokenReservationId: z.string().uuid(),
|
|
12
|
+
precalculatedPrice: z.number(),
|
|
12
13
|
modelId: z.string().optional(),
|
|
13
14
|
prompt: z.string().optional(),
|
|
14
15
|
params: ImageEditorJobParamsSchema.optional(),
|
|
@@ -29,6 +29,7 @@ export const ImageEditorJobSchema = z.object({
|
|
|
29
29
|
isPublished: z.boolean(),
|
|
30
30
|
postId: z.string().nullable(),
|
|
31
31
|
isDeleted: z.boolean(),
|
|
32
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
32
33
|
createdAt: z.date(),
|
|
33
34
|
completedAt: z.date().nullable().optional(),
|
|
34
35
|
updatedAt: z.date(),
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
-
import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
|
|
4
3
|
import { JOB_REQUEST_ORIGIN } from '../../tools';
|
|
4
|
+
import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
|
|
5
5
|
|
|
6
6
|
export namespace ExecuteImageGenerationCommand {
|
|
7
7
|
export const RequestSchema = z.object({
|
|
8
8
|
userId: z.string().uuid().nullable().optional(),
|
|
9
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
10
|
prompt: z.string(),
|
|
11
|
-
userBalance: z.number(),
|
|
12
11
|
modelId: z.string().uuid(),
|
|
13
12
|
params: ImageGenerationRequestParamsSchema,
|
|
14
13
|
presetId: z.string().uuid().nullable().optional(),
|
|
15
14
|
origin: z.nativeEnum(JOB_REQUEST_ORIGIN).default(JOB_REQUEST_ORIGIN.API),
|
|
16
15
|
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
16
|
+
tokenReservationId: z.string().uuid(),
|
|
17
|
+
precalculatedPrice: z.number(),
|
|
17
18
|
});
|
|
18
19
|
export type Request = z.infer<typeof RequestSchema>;
|
|
19
20
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { ImageGenerationRequestParamsSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace GetImageGenerationPriceCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
modelId: z.string().uuid(),
|
|
8
|
+
userId: z.string().uuid().nullable().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
+
prompt: z.string(),
|
|
11
|
+
params: ImageGenerationRequestParamsSchema,
|
|
12
|
+
presetId: z.string().uuid().nullable().optional(),
|
|
13
|
+
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
14
|
+
});
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseDataSchema = z.object({
|
|
18
|
+
price: z.number(),
|
|
19
|
+
});
|
|
20
|
+
export type ResponseData = z.infer<typeof ResponseDataSchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './execute-image-generation.command';
|
|
2
2
|
export * from './forward-image-generation-job.command';
|
|
3
|
+
export * from './get-image-generation-price.command';
|
|
3
4
|
export * from './save-image-generation-job.command';
|
|
4
5
|
export * from './soft-delete-image-generation-job-by-uuid.command';
|
|
5
6
|
export * from './soft-delete-image-generation-jobs-by-criteria.command';
|
|
@@ -7,12 +7,13 @@ export namespace RetryImageGenerationJobCommand {
|
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
8
|
userId: z.string().uuid().nullable().optional(),
|
|
9
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
11
|
+
tokenReservationId: z.string().uuid(),
|
|
12
|
+
precalculatedPrice: z.number(),
|
|
12
13
|
modelId: z.string().uuid().optional(),
|
|
14
|
+
prompt: z.string().optional(),
|
|
13
15
|
params: ImageGenerationRequestParamsSchema.optional(),
|
|
14
16
|
presetId: z.string().uuid().nullable().optional(),
|
|
15
|
-
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
16
17
|
});
|
|
17
18
|
export type Request = z.infer<typeof RequestSchema>;
|
|
18
19
|
|
|
@@ -32,6 +32,7 @@ export const ImageGenerationJobSchema = z.object({
|
|
|
32
32
|
postId: z.string().nullable(),
|
|
33
33
|
isDeleted: z.boolean(),
|
|
34
34
|
internalError: z.string().nullable(),
|
|
35
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
35
36
|
createdAt: z.date(),
|
|
36
37
|
updatedAt: z.date(),
|
|
37
38
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const IMAGE_GENERATION_AMQP_ROUTES = {
|
|
2
2
|
EXECUTE: 'tools.image-generation.execute.rpc',
|
|
3
|
+
GET_PRICE: 'tools.image-generation.get-price.rpc',
|
|
3
4
|
CONFIG: 'tools.image-generation.config.rpc',
|
|
4
5
|
FORWARD_JOB: 'tools.image-generation.jobs.forward.rpc',
|
|
5
6
|
GET_JOB: 'tools.image-generation.jobs.get.rpc',
|
|
@@ -7,9 +7,11 @@ export namespace GenerateMusicCommand {
|
|
|
7
7
|
export const RequestSchema = z.object({
|
|
8
8
|
userId: z.string().uuid().nullable().optional(),
|
|
9
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
-
userBalance: z.number(),
|
|
11
10
|
modelId: z.string(),
|
|
12
11
|
params: MusicJobParamsSchema,
|
|
12
|
+
tokenReservationId: z.string().uuid(),
|
|
13
|
+
precalculatedPrice: z.number(),
|
|
14
|
+
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
13
15
|
});
|
|
14
16
|
export type Request = z.infer<typeof RequestSchema>;
|
|
15
17
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { MusicJobParamsSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace GetMusicPriceCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
modelId: z.string(),
|
|
8
|
+
userId: z.string().uuid().nullable().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
+
params: MusicJobParamsSchema,
|
|
11
|
+
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
12
|
+
});
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseDataSchema = z.object({
|
|
16
|
+
price: z.number(),
|
|
17
|
+
});
|
|
18
|
+
export type ResponseData = z.infer<typeof ResponseDataSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
}
|
package/music/commands/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './delete-all-music-jobs.command';
|
|
|
3
3
|
export * from './retry-music-job.command';
|
|
4
4
|
export * from './set-reaction-to-music-job.command';
|
|
5
5
|
export * from './generate-music.command';
|
|
6
|
+
export * from './get-music-price.command';
|
|
6
7
|
export * from './update-music-job-title.command';
|
|
7
8
|
export * from './convert-to-wav.command';
|
|
8
9
|
export * from './generate-lyrics.command';
|
|
@@ -5,11 +5,13 @@ import { MusicJobParamsSchema, MusicJobSchema } from '../models/music-job.schema
|
|
|
5
5
|
export namespace RetryMusicJobCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
userBalance: z.number(),
|
|
9
8
|
userId: z.string().uuid().nullable().optional(),
|
|
10
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
+
tokenReservationId: z.string().uuid(),
|
|
11
|
+
precalculatedPrice: z.number(),
|
|
11
12
|
modelId: z.string().uuid().optional(),
|
|
12
13
|
params: MusicJobParamsSchema.optional(),
|
|
14
|
+
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
13
15
|
});
|
|
14
16
|
export type Request = z.infer<typeof RequestSchema>;
|
|
15
17
|
|
|
@@ -48,6 +48,7 @@ export const MusicJobSchema = z.object({
|
|
|
48
48
|
userId: z.string().nullable().optional(),
|
|
49
49
|
unregisteredUserId: z.string().nullable().optional(),
|
|
50
50
|
isDeleted: z.boolean(),
|
|
51
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
51
52
|
createdAt: z.date(),
|
|
52
53
|
completedAt: z.date().nullable().optional(),
|
|
53
54
|
updatedAt: z.date(),
|
|
@@ -20,6 +20,19 @@ export const MusicModelParamsSchema = z.object({
|
|
|
20
20
|
|
|
21
21
|
export type MusicModelParams = z.infer<typeof MusicModelParamsSchema>;
|
|
22
22
|
|
|
23
|
+
export const MusicModelPricingRuleConditionSchema = z.object({
|
|
24
|
+
withoutSub: z.boolean().optional(),
|
|
25
|
+
});
|
|
26
|
+
export type MusicModelPricingRuleCondition = z.infer<typeof MusicModelPricingRuleConditionSchema>;
|
|
27
|
+
|
|
28
|
+
export const MusicModelPricingRulesSchema = z.array(
|
|
29
|
+
z.object({
|
|
30
|
+
condition: MusicModelPricingRuleConditionSchema,
|
|
31
|
+
value: z.number(),
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
export type MusicModelPricingRules = z.infer<typeof MusicModelPricingRulesSchema>;
|
|
35
|
+
|
|
23
36
|
export const MusicModelSchema = z.object({
|
|
24
37
|
uuid: z.string(),
|
|
25
38
|
title: z.string(),
|
|
@@ -33,6 +46,7 @@ export const MusicModelSchema = z.object({
|
|
|
33
46
|
maxPromptLength: z.number(),
|
|
34
47
|
maxLyricsLength: z.number(),
|
|
35
48
|
params: MusicModelParamsSchema,
|
|
49
|
+
pricingRules: MusicModelPricingRulesSchema,
|
|
36
50
|
createdAt: z.date(),
|
|
37
51
|
updatedAt: z.date(),
|
|
38
52
|
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetParaphrasePriceCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
typeId: 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
|
+
}
|
|
@@ -7,11 +7,12 @@ export namespace ParaphraseCommand {
|
|
|
7
7
|
export const RequestSchema = z.object({
|
|
8
8
|
userId: z.string().uuid().nullable().optional(),
|
|
9
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
-
userBalance: z.number(),
|
|
11
10
|
prompt: z.string(),
|
|
12
11
|
typeId: z.string().uuid(),
|
|
13
12
|
styleId: z.string().uuid(),
|
|
14
13
|
intensity: z.nativeEnum(PARAPHRASING_INTENSITY),
|
|
14
|
+
tokenReservationId: z.string().uuid(),
|
|
15
|
+
precalculatedPrice: z.number(),
|
|
15
16
|
});
|
|
16
17
|
export type Request = z.infer<typeof RequestSchema>;
|
|
17
18
|
|
|
@@ -5,9 +5,10 @@ import { ParaphraseJobSchema } from '../models/paraphrase-job.schema';
|
|
|
5
5
|
export namespace RetryParaphraseJobCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
userBalance: z.number(),
|
|
9
8
|
userId: z.string().uuid().nullable().optional(),
|
|
10
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
+
tokenReservationId: z.string().uuid(),
|
|
11
|
+
precalculatedPrice: z.number(),
|
|
11
12
|
});
|
|
12
13
|
export type Request = z.infer<typeof RequestSchema>;
|
|
13
14
|
|
|
@@ -19,6 +19,7 @@ export const ParaphraseJobSchema = z.object({
|
|
|
19
19
|
typeId: z.string(),
|
|
20
20
|
styleId: z.string(),
|
|
21
21
|
intensity: z.nativeEnum(PARAPHRASING_INTENSITY),
|
|
22
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
22
23
|
createdAt: z.date(),
|
|
23
24
|
updatedAt: z.date(),
|
|
24
25
|
completedAt: z.date().nullable(),
|
|
@@ -7,7 +7,8 @@ export namespace GenerateSlidesCommand {
|
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
8
|
userId: z.string().uuid().nullable().optional(),
|
|
9
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
-
|
|
10
|
+
tokenReservationId: z.string().uuid(),
|
|
11
|
+
precalculatedPrice: z.number(),
|
|
11
12
|
});
|
|
12
13
|
export type Request = z.infer<typeof RequestSchema>;
|
|
13
14
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common';
|
|
3
|
+
|
|
4
|
+
export namespace GetPresentationSlidesGenerationPriceCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
slideCount: z.number().int().min(1),
|
|
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
|
+
}
|
|
@@ -7,6 +7,7 @@ export * from './generate-presentation-outline.command';
|
|
|
7
7
|
export * from './generate-and-insert-slide.command';
|
|
8
8
|
export * from './export-as-pptx.command';
|
|
9
9
|
export * from './generate-slides.command';
|
|
10
|
+
export * from './get-presentation-slides-generation-price.command';
|
|
10
11
|
export * from './reposition-slide-outline.command';
|
|
11
12
|
export * from './update-slide-outline.command';
|
|
12
13
|
export * from './update-presentation.command';
|
|
@@ -19,6 +19,7 @@ export const PresentationSchema = z.object({
|
|
|
19
19
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
20
20
|
slideCount: z.number(),
|
|
21
21
|
isDeleted: z.boolean(),
|
|
22
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
22
23
|
lastContentUpdateAt: z.date().nullable(),
|
|
23
24
|
lastPptxExportedAt: z.date().nullable(),
|
|
24
25
|
createdAt: z.date(),
|
|
@@ -4,6 +4,7 @@ export const PRESENTATION_AMQP_ROUTES = {
|
|
|
4
4
|
FIND_BY_UUID: 'tools.presentation.find-by-uuid.rpc',
|
|
5
5
|
GENERATE_PRESENTATION_OUTLINE: 'tools.presentation.generate-outline.rpc',
|
|
6
6
|
GENERATE_PRESENTATION_SLIDES: 'tools.presentation.generate-slides.rpc',
|
|
7
|
+
GET_SLIDES_GENERATION_PRICE: 'tools.presentation.slides.get-price.rpc',
|
|
7
8
|
GENERATE_AND_INSERT_SLIDE: 'tools.presentation.generate-and-insert-slide.rpc',
|
|
8
9
|
UPDATE_PRESENTATION_OUTLINE: 'tools.presentation.update-presentation-outline.rpc',
|
|
9
10
|
LIST_PRESENTATIONS: 'tools.presentation.list-presentations.rpc',
|