@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.
Files changed (141) hide show
  1. package/build/image-editor/commands/get-image-editor-price.command.js +24 -0
  2. package/build/image-editor/commands/image-editor.command.js +2 -1
  3. package/build/image-editor/commands/index.js +1 -0
  4. package/build/image-editor/commands/retry-image-editor-job.command.js +2 -1
  5. package/build/image-editor/commands/update-published-status-image-editor-jobs.command.js +7 -1
  6. package/build/image-editor/models/image-editor-job.schema.js +2 -0
  7. package/build/image-editor/routes/image-editor.amqp.routes.js +1 -0
  8. package/build/image-generation/commands/execute-image-generation.command.js +3 -2
  9. package/build/image-generation/commands/get-image-generation-price.command.js +22 -0
  10. package/build/image-generation/commands/index.js +1 -0
  11. package/build/image-generation/commands/retry-image-generation-job.command.js +4 -3
  12. package/build/image-generation/commands/update-published-status-image-generation-jobs.command.js +7 -1
  13. package/build/image-generation/models/image-generation-job.schema.js +2 -0
  14. package/build/image-generation/queries/find-image-generation-job-by-id.query.js +1 -5
  15. package/build/image-generation/routes/image-generation.amqp.routes.js +1 -0
  16. package/build/music/commands/generate-music.command.js +2 -1
  17. package/build/music/commands/get-music-price.command.js +19 -0
  18. package/build/music/commands/index.js +1 -0
  19. package/build/music/commands/retry-music-job.command.js +2 -1
  20. package/build/music/commands/update-published-status-music-jobs.command.js +7 -1
  21. package/build/music/models/music-job.schema.js +2 -0
  22. package/build/music/routes/music.amqp.routes.js +1 -0
  23. package/build/paraphrase/commands/get-paraphrase-price.command.js +15 -0
  24. package/build/paraphrase/commands/index.js +1 -0
  25. package/build/paraphrase/commands/paraphrase.command.js +2 -1
  26. package/build/paraphrase/commands/retry-paraphrase-job.command.js +2 -1
  27. package/build/paraphrase/models/paraphrase-job.schema.js +1 -0
  28. package/build/paraphrase/routes/paraphrase.amqp.routes.js +1 -0
  29. package/build/presentation/commands/generate-slides.command.js +2 -1
  30. package/build/presentation/commands/get-presentation-slides-generation-price.command.js +15 -0
  31. package/build/presentation/commands/index.js +1 -0
  32. package/build/presentation/models/presentation.schema.js +1 -0
  33. package/build/presentation/routes/presentation.routes.js +1 -0
  34. package/build/stt/commands/get-stt-price.command.js +16 -0
  35. package/build/stt/commands/index.js +1 -0
  36. package/build/stt/commands/retry-stt-job.command.js +2 -1
  37. package/build/stt/commands/stt.command.js +2 -1
  38. package/build/stt/models/stt-job.schema.js +1 -0
  39. package/build/stt/routes/stt.amqp.routes.js +1 -0
  40. package/build/tools/events/index.js +1 -0
  41. package/build/tools/events/tool-job-failed.event.js +14 -0
  42. package/build/tools/models/tool-job.schema.js +1 -0
  43. package/build/tools/routes/tools.aqmp.routes.js +1 -0
  44. package/build/tts/commands/get-tts-price.command.js +16 -0
  45. package/build/tts/commands/index.js +1 -0
  46. package/build/tts/commands/retry-tts-job.command.js +2 -1
  47. package/build/tts/commands/tts.command.js +2 -1
  48. package/build/tts/models/tts-job.schema.js +1 -0
  49. package/build/tts/routes/tts.amqp.routes.js +1 -0
  50. package/build/video/commands/get-video-price.command.js +17 -0
  51. package/build/video/commands/index.js +1 -0
  52. package/build/video/commands/retry-video-job.command.js +2 -1
  53. package/build/video/commands/update-published-status-video-jobs.command.js +7 -1
  54. package/build/video/commands/video.command.js +2 -1
  55. package/build/video/models/video-job.schema.js +3 -0
  56. package/build/video/routes/video.amqp.routes.js +1 -0
  57. package/build/video-editor/commands/edit-video.command.js +2 -1
  58. package/build/video-editor/commands/get-video-editor-price.command.js +15 -0
  59. package/build/video-editor/commands/index.js +1 -0
  60. package/build/video-editor/commands/retry-video-editor-job.command.js +2 -1
  61. package/build/video-editor/commands/update-published-status-video-editor-jobs.command.js +7 -1
  62. package/build/video-editor/models/video-editor-job.schema.js +2 -0
  63. package/build/video-editor/queries/find-video-editor-job-by-id.query.js +1 -5
  64. package/build/video-editor/routes/video-editor.amqp.routes.js +1 -0
  65. package/build/writer/commands/generate-document-contents.command.js +2 -1
  66. package/build/writer/commands/get-writer-content-generation-price.command.js +16 -0
  67. package/build/writer/commands/index.js +1 -0
  68. package/build/writer/models/writer-document.schema.js +1 -0
  69. package/build/writer/routes/writer.routes.js +1 -0
  70. package/image-editor/commands/get-image-editor-price.command.ts +26 -0
  71. package/image-editor/commands/image-editor.command.ts +2 -1
  72. package/image-editor/commands/index.ts +1 -0
  73. package/image-editor/commands/retry-image-editor-job.command.ts +2 -1
  74. package/image-editor/commands/update-published-status-image-editor-jobs.command.ts +9 -3
  75. package/image-editor/models/image-editor-job.schema.ts +2 -0
  76. package/image-editor/routes/image-editor.amqp.routes.ts +1 -0
  77. package/image-generation/commands/execute-image-generation.command.ts +3 -2
  78. package/image-generation/commands/get-image-generation-price.command.ts +24 -0
  79. package/image-generation/commands/index.ts +1 -0
  80. package/image-generation/commands/retry-image-generation-job.command.ts +4 -3
  81. package/image-generation/commands/update-published-status-image-generation-jobs.command.ts +9 -3
  82. package/image-generation/models/image-generation-job.schema.ts +2 -0
  83. package/image-generation/queries/find-image-generation-job-by-id.query.ts +5 -9
  84. package/image-generation/routes/image-generation.amqp.routes.ts +1 -0
  85. package/music/commands/generate-music.command.ts +2 -1
  86. package/music/commands/get-music-price.command.ts +21 -0
  87. package/music/commands/index.ts +1 -0
  88. package/music/commands/retry-music-job.command.ts +2 -1
  89. package/music/commands/update-published-status-music-jobs.command.ts +9 -3
  90. package/music/models/music-job.schema.ts +2 -0
  91. package/music/routes/music.amqp.routes.ts +1 -0
  92. package/package.json +1 -1
  93. package/paraphrase/commands/get-paraphrase-price.command.ts +16 -0
  94. package/paraphrase/commands/index.ts +1 -0
  95. package/paraphrase/commands/paraphrase.command.ts +2 -1
  96. package/paraphrase/commands/retry-paraphrase-job.command.ts +2 -1
  97. package/paraphrase/models/paraphrase-job.schema.ts +1 -0
  98. package/paraphrase/routes/paraphrase.amqp.routes.ts +1 -0
  99. package/presentation/commands/generate-slides.command.ts +2 -1
  100. package/presentation/commands/get-presentation-slides-generation-price.command.ts +16 -0
  101. package/presentation/commands/index.ts +1 -0
  102. package/presentation/models/presentation.schema.ts +1 -0
  103. package/presentation/routes/presentation.routes.ts +1 -0
  104. package/stt/commands/get-stt-price.command.ts +17 -0
  105. package/stt/commands/index.ts +1 -0
  106. package/stt/commands/retry-stt-job.command.ts +2 -1
  107. package/stt/commands/stt.command.ts +2 -1
  108. package/stt/models/stt-job.schema.ts +1 -0
  109. package/stt/routes/stt.amqp.routes.ts +1 -0
  110. package/tools/enums/index.ts +1 -1
  111. package/tools/enums/job-request-origin.enum.ts +3 -3
  112. package/tools/events/index.ts +1 -0
  113. package/tools/events/tool-job-failed.event.ts +13 -0
  114. package/tools/models/tool-job.schema.ts +1 -0
  115. package/tools/routes/tools.aqmp.routes.ts +1 -0
  116. package/tts/commands/get-tts-price.command.ts +17 -0
  117. package/tts/commands/index.ts +1 -0
  118. package/tts/commands/retry-tts-job.command.ts +2 -1
  119. package/tts/commands/tts.command.ts +2 -1
  120. package/tts/models/tts-job.schema.ts +1 -0
  121. package/tts/routes/tts.amqp.routes.ts +1 -0
  122. package/video/commands/get-video-price.command.ts +18 -0
  123. package/video/commands/index.ts +1 -0
  124. package/video/commands/retry-video-job.command.ts +2 -1
  125. package/video/commands/update-published-status-video-jobs.command.ts +9 -3
  126. package/video/commands/video.command.ts +2 -1
  127. package/video/models/video-job.schema.ts +3 -0
  128. package/video/routes/video.amqp.routes.ts +1 -0
  129. package/video-editor/commands/edit-video.command.ts +2 -1
  130. package/video-editor/commands/get-video-editor-price.command.ts +16 -0
  131. package/video-editor/commands/index.ts +1 -0
  132. package/video-editor/commands/retry-video-editor-job.command.ts +2 -1
  133. package/video-editor/commands/update-published-status-video-editor-jobs.command.ts +9 -3
  134. package/video-editor/models/video-editor-job.schema.ts +2 -0
  135. package/video-editor/queries/find-video-editor-job-by-id.query.ts +5 -9
  136. package/video-editor/routes/video-editor.amqp.routes.ts +1 -0
  137. package/writer/commands/generate-document-contents.command.ts +2 -1
  138. package/writer/commands/get-writer-content-generation-price.command.ts +17 -0
  139. package/writer/commands/index.ts +1 -0
  140. package/writer/models/writer-document.schema.ts +1 -0
  141. package/writer/routes/writer.routes.ts +1 -0
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetImageEditorPriceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const common_1 = require("../../common");
7
+ var GetImageEditorPriceCommand;
8
+ (function (GetImageEditorPriceCommand) {
9
+ GetImageEditorPriceCommand.RequestSchema = zod_1.z.object({
10
+ modelId: zod_1.z.string().uuid(),
11
+ userId: zod_1.z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
+ prompt: zod_1.z.string(),
14
+ params: zod_1.z.object({
15
+ attachedFiles: zod_1.z.array(common_1.AttachedFileSchema),
16
+ systemPromptId: zod_1.z.string().optional(),
17
+ }),
18
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
19
+ });
20
+ GetImageEditorPriceCommand.ResponseDataSchema = zod_1.z.object({
21
+ price: zod_1.z.number(),
22
+ });
23
+ GetImageEditorPriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetImageEditorPriceCommand.ResponseDataSchema);
24
+ })(GetImageEditorPriceCommand || (exports.GetImageEditorPriceCommand = GetImageEditorPriceCommand = {}));
@@ -11,13 +11,14 @@ var ImageEditorCommand;
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: zod_1.z.object({
17
16
  attachedFiles: zod_1.z.array(common_1.AttachedFileSchema),
18
17
  systemPromptId: zod_1.z.string().optional(),
19
18
  }),
20
19
  userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
20
+ tokenReservationId: zod_1.z.string().uuid(),
21
+ precalculatedPrice: zod_1.z.number(),
21
22
  });
22
23
  ImageEditorCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageEditorJobSchema);
23
24
  })(ImageEditorCommand || (exports.ImageEditorCommand = ImageEditorCommand = {}));
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./delete-image-editor-job-by-uuid.command"), exports);
18
18
  __exportStar(require("./delete-all-image-editor-jobs.command"), exports);
19
+ __exportStar(require("./get-image-editor-price.command"), exports);
19
20
  __exportStar(require("./retry-image-editor-job.command"), exports);
20
21
  __exportStar(require("./set-reaction-to-image-editor-job.command"), exports);
21
22
  __exportStar(require("./image-editor.command"), exports);
@@ -8,10 +8,11 @@ var RetryImageEditorJobCommand;
8
8
  (function (RetryImageEditorJobCommand) {
9
9
  RetryImageEditorJobCommand.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
  userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
14
+ tokenReservationId: zod_1.z.string().uuid(),
15
+ precalculatedPrice: zod_1.z.number(),
15
16
  modelId: zod_1.z.string().optional(),
16
17
  prompt: zod_1.z.string().optional(),
17
18
  params: models_1.ImageEditorJobParamsSchema.optional(),
@@ -12,8 +12,14 @@ var UpdatePublishedStatusImageEditorJobsCommand;
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  }),
15
- data: zod_1.z.object({
15
+ data: zod_1.z
16
+ .object({
16
17
  isPublished: zod_1.z.boolean(),
18
+ postId: zod_1.z.string().nullable().optional(),
19
+ })
20
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
21
+ message: 'Post ID is required when job is published',
22
+ path: ['postId'],
17
23
  }),
18
24
  });
19
25
  UpdatePublishedStatusImageEditorJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageEditorJobSchema);
@@ -26,7 +26,9 @@ exports.ImageEditorJobSchema = zod_1.z.object({
26
26
  userId: zod_1.z.string().nullable().optional(),
27
27
  unregisteredUserId: zod_1.z.string().nullable().optional(),
28
28
  isPublished: zod_1.z.boolean(),
29
+ postId: zod_1.z.string().nullable(),
29
30
  isDeleted: zod_1.z.boolean(),
31
+ tokenReservationId: zod_1.z.string().nullable().optional(),
30
32
  createdAt: zod_1.z.date(),
31
33
  completedAt: zod_1.z.date().nullable().optional(),
32
34
  updatedAt: zod_1.z.date(),
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IMAGE_EDITOR_AMQP_ROUTES = void 0;
4
4
  exports.IMAGE_EDITOR_AMQP_ROUTES = {
5
5
  EXECUTE: 'tools.image.execute.rpc',
6
+ GET_PRICE: 'tools.image.get-price.rpc',
6
7
  CONFIG: 'tools.image.config.rpc',
7
8
  GET_JOB: 'tools.image.jobs.get.rpc',
8
9
  LIST_JOBS: 'tools.image.jobs.list.rpc',
@@ -3,20 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExecuteImageGenerationCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const command_response_schema_1 = require("../../common/models/command-response.schema");
6
- const models_1 = require("../models");
7
6
  const tools_1 = require("../../tools");
7
+ const models_1 = require("../models");
8
8
  var ExecuteImageGenerationCommand;
9
9
  (function (ExecuteImageGenerationCommand) {
10
10
  ExecuteImageGenerationCommand.RequestSchema = zod_1.z.object({
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().uuid(),
16
15
  params: models_1.ImageGenerationRequestParamsSchema,
17
16
  presetId: zod_1.z.string().uuid().nullable().optional(),
18
17
  origin: zod_1.z.nativeEnum(tools_1.JOB_REQUEST_ORIGIN).default(tools_1.JOB_REQUEST_ORIGIN.API),
19
18
  userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
19
+ tokenReservationId: zod_1.z.string().uuid(),
20
+ precalculatedPrice: zod_1.z.number(),
20
21
  });
21
22
  ExecuteImageGenerationCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
22
23
  })(ExecuteImageGenerationCommand || (exports.ExecuteImageGenerationCommand = ExecuteImageGenerationCommand = {}));
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetImageGenerationPriceCommand = 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 GetImageGenerationPriceCommand;
8
+ (function (GetImageGenerationPriceCommand) {
9
+ GetImageGenerationPriceCommand.RequestSchema = zod_1.z.object({
10
+ modelId: zod_1.z.string().uuid(),
11
+ userId: zod_1.z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
+ prompt: zod_1.z.string(),
14
+ params: models_1.ImageGenerationRequestParamsSchema,
15
+ presetId: zod_1.z.string().uuid().nullable().optional(),
16
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
17
+ });
18
+ GetImageGenerationPriceCommand.ResponseDataSchema = zod_1.z.object({
19
+ price: zod_1.z.number(),
20
+ });
21
+ GetImageGenerationPriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetImageGenerationPriceCommand.ResponseDataSchema);
22
+ })(GetImageGenerationPriceCommand || (exports.GetImageGenerationPriceCommand = GetImageGenerationPriceCommand = {}));
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./execute-image-generation.command"), exports);
18
18
  __exportStar(require("./forward-image-generation-job.command"), exports);
19
+ __exportStar(require("./get-image-generation-price.command"), exports);
19
20
  __exportStar(require("./save-image-generation-job.command"), exports);
20
21
  __exportStar(require("./soft-delete-image-generation-job-by-uuid.command"), exports);
21
22
  __exportStar(require("./soft-delete-image-generation-jobs-by-criteria.command"), exports);
@@ -10,12 +10,13 @@ var RetryImageGenerationJobCommand;
10
10
  uuid: 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
- prompt: zod_1.z.string().optional(),
14
- userBalance: zod_1.z.number(),
13
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
14
+ tokenReservationId: zod_1.z.string().uuid(),
15
+ precalculatedPrice: zod_1.z.number(),
15
16
  modelId: zod_1.z.string().uuid().optional(),
17
+ prompt: zod_1.z.string().optional(),
16
18
  params: models_1.ImageGenerationRequestParamsSchema.optional(),
17
19
  presetId: zod_1.z.string().uuid().nullable().optional(),
18
- userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
19
20
  });
20
21
  RetryImageGenerationJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
21
22
  })(RetryImageGenerationJobCommand || (exports.RetryImageGenerationJobCommand = RetryImageGenerationJobCommand = {}));
@@ -12,8 +12,14 @@ var UpdatePublishedStatusImageGenerationJobsCommand;
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  }),
15
- data: zod_1.z.object({
15
+ data: zod_1.z
16
+ .object({
16
17
  isPublished: zod_1.z.boolean(),
18
+ postId: zod_1.z.string().nullable().optional(),
19
+ })
20
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
21
+ message: 'Post ID is required when job is published',
22
+ path: ['postId'],
17
23
  }),
18
24
  });
19
25
  UpdatePublishedStatusImageGenerationJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
@@ -29,8 +29,10 @@ exports.ImageGenerationJobSchema = zod_1.z.object({
29
29
  userId: zod_1.z.string().nullable().optional(),
30
30
  unregisteredUserId: zod_1.z.string().nullable().optional(),
31
31
  isPublished: zod_1.z.boolean(),
32
+ postId: zod_1.z.string().nullable(),
32
33
  isDeleted: zod_1.z.boolean(),
33
34
  internalError: zod_1.z.string().nullable(),
35
+ tokenReservationId: zod_1.z.string().nullable().optional(),
34
36
  createdAt: zod_1.z.date(),
35
37
  updatedAt: zod_1.z.date(),
36
38
  });
@@ -6,14 +6,10 @@ const command_response_schema_1 = require("../../common/models/command-response.
6
6
  const models_1 = require("../models");
7
7
  var FindImageGenerationJobByIdQuery;
8
8
  (function (FindImageGenerationJobByIdQuery) {
9
- FindImageGenerationJobByIdQuery.RequestSchema = zod_1.z
10
- .object({
9
+ FindImageGenerationJobByIdQuery.RequestSchema = zod_1.z.object({
11
10
  uuid: zod_1.z.string(),
12
11
  userId: zod_1.z.string().uuid().nullable().optional(),
13
12
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
- })
15
- .refine((data) => data.userId || data.unregisteredUserId, {
16
- message: 'Either userId or unregisteredUserId must be provided',
17
13
  });
18
14
  FindImageGenerationJobByIdQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
19
15
  })(FindImageGenerationJobByIdQuery || (exports.FindImageGenerationJobByIdQuery = FindImageGenerationJobByIdQuery = {}));
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IMAGE_GENERATION_AMQP_ROUTES = void 0;
4
4
  exports.IMAGE_GENERATION_AMQP_ROUTES = {
5
5
  EXECUTE: 'tools.image-generation.execute.rpc',
6
+ GET_PRICE: 'tools.image-generation.get-price.rpc',
6
7
  CONFIG: 'tools.image-generation.config.rpc',
7
8
  FORWARD_JOB: 'tools.image-generation.jobs.forward.rpc',
8
9
  GET_JOB: 'tools.image-generation.jobs.get.rpc',
@@ -10,9 +10,10 @@ var GenerateMusicCommand;
10
10
  GenerateMusicCommand.RequestSchema = zod_1.z.object({
11
11
  userId: zod_1.z.string().uuid().nullable().optional(),
12
12
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
- userBalance: zod_1.z.number(),
14
13
  modelId: zod_1.z.string(),
15
14
  params: models_1.MusicJobParamsSchema,
15
+ tokenReservationId: zod_1.z.string().uuid(),
16
+ precalculatedPrice: zod_1.z.number(),
16
17
  });
17
18
  GenerateMusicCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(music_job_schema_1.MusicJobSchema);
18
19
  })(GenerateMusicCommand || (exports.GenerateMusicCommand = GenerateMusicCommand = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetMusicPriceCommand = 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 GetMusicPriceCommand;
8
+ (function (GetMusicPriceCommand) {
9
+ GetMusicPriceCommand.RequestSchema = zod_1.z.object({
10
+ modelId: zod_1.z.string(),
11
+ userId: zod_1.z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
+ params: models_1.MusicJobParamsSchema,
14
+ });
15
+ GetMusicPriceCommand.ResponseDataSchema = zod_1.z.object({
16
+ price: zod_1.z.number(),
17
+ });
18
+ GetMusicPriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetMusicPriceCommand.ResponseDataSchema);
19
+ })(GetMusicPriceCommand || (exports.GetMusicPriceCommand = GetMusicPriceCommand = {}));
@@ -19,6 +19,7 @@ __exportStar(require("./delete-all-music-jobs.command"), exports);
19
19
  __exportStar(require("./retry-music-job.command"), exports);
20
20
  __exportStar(require("./set-reaction-to-music-job.command"), exports);
21
21
  __exportStar(require("./generate-music.command"), exports);
22
+ __exportStar(require("./get-music-price.command"), exports);
22
23
  __exportStar(require("./update-music-job-title.command"), exports);
23
24
  __exportStar(require("./convert-to-wav.command"), exports);
24
25
  __exportStar(require("./generate-lyrics.command"), exports);
@@ -8,9 +8,10 @@ var RetryMusicJobCommand;
8
8
  (function (RetryMusicJobCommand) {
9
9
  RetryMusicJobCommand.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(),
13
+ tokenReservationId: zod_1.z.string().uuid(),
14
+ precalculatedPrice: zod_1.z.number(),
14
15
  modelId: zod_1.z.string().uuid().optional(),
15
16
  params: music_job_schema_1.MusicJobParamsSchema.optional(),
16
17
  });
@@ -12,8 +12,14 @@ var UpdatePublishedStatusMusicJobsCommand;
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  }),
15
- data: zod_1.z.object({
15
+ data: zod_1.z
16
+ .object({
16
17
  isPublished: zod_1.z.boolean(),
18
+ postId: zod_1.z.string().nullable().optional(),
19
+ })
20
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
21
+ message: 'Post ID is required when job is published',
22
+ path: ['postId'],
17
23
  }),
18
24
  });
19
25
  UpdatePublishedStatusMusicJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.MusicJobSchema);
@@ -47,7 +47,9 @@ exports.MusicJobSchema = zod_1.z.object({
47
47
  userId: zod_1.z.string().nullable().optional(),
48
48
  unregisteredUserId: zod_1.z.string().nullable().optional(),
49
49
  isPublished: zod_1.z.boolean(),
50
+ postId: zod_1.z.string().nullable(),
50
51
  isDeleted: zod_1.z.boolean(),
52
+ tokenReservationId: zod_1.z.string().nullable().optional(),
51
53
  createdAt: zod_1.z.date(),
52
54
  completedAt: zod_1.z.date().nullable().optional(),
53
55
  updatedAt: zod_1.z.date(),
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MUSIC_AMQP_ROUTES = void 0;
4
4
  exports.MUSIC_AMQP_ROUTES = {
5
5
  EXECUTE: 'tools.music.execute.rpc',
6
+ GET_PRICE: 'tools.music.get-price.rpc',
6
7
  GENERATE_LYRICS: 'tools.music.generate-lyrics.rpc',
7
8
  CONVERT_TO_WAV: 'tools.music.convert-to-wav.rpc',
8
9
  CONFIG: 'tools.music.config.rpc',
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetParaphrasePriceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ var GetParaphrasePriceCommand;
7
+ (function (GetParaphrasePriceCommand) {
8
+ GetParaphrasePriceCommand.RequestSchema = zod_1.z.object({
9
+ typeId: zod_1.z.string().uuid(),
10
+ });
11
+ GetParaphrasePriceCommand.ResponseDataSchema = zod_1.z.object({
12
+ price: zod_1.z.number(),
13
+ });
14
+ GetParaphrasePriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetParaphrasePriceCommand.ResponseDataSchema);
15
+ })(GetParaphrasePriceCommand || (exports.GetParaphrasePriceCommand = GetParaphrasePriceCommand = {}));
@@ -20,3 +20,4 @@ __exportStar(require("./delete-all-paraphrase-jobs.command"), exports);
20
20
  __exportStar(require("./set-reaction-to-paraphrase-job.command"), exports);
21
21
  __exportStar(require("./update-paraphrase-job-title.command"), exports);
22
22
  __exportStar(require("./retry-paraphrase-job.command"), exports);
23
+ __exportStar(require("./get-paraphrase-price.command"), exports);
@@ -10,11 +10,12 @@ var ParaphraseCommand;
10
10
  ParaphraseCommand.RequestSchema = zod_1.z.object({
11
11
  userId: zod_1.z.string().uuid().nullable().optional(),
12
12
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
- userBalance: zod_1.z.number(),
14
13
  prompt: zod_1.z.string(),
15
14
  typeId: zod_1.z.string().uuid(),
16
15
  styleId: zod_1.z.string().uuid(),
17
16
  intensity: zod_1.z.nativeEnum(enums_1.PARAPHRASING_INTENSITY),
17
+ tokenReservationId: zod_1.z.string().uuid(),
18
+ precalculatedPrice: zod_1.z.number(),
18
19
  });
19
20
  ParaphraseCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(paraphrase_job_schema_1.ParaphraseJobSchema);
20
21
  })(ParaphraseCommand || (exports.ParaphraseCommand = ParaphraseCommand = {}));
@@ -8,9 +8,10 @@ var RetryParaphraseJobCommand;
8
8
  (function (RetryParaphraseJobCommand) {
9
9
  RetryParaphraseJobCommand.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(),
13
+ tokenReservationId: zod_1.z.string().uuid(),
14
+ precalculatedPrice: zod_1.z.number(),
14
15
  });
15
16
  RetryParaphraseJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(paraphrase_job_schema_1.ParaphraseJobSchema);
16
17
  })(RetryParaphraseJobCommand || (exports.RetryParaphraseJobCommand = RetryParaphraseJobCommand = {}));
@@ -21,6 +21,7 @@ exports.ParaphraseJobSchema = zod_1.z.object({
21
21
  typeId: zod_1.z.string(),
22
22
  styleId: zod_1.z.string(),
23
23
  intensity: zod_1.z.nativeEnum(enums_1.PARAPHRASING_INTENSITY),
24
+ tokenReservationId: zod_1.z.string().nullable().optional(),
24
25
  createdAt: zod_1.z.date(),
25
26
  updatedAt: zod_1.z.date(),
26
27
  completedAt: zod_1.z.date().nullable(),
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PARAPHRASE_AMQP_ROUTES = void 0;
4
4
  exports.PARAPHRASE_AMQP_ROUTES = {
5
5
  EXECUTE: 'tools.paraphrase.execute.rpc',
6
+ GET_PRICE: 'tools.paraphrase.get-price.rpc',
6
7
  CONFIG: 'tools.paraphrase.config.rpc',
7
8
  GET_JOB: 'tools.paraphrase.jobs.get.rpc',
8
9
  LIST_JOBS: 'tools.paraphrase.jobs.list.rpc',
@@ -10,7 +10,8 @@ var GenerateSlidesCommand;
10
10
  uuid: 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
- userBalance: zod_1.z.number(),
13
+ tokenReservationId: zod_1.z.string().uuid(),
14
+ precalculatedPrice: zod_1.z.number(),
14
15
  });
15
16
  GenerateSlidesCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.PresentationSchema);
16
17
  })(GenerateSlidesCommand || (exports.GenerateSlidesCommand = GenerateSlidesCommand = {}));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetPresentationSlidesGenerationPriceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_1 = require("../../common");
6
+ var GetPresentationSlidesGenerationPriceCommand;
7
+ (function (GetPresentationSlidesGenerationPriceCommand) {
8
+ GetPresentationSlidesGenerationPriceCommand.RequestSchema = zod_1.z.object({
9
+ slideCount: zod_1.z.number().int().min(1),
10
+ });
11
+ GetPresentationSlidesGenerationPriceCommand.ResponseDataSchema = zod_1.z.object({
12
+ price: zod_1.z.number(),
13
+ });
14
+ GetPresentationSlidesGenerationPriceCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(GetPresentationSlidesGenerationPriceCommand.ResponseDataSchema);
15
+ })(GetPresentationSlidesGenerationPriceCommand || (exports.GetPresentationSlidesGenerationPriceCommand = GetPresentationSlidesGenerationPriceCommand = {}));
@@ -23,6 +23,7 @@ __exportStar(require("./generate-presentation-outline.command"), exports);
23
23
  __exportStar(require("./generate-and-insert-slide.command"), exports);
24
24
  __exportStar(require("./export-as-pptx.command"), exports);
25
25
  __exportStar(require("./generate-slides.command"), exports);
26
+ __exportStar(require("./get-presentation-slides-generation-price.command"), exports);
26
27
  __exportStar(require("./reposition-slide-outline.command"), exports);
27
28
  __exportStar(require("./update-slide-outline.command"), exports);
28
29
  __exportStar(require("./update-presentation.command"), exports);
@@ -21,6 +21,7 @@ exports.PresentationSchema = zod_1.z.object({
21
21
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
22
22
  slideCount: zod_1.z.number(),
23
23
  isDeleted: zod_1.z.boolean(),
24
+ tokenReservationId: zod_1.z.string().nullable().optional(),
24
25
  lastContentUpdateAt: zod_1.z.date().nullable(),
25
26
  lastPptxExportedAt: zod_1.z.date().nullable(),
26
27
  createdAt: zod_1.z.date(),
@@ -7,6 +7,7 @@ exports.PRESENTATION_AMQP_ROUTES = {
7
7
  FIND_BY_UUID: 'tools.presentation.find-by-uuid.rpc',
8
8
  GENERATE_PRESENTATION_OUTLINE: 'tools.presentation.generate-outline.rpc',
9
9
  GENERATE_PRESENTATION_SLIDES: 'tools.presentation.generate-slides.rpc',
10
+ GET_SLIDES_GENERATION_PRICE: 'tools.presentation.slides.get-price.rpc',
10
11
  GENERATE_AND_INSERT_SLIDE: 'tools.presentation.generate-and-insert-slide.rpc',
11
12
  UPDATE_PRESENTATION_OUTLINE: 'tools.presentation.update-presentation-outline.rpc',
12
13
  LIST_PRESENTATIONS: 'tools.presentation.list-presentations.rpc',
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetSTTPriceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ var GetSTTPriceCommand;
7
+ (function (GetSTTPriceCommand) {
8
+ GetSTTPriceCommand.RequestSchema = zod_1.z.object({
9
+ modelId: zod_1.z.string(),
10
+ durationInSeconds: zod_1.z.number(),
11
+ });
12
+ GetSTTPriceCommand.ResponseDataSchema = zod_1.z.object({
13
+ price: zod_1.z.number(),
14
+ });
15
+ GetSTTPriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetSTTPriceCommand.ResponseDataSchema);
16
+ })(GetSTTPriceCommand || (exports.GetSTTPriceCommand = GetSTTPriceCommand = {}));
@@ -19,4 +19,5 @@ __exportStar(require("./delete-all-stt-jobs.command"), exports);
19
19
  __exportStar(require("./retry-stt-job.command"), exports);
20
20
  __exportStar(require("./set-reaction-to-stt-job.command"), exports);
21
21
  __exportStar(require("./stt.command"), exports);
22
+ __exportStar(require("./get-stt-price.command"), exports);
22
23
  __exportStar(require("./update-stt-job-title.command"), exports);
@@ -8,9 +8,10 @@ var RetrySTTJobCommand;
8
8
  (function (RetrySTTJobCommand) {
9
9
  RetrySTTJobCommand.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(),
13
+ tokenReservationId: zod_1.z.string().uuid(),
14
+ precalculatedPrice: zod_1.z.number(),
14
15
  });
15
16
  RetrySTTJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.STTJobSchema);
16
17
  })(RetrySTTJobCommand || (exports.RetrySTTJobCommand = RetrySTTJobCommand = {}));
@@ -9,12 +9,13 @@ var STTCommand;
9
9
  STTCommand.RequestSchema = zod_1.z.object({
10
10
  userId: zod_1.z.string().uuid().nullable().optional(),
11
11
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
12
- userBalance: zod_1.z.number(),
13
12
  modelId: zod_1.z.string(),
14
13
  fileId: zod_1.z.string(),
15
14
  fileKey: zod_1.z.string(),
16
15
  fileUrl: zod_1.z.string(),
17
16
  durationInSeconds: zod_1.z.number(),
17
+ tokenReservationId: zod_1.z.string().uuid(),
18
+ precalculatedPrice: zod_1.z.number(),
18
19
  });
19
20
  STTCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(stt_job_schema_1.STTJobSchema);
20
21
  })(STTCommand || (exports.STTCommand = STTCommand = {}));
@@ -21,6 +21,7 @@ exports.STTJobSchema = zod_1.z.object({
21
21
  userId: zod_1.z.string().nullable(),
22
22
  unregisteredUserId: zod_1.z.string().nullable(),
23
23
  price: zod_1.z.number(),
24
+ tokenReservationId: zod_1.z.string().nullable().optional(),
24
25
  isDeleted: zod_1.z.boolean(),
25
26
  createdAt: zod_1.z.date(),
26
27
  completedAt: zod_1.z.date().nullable(),
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.STT_AMQP_ROUTES = void 0;
4
4
  exports.STT_AMQP_ROUTES = {
5
5
  EXECUTE: 'tools.stt.execute.rpc',
6
+ GET_PRICE: 'tools.stt.get-price.rpc',
6
7
  CONFIG: 'tools.stt.config.rpc',
7
8
  GET_JOB: 'tools.stt.jobs.get.rpc',
8
9
  LIST_JOBS: 'tools.stt.jobs.list.rpc',
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./tool-job-complete.event"), exports);
18
+ __exportStar(require("./tool-job-failed.event"), exports);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolJobFailedEvent = void 0;
4
+ const enums_1 = require("../enums");
5
+ const models_1 = require("../models");
6
+ const zod_1 = require("zod");
7
+ var ToolJobFailedEvent;
8
+ (function (ToolJobFailedEvent) {
9
+ ToolJobFailedEvent.PayloadSchema = zod_1.z.object({
10
+ job: models_1.ToolJobSchema.extend({
11
+ toolType: zod_1.z.nativeEnum(enums_1.TOOL_TYPE),
12
+ }),
13
+ });
14
+ })(ToolJobFailedEvent || (exports.ToolJobFailedEvent = ToolJobFailedEvent = {}));
@@ -7,6 +7,7 @@ exports.ToolJobSchema = zod_1.z.object({
7
7
  userId: zod_1.z.string().nullable(),
8
8
  unregisteredUserId: zod_1.z.string().nullable(),
9
9
  price: zod_1.z.number(),
10
+ tokenReservationId: zod_1.z.string().nullable().optional(),
10
11
  createdAt: zod_1.z.date(),
11
12
  updatedAt: zod_1.z.date(),
12
13
  });
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TOOLS_AMQP_ROUTES = void 0;
4
4
  exports.TOOLS_AMQP_ROUTES = {
5
5
  JOB_COMPLETED: 'tools.job.completed',
6
+ JOB_FAILED: 'tools.job.failed',
6
7
  FIND_ALL: 'tools.find.all.rpc',
7
8
  GET_GLOBAL_TOOLS_CONFIG: 'tools.config.rpc',
8
9
  GET_TOOLS_WITH_CONFIGS: 'tools.with-configs.rpc',
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetTTSPriceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ var GetTTSPriceCommand;
7
+ (function (GetTTSPriceCommand) {
8
+ GetTTSPriceCommand.RequestSchema = zod_1.z.object({
9
+ modelId: zod_1.z.string(),
10
+ userInput: zod_1.z.string(),
11
+ });
12
+ GetTTSPriceCommand.ResponseDataSchema = zod_1.z.object({
13
+ price: zod_1.z.number(),
14
+ });
15
+ GetTTSPriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetTTSPriceCommand.ResponseDataSchema);
16
+ })(GetTTSPriceCommand || (exports.GetTTSPriceCommand = GetTTSPriceCommand = {}));
@@ -19,4 +19,5 @@ __exportStar(require("./delete-all-tts-jobs.command"), exports);
19
19
  __exportStar(require("./retry-tts-job.command"), exports);
20
20
  __exportStar(require("./set-reaction-to-tts-job.command"), exports);
21
21
  __exportStar(require("./tts.command"), exports);
22
+ __exportStar(require("./get-tts-price.command"), exports);
22
23
  __exportStar(require("./update-tts-job-title.command"), exports);
@@ -8,9 +8,10 @@ var RetryTTSJobCommand;
8
8
  (function (RetryTTSJobCommand) {
9
9
  RetryTTSJobCommand.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(),
13
+ tokenReservationId: zod_1.z.string().uuid(),
14
+ precalculatedPrice: zod_1.z.number(),
14
15
  });
15
16
  RetryTTSJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(tts_job_schema_1.TTSJobSchema);
16
17
  })(RetryTTSJobCommand || (exports.RetryTTSJobCommand = RetryTTSJobCommand = {}));
@@ -9,7 +9,6 @@ var TTSCommand;
9
9
  TTSCommand.RequestSchema = zod_1.z.object({
10
10
  userId: zod_1.z.string().uuid().nullable().optional(),
11
11
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
12
- userBalance: zod_1.z.number(),
13
12
  modelId: zod_1.z.string(),
14
13
  voiceId: zod_1.z.string(),
15
14
  userInput: zod_1.z.string(),
@@ -21,6 +20,8 @@ var TTSCommand;
21
20
  style: zod_1.z.number().optional(),
22
21
  })
23
22
  .optional(),
23
+ tokenReservationId: zod_1.z.string().uuid(),
24
+ precalculatedPrice: zod_1.z.number(),
24
25
  });
25
26
  TTSCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(tts_job_schema_1.TTSJobSchema);
26
27
  })(TTSCommand || (exports.TTSCommand = TTSCommand = {}));