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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) 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/models/image-editor-job.schema.js +1 -0
  6. package/build/image-editor/routes/image-editor.amqp.routes.js +1 -0
  7. package/build/image-generation/commands/execute-image-generation.command.js +3 -2
  8. package/build/image-generation/commands/get-image-generation-price.command.js +22 -0
  9. package/build/image-generation/commands/index.js +1 -0
  10. package/build/image-generation/commands/retry-image-generation-job.command.js +4 -3
  11. package/build/image-generation/models/image-generation-job.schema.js +1 -0
  12. package/build/image-generation/routes/image-generation.amqp.routes.js +1 -0
  13. package/build/music/commands/generate-music.command.js +3 -1
  14. package/build/music/commands/get-music-price.command.js +20 -0
  15. package/build/music/commands/index.js +1 -0
  16. package/build/music/commands/retry-music-job.command.js +3 -1
  17. package/build/music/models/music-job.schema.js +1 -0
  18. package/build/music/models/music-model.schema.js +9 -1
  19. package/build/music/models/music-track.schema.js +1 -0
  20. package/build/music/routes/music.amqp.routes.js +1 -0
  21. package/build/paraphrase/commands/get-paraphrase-price.command.js +15 -0
  22. package/build/paraphrase/commands/index.js +1 -0
  23. package/build/paraphrase/commands/paraphrase.command.js +2 -1
  24. package/build/paraphrase/commands/retry-paraphrase-job.command.js +2 -1
  25. package/build/paraphrase/models/paraphrase-job.schema.js +1 -0
  26. package/build/paraphrase/routes/paraphrase.amqp.routes.js +1 -0
  27. package/build/presentation/commands/generate-slides.command.js +2 -1
  28. package/build/presentation/commands/get-presentation-slides-generation-price.command.js +15 -0
  29. package/build/presentation/commands/index.js +1 -0
  30. package/build/presentation/models/presentation.schema.js +1 -0
  31. package/build/presentation/routes/presentation.routes.js +1 -0
  32. package/build/stt/commands/get-stt-price.command.js +16 -0
  33. package/build/stt/commands/index.js +1 -0
  34. package/build/stt/commands/retry-stt-job.command.js +2 -1
  35. package/build/stt/commands/stt.command.js +2 -1
  36. package/build/stt/models/stt-job.schema.js +1 -0
  37. package/build/stt/routes/stt.amqp.routes.js +1 -0
  38. package/build/tools/events/index.js +1 -0
  39. package/build/tools/events/tool-job-failed.event.js +14 -0
  40. package/build/tools/models/tool-job.schema.js +1 -0
  41. package/build/tools/routes/tools.aqmp.routes.js +1 -0
  42. package/build/tts/commands/get-tts-price.command.js +16 -0
  43. package/build/tts/commands/index.js +1 -0
  44. package/build/tts/commands/retry-tts-job.command.js +2 -1
  45. package/build/tts/commands/tts.command.js +2 -1
  46. package/build/tts/models/tts-job.schema.js +1 -0
  47. package/build/tts/routes/tts.amqp.routes.js +1 -0
  48. package/build/video/commands/get-video-price.command.js +17 -0
  49. package/build/video/commands/index.js +1 -0
  50. package/build/video/commands/retry-video-job.command.js +2 -1
  51. package/build/video/commands/video.command.js +2 -1
  52. package/build/video/models/video-job.schema.js +1 -0
  53. package/build/video/routes/video.amqp.routes.js +1 -0
  54. package/build/video-editor/commands/edit-video.command.js +2 -1
  55. package/build/video-editor/commands/get-video-editor-price.command.js +15 -0
  56. package/build/video-editor/commands/index.js +1 -0
  57. package/build/video-editor/commands/retry-video-editor-job.command.js +2 -1
  58. package/build/video-editor/models/video-editor-job.schema.js +1 -0
  59. package/build/video-editor/routes/video-editor.amqp.routes.js +1 -0
  60. package/build/writer/commands/generate-document-contents.command.js +2 -1
  61. package/build/writer/commands/get-writer-content-generation-price.command.js +16 -0
  62. package/build/writer/commands/index.js +1 -0
  63. package/build/writer/models/writer-document.schema.js +1 -0
  64. package/build/writer/routes/writer.routes.js +1 -0
  65. package/image-editor/commands/get-image-editor-price.command.ts +26 -0
  66. package/image-editor/commands/image-editor.command.ts +2 -1
  67. package/image-editor/commands/index.ts +1 -0
  68. package/image-editor/commands/retry-image-editor-job.command.ts +2 -1
  69. package/image-editor/models/image-editor-job.schema.ts +1 -0
  70. package/image-editor/routes/image-editor.amqp.routes.ts +1 -0
  71. package/image-generation/commands/execute-image-generation.command.ts +3 -2
  72. package/image-generation/commands/get-image-generation-price.command.ts +24 -0
  73. package/image-generation/commands/index.ts +1 -0
  74. package/image-generation/commands/retry-image-generation-job.command.ts +4 -3
  75. package/image-generation/models/image-generation-job.schema.ts +1 -0
  76. package/image-generation/routes/image-generation.amqp.routes.ts +1 -0
  77. package/music/commands/generate-music.command.ts +3 -1
  78. package/music/commands/get-music-price.command.ts +22 -0
  79. package/music/commands/index.ts +1 -0
  80. package/music/commands/retry-music-job.command.ts +3 -1
  81. package/music/models/music-job.schema.ts +1 -0
  82. package/music/models/music-model.schema.ts +14 -0
  83. package/music/models/music-track.schema.ts +1 -0
  84. package/music/routes/music.amqp.routes.ts +1 -0
  85. package/package.json +1 -1
  86. package/paraphrase/commands/get-paraphrase-price.command.ts +16 -0
  87. package/paraphrase/commands/index.ts +1 -0
  88. package/paraphrase/commands/paraphrase.command.ts +2 -1
  89. package/paraphrase/commands/retry-paraphrase-job.command.ts +2 -1
  90. package/paraphrase/models/paraphrase-job.schema.ts +1 -0
  91. package/paraphrase/routes/paraphrase.amqp.routes.ts +1 -0
  92. package/presentation/commands/generate-slides.command.ts +2 -1
  93. package/presentation/commands/get-presentation-slides-generation-price.command.ts +16 -0
  94. package/presentation/commands/index.ts +1 -0
  95. package/presentation/models/presentation.schema.ts +1 -0
  96. package/presentation/routes/presentation.routes.ts +1 -0
  97. package/stt/commands/get-stt-price.command.ts +17 -0
  98. package/stt/commands/index.ts +1 -0
  99. package/stt/commands/retry-stt-job.command.ts +2 -1
  100. package/stt/commands/stt.command.ts +2 -1
  101. package/stt/models/stt-job.schema.ts +1 -0
  102. package/stt/routes/stt.amqp.routes.ts +1 -0
  103. package/tools/events/index.ts +1 -0
  104. package/tools/events/tool-job-failed.event.ts +13 -0
  105. package/tools/models/tool-job.schema.ts +1 -0
  106. package/tools/routes/tools.aqmp.routes.ts +1 -0
  107. package/tts/commands/get-tts-price.command.ts +17 -0
  108. package/tts/commands/index.ts +1 -0
  109. package/tts/commands/retry-tts-job.command.ts +2 -1
  110. package/tts/commands/tts.command.ts +2 -1
  111. package/tts/models/tts-job.schema.ts +1 -0
  112. package/tts/routes/tts.amqp.routes.ts +1 -0
  113. package/video/commands/get-video-price.command.ts +18 -0
  114. package/video/commands/index.ts +1 -0
  115. package/video/commands/retry-video-job.command.ts +2 -1
  116. package/video/commands/video.command.ts +2 -1
  117. package/video/models/video-job.schema.ts +1 -0
  118. package/video/routes/video.amqp.routes.ts +1 -0
  119. package/video-editor/commands/edit-video.command.ts +2 -1
  120. package/video-editor/commands/get-video-editor-price.command.ts +16 -0
  121. package/video-editor/commands/index.ts +1 -0
  122. package/video-editor/commands/retry-video-editor-job.command.ts +2 -1
  123. package/video-editor/models/video-editor-job.schema.ts +1 -0
  124. package/video-editor/routes/video-editor.amqp.routes.ts +1 -0
  125. package/writer/commands/generate-document-contents.command.ts +2 -1
  126. package/writer/commands/get-writer-content-generation-price.command.ts +17 -0
  127. package/writer/commands/index.ts +1 -0
  128. package/writer/models/writer-document.schema.ts +1 -0
  129. 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(),
@@ -28,6 +28,7 @@ exports.ImageEditorJobSchema = zod_1.z.object({
28
28
  isPublished: zod_1.z.boolean(),
29
29
  postId: zod_1.z.string().nullable(),
30
30
  isDeleted: zod_1.z.boolean(),
31
+ tokenReservationId: zod_1.z.string().nullable().optional(),
31
32
  createdAt: zod_1.z.date(),
32
33
  completedAt: zod_1.z.date().nullable().optional(),
33
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 = {}));
@@ -32,6 +32,7 @@ exports.ImageGenerationJobSchema = zod_1.z.object({
32
32
  postId: zod_1.z.string().nullable(),
33
33
  isDeleted: zod_1.z.boolean(),
34
34
  internalError: zod_1.z.string().nullable(),
35
+ tokenReservationId: zod_1.z.string().nullable().optional(),
35
36
  createdAt: zod_1.z.date(),
36
37
  updatedAt: zod_1.z.date(),
37
38
  });
@@ -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,11 @@ 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(),
17
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
16
18
  });
17
19
  GenerateMusicCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(music_job_schema_1.MusicJobSchema);
18
20
  })(GenerateMusicCommand || (exports.GenerateMusicCommand = GenerateMusicCommand = {}));
@@ -0,0 +1,20 @@
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
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
15
+ });
16
+ GetMusicPriceCommand.ResponseDataSchema = zod_1.z.object({
17
+ price: zod_1.z.number(),
18
+ });
19
+ GetMusicPriceCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(GetMusicPriceCommand.ResponseDataSchema);
20
+ })(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,11 +8,13 @@ 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(),
17
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
16
18
  });
17
19
  RetryMusicJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(music_job_schema_1.MusicJobSchema);
18
20
  })(RetryMusicJobCommand || (exports.RetryMusicJobCommand = RetryMusicJobCommand = {}));
@@ -47,6 +47,7 @@ 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
  isDeleted: zod_1.z.boolean(),
50
+ tokenReservationId: zod_1.z.string().nullable().optional(),
50
51
  createdAt: zod_1.z.date(),
51
52
  completedAt: zod_1.z.date().nullable().optional(),
52
53
  updatedAt: zod_1.z.date(),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MusicModelSchema = exports.MusicModelParamsSchema = void 0;
3
+ exports.MusicModelSchema = exports.MusicModelPricingRulesSchema = exports.MusicModelPricingRuleConditionSchema = exports.MusicModelParamsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const common_1 = require("../../common");
6
6
  const enums_1 = require("../enums");
@@ -17,6 +17,13 @@ exports.MusicModelParamsSchema = zod_1.z.object({
17
17
  })),
18
18
  }),
19
19
  });
20
+ exports.MusicModelPricingRuleConditionSchema = zod_1.z.object({
21
+ withoutSub: zod_1.z.boolean().optional(),
22
+ });
23
+ exports.MusicModelPricingRulesSchema = zod_1.z.array(zod_1.z.object({
24
+ condition: exports.MusicModelPricingRuleConditionSchema,
25
+ value: zod_1.z.number(),
26
+ }));
20
27
  exports.MusicModelSchema = zod_1.z.object({
21
28
  uuid: zod_1.z.string(),
22
29
  title: zod_1.z.string(),
@@ -30,6 +37,7 @@ exports.MusicModelSchema = zod_1.z.object({
30
37
  maxPromptLength: zod_1.z.number(),
31
38
  maxLyricsLength: zod_1.z.number(),
32
39
  params: exports.MusicModelParamsSchema,
40
+ pricingRules: exports.MusicModelPricingRulesSchema,
33
41
  createdAt: zod_1.z.date(),
34
42
  updatedAt: zod_1.z.date(),
35
43
  });
@@ -11,6 +11,7 @@ exports.MusicTrackSchema = zod_1.z.object({
11
11
  prompt: zod_1.z.string().nullable(),
12
12
  tags: zod_1.z.string(),
13
13
  duration: zod_1.z.number(),
14
+ waveformPeaks: zod_1.z.array(zod_1.z.number()),
14
15
  isPublished: zod_1.z.boolean().optional(),
15
16
  postId: zod_1.z.string().nullable().optional(),
16
17
  genJobId: zod_1.z.string().nullable().optional(),
@@ -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 = {}));
@@ -25,6 +25,7 @@ exports.TTSJobSchema = zod_1.z.object({
25
25
  duration: zod_1.z.number(),
26
26
  userId: zod_1.z.string().nullable(),
27
27
  unregisteredUserId: zod_1.z.string().nullable(),
28
+ tokenReservationId: zod_1.z.string().nullable().optional(),
28
29
  isDeleted: zod_1.z.boolean(),
29
30
  params: exports.TTSJobParamsSchema,
30
31
  createdAt: zod_1.z.date(),
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TTS_AMQP_ROUTES = void 0;
4
4
  exports.TTS_AMQP_ROUTES = {
5
5
  EXECUTE: 'tools.tts.execute.rpc',
6
+ GET_PRICE: 'tools.tts.get-price.rpc',
6
7
  CONFIG: 'tools.tts.config.rpc',
7
8
  GET_JOB: 'tools.tts.jobs.get.rpc',
8
9
  LIST_JOBS: 'tools.tts.jobs.list.rpc',