@purpleschool/gptbot-tools 0.0.55 → 0.0.56-presentation
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/common/errors/errors.js +399 -2
- package/build/index.js +6 -0
- package/build/music/commands/convert-to-wav.command.js +15 -0
- package/build/music/commands/delete-all-music-jobs.command.js +13 -0
- package/build/music/commands/delete-music-job-by-uuid.command.js +14 -0
- package/build/music/commands/generate-lyrics.command.js +18 -0
- package/build/music/commands/generate-music.command.js +18 -0
- package/build/music/commands/index.js +24 -0
- package/build/music/commands/retry-music-job.command.js +16 -0
- package/build/music/commands/set-reaction-to-music-job.command.js +17 -0
- package/build/music/commands/update-music-job-title.command.js +16 -0
- package/build/music/enums/index.js +22 -0
- package/build/music/enums/music-action-type.enum.js +7 -0
- package/build/music/enums/music-pricing-rule-type.enum.js +7 -0
- package/build/music/enums/music-strategy.enum.js +7 -0
- package/build/music/enums/music-vocal-gender.enum.js +8 -0
- package/build/music/enums/suno-mode-type.enum.js +10 -0
- package/build/music/enums/suno-model-type.enum.js +10 -0
- package/build/music/index.js +22 -0
- package/build/music/models/index.js +20 -0
- package/build/music/models/music-config.schema.js +8 -0
- package/build/music/models/music-job.schema.js +54 -0
- package/build/music/models/music-model.schema.js +35 -0
- package/build/music/models/music-track.schema.js +17 -0
- package/build/music/queries/find-music-job-by-id.query.js +10 -0
- package/build/music/queries/find-music-jobs.query.js +28 -0
- package/build/music/queries/get-music-config.query.js +9 -0
- package/build/music/queries/index.js +19 -0
- package/build/music/routes/index.js +17 -0
- package/build/music/routes/music.amqp.routes.js +16 -0
- package/build/music/utils/calculate-music-generation-price.util.js +7 -0
- package/build/music/utils/index.js +17 -0
- package/build/presentation/commands/build-blank-slide.command.js +15 -0
- package/build/presentation/commands/generate-and-insert-slide.command.js +22 -0
- package/build/presentation/commands/index.js +7 -0
- package/build/presentation/commands/presentation-generate-report.command.js +18 -0
- package/build/presentation/commands/presentation-paraphrase.command.js +19 -0
- package/build/presentation/commands/update-presentation-slides.command.js +16 -0
- package/build/presentation/commands/update-slide-image-slot.command.js +34 -0
- package/build/presentation/commands/update-slide.command.js +17 -0
- package/build/presentation/enums/index.js +4 -0
- package/build/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
- package/build/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
- package/build/presentation/enums/presentation-ai-action-type.enum.js +8 -0
- package/build/presentation/enums/slide-image-slot-action.enum.js +8 -0
- package/build/presentation/index.js +1 -0
- package/build/presentation/models/index.js +1 -0
- package/build/presentation/models/presentation-ai-action.schema.js +27 -0
- package/build/presentation/models/presentation-config.schema.js +3 -0
- package/build/presentation/models/presentation.schema.js +4 -1
- package/build/presentation/models/slide-content-edit.schema.js +135 -0
- package/build/presentation/models/slide-content.schema.js +5 -1
- package/build/presentation/models/slide.schema.js +39 -1
- package/build/presentation/routes/presentation.routes.js +7 -0
- package/build/presentation/utils/calculate-presentation-ai-action-price.util.js +16 -0
- package/build/presentation/utils/index.js +17 -0
- package/build/tools/enums/tool-type.enum.js +4 -0
- package/build/video/enums/video-strategy.enum.js +2 -0
- package/build/video/routes/video.http.routes.js +1 -0
- package/build/video-editor/commands/delete-all-video-editor-jobs.command.js +13 -0
- package/build/video-editor/commands/delete-video-editor-job-by-uuid.command.js +14 -0
- package/build/video-editor/commands/edit-video.command.js +19 -0
- package/build/video-editor/commands/index.js +22 -0
- package/build/video-editor/commands/retry-video-editor-job.command.js +16 -0
- package/build/video-editor/commands/set-reaction-to-video-editor-job.command.js +17 -0
- package/build/video-editor/commands/update-video-editor-job-title.command.js +16 -0
- package/build/video-editor/enums/index.js +17 -0
- package/build/video-editor/enums/video-editor-model-strategy.enum.js +10 -0
- package/build/video-editor/index.js +22 -0
- package/build/video-editor/models/index.js +19 -0
- package/build/video-editor/models/video-editor-config.schema.js +11 -0
- package/build/video-editor/models/video-editor-job.schema.js +27 -0
- package/build/video-editor/models/video-editor-model.schema.js +24 -0
- package/build/video-editor/queries/find-video-editor-job-by-id.query.js +19 -0
- package/build/video-editor/queries/find-video-editor-jobs.query.js +28 -0
- package/build/video-editor/queries/get-video-editor-config.query.js +11 -0
- package/build/video-editor/queries/index.js +19 -0
- package/build/video-editor/routes/index.js +18 -0
- package/build/video-editor/routes/video-editor.amqp.routes.js +14 -0
- package/build/video-editor/routes/video-editor.http.routes.js +8 -0
- package/build/video-editor/utils/calculate-video-editing-price.js +10 -0
- package/build/video-editor/utils/index.js +17 -0
- package/build/writer/commands/generate-document-contents.command.js +1 -0
- package/build/writer/enums/index.js +1 -0
- package/build/writer/enums/writer-content-generation-strategy.enum.js +8 -0
- package/build/writer/index.js +1 -0
- package/build/writer/models/index.js +1 -0
- package/build/writer/models/writer-config.schema.js +2 -0
- package/build/writer/models/writer-document-type.schema.js +1 -0
- package/build/writer/models/writer-document.schema.js +1 -0
- package/build/writer/models/writer-model.schema.js +21 -0
- package/build/writer/utils/calculate-writer-content-generation-price.util.js +2 -2
- package/common/errors/errors.ts +408 -3
- package/index.ts +6 -0
- package/music/commands/convert-to-wav.command.ts +15 -0
- package/music/commands/delete-all-music-jobs.command.ts +13 -0
- package/music/commands/delete-music-job-by-uuid.command.ts +14 -0
- package/music/commands/generate-lyrics.command.ts +20 -0
- package/music/commands/generate-music.command.ts +18 -0
- package/music/commands/index.ts +8 -0
- package/music/commands/retry-music-job.command.ts +16 -0
- package/music/commands/set-reaction-to-music-job.command.ts +17 -0
- package/music/commands/update-music-job-title.command.ts +16 -0
- package/music/enums/index.ts +6 -0
- package/music/enums/music-action-type.enum.ts +3 -0
- package/music/enums/music-pricing-rule-type.enum.ts +3 -0
- package/music/enums/music-strategy.enum.ts +3 -0
- package/music/enums/music-vocal-gender.enum.ts +4 -0
- package/music/enums/suno-mode-type.enum.ts +6 -0
- package/music/enums/suno-model-type.enum.ts +6 -0
- package/music/index.ts +6 -0
- package/music/models/index.ts +4 -0
- package/music/models/music-config.schema.ts +8 -0
- package/music/models/music-job.schema.ts +57 -0
- package/music/models/music-model.schema.ts +40 -0
- package/music/models/music-track.schema.ts +19 -0
- package/music/queries/find-music-job-by-id.query.ts +11 -0
- package/music/queries/find-music-jobs.query.ts +33 -0
- package/music/queries/get-music-config.query.ts +8 -0
- package/music/queries/index.ts +3 -0
- package/music/routes/index.ts +1 -0
- package/music/routes/music.amqp.routes.ts +13 -0
- package/music/utils/calculate-music-generation-price.util.ts +5 -0
- package/music/utils/index.ts +1 -0
- package/package.json +1 -1
- package/presentation/commands/build-blank-slide.command.ts +15 -0
- package/presentation/commands/generate-and-insert-slide.command.ts +22 -0
- package/presentation/commands/index.ts +7 -0
- package/presentation/commands/presentation-generate-report.command.ts +20 -0
- package/presentation/commands/presentation-paraphrase.command.ts +21 -0
- package/presentation/commands/update-presentation-slides.command.ts +16 -0
- package/presentation/commands/update-slide-image-slot.command.ts +39 -0
- package/presentation/commands/update-slide.command.ts +17 -0
- package/presentation/enums/index.ts +4 -0
- package/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
- package/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
- package/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
- package/presentation/enums/slide-image-slot-action.enum.ts +4 -0
- package/presentation/index.ts +1 -0
- package/presentation/models/index.ts +1 -0
- package/presentation/models/presentation-ai-action.schema.ts +30 -0
- package/presentation/models/presentation-config.schema.ts +3 -0
- package/presentation/models/presentation.schema.ts +4 -1
- package/presentation/models/slide-content-edit.schema.ts +160 -0
- package/presentation/models/slide-content.schema.ts +104 -11
- package/presentation/models/slide-image-slot.schema.ts +1 -0
- package/presentation/models/slide.schema.ts +47 -0
- package/presentation/routes/presentation.routes.ts +7 -0
- package/presentation/utils/calculate-presentation-ai-action-price.util.ts +20 -0
- package/presentation/utils/index.ts +1 -0
- package/tools/enums/tool-type.enum.ts +4 -0
- package/video/enums/video-strategy.enum.ts +2 -0
- package/video/routes/video.http.routes.ts +1 -0
- package/video-editor/commands/delete-all-video-editor-jobs.command.ts +13 -0
- package/video-editor/commands/delete-video-editor-job-by-uuid.command.ts +14 -0
- package/video-editor/commands/edit-video.command.ts +19 -0
- package/video-editor/commands/index.ts +6 -0
- package/video-editor/commands/retry-video-editor-job.command.ts +16 -0
- package/video-editor/commands/set-reaction-to-video-editor-job.command.ts +17 -0
- package/video-editor/commands/update-video-editor-job-title.command.ts +16 -0
- package/video-editor/enums/index.ts +1 -0
- package/video-editor/enums/video-editor-model-strategy.enum.ts +6 -0
- package/video-editor/index.ts +6 -0
- package/video-editor/models/index.ts +3 -0
- package/video-editor/models/video-editor-config.schema.ts +7 -0
- package/video-editor/models/video-editor-job.schema.ts +27 -0
- package/video-editor/models/video-editor-model.schema.ts +23 -0
- package/video-editor/queries/find-video-editor-job-by-id.query.ts +19 -0
- package/video-editor/queries/find-video-editor-jobs.query.ts +33 -0
- package/video-editor/queries/get-video-editor-config.query.ts +11 -0
- package/video-editor/queries/index.ts +3 -0
- package/video-editor/routes/index.ts +2 -0
- package/video-editor/routes/video-editor.amqp.routes.ts +11 -0
- package/video-editor/routes/video-editor.http.routes.ts +6 -0
- package/video-editor/utils/calculate-video-editing-price.ts +12 -0
- package/video-editor/utils/index.ts +1 -0
- package/writer/commands/generate-document-contents.command.ts +1 -0
- package/writer/enums/index.ts +1 -0
- package/writer/enums/writer-content-generation-strategy.enum.ts +4 -0
- package/writer/index.ts +1 -0
- package/writer/models/index.ts +1 -0
- package/writer/models/writer-config.schema.ts +2 -0
- package/writer/models/writer-document-type.schema.ts +1 -0
- package/writer/models/writer-document.schema.ts +1 -0
- package/writer/models/writer-model.schema.ts +21 -0
- package/writer/utils/calculate-writer-content-generation-price.util.ts +4 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema, TOOL_MODEL_STATUS } from '../../common';
|
|
3
|
+
import { VIDEO_EDITOR_MODEL_STRATEGY } from '../enums';
|
|
4
|
+
|
|
5
|
+
export const VideoEditorModelSchema = z.object({
|
|
6
|
+
uuid: z.string(),
|
|
7
|
+
title: z.string(),
|
|
8
|
+
description: z.string(),
|
|
9
|
+
aiModel: z.string(),
|
|
10
|
+
pricePerSecond: z.number(),
|
|
11
|
+
order: z.number(),
|
|
12
|
+
status: z.nativeEnum(TOOL_MODEL_STATUS),
|
|
13
|
+
icons: IconVariantsSchema,
|
|
14
|
+
strategy: z.nativeEnum(VIDEO_EDITOR_MODEL_STRATEGY),
|
|
15
|
+
maxPromptLength: z.number(),
|
|
16
|
+
maxInputVideoSizeBytes: z.number(),
|
|
17
|
+
maxInputVideoDurationInSeconds: z.number(),
|
|
18
|
+
supportedFormats: z.array(z.string()),
|
|
19
|
+
needsTranslation: z.boolean(),
|
|
20
|
+
createdAt: z.date(),
|
|
21
|
+
updatedAt: z.date(),
|
|
22
|
+
});
|
|
23
|
+
export type VideoEditorModel = z.infer<typeof VideoEditorModelSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { VideoEditorJobSchema } from '../models/video-editor-job.schema';
|
|
4
|
+
|
|
5
|
+
export namespace FindVideoEditorJobByIdQuery {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
uuid: z.string(),
|
|
9
|
+
userId: z.string().uuid().nullable().optional(),
|
|
10
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
11
|
+
})
|
|
12
|
+
.refine((data) => data.userId || data.unregisteredUserId, {
|
|
13
|
+
message: 'Either userId or unregisteredUserId must be provided',
|
|
14
|
+
});
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = ICommandResponseSchema(VideoEditorJobSchema);
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { VideoEditorJobSchema } from '../models/video-editor-job.schema';
|
|
4
|
+
|
|
5
|
+
export namespace FindVideoEditorJobsQuery {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
userId: z.string().uuid().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().optional(),
|
|
10
|
+
title: z.string().optional(),
|
|
11
|
+
limit: z.coerce.number().min(1).optional(),
|
|
12
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
13
|
+
})
|
|
14
|
+
.refine(
|
|
15
|
+
(data) => {
|
|
16
|
+
return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'At least userId or unregisteredUserId must be present',
|
|
20
|
+
path: ['userId', 'unregisteredUserId'],
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
24
|
+
|
|
25
|
+
export const ResponseSchema = ICommandResponseSchema(
|
|
26
|
+
z.object({
|
|
27
|
+
data: z.array(VideoEditorJobSchema),
|
|
28
|
+
page: z.number(),
|
|
29
|
+
totalPages: z.number(),
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { VideoEditorConfigSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace GetVideoEditorConfigQuery {
|
|
6
|
+
export const RequestSchema = z.object({});
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = ICommandResponseSchema(VideoEditorConfigSchema);
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const VIDEO_EDITOR_AMQP_ROUTES = {
|
|
2
|
+
EXECUTE: 'tools.video-editor.execute.rpc',
|
|
3
|
+
CONFIG: 'tools.video-editor.config.rpc',
|
|
4
|
+
GET_JOB: 'tools.video-editor.jobs.get.rpc',
|
|
5
|
+
LIST_JOBS: 'tools.video-editor.jobs.list.rpc',
|
|
6
|
+
SET_REACTION: 'tools.video-editor.jobs.set-reaction.rpc',
|
|
7
|
+
UPDATE_TITLE: 'tools.video-editor.jobs.update-title.rpc',
|
|
8
|
+
SOFT_DELETE: 'tools.video-editor.jobs.soft-delete.rpc',
|
|
9
|
+
SOFT_DELETE_ALL: 'tools.video-editor.jobs.soft-delete-all.rpc',
|
|
10
|
+
RETRY: 'tools.video-editor.jobs.retry.rpc',
|
|
11
|
+
} as const;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function calculateVideoEditingPrice({
|
|
2
|
+
duration,
|
|
3
|
+
pricePerSecond,
|
|
4
|
+
}: {
|
|
5
|
+
duration: number;
|
|
6
|
+
pricePerSecond: number;
|
|
7
|
+
}): number {
|
|
8
|
+
if (duration <= 0) throw new Error('Duration must be positive');
|
|
9
|
+
if (pricePerSecond < 0) throw new Error('Price per second cannot be negative');
|
|
10
|
+
|
|
11
|
+
return Math.ceil(duration * pricePerSecond);
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calculate-video-editing-price';
|
|
@@ -8,6 +8,7 @@ export namespace GenerateWriterDocumentContentsCommand {
|
|
|
8
8
|
userId: z.string().uuid().nullable().optional(),
|
|
9
9
|
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
10
|
userBalance: z.number(),
|
|
11
|
+
modelId: z.string(),
|
|
11
12
|
});
|
|
12
13
|
export type Request = z.infer<typeof RequestSchema>;
|
|
13
14
|
|
package/writer/enums/index.ts
CHANGED
package/writer/index.ts
CHANGED
package/writer/models/index.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { WriterDocumentTypeSchema } from './writer-document-type.schema';
|
|
3
3
|
import { WriterAiActionSchema } from './writer-ai-action.schema';
|
|
4
|
+
import { WriterModelSchema } from './writer-model.schema';
|
|
4
5
|
|
|
5
6
|
export const WriterConfigSchema = z.object({
|
|
6
7
|
maxPromptLength: z.number(),
|
|
7
8
|
documentTypes: z.array(WriterDocumentTypeSchema),
|
|
8
9
|
aiActions: z.array(WriterAiActionSchema),
|
|
10
|
+
models: z.array(WriterModelSchema),
|
|
9
11
|
});
|
|
10
12
|
export type WriterConfig = z.infer<typeof WriterConfigSchema>;
|
|
@@ -14,6 +14,7 @@ export const WriterDocumentSchema = z.object({
|
|
|
14
14
|
finalMd: z.string().nullable(),
|
|
15
15
|
userId: z.string().nullable(),
|
|
16
16
|
unregisteredUserId: z.string().nullable(),
|
|
17
|
+
modelId: z.string().nullable(),
|
|
17
18
|
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
18
19
|
pages: z.number(),
|
|
19
20
|
isDeleted: z.boolean(),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TOOL_MODEL_STATUS } from '../../common';
|
|
3
|
+
import { IconVariantsSchema } from '../../common';
|
|
4
|
+
import { WRITER_CONTENT_GENERATION_STRATEGY } from '../enums/writer-content-generation-strategy.enum';
|
|
5
|
+
|
|
6
|
+
export const WriterModelSchema = z.object({
|
|
7
|
+
uuid: z.string(),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
description: z.string(),
|
|
10
|
+
aiModel: z.string(),
|
|
11
|
+
pricePerPage: z.number(),
|
|
12
|
+
order: z.number(),
|
|
13
|
+
status: z.nativeEnum(TOOL_MODEL_STATUS),
|
|
14
|
+
icons: IconVariantsSchema,
|
|
15
|
+
strategy: z.nativeEnum(WRITER_CONTENT_GENERATION_STRATEGY),
|
|
16
|
+
maxInputLength: z.number(),
|
|
17
|
+
createdAt: z.date(),
|
|
18
|
+
updatedAt: z.date(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type WriterModel = z.infer<typeof WriterModelSchema>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { WriterModel } from '../models';
|
|
2
|
+
|
|
3
|
+
export function calculateWriterContentGenerationPrice(pages: number, model: WriterModel): number {
|
|
4
|
+
return Math.max(1, pages * model.pricePerPage);
|
|
3
5
|
}
|