@purpleschool/gptbot-tools 0.0.118 → 0.0.119-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/commands/update-published-status-image-editor-jobs.command.js +7 -1
- package/build/image-editor/models/image-editor-job.schema.js +2 -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/commands/update-published-status-image-generation-jobs.command.js +7 -1
- package/build/image-generation/models/image-generation-job.schema.js +2 -0
- package/build/image-generation/queries/find-image-generation-job-by-id.query.js +1 -5
- package/build/image-generation/routes/image-generation.amqp.routes.js +1 -0
- package/build/music/commands/generate-music.command.js +2 -1
- package/build/music/commands/get-music-price.command.js +19 -0
- package/build/music/commands/index.js +1 -0
- package/build/music/commands/retry-music-job.command.js +2 -1
- package/build/music/commands/update-published-status-music-jobs.command.js +7 -1
- package/build/music/models/music-job.schema.js +2 -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/update-published-status-video-jobs.command.js +7 -1
- package/build/video/commands/video.command.js +2 -1
- package/build/video/models/video-job.schema.js +3 -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/commands/update-published-status-video-editor-jobs.command.js +7 -1
- package/build/video-editor/models/video-editor-job.schema.js +2 -0
- package/build/video-editor/queries/find-video-editor-job-by-id.query.js +1 -5
- 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/commands/update-published-status-image-editor-jobs.command.ts +9 -3
- package/image-editor/models/image-editor-job.schema.ts +2 -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/commands/update-published-status-image-generation-jobs.command.ts +9 -3
- package/image-generation/models/image-generation-job.schema.ts +2 -0
- package/image-generation/queries/find-image-generation-job-by-id.query.ts +5 -9
- package/image-generation/routes/image-generation.amqp.routes.ts +1 -0
- package/music/commands/generate-music.command.ts +2 -1
- package/music/commands/get-music-price.command.ts +21 -0
- package/music/commands/index.ts +1 -0
- package/music/commands/retry-music-job.command.ts +2 -1
- package/music/commands/update-published-status-music-jobs.command.ts +9 -3
- package/music/models/music-job.schema.ts +2 -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/enums/index.ts +1 -1
- package/tools/enums/job-request-origin.enum.ts +3 -3
- 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/update-published-status-video-jobs.command.ts +9 -3
- package/video/commands/video.command.ts +2 -1
- package/video/models/video-job.schema.ts +3 -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/commands/update-published-status-video-editor-jobs.command.ts +9 -3
- package/video-editor/models/video-editor-job.schema.ts +2 -0
- package/video-editor/queries/find-video-editor-job-by-id.query.ts +5 -9
- 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,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',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetSTTPriceCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
modelId: z.string(),
|
|
7
|
+
durationInSeconds: z.number(),
|
|
8
|
+
});
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseDataSchema = z.object({
|
|
12
|
+
price: z.number(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
package/stt/commands/index.ts
CHANGED
|
@@ -5,9 +5,10 @@ import { STTJobSchema } from '../models';
|
|
|
5
5
|
export namespace RetrySTTJobCommand {
|
|
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
|
|
|
@@ -6,12 +6,13 @@ export namespace STTCommand {
|
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
userId: z.string().uuid().nullable().optional(),
|
|
8
8
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
9
|
-
userBalance: z.number(),
|
|
10
9
|
modelId: z.string(),
|
|
11
10
|
fileId: z.string(),
|
|
12
11
|
fileKey: z.string(),
|
|
13
12
|
fileUrl: z.string(),
|
|
14
13
|
durationInSeconds: z.number(),
|
|
14
|
+
tokenReservationId: z.string().uuid(),
|
|
15
|
+
precalculatedPrice: z.number(),
|
|
15
16
|
});
|
|
16
17
|
export type Request = z.infer<typeof RequestSchema>;
|
|
17
18
|
|
|
@@ -19,6 +19,7 @@ export const STTJobSchema = z.object({
|
|
|
19
19
|
userId: z.string().nullable(),
|
|
20
20
|
unregisteredUserId: z.string().nullable(),
|
|
21
21
|
price: z.number(),
|
|
22
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
22
23
|
isDeleted: z.boolean(),
|
|
23
24
|
createdAt: z.date(),
|
|
24
25
|
completedAt: z.date().nullable(),
|
package/tools/enums/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export enum JOB_REQUEST_ORIGIN {
|
|
2
|
-
API =
|
|
3
|
-
B2B =
|
|
4
|
-
}
|
|
2
|
+
API = 'api',
|
|
3
|
+
B2B = 'b2b',
|
|
4
|
+
}
|
package/tools/events/index.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TOOL_TYPE } from '../enums';
|
|
2
|
+
import { ToolJobSchema } from '../models';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
export namespace ToolJobFailedEvent {
|
|
6
|
+
export const PayloadSchema = z.object({
|
|
7
|
+
job: ToolJobSchema.extend({
|
|
8
|
+
toolType: z.nativeEnum(TOOL_TYPE),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type Payload = z.infer<typeof PayloadSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetTTSPriceCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
modelId: z.string(),
|
|
7
|
+
userInput: z.string(),
|
|
8
|
+
});
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseDataSchema = z.object({
|
|
12
|
+
price: z.number(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
package/tts/commands/index.ts
CHANGED
|
@@ -5,9 +5,10 @@ import { TTSJobSchema } from '../models/tts-job.schema';
|
|
|
5
5
|
export namespace RetryTTSJobCommand {
|
|
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
|
|
|
@@ -6,7 +6,6 @@ export namespace TTSCommand {
|
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
userId: z.string().uuid().nullable().optional(),
|
|
8
8
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
9
|
-
userBalance: z.number(),
|
|
10
9
|
modelId: z.string(),
|
|
11
10
|
voiceId: z.string(),
|
|
12
11
|
userInput: z.string(),
|
|
@@ -18,6 +17,8 @@ export namespace TTSCommand {
|
|
|
18
17
|
style: z.number().optional(),
|
|
19
18
|
})
|
|
20
19
|
.optional(),
|
|
20
|
+
tokenReservationId: z.string().uuid(),
|
|
21
|
+
precalculatedPrice: z.number(),
|
|
21
22
|
});
|
|
22
23
|
export type Request = z.infer<typeof RequestSchema>;
|
|
23
24
|
|
|
@@ -25,6 +25,7 @@ export const TTSJobSchema = z.object({
|
|
|
25
25
|
duration: z.number(),
|
|
26
26
|
userId: z.string().nullable(),
|
|
27
27
|
unregisteredUserId: z.string().nullable(),
|
|
28
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
28
29
|
isDeleted: z.boolean(),
|
|
29
30
|
params: TTSJobParamsSchema,
|
|
30
31
|
createdAt: z.date(),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { VideoGenerationRequestParamsSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace GetVideoPriceCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
modelId: z.string(),
|
|
8
|
+
params: VideoGenerationRequestParamsSchema,
|
|
9
|
+
});
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseDataSchema = z.object({
|
|
13
|
+
price: z.number(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
package/video/commands/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './delete-all-video-jobs.command';
|
|
|
3
3
|
export * from './retry-video-job.command';
|
|
4
4
|
export * from './set-reaction-to-video-job.command';
|
|
5
5
|
export * from './video.command';
|
|
6
|
+
export * from './get-video-price.command';
|
|
6
7
|
export * from './update-video-job-title.command';
|
|
7
8
|
export * from './video-model';
|
|
8
9
|
export * from './update-published-status-video-jobs.command';
|
|
@@ -6,12 +6,13 @@ import { VideoGenerationRequestParamsSchema } from '../models';
|
|
|
6
6
|
export namespace RetryVideoJobCommand {
|
|
7
7
|
export const RequestSchema = z.object({
|
|
8
8
|
uuid: z.string().uuid(),
|
|
9
|
-
userBalance: z.number(),
|
|
10
9
|
userId: z.string().uuid().nullable().optional(),
|
|
11
10
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
12
11
|
prompt: z.string().optional(),
|
|
13
12
|
modelId: z.string().uuid().optional(),
|
|
14
13
|
params: VideoGenerationRequestParamsSchema.optional(),
|
|
14
|
+
tokenReservationId: z.string().uuid(),
|
|
15
|
+
precalculatedPrice: z.number(),
|
|
15
16
|
});
|
|
16
17
|
export type Request = z.infer<typeof RequestSchema>;
|
|
17
18
|
|
|
@@ -9,9 +9,15 @@ export namespace UpdatePublishedStatusVideoJobsCommand {
|
|
|
9
9
|
userId: z.string().uuid().nullable().optional(),
|
|
10
10
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
11
11
|
}),
|
|
12
|
-
data: z
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
data: z
|
|
13
|
+
.object({
|
|
14
|
+
isPublished: z.boolean(),
|
|
15
|
+
postId: z.string().nullable().optional(),
|
|
16
|
+
})
|
|
17
|
+
.refine((data) => (data.isPublished ? !!data.postId : true), {
|
|
18
|
+
message: 'Post ID is required when job is published',
|
|
19
|
+
path: ['postId'],
|
|
20
|
+
}),
|
|
15
21
|
});
|
|
16
22
|
export type Request = z.infer<typeof RequestSchema>;
|
|
17
23
|
|
|
@@ -8,9 +8,10 @@ export namespace VideoCommand {
|
|
|
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: VideoGenerationRequestParamsSchema,
|
|
13
|
+
tokenReservationId: z.string().uuid(),
|
|
14
|
+
precalculatedPrice: z.number(),
|
|
14
15
|
});
|
|
15
16
|
export type Request = z.infer<typeof RequestSchema>;
|
|
16
17
|
|
|
@@ -18,6 +18,8 @@ export const VideoJobSchema = z.object({
|
|
|
18
18
|
uuid: z.string(),
|
|
19
19
|
prompt: z.string(),
|
|
20
20
|
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
21
|
+
isPublished: z.boolean(),
|
|
22
|
+
postId: z.string().nullable(),
|
|
21
23
|
dislikeReason: z.string().nullable(),
|
|
22
24
|
externalId: z.string().nullable(),
|
|
23
25
|
title: z.string(),
|
|
@@ -30,6 +32,7 @@ export const VideoJobSchema = z.object({
|
|
|
30
32
|
attempts: z.array(z.any()),
|
|
31
33
|
userId: z.string().nullable().optional(),
|
|
32
34
|
unregisteredUserId: z.string().nullable().optional(),
|
|
35
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
33
36
|
isDeleted: z.boolean(),
|
|
34
37
|
createdAt: z.date(),
|
|
35
38
|
completedAt: z.date().nullable().optional(),
|
|
@@ -10,8 +10,9 @@ export namespace EditVideoCommand {
|
|
|
10
10
|
inputVideoId: z.string().uuid(),
|
|
11
11
|
inputVideoUrl: z.string(),
|
|
12
12
|
duration: z.number(),
|
|
13
|
-
userBalance: z.number(),
|
|
14
13
|
modelId: z.string().uuid(),
|
|
14
|
+
tokenReservationId: z.string().uuid(),
|
|
15
|
+
precalculatedPrice: z.number(),
|
|
15
16
|
});
|
|
16
17
|
export type Request = z.infer<typeof RequestSchema>;
|
|
17
18
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetVideoEditorPriceCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
modelId: z.string(),
|
|
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
|
+
}
|
|
@@ -5,4 +5,5 @@ export * from './set-reaction-to-video-editor-job.command';
|
|
|
5
5
|
export * from './update-video-editor-job-title.command';
|
|
6
6
|
export * from './update-published-status-video-editor-jobs.command';
|
|
7
7
|
export * from './edit-video.command';
|
|
8
|
+
export * from './get-video-editor-price.command';
|
|
8
9
|
export * from './video-editor-model';
|
|
@@ -5,7 +5,6 @@ import { VideoEditorJobSchema } from '../models/video-editor-job.schema';
|
|
|
5
5
|
export namespace RetryVideoEditorJobCommand {
|
|
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
|
prompt: z.string().optional(),
|
|
@@ -13,6 +12,8 @@ export namespace RetryVideoEditorJobCommand {
|
|
|
13
12
|
inputVideoUrl: z.string().optional(),
|
|
14
13
|
duration: z.number().optional(),
|
|
15
14
|
modelId: z.string().uuid().optional(),
|
|
15
|
+
tokenReservationId: z.string().uuid(),
|
|
16
|
+
precalculatedPrice: z.number(),
|
|
16
17
|
});
|
|
17
18
|
export type Request = z.infer<typeof RequestSchema>;
|
|
18
19
|
|
|
@@ -9,9 +9,15 @@ export namespace UpdatePublishedStatusVideoEditorJobsCommand {
|
|
|
9
9
|
userId: z.string().uuid().nullable().optional(),
|
|
10
10
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
11
11
|
}),
|
|
12
|
-
data: z
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
data: z
|
|
13
|
+
.object({
|
|
14
|
+
isPublished: z.boolean(),
|
|
15
|
+
postId: z.string().nullable().optional(),
|
|
16
|
+
})
|
|
17
|
+
.refine((data) => (data.isPublished ? !!data.postId : true), {
|
|
18
|
+
message: 'Post ID is required when job is published',
|
|
19
|
+
path: ['postId'],
|
|
20
|
+
}),
|
|
15
21
|
});
|
|
16
22
|
export type Request = z.infer<typeof RequestSchema>;
|
|
17
23
|
|
|
@@ -21,7 +21,9 @@ export const VideoEditorJobSchema = z.object({
|
|
|
21
21
|
attempts: z.array(z.any()),
|
|
22
22
|
userId: z.string().nullable().optional(),
|
|
23
23
|
unregisteredUserId: z.string().nullable().optional(),
|
|
24
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
24
25
|
isPublished: z.boolean(),
|
|
26
|
+
postId: z.string().nullable(),
|
|
25
27
|
isDeleted: z.boolean(),
|
|
26
28
|
createdAt: z.date(),
|
|
27
29
|
completedAt: z.date().nullable().optional(),
|
|
@@ -3,15 +3,11 @@ import { ICommandResponseSchema } from '../../common/models/command-response.sch
|
|
|
3
3
|
import { VideoEditorJobSchema } from '../models/video-editor-job.schema';
|
|
4
4
|
|
|
5
5
|
export namespace FindVideoEditorJobByIdQuery {
|
|
6
|
-
export const RequestSchema = z
|
|
7
|
-
.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
12
|
-
.refine((data) => data.userId || data.unregisteredUserId, {
|
|
13
|
-
message: 'Either userId or unregisteredUserId must be provided',
|
|
14
|
-
});
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
uuid: z.string(),
|
|
8
|
+
userId: z.string().uuid().nullable().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
+
});
|
|
15
11
|
export type Request = z.infer<typeof RequestSchema>;
|
|
16
12
|
|
|
17
13
|
export const ResponseSchema = ICommandResponseSchema(VideoEditorJobSchema);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const VIDEO_EDITOR_AMQP_ROUTES = {
|
|
2
2
|
EXECUTE: 'tools.video-editor.execute.rpc',
|
|
3
|
+
GET_PRICE: 'tools.video-editor.get-price.rpc',
|
|
3
4
|
CONFIG: 'tools.video-editor.config.rpc',
|
|
4
5
|
GET_JOB: 'tools.video-editor.jobs.get.rpc',
|
|
5
6
|
LIST_JOBS: 'tools.video-editor.jobs.list.rpc',
|
|
@@ -7,7 +7,8 @@ export namespace GenerateWriterDocumentContentsCommand {
|
|
|
7
7
|
documentId: 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
|
modelId: z.string(),
|
|
12
13
|
});
|
|
13
14
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common';
|
|
3
|
+
|
|
4
|
+
export namespace GetWriterContentGenerationPriceCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
documentId: z.string().uuid(),
|
|
7
|
+
modelId: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseDataSchema = z.object({
|
|
12
|
+
price: z.number(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
package/writer/commands/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './delete-all-user-writer-documents.command';
|
|
|
4
4
|
export * from './update-writer-document-outline.command';
|
|
5
5
|
export * from './export-writer-document-as-docx.command';
|
|
6
6
|
export * from './generate-document-contents.command';
|
|
7
|
+
export * from './get-writer-content-generation-price.command';
|
|
7
8
|
export * from './writer-paraphrase.command';
|
|
8
9
|
export * from './writer-extend-text.command';
|
|
9
10
|
export * from './writer-shorten-text.command';
|
|
@@ -19,6 +19,7 @@ export const WriterDocumentSchema = z.object({
|
|
|
19
19
|
dislikeReason: z.string().nullable(),
|
|
20
20
|
pages: z.number(),
|
|
21
21
|
isDeleted: z.boolean(),
|
|
22
|
+
tokenReservationId: z.string().nullable().optional(),
|
|
22
23
|
createdAt: z.date(),
|
|
23
24
|
updatedAt: z.date(),
|
|
24
25
|
completedAt: z.date().nullable(),
|
|
@@ -8,6 +8,7 @@ export const WRITER_AMQP_ROUTES = {
|
|
|
8
8
|
UPDATE_DOCUMENT_OUTLINE: 'tools.writer.update-document-outline.rpc',
|
|
9
9
|
UPDATE_DOCUMENT_CONTENTS: 'tools.writer.update-document-contents.rpc',
|
|
10
10
|
GENERATE_DOCUMENT_CONTENTS: 'tools.writer.generate-document-contents.rpc',
|
|
11
|
+
GET_CONTENT_GENERATION_PRICE: 'tools.writer.content-generation.get-price.rpc',
|
|
11
12
|
PARAPHRASE: 'tools.writer.actions.paraphrase.rpc',
|
|
12
13
|
EXTEND_TEXT: 'tools.writer.actions.extend-text.rpc',
|
|
13
14
|
SHORTEN_TEXT: 'tools.writer.actions.shorten-text.rpc',
|