@purpleschool/gptbot-tools 0.0.130-stage-2 → 0.0.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/build/common/errors/errors.js +5 -0
  2. package/build/image-editor/commands/image-editor.command.js +1 -2
  3. package/build/image-editor/commands/index.js +0 -1
  4. package/build/image-editor/commands/retry-image-editor-job.command.js +1 -2
  5. package/build/image-editor/models/image-editor-job.schema.js +0 -1
  6. package/build/image-editor/routes/image-editor.amqp.routes.js +0 -1
  7. package/build/image-generation/commands/execute-image-generation.command.js +2 -3
  8. package/build/image-generation/commands/index.js +0 -1
  9. package/build/image-generation/commands/retry-image-generation-job.command.js +3 -4
  10. package/build/image-generation/models/image-generation-job.schema.js +0 -1
  11. package/build/image-generation/routes/image-generation.amqp.routes.js +0 -1
  12. package/build/music/commands/generate-music.command.js +1 -2
  13. package/build/music/commands/index.js +0 -1
  14. package/build/music/commands/retry-music-job.command.js +1 -2
  15. package/build/music/models/music-job.schema.js +0 -1
  16. package/build/music/routes/music.amqp.routes.js +0 -1
  17. package/build/paraphrase/commands/index.js +0 -1
  18. package/build/paraphrase/commands/paraphrase.command.js +1 -2
  19. package/build/paraphrase/commands/retry-paraphrase-job.command.js +1 -2
  20. package/build/paraphrase/models/paraphrase-job.schema.js +0 -1
  21. package/build/paraphrase/routes/paraphrase.amqp.routes.js +0 -1
  22. package/build/presentation/commands/generate-slides.command.js +1 -2
  23. package/build/presentation/commands/index.js +0 -1
  24. package/build/presentation/models/presentation.schema.js +0 -1
  25. package/build/presentation/routes/presentation.routes.js +0 -1
  26. package/build/stt/commands/index.js +0 -1
  27. package/build/stt/commands/retry-stt-job.command.js +1 -2
  28. package/build/stt/commands/stt.command.js +1 -2
  29. package/build/stt/models/stt-job.schema.js +0 -1
  30. package/build/stt/routes/stt.amqp.routes.js +0 -1
  31. package/build/tools/events/index.js +0 -1
  32. package/build/tools/models/tool-job.schema.js +0 -1
  33. package/build/tools/routes/tools.aqmp.routes.js +0 -1
  34. package/build/tts/commands/index.js +0 -1
  35. package/build/tts/commands/retry-tts-job.command.js +1 -2
  36. package/build/tts/commands/tts.command.js +1 -2
  37. package/build/tts/models/tts-job.schema.js +0 -1
  38. package/build/tts/routes/tts.amqp.routes.js +0 -1
  39. package/build/video/commands/index.js +0 -1
  40. package/build/video/commands/retry-video-job.command.js +1 -2
  41. package/build/video/commands/video.command.js +1 -2
  42. package/build/video/models/video-job.schema.js +0 -1
  43. package/build/video/routes/video.amqp.routes.js +0 -1
  44. package/build/video-editor/commands/edit-video.command.js +1 -2
  45. package/build/video-editor/commands/index.js +0 -1
  46. package/build/video-editor/commands/retry-video-editor-job.command.js +1 -2
  47. package/build/video-editor/models/video-editor-job.schema.js +0 -1
  48. package/build/video-editor/routes/video-editor.amqp.routes.js +0 -1
  49. package/build/writer/commands/generate-document-contents.command.js +1 -2
  50. package/build/writer/commands/index.js +1 -1
  51. package/build/writer/commands/update-writer-document-outline.command.js +0 -1
  52. package/build/writer/commands/update-writer-document-title-page.command.js +16 -0
  53. package/build/writer/models/writer-document-title-page.schema.js +2 -4
  54. package/build/writer/models/writer-document.schema.js +0 -1
  55. package/build/writer/routes/writer.routes.js +1 -1
  56. package/common/errors/errors.ts +5 -0
  57. package/image-editor/commands/image-editor.command.ts +1 -2
  58. package/image-editor/commands/index.ts +0 -1
  59. package/image-editor/commands/retry-image-editor-job.command.ts +1 -2
  60. package/image-editor/models/image-editor-job.schema.ts +0 -1
  61. package/image-editor/routes/image-editor.amqp.routes.ts +0 -1
  62. package/image-generation/commands/execute-image-generation.command.ts +2 -3
  63. package/image-generation/commands/index.ts +0 -1
  64. package/image-generation/commands/retry-image-generation-job.command.ts +3 -4
  65. package/image-generation/models/image-generation-job.schema.ts +0 -1
  66. package/image-generation/routes/image-generation.amqp.routes.ts +0 -1
  67. package/music/commands/generate-music.command.ts +1 -2
  68. package/music/commands/index.ts +0 -1
  69. package/music/commands/retry-music-job.command.ts +1 -2
  70. package/music/models/music-job.schema.ts +0 -1
  71. package/music/routes/music.amqp.routes.ts +0 -1
  72. package/package.json +1 -1
  73. package/paraphrase/commands/index.ts +0 -1
  74. package/paraphrase/commands/paraphrase.command.ts +1 -2
  75. package/paraphrase/commands/retry-paraphrase-job.command.ts +1 -2
  76. package/paraphrase/models/paraphrase-job.schema.ts +0 -1
  77. package/paraphrase/routes/paraphrase.amqp.routes.ts +0 -1
  78. package/presentation/commands/generate-slides.command.ts +1 -2
  79. package/presentation/commands/index.ts +0 -1
  80. package/presentation/models/presentation.schema.ts +0 -1
  81. package/presentation/routes/presentation.routes.ts +0 -1
  82. package/stt/commands/index.ts +0 -1
  83. package/stt/commands/retry-stt-job.command.ts +1 -2
  84. package/stt/commands/stt.command.ts +1 -2
  85. package/stt/models/stt-job.schema.ts +0 -1
  86. package/stt/routes/stt.amqp.routes.ts +0 -1
  87. package/tools/events/index.ts +0 -1
  88. package/tools/models/tool-job.schema.ts +0 -1
  89. package/tools/routes/tools.aqmp.routes.ts +0 -1
  90. package/tts/commands/index.ts +0 -1
  91. package/tts/commands/retry-tts-job.command.ts +1 -2
  92. package/tts/commands/tts.command.ts +1 -2
  93. package/tts/models/tts-job.schema.ts +0 -1
  94. package/tts/routes/tts.amqp.routes.ts +0 -1
  95. package/video/commands/index.ts +0 -1
  96. package/video/commands/retry-video-job.command.ts +1 -2
  97. package/video/commands/video.command.ts +1 -2
  98. package/video/models/video-job.schema.ts +0 -1
  99. package/video/routes/video.amqp.routes.ts +0 -1
  100. package/video-editor/commands/edit-video.command.ts +1 -2
  101. package/video-editor/commands/index.ts +0 -1
  102. package/video-editor/commands/retry-video-editor-job.command.ts +1 -2
  103. package/video-editor/models/video-editor-job.schema.ts +0 -1
  104. package/video-editor/routes/video-editor.amqp.routes.ts +0 -1
  105. package/writer/commands/generate-document-contents.command.ts +1 -2
  106. package/writer/commands/index.ts +1 -1
  107. package/writer/commands/update-writer-document-outline.command.ts +1 -2
  108. package/writer/commands/update-writer-document-title-page.command.ts +16 -0
  109. package/writer/models/writer-document-title-page.schema.ts +9 -11
  110. package/writer/models/writer-document.schema.ts +0 -1
  111. package/writer/routes/writer.routes.ts +1 -1
  112. package/build/image-editor/commands/get-image-editor-price.command.js +0 -24
  113. package/build/image-generation/commands/get-image-generation-price.command.js +0 -22
  114. package/build/music/commands/get-music-price.command.js +0 -20
  115. package/build/paraphrase/commands/get-paraphrase-price.command.js +0 -15
  116. package/build/presentation/commands/get-presentation-slides-generation-price.command.js +0 -15
  117. package/build/stt/commands/get-stt-price.command.js +0 -16
  118. package/build/tools/events/tool-job-failed.event.js +0 -14
  119. package/build/tts/commands/get-tts-price.command.js +0 -16
  120. package/build/video/commands/get-video-price.command.js +0 -17
  121. package/build/video-editor/commands/get-video-editor-price.command.js +0 -15
  122. package/build/writer/commands/get-writer-content-generation-price.command.js +0 -16
  123. package/image-editor/commands/get-image-editor-price.command.ts +0 -26
  124. package/image-generation/commands/get-image-generation-price.command.ts +0 -24
  125. package/music/commands/get-music-price.command.ts +0 -22
  126. package/paraphrase/commands/get-paraphrase-price.command.ts +0 -16
  127. package/presentation/commands/get-presentation-slides-generation-price.command.ts +0 -16
  128. package/stt/commands/get-stt-price.command.ts +0 -17
  129. package/tools/events/tool-job-failed.event.ts +0 -13
  130. package/tts/commands/get-tts-price.command.ts +0 -17
  131. package/video/commands/get-video-price.command.ts +0 -18
  132. package/video-editor/commands/get-video-editor-price.command.ts +0 -16
  133. package/writer/commands/get-writer-content-generation-price.command.ts +0 -17
@@ -9,9 +9,9 @@ exports.WRITER_AMQP_ROUTES = {
9
9
  DELETE_DOCUMENT: 'tools.writer.delete-document.rpc',
10
10
  DELETE_ALL_USER_DOCUMENTS: 'tools.writer.delete-all-user-documents.rpc',
11
11
  UPDATE_DOCUMENT_OUTLINE: 'tools.writer.update-document-outline.rpc',
12
+ UPDATE_DOCUMENT_TITLE_PAGE: 'tools.writer.update-document-title-page.rpc',
12
13
  UPDATE_DOCUMENT_CONTENTS: 'tools.writer.update-document-contents.rpc',
13
14
  GENERATE_DOCUMENT_CONTENTS: 'tools.writer.generate-document-contents.rpc',
14
- GET_CONTENT_GENERATION_PRICE: 'tools.writer.content-generation.get-price.rpc',
15
15
  PARAPHRASE: 'tools.writer.actions.paraphrase.rpc',
16
16
  EXTEND_TEXT: 'tools.writer.actions.extend-text.rpc',
17
17
  SHORTEN_TEXT: 'tools.writer.actions.shorten-text.rpc',
@@ -776,6 +776,11 @@ export const ERRORS = {
776
776
  message: 'Произошла ошибка при экспорте документа в docx',
777
777
  httpCode: 500,
778
778
  },
779
+ TITLE_PAGE_UPDATE_ERROR: {
780
+ code: 'WRITER_DOCUMENT.TITLE_PAGE_UPDATE_ERROR',
781
+ message: 'Произошла ошибка при обновлении титульного листа документа',
782
+ httpCode: 500,
783
+ },
779
784
  },
780
785
  WRITER_AI_ACTION: {
781
786
  AI_ERROR: {
@@ -8,14 +8,13 @@ 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(),
11
12
  modelId: z.string(),
12
13
  params: z.object({
13
14
  attachedFiles: z.array(AttachedFileSchema),
14
15
  systemPromptId: z.string().optional(),
15
16
  }),
16
17
  userHasActiveSubscriptionOrProduct: z.boolean(),
17
- tokenReservationId: z.string().uuid(),
18
- precalculatedPrice: z.number(),
19
18
  });
20
19
  export type Request = z.infer<typeof RequestSchema>;
21
20
 
@@ -1,6 +1,5 @@
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';
4
3
  export * from './retry-image-editor-job.command';
5
4
  export * from './set-reaction-to-image-editor-job.command';
6
5
  export * from './image-editor.command';
@@ -5,11 +5,10 @@ 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(),
8
9
  userId: z.string().uuid().nullable().optional(),
9
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
11
  userHasActiveSubscriptionOrProduct: z.boolean(),
11
- tokenReservationId: z.string().uuid(),
12
- precalculatedPrice: z.number(),
13
12
  modelId: z.string().optional(),
14
13
  prompt: z.string().optional(),
15
14
  params: ImageEditorJobParamsSchema.optional(),
@@ -29,7 +29,6 @@ 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(),
33
32
  createdAt: z.date(),
34
33
  completedAt: z.date().nullable().optional(),
35
34
  updatedAt: z.date(),
@@ -1,6 +1,5 @@
1
1
  export const IMAGE_EDITOR_AMQP_ROUTES = {
2
2
  EXECUTE: 'tools.image.execute.rpc',
3
- GET_PRICE: 'tools.image.get-price.rpc',
4
3
  CONFIG: 'tools.image.config.rpc',
5
4
  GET_JOB: 'tools.image.jobs.get.rpc',
6
5
  LIST_JOBS: 'tools.image.jobs.list.rpc',
@@ -1,20 +1,19 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
- import { JOB_REQUEST_ORIGIN } from '../../tools';
4
3
  import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
4
+ import { JOB_REQUEST_ORIGIN } from '../../tools';
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(),
11
12
  modelId: z.string().uuid(),
12
13
  params: ImageGenerationRequestParamsSchema,
13
14
  presetId: z.string().uuid().nullable().optional(),
14
15
  origin: z.nativeEnum(JOB_REQUEST_ORIGIN).default(JOB_REQUEST_ORIGIN.API),
15
16
  userHasActiveSubscriptionOrProduct: z.boolean(),
16
- tokenReservationId: z.string().uuid(),
17
- precalculatedPrice: z.number(),
18
17
  });
19
18
  export type Request = z.infer<typeof RequestSchema>;
20
19
 
@@ -1,6 +1,5 @@
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';
4
3
  export * from './save-image-generation-job.command';
5
4
  export * from './soft-delete-image-generation-job-by-uuid.command';
6
5
  export * from './soft-delete-image-generation-jobs-by-criteria.command';
@@ -7,13 +7,12 @@ 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
- userHasActiveSubscriptionOrProduct: z.boolean(),
11
- tokenReservationId: z.string().uuid(),
12
- precalculatedPrice: z.number(),
13
- modelId: z.string().uuid().optional(),
14
10
  prompt: z.string().optional(),
11
+ userBalance: z.number(),
12
+ modelId: z.string().uuid().optional(),
15
13
  params: ImageGenerationRequestParamsSchema.optional(),
16
14
  presetId: z.string().uuid().nullable().optional(),
15
+ userHasActiveSubscriptionOrProduct: z.boolean(),
17
16
  });
18
17
  export type Request = z.infer<typeof RequestSchema>;
19
18
 
@@ -32,7 +32,6 @@ 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(),
36
35
  createdAt: z.date(),
37
36
  updatedAt: z.date(),
38
37
  });
@@ -1,6 +1,5 @@
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',
4
3
  CONFIG: 'tools.image-generation.config.rpc',
5
4
  FORWARD_JOB: 'tools.image-generation.jobs.forward.rpc',
6
5
  GET_JOB: 'tools.image-generation.jobs.get.rpc',
@@ -7,10 +7,9 @@ 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(),
10
11
  modelId: z.string(),
11
12
  params: MusicJobParamsSchema,
12
- tokenReservationId: z.string().uuid(),
13
- precalculatedPrice: z.number(),
14
13
  userHasActiveSubscriptionOrProduct: z.boolean(),
15
14
  });
16
15
  export type Request = z.infer<typeof RequestSchema>;
@@ -3,7 +3,6 @@ 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';
7
6
  export * from './update-music-job-title.command';
8
7
  export * from './convert-to-wav.command';
9
8
  export * from './generate-lyrics.command';
@@ -5,10 +5,9 @@ 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(),
8
9
  userId: z.string().uuid().nullable().optional(),
9
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
- tokenReservationId: z.string().uuid(),
11
- precalculatedPrice: z.number(),
12
11
  modelId: z.string().uuid().optional(),
13
12
  params: MusicJobParamsSchema.optional(),
14
13
  userHasActiveSubscriptionOrProduct: z.boolean(),
@@ -48,7 +48,6 @@ 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(),
52
51
  createdAt: z.date(),
53
52
  completedAt: z.date().nullable().optional(),
54
53
  updatedAt: z.date(),
@@ -1,6 +1,5 @@
1
1
  export const MUSIC_AMQP_ROUTES = {
2
2
  EXECUTE: 'tools.music.execute.rpc',
3
- GET_PRICE: 'tools.music.get-price.rpc',
4
3
  GENERATE_LYRICS: 'tools.music.generate-lyrics.rpc',
5
4
  CONVERT_TO_WAV: 'tools.music.convert-to-wav.rpc',
6
5
  CONFIG: 'tools.music.config.rpc',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot-tools",
3
- "version": "0.0.130-stage-2",
3
+ "version": "0.0.131",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {
@@ -4,4 +4,3 @@ export * from './delete-all-paraphrase-jobs.command';
4
4
  export * from './set-reaction-to-paraphrase-job.command';
5
5
  export * from './update-paraphrase-job-title.command';
6
6
  export * from './retry-paraphrase-job.command';
7
- export * from './get-paraphrase-price.command';
@@ -7,12 +7,11 @@ 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(),
10
11
  prompt: z.string(),
11
12
  typeId: z.string().uuid(),
12
13
  styleId: z.string().uuid(),
13
14
  intensity: z.nativeEnum(PARAPHRASING_INTENSITY),
14
- tokenReservationId: z.string().uuid(),
15
- precalculatedPrice: z.number(),
16
15
  });
17
16
  export type Request = z.infer<typeof RequestSchema>;
18
17
 
@@ -5,10 +5,9 @@ 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(),
8
9
  userId: z.string().uuid().nullable().optional(),
9
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
- tokenReservationId: z.string().uuid(),
11
- precalculatedPrice: z.number(),
12
11
  });
13
12
  export type Request = z.infer<typeof RequestSchema>;
14
13
 
@@ -19,7 +19,6 @@ 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(),
23
22
  createdAt: z.date(),
24
23
  updatedAt: z.date(),
25
24
  completedAt: z.date().nullable(),
@@ -1,6 +1,5 @@
1
1
  export const PARAPHRASE_AMQP_ROUTES = {
2
2
  EXECUTE: 'tools.paraphrase.execute.rpc',
3
- GET_PRICE: 'tools.paraphrase.get-price.rpc',
4
3
  CONFIG: 'tools.paraphrase.config.rpc',
5
4
  GET_JOB: 'tools.paraphrase.jobs.get.rpc',
6
5
  LIST_JOBS: 'tools.paraphrase.jobs.list.rpc',
@@ -7,8 +7,7 @@ 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
- tokenReservationId: z.string().uuid(),
11
- precalculatedPrice: z.number(),
10
+ userBalance: z.number(),
12
11
  });
13
12
  export type Request = z.infer<typeof RequestSchema>;
14
13
 
@@ -7,7 +7,6 @@ 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';
11
10
  export * from './reposition-slide-outline.command';
12
11
  export * from './update-slide-outline.command';
13
12
  export * from './update-presentation.command';
@@ -19,7 +19,6 @@ 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(),
23
22
  lastContentUpdateAt: z.date().nullable(),
24
23
  lastPptxExportedAt: z.date().nullable(),
25
24
  createdAt: z.date(),
@@ -4,7 +4,6 @@ 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',
8
7
  GENERATE_AND_INSERT_SLIDE: 'tools.presentation.generate-and-insert-slide.rpc',
9
8
  UPDATE_PRESENTATION_OUTLINE: 'tools.presentation.update-presentation-outline.rpc',
10
9
  LIST_PRESENTATIONS: 'tools.presentation.list-presentations.rpc',
@@ -3,5 +3,4 @@ export * from './delete-all-stt-jobs.command';
3
3
  export * from './retry-stt-job.command';
4
4
  export * from './set-reaction-to-stt-job.command';
5
5
  export * from './stt.command';
6
- export * from './get-stt-price.command';
7
6
  export * from './update-stt-job-title.command';
@@ -5,10 +5,9 @@ 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(),
8
9
  userId: z.string().uuid().nullable().optional(),
9
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
- tokenReservationId: z.string().uuid(),
11
- precalculatedPrice: z.number(),
12
11
  });
13
12
  export type Request = z.infer<typeof RequestSchema>;
14
13
 
@@ -6,13 +6,12 @@ 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(),
9
10
  modelId: z.string(),
10
11
  fileId: z.string(),
11
12
  fileKey: z.string(),
12
13
  fileUrl: z.string(),
13
14
  durationInSeconds: z.number(),
14
- tokenReservationId: z.string().uuid(),
15
- precalculatedPrice: z.number(),
16
15
  });
17
16
  export type Request = z.infer<typeof RequestSchema>;
18
17
 
@@ -19,7 +19,6 @@ 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(),
23
22
  isDeleted: z.boolean(),
24
23
  createdAt: z.date(),
25
24
  completedAt: z.date().nullable(),
@@ -1,6 +1,5 @@
1
1
  export const STT_AMQP_ROUTES = {
2
2
  EXECUTE: 'tools.stt.execute.rpc',
3
- GET_PRICE: 'tools.stt.get-price.rpc',
4
3
  CONFIG: 'tools.stt.config.rpc',
5
4
  GET_JOB: 'tools.stt.jobs.get.rpc',
6
5
  LIST_JOBS: 'tools.stt.jobs.list.rpc',
@@ -1,2 +1 @@
1
1
  export * from './tool-job-complete.event';
2
- export * from './tool-job-failed.event';
@@ -5,7 +5,6 @@ export const ToolJobSchema = z.object({
5
5
  userId: z.string().nullable(),
6
6
  unregisteredUserId: z.string().nullable(),
7
7
  price: z.number(),
8
- tokenReservationId: z.string().nullable().optional(),
9
8
  createdAt: z.date(),
10
9
  updatedAt: z.date(),
11
10
  });
@@ -1,6 +1,5 @@
1
1
  export const TOOLS_AMQP_ROUTES = {
2
2
  JOB_COMPLETED: 'tools.job.completed',
3
- JOB_FAILED: 'tools.job.failed',
4
3
  FIND_ALL: 'tools.find.all.rpc',
5
4
  GET_GLOBAL_TOOLS_CONFIG: 'tools.config.rpc',
6
5
  GET_TOOLS_WITH_CONFIGS: 'tools.with-configs.rpc',
@@ -3,5 +3,4 @@ export * from './delete-all-tts-jobs.command';
3
3
  export * from './retry-tts-job.command';
4
4
  export * from './set-reaction-to-tts-job.command';
5
5
  export * from './tts.command';
6
- export * from './get-tts-price.command';
7
6
  export * from './update-tts-job-title.command';
@@ -5,10 +5,9 @@ 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(),
8
9
  userId: z.string().uuid().nullable().optional(),
9
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
- tokenReservationId: z.string().uuid(),
11
- precalculatedPrice: z.number(),
12
11
  });
13
12
  export type Request = z.infer<typeof RequestSchema>;
14
13
 
@@ -6,6 +6,7 @@ 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(),
9
10
  modelId: z.string(),
10
11
  voiceId: z.string(),
11
12
  userInput: z.string(),
@@ -17,8 +18,6 @@ export namespace TTSCommand {
17
18
  style: z.number().optional(),
18
19
  })
19
20
  .optional(),
20
- tokenReservationId: z.string().uuid(),
21
- precalculatedPrice: z.number(),
22
21
  });
23
22
  export type Request = z.infer<typeof RequestSchema>;
24
23
 
@@ -25,7 +25,6 @@ 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(),
29
28
  isDeleted: z.boolean(),
30
29
  params: TTSJobParamsSchema,
31
30
  createdAt: z.date(),
@@ -1,6 +1,5 @@
1
1
  export const TTS_AMQP_ROUTES = {
2
2
  EXECUTE: 'tools.tts.execute.rpc',
3
- GET_PRICE: 'tools.tts.get-price.rpc',
4
3
  CONFIG: 'tools.tts.config.rpc',
5
4
  GET_JOB: 'tools.tts.jobs.get.rpc',
6
5
  LIST_JOBS: 'tools.tts.jobs.list.rpc',
@@ -3,7 +3,6 @@ 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';
7
6
  export * from './update-video-job-title.command';
8
7
  export * from './video-model';
9
8
  export * from './update-published-status-video-jobs.command';
@@ -6,13 +6,12 @@ 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(),
9
10
  userId: z.string().uuid().nullable().optional(),
10
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
11
12
  prompt: z.string().optional(),
12
13
  modelId: z.string().uuid().optional(),
13
14
  params: VideoGenerationRequestParamsSchema.optional(),
14
- tokenReservationId: z.string().uuid(),
15
- precalculatedPrice: z.number(),
16
15
  });
17
16
  export type Request = z.infer<typeof RequestSchema>;
18
17
 
@@ -8,10 +8,9 @@ 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(),
11
12
  modelId: z.string(),
12
13
  params: VideoGenerationRequestParamsSchema,
13
- tokenReservationId: z.string().uuid(),
14
- precalculatedPrice: z.number(),
15
14
  });
16
15
  export type Request = z.infer<typeof RequestSchema>;
17
16
 
@@ -34,7 +34,6 @@ export const VideoJobSchema = z.object({
34
34
  attempts: z.array(z.any()),
35
35
  userId: z.string().nullable().optional(),
36
36
  unregisteredUserId: z.string().nullable().optional(),
37
- tokenReservationId: z.string().nullable().optional(),
38
37
  isDeleted: z.boolean(),
39
38
  createdAt: z.date(),
40
39
  completedAt: z.date().nullable().optional(),
@@ -1,6 +1,5 @@
1
1
  export const VIDEO_AMQP_ROUTES = {
2
2
  EXECUTE: 'tools.video.execute.rpc',
3
- GET_PRICE: 'tools.video.get-price.rpc',
4
3
  CONFIG: 'tools.video.config.rpc',
5
4
  GET_JOB: 'tools.video.jobs.get.rpc',
6
5
  LIST_JOBS: 'tools.video.jobs.list.rpc',
@@ -10,9 +10,8 @@ export namespace EditVideoCommand {
10
10
  inputVideoId: z.string().uuid(),
11
11
  inputVideoUrl: z.string(),
12
12
  duration: z.number(),
13
+ userBalance: z.number(),
13
14
  modelId: z.string().uuid(),
14
- tokenReservationId: z.string().uuid(),
15
- precalculatedPrice: z.number(),
16
15
  });
17
16
  export type Request = z.infer<typeof RequestSchema>;
18
17
 
@@ -5,5 +5,4 @@ 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';
9
8
  export * from './video-editor-model';
@@ -5,6 +5,7 @@ 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(),
8
9
  userId: z.string().uuid().nullable().optional(),
9
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
11
  prompt: z.string().optional(),
@@ -12,8 +13,6 @@ export namespace RetryVideoEditorJobCommand {
12
13
  inputVideoUrl: z.string().optional(),
13
14
  duration: z.number().optional(),
14
15
  modelId: z.string().uuid().optional(),
15
- tokenReservationId: z.string().uuid(),
16
- precalculatedPrice: z.number(),
17
16
  });
18
17
  export type Request = z.infer<typeof RequestSchema>;
19
18
 
@@ -21,7 +21,6 @@ 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(),
25
24
  isPublished: z.boolean(),
26
25
  postId: z.string().nullable(),
27
26
  isDeleted: z.boolean(),
@@ -1,6 +1,5 @@
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',
4
3
  CONFIG: 'tools.video-editor.config.rpc',
5
4
  GET_JOB: 'tools.video-editor.jobs.get.rpc',
6
5
  LIST_JOBS: 'tools.video-editor.jobs.list.rpc',
@@ -7,8 +7,7 @@ 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
- tokenReservationId: z.string().uuid(),
11
- precalculatedPrice: z.number(),
10
+ userBalance: z.number(),
12
11
  modelId: z.string(),
13
12
  });
14
13
  export type Request = z.infer<typeof RequestSchema>;
@@ -2,9 +2,9 @@ export * from './create-writer-document.command';
2
2
  export * from './delete-writer-document.command';
3
3
  export * from './delete-all-user-writer-documents.command';
4
4
  export * from './update-writer-document-outline.command';
5
+ export * from './update-writer-document-title-page.command';
5
6
  export * from './export-writer-document-as-docx.command';
6
7
  export * from './generate-document-contents.command';
7
- export * from './get-writer-content-generation-price.command';
8
8
  export * from './writer-paraphrase.command';
9
9
  export * from './writer-extend-text.command';
10
10
  export * from './writer-shorten-text.command';
@@ -1,13 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common';
3
- import { WriterDocumentOutlineSchema, WriterDocumentTitlePageSchema } from '../models';
3
+ import { WriterDocumentOutlineSchema } from '../models';
4
4
 
5
5
  export namespace UpdateWriterDocumentOutlineCommand {
6
6
  export const RequestSchema = z.object({
7
7
  userId: z.string().uuid().nullable().optional(),
8
8
  unregisteredUserId: z.string().uuid().nullable().optional(),
9
9
  documentId: z.string().uuid(),
10
- titlePage: WriterDocumentTitlePageSchema,
11
10
  data: WriterDocumentOutlineSchema,
12
11
  });
13
12
  export type Request = z.infer<typeof RequestSchema>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common';
3
+ import { WriterDocumentTitlePageSchema } from '../models';
4
+
5
+ export namespace UpdateWriterDocumentTitlePageCommand {
6
+ export const RequestSchema = z.object({
7
+ userId: z.string().uuid().nullable().optional(),
8
+ unregisteredUserId: z.string().uuid().nullable().optional(),
9
+ documentId: z.string().uuid(),
10
+ titlePage: WriterDocumentTitlePageSchema,
11
+ });
12
+ export type Request = z.infer<typeof RequestSchema>;
13
+
14
+ export const ResponseSchema = ICommandResponseSchema(WriterDocumentTitlePageSchema);
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -1,15 +1,13 @@
1
1
  import { z } from 'zod';
2
2
 
3
- export const WriterDocumentTitlePageSchema = z
4
- .object({
5
- fullName: z.string().min(1).max(200).optional().nullable(),
6
- city: z.string().min(1).max(200).optional().nullable(),
7
- institution: z.string().min(1).max(300).optional().nullable(),
8
- faculty: z.string().min(1).max(200).optional().nullable(),
9
- specialty: z.string().min(1).max(200).optional().nullable(),
10
- group: z.string().min(1).max(100).optional().nullable(),
11
- subject: z.string().min(1).max(200).optional().nullable(),
12
- })
13
- .nullable();
3
+ export const WriterDocumentTitlePageSchema = z.object({
4
+ fullName: z.string().min(1).max(200).optional().nullable(),
5
+ city: z.string().min(1).max(200).optional().nullable(),
6
+ institution: z.string().min(1).max(300).optional().nullable(),
7
+ faculty: z.string().min(1).max(200).optional().nullable(),
8
+ specialty: z.string().min(1).max(200).optional().nullable(),
9
+ group: z.string().min(1).max(100).optional().nullable(),
10
+ subject: z.string().min(1).max(200).optional().nullable(),
11
+ });
14
12
 
15
13
  export type WriterDocumentTitlePage = z.infer<typeof WriterDocumentTitlePageSchema>;