@purpleschool/gptbot-tools 0.0.14 → 0.0.16

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 (103) hide show
  1. package/build/common/enums/index.js +1 -0
  2. package/build/common/enums/reasoning-effort.enum.js +7 -7
  3. package/build/common/enums/user-reaction.enum.js +8 -0
  4. package/build/common/errors/errors.js +139 -0
  5. package/build/common/models/icon-variants.schema.js +14 -0
  6. package/build/common/models/index.js +1 -0
  7. package/build/index.js +6 -0
  8. package/build/paraphrase/models/paraphrase-type.schema.js +1 -1
  9. package/build/paraphrase/routes/paraphrase.amqp.routes.js +2 -2
  10. package/build/stt/commands/delete-all-stt-jobs.command.js +13 -0
  11. package/build/stt/commands/delete-stt-job-by-uuid.command.js +14 -0
  12. package/build/stt/commands/index.js +20 -0
  13. package/build/stt/commands/set-reaction-to-stt-job.command.js +17 -0
  14. package/build/stt/commands/stt.command.js +19 -0
  15. package/build/stt/enums/index.js +17 -0
  16. package/build/stt/enums/stt-strategy.enum.js +7 -0
  17. package/build/stt/index.js +21 -0
  18. package/build/stt/models/index.js +20 -0
  19. package/build/stt/models/stt-config.schema.js +8 -0
  20. package/build/stt/models/stt-job.schema.js +24 -0
  21. package/build/stt/models/stt-model.schema.js +19 -0
  22. package/build/stt/models/stt-response.schema.js +8 -0
  23. package/build/stt/queries/find-stt-job-by-uuid.query.js +10 -0
  24. package/build/stt/queries/find-stt-jobs.query.js +28 -0
  25. package/build/stt/queries/get-stt-config.query.js +9 -0
  26. package/build/stt/queries/index.js +19 -0
  27. package/build/stt/routes/index.js +17 -0
  28. package/build/stt/routes/stt.amqp.routes.js +12 -0
  29. package/build/tools/enums/job-status.enum.js +1 -1
  30. package/build/tools/routes/tools.aqmp.routes.js +2 -2
  31. package/build/tts/commands/delete-all-tts-jobs.command.js +13 -0
  32. package/build/tts/commands/delete-tts-job-by-uuid.command.js +14 -0
  33. package/build/tts/commands/index.js +21 -0
  34. package/build/tts/commands/set-reaction-to-tts-job.command.js +17 -0
  35. package/build/tts/commands/tts.command.js +26 -0
  36. package/build/tts/commands/update-tts-job-title.command.js +19 -0
  37. package/build/tts/enums/index.js +18 -0
  38. package/build/tts/enums/tts-model-type.enum.js +8 -0
  39. package/build/tts/enums/tts-strategy.enum.js +7 -0
  40. package/build/tts/index.js +21 -0
  41. package/build/tts/models/index.js +19 -0
  42. package/build/tts/models/tts-config.schema.js +8 -0
  43. package/build/tts/models/tts-job.schema.js +24 -0
  44. package/build/tts/models/tts-model.schema.js +54 -0
  45. package/build/tts/queries/find-tts-job-by-id.query.js +10 -0
  46. package/build/tts/queries/find-tts-jobs.query.js +28 -0
  47. package/build/tts/queries/get-tts-config.query.js +9 -0
  48. package/build/tts/queries/index.js +19 -0
  49. package/build/tts/routes/index.js +17 -0
  50. package/build/tts/routes/tts.amqp.routes.js +13 -0
  51. package/common/enums/index.ts +1 -0
  52. package/common/enums/reasoning-effort.enum.ts +1 -1
  53. package/common/enums/user-reaction.enum.ts +4 -0
  54. package/common/errors/errors.ts +139 -0
  55. package/common/models/icon-variants.schema.ts +12 -0
  56. package/common/models/index.ts +1 -0
  57. package/index.ts +6 -0
  58. package/package.json +1 -1
  59. package/paraphrase/models/paraphrase-type.schema.ts +2 -2
  60. package/paraphrase/routes/paraphrase.amqp.routes.ts +1 -1
  61. package/stt/commands/delete-all-stt-jobs.command.ts +13 -0
  62. package/stt/commands/delete-stt-job-by-uuid.command.ts +14 -0
  63. package/stt/commands/index.ts +4 -0
  64. package/stt/commands/set-reaction-to-stt-job.command.ts +17 -0
  65. package/stt/commands/stt.command.ts +19 -0
  66. package/stt/enums/index.ts +1 -0
  67. package/stt/enums/stt-strategy.enum.ts +3 -0
  68. package/stt/index.ts +5 -0
  69. package/stt/models/index.ts +4 -0
  70. package/stt/models/stt-config.schema.ts +8 -0
  71. package/stt/models/stt-job.schema.ts +24 -0
  72. package/stt/models/stt-model.schema.ts +19 -0
  73. package/stt/models/stt-response.schema.ts +8 -0
  74. package/stt/queries/find-stt-job-by-uuid.query.ts +11 -0
  75. package/stt/queries/find-stt-jobs.query.ts +33 -0
  76. package/stt/queries/get-stt-config.query.ts +8 -0
  77. package/stt/queries/index.ts +3 -0
  78. package/stt/routes/index.ts +1 -0
  79. package/stt/routes/stt.amqp.routes.ts +9 -0
  80. package/tools/enums/job-status.enum.ts +1 -1
  81. package/tools/models/tool-job.schema.ts +2 -0
  82. package/tools/models/tool.schema.ts +2 -0
  83. package/tools/routes/tools.aqmp.routes.ts +1 -1
  84. package/tts/commands/delete-all-tts-jobs.command.ts +13 -0
  85. package/tts/commands/delete-tts-job-by-uuid.command.ts +14 -0
  86. package/tts/commands/index.ts +5 -0
  87. package/tts/commands/set-reaction-to-tts-job.command.ts +17 -0
  88. package/tts/commands/tts.command.ts +26 -0
  89. package/tts/commands/update-tts-job-title.command.ts +21 -0
  90. package/tts/enums/index.ts +2 -0
  91. package/tts/enums/tts-model-type.enum.ts +4 -0
  92. package/tts/enums/tts-strategy.enum.ts +3 -0
  93. package/tts/index.ts +5 -0
  94. package/tts/models/index.ts +3 -0
  95. package/tts/models/tts-config.schema.ts +8 -0
  96. package/tts/models/tts-job.schema.ts +24 -0
  97. package/tts/models/tts-model.schema.ts +62 -0
  98. package/tts/queries/find-tts-job-by-id.query.ts +11 -0
  99. package/tts/queries/find-tts-jobs.query.ts +33 -0
  100. package/tts/queries/get-tts-config.query.ts +8 -0
  101. package/tts/queries/index.ts +3 -0
  102. package/tts/routes/index.ts +1 -0
  103. package/tts/routes/tts.amqp.routes.ts +10 -0
@@ -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("./reasoning-effort.enum"), exports);
18
+ __exportStar(require("./user-reaction.enum"), exports);
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REASONINIG_EFFORT = void 0;
4
- var REASONINIG_EFFORT;
5
- (function (REASONINIG_EFFORT) {
6
- REASONINIG_EFFORT["LOW"] = "low";
7
- REASONINIG_EFFORT["MEDIUM"] = "medium";
8
- REASONINIG_EFFORT["HIGH"] = "high";
9
- })(REASONINIG_EFFORT || (exports.REASONINIG_EFFORT = REASONINIG_EFFORT = {}));
3
+ exports.REASONING_EFFORT = void 0;
4
+ var REASONING_EFFORT;
5
+ (function (REASONING_EFFORT) {
6
+ REASONING_EFFORT["LOW"] = "low";
7
+ REASONING_EFFORT["MEDIUM"] = "medium";
8
+ REASONING_EFFORT["HIGH"] = "high";
9
+ })(REASONING_EFFORT || (exports.REASONING_EFFORT = REASONING_EFFORT = {}));
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_REACTION = void 0;
4
+ var USER_REACTION;
5
+ (function (USER_REACTION) {
6
+ USER_REACTION["LIKED"] = "LIKED";
7
+ USER_REACTION["DISLIKED"] = "DISLIKED";
8
+ })(USER_REACTION || (exports.USER_REACTION = USER_REACTION = {}));
@@ -98,4 +98,143 @@ exports.ERRORS = {
98
98
  httpCode: 404,
99
99
  },
100
100
  },
101
+ S3: {
102
+ GET_FILE_STREAM_ERROR: {
103
+ code: 'S3.STREAM_ERROR',
104
+ message: 'Произошла ошибка при получении потока S3',
105
+ httpCode: 500,
106
+ },
107
+ STREAM_UPLOAD_ERROR: {
108
+ code: 'S3.STREAM_UPLOAD_ERROR',
109
+ message: 'Произошла ошибка при загрузке файлы в S3 в потоковом режиме',
110
+ httpCode: 500,
111
+ },
112
+ },
113
+ STT: {
114
+ AI_ERROR: {
115
+ code: 'STT.AI_ERROR',
116
+ message: 'Произошла ошибка во время запроса к ИИ',
117
+ httpCode: 500,
118
+ },
119
+ INSUFFICIENT_BALANCE: {
120
+ code: 'STT.INSUFFICIENT_BALANCE',
121
+ message: 'У пользователя недостаточно средств',
122
+ httpCode: 400,
123
+ },
124
+ DURATION_EXCEEDED: {
125
+ code: 'STT.DURATION_EXCEEDED',
126
+ message: 'Превышена максимальная длительность аудио',
127
+ httpCode: 400,
128
+ },
129
+ },
130
+ STT_MODEL: {
131
+ SAVE_ERROR: {
132
+ code: 'STT_MODEL.SAVE_ERROR',
133
+ message: 'Произошла ошибка при сохранении модели STT',
134
+ httpCode: 500,
135
+ },
136
+ FIND_ERROR: {
137
+ code: 'STT_MODEL.FIND_ERROR',
138
+ message: 'Произошла ошибка при поиске модели STT',
139
+ httpCode: 500,
140
+ },
141
+ NOT_FOUND: {
142
+ code: 'STT_MODEL.NOT_FOUND',
143
+ message: 'Модель STT не найдена',
144
+ httpCode: 404,
145
+ },
146
+ },
147
+ STT_JOB: {
148
+ SAVE_ERROR: {
149
+ code: 'STT_JOB.SAVE_ERROR',
150
+ message: 'Произошла ошибка при сохранении задания STT',
151
+ httpCode: 500,
152
+ },
153
+ FIND_ERROR: {
154
+ code: 'STT_JOB.FIND_ERROR',
155
+ message: 'Произошла ошибка при поиске задания STT',
156
+ httpCode: 500,
157
+ },
158
+ NOT_FOUND: {
159
+ code: 'STT_JOB.NOT_FOUND',
160
+ message: 'Задание STT не найдено',
161
+ httpCode: 404,
162
+ },
163
+ NOT_AN_OWNER: {
164
+ code: 'STT_JOB.NOT_AN_OWNER',
165
+ message: 'Пользователь не является владельцем задания STT',
166
+ httpCode: 403,
167
+ },
168
+ DELETE_ERROR: {
169
+ code: 'STT_JOB.DELETE_ERROR',
170
+ message: 'Произошла ошибка при удалении задания STT',
171
+ httpCode: 500,
172
+ },
173
+ },
174
+ TTS: {
175
+ AI_ERROR: {
176
+ code: 'TTS.AI_ERROR',
177
+ message: 'Произошла ошибка во время запроса к ИИ',
178
+ httpCode: 500,
179
+ },
180
+ INSUFFICIENT_BALANCE: {
181
+ code: 'TTS.INSUFFICIENT_BALANCE',
182
+ message: 'У пользователя недостаточно средств',
183
+ httpCode: 400,
184
+ },
185
+ VOICE_NOT_FOUND: {
186
+ code: 'TTS.VOICE_NOT_FOUND',
187
+ message: 'Произошла ошибка при поиске голоса TTS',
188
+ httpCode: 404,
189
+ },
190
+ INVALID_PARAMS: {
191
+ code: 'TTS.INVALID_PARAMS',
192
+ message: 'Некорректные параметры TTS',
193
+ httpCode: 400,
194
+ },
195
+ DELETE_ERROR: {
196
+ code: 'TTS.DELETE_ERROR',
197
+ message: 'Произошла ошибка при удалении задания TTS',
198
+ httpCode: 500,
199
+ },
200
+ },
201
+ TTS_MODEL: {
202
+ SAVE_ERROR: {
203
+ code: 'TTS_MODEL.SAVE_ERROR',
204
+ message: 'Произошла ошибка при сохранении модели TTS',
205
+ httpCode: 500,
206
+ },
207
+ FIND_ERROR: {
208
+ code: 'TTS_MODEL.FIND_ERROR',
209
+ message: 'Произошла ошибка при поиске модели TTS',
210
+ httpCode: 500,
211
+ },
212
+ NOT_FOUND: {
213
+ code: 'TTS_MODEL.NOT_FOUND',
214
+ message: 'Модель TTS не найдена',
215
+ httpCode: 404,
216
+ },
217
+ },
218
+ TTS_JOB: {
219
+ SAVE_ERROR: {
220
+ code: 'TTS_JOB.SAVE_ERROR',
221
+ message: 'Произошла ошибка при сохранении задания TTS',
222
+ httpCode: 500,
223
+ },
224
+ FIND_ERROR: {
225
+ code: 'TTS_JOB.FIND_ERROR',
226
+ message: 'Произошла ошибка при поиске задания TTS',
227
+ httpCode: 500,
228
+ },
229
+ NOT_FOUND: {
230
+ code: 'TTS_JOB.NOT_FOUND',
231
+ message: 'Задание TTS не найдено',
232
+ httpCode: 404,
233
+ },
234
+ NOT_AN_OWNER: {
235
+ code: 'TTS_JOB.NOT_AN_OWNER',
236
+ message: 'Пользователь не является владельцем данного сообщения',
237
+ httpCode: 403,
238
+ },
239
+ },
101
240
  };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IconVariantsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.IconVariantsSchema = zod_1.z.object({
6
+ light: zod_1.z.object({
7
+ svg: zod_1.z.string(),
8
+ png: zod_1.z.string(),
9
+ }),
10
+ dark: zod_1.z.object({
11
+ svg: zod_1.z.string(),
12
+ png: zod_1.z.string(),
13
+ }),
14
+ });
@@ -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("./command-response.schema"), exports);
18
+ __exportStar(require("./icon-variants.schema"), exports);
package/build/index.js CHANGED
@@ -40,12 +40,18 @@ exports.ToolService = void 0;
40
40
  __exportStar(require("./common"), exports);
41
41
  __exportStar(require("./paraphrase"), exports);
42
42
  __exportStar(require("./tools"), exports);
43
+ __exportStar(require("./stt"), exports);
44
+ __exportStar(require("./tts"), exports);
43
45
  const common = __importStar(require("./common"));
44
46
  const paraphrase = __importStar(require("./paraphrase"));
45
47
  const tools = __importStar(require("./tools"));
48
+ const stt = __importStar(require("./stt"));
49
+ const tts = __importStar(require("./tts"));
46
50
  var ToolService;
47
51
  (function (ToolService) {
48
52
  ToolService.Common = common;
49
53
  ToolService.Paraphrase = paraphrase;
50
54
  ToolService.Tools = tools;
55
+ ToolService.TTS = tts;
56
+ ToolService.STT = stt;
51
57
  })(ToolService || (exports.ToolService = ToolService = {}));
@@ -9,7 +9,7 @@ exports.ParaphraseTypeSchema = zod_1.z.object({
9
9
  icon: zod_1.z.string(),
10
10
  price: zod_1.z.number(),
11
11
  aiModel: zod_1.z.string(),
12
- reasoningEffort: zod_1.z.nativeEnum(common_1.REASONINIG_EFFORT).nullable().optional(),
12
+ reasoningEffort: zod_1.z.nativeEnum(common_1.REASONING_EFFORT).nullable().optional(),
13
13
  order: zod_1.z.number(),
14
14
  createdAt: zod_1.z.date(),
15
15
  updatedAt: zod_1.z.date(),
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PARAPHRASE_ARMQ_ROUTES = void 0;
4
- exports.PARAPHRASE_ARMQ_ROUTES = {
3
+ exports.PARAPHRASE_AMQP_ROUTES = void 0;
4
+ exports.PARAPHRASE_AMQP_ROUTES = {
5
5
  EXECUTE: 'tools.paraphrase.execute.rpc',
6
6
  CONFIG: 'tools.paraphrase.config.rpc',
7
7
  GET_JOB: 'tools.paraphrase.jobs.get.rpc',
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteAllSTTJobsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ var DeleteAllSTTJobsCommand;
7
+ (function (DeleteAllSTTJobsCommand) {
8
+ DeleteAllSTTJobsCommand.RequestSchema = zod_1.z.object({
9
+ userId: zod_1.z.string().uuid().nullable().optional(),
10
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
11
+ });
12
+ DeleteAllSTTJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(zod_1.z.boolean());
13
+ })(DeleteAllSTTJobsCommand || (exports.DeleteAllSTTJobsCommand = DeleteAllSTTJobsCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteSTTJobByUuidCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ var DeleteSTTJobByUuidCommand;
7
+ (function (DeleteSTTJobByUuidCommand) {
8
+ DeleteSTTJobByUuidCommand.RequestSchema = zod_1.z.object({
9
+ userId: zod_1.z.string().uuid().nullable().optional(),
10
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
11
+ uuid: zod_1.z.string(),
12
+ });
13
+ DeleteSTTJobByUuidCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(zod_1.z.boolean());
14
+ })(DeleteSTTJobByUuidCommand || (exports.DeleteSTTJobByUuidCommand = DeleteSTTJobByUuidCommand = {}));
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./delete-stt-job-by-uuid.command"), exports);
18
+ __exportStar(require("./delete-all-stt-jobs.command"), exports);
19
+ __exportStar(require("./set-reaction-to-stt-job.command"), exports);
20
+ __exportStar(require("./stt.command"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetReactionToSTTJobCommand = 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
+ const models_1 = require("../models");
8
+ var SetReactionToSTTJobCommand;
9
+ (function (SetReactionToSTTJobCommand) {
10
+ SetReactionToSTTJobCommand.RequestSchema = zod_1.z.object({
11
+ userId: zod_1.z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
+ uuid: zod_1.z.string(),
14
+ reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
15
+ });
16
+ SetReactionToSTTJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.STTJobSchema);
17
+ })(SetReactionToSTTJobCommand || (exports.SetReactionToSTTJobCommand = SetReactionToSTTJobCommand = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STTCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const stt_job_schema_1 = require("../models/stt-job.schema");
7
+ var STTCommand;
8
+ (function (STTCommand) {
9
+ STTCommand.RequestSchema = zod_1.z.object({
10
+ userId: zod_1.z.string().uuid().nullable().optional(),
11
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
12
+ userBalance: zod_1.z.number(),
13
+ modelId: zod_1.z.string(),
14
+ fileKey: zod_1.z.string(),
15
+ fileUrl: zod_1.z.string(),
16
+ durationInSeconds: zod_1.z.number(),
17
+ });
18
+ STTCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(stt_job_schema_1.STTJobSchema);
19
+ })(STTCommand || (exports.STTCommand = STTCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./stt-strategy.enum"), exports);
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STT_STRATEGY = void 0;
4
+ var STT_STRATEGY;
5
+ (function (STT_STRATEGY) {
6
+ STT_STRATEGY["ELEVENLABS_STT"] = "ELEVENLABS_STT";
7
+ })(STT_STRATEGY || (exports.STT_STRATEGY = STT_STRATEGY = {}));
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./commands"), exports);
18
+ __exportStar(require("./enums"), exports);
19
+ __exportStar(require("./models"), exports);
20
+ __exportStar(require("./queries"), exports);
21
+ __exportStar(require("./routes"), exports);
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./stt-config.schema"), exports);
18
+ __exportStar(require("./stt-job.schema"), exports);
19
+ __exportStar(require("./stt-model.schema"), exports);
20
+ __exportStar(require("./stt-response.schema"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STTConfigSchema = void 0;
4
+ const stt_model_schema_1 = require("./stt-model.schema");
5
+ const zod_1 = require("zod");
6
+ exports.STTConfigSchema = zod_1.z.object({
7
+ models: zod_1.z.array(stt_model_schema_1.STTModelSchema),
8
+ });
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STTJobSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const tools_1 = require("../../tools");
6
+ const stt_response_schema_1 = require("./stt-response.schema");
7
+ const common_1 = require("../../common");
8
+ exports.STTJobSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string(),
10
+ modelId: zod_1.z.string(),
11
+ title: zod_1.z.string(),
12
+ fileUrl: zod_1.z.string(),
13
+ aiResponse: stt_response_schema_1.STTResponseSchema.nullable(),
14
+ reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
15
+ status: zod_1.z.nativeEnum(tools_1.JOB_STATUS),
16
+ error: zod_1.z.string().nullable(),
17
+ userId: zod_1.z.string().nullable(),
18
+ unregisteredUserId: zod_1.z.string().nullable(),
19
+ price: zod_1.z.number(),
20
+ isDeleted: zod_1.z.boolean(),
21
+ createdAt: zod_1.z.date(),
22
+ completedAt: zod_1.z.date().nullable(),
23
+ updatedAt: zod_1.z.date(),
24
+ });
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STTModelSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_1 = require("../../common");
6
+ exports.STTModelSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string(),
8
+ title: zod_1.z.string(),
9
+ description: zod_1.z.string(),
10
+ aiModel: zod_1.z.string(),
11
+ pricePerMin: zod_1.z.number(),
12
+ order: zod_1.z.number(),
13
+ icons: common_1.IconVariantsSchema,
14
+ strategy: zod_1.z.string().optional(),
15
+ maxDurationSeconds: zod_1.z.number(),
16
+ maxSizeMB: zod_1.z.number(),
17
+ createdAt: zod_1.z.date(),
18
+ updatedAt: zod_1.z.date(),
19
+ });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STTResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.STTResponseSchema = zod_1.z.object({
6
+ raw: zod_1.z.object({}),
7
+ md: zod_1.z.string(),
8
+ });
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindSTTJobByUuidQuery = void 0;
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
+ const models_1 = require("../models");
6
+ var FindSTTJobByUuidQuery;
7
+ (function (FindSTTJobByUuidQuery) {
8
+ FindSTTJobByUuidQuery.RequestSchema = models_1.STTJobSchema.pick({ uuid: true });
9
+ FindSTTJobByUuidQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.STTJobSchema);
10
+ })(FindSTTJobByUuidQuery || (exports.FindSTTJobByUuidQuery = FindSTTJobByUuidQuery = {}));
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindSTTJobsQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const stt_job_schema_1 = require("../models/stt-job.schema");
7
+ var FindSTTJobsQuery;
8
+ (function (FindSTTJobsQuery) {
9
+ FindSTTJobsQuery.RequestSchema = zod_1.z
10
+ .object({
11
+ userId: zod_1.z.string().uuid().optional(),
12
+ unregisteredUserId: zod_1.z.string().uuid().optional(),
13
+ title: zod_1.z.string().optional(),
14
+ limit: zod_1.z.coerce.number().min(1).optional(),
15
+ offset: zod_1.z.coerce.number().min(0).optional(),
16
+ })
17
+ .refine((data) => {
18
+ return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
19
+ }, {
20
+ message: 'At least userId or unregisteredUserId must be present',
21
+ path: ['userId', 'unregisteredUserId'],
22
+ });
23
+ FindSTTJobsQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(zod_1.z.object({
24
+ data: zod_1.z.array(stt_job_schema_1.STTJobSchema),
25
+ page: zod_1.z.number(),
26
+ totalPages: zod_1.z.number(),
27
+ }));
28
+ })(FindSTTJobsQuery || (exports.FindSTTJobsQuery = FindSTTJobsQuery = {}));
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetSTTConfigQuery = void 0;
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
+ const models_1 = require("../models");
6
+ var GetSTTConfigQuery;
7
+ (function (GetSTTConfigQuery) {
8
+ GetSTTConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.STTConfigSchema);
9
+ })(GetSTTConfigQuery || (exports.GetSTTConfigQuery = GetSTTConfigQuery = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./find-stt-job-by-uuid.query"), exports);
18
+ __exportStar(require("./find-stt-jobs.query"), exports);
19
+ __exportStar(require("./get-stt-config.query"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./stt.amqp.routes"), exports);
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STT_AMQP_ROUTES = void 0;
4
+ exports.STT_AMQP_ROUTES = {
5
+ EXECUTE: 'tools.stt.execute.rpc',
6
+ CONFIG: 'tools.stt.config.rpc',
7
+ GET_JOB: 'tools.stt.jobs.get.rpc',
8
+ LIST_JOBS: 'tools.stt.jobs.list.rpc',
9
+ SET_REACTION: 'tools.stt.jobs.set_reaction.rpc',
10
+ SOFT_DELETE: 'tools.stt.jobs.soft-delete.rpc',
11
+ SOFT_DELETE_ALL: 'tools.stt.jobs.soft-delete-all.rpc',
12
+ };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.JOB_STATUS = void 0;
4
4
  var JOB_STATUS;
5
5
  (function (JOB_STATUS) {
6
- JOB_STATUS["PEDNING"] = "pending";
6
+ JOB_STATUS["PENDING"] = "pending";
7
7
  JOB_STATUS["PROCESSING"] = "processing";
8
8
  JOB_STATUS["COMPLETED"] = "completed";
9
9
  JOB_STATUS["FAILED"] = "failed";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TOOLS_AQMP_ROUTES = void 0;
4
- exports.TOOLS_AQMP_ROUTES = {
3
+ exports.TOOLS_AMQP_ROUTES = void 0;
4
+ exports.TOOLS_AMQP_ROUTES = {
5
5
  JOB_COMPLETED: 'tools.job.completed',
6
6
  FIND_ALL: 'tools.find.all.rpc',
7
7
  };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteAllTTSJobsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ var DeleteAllTTSJobsCommand;
7
+ (function (DeleteAllTTSJobsCommand) {
8
+ DeleteAllTTSJobsCommand.RequestSchema = zod_1.z.object({
9
+ userId: zod_1.z.string().uuid().nullable().optional(),
10
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
11
+ });
12
+ DeleteAllTTSJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(zod_1.z.boolean());
13
+ })(DeleteAllTTSJobsCommand || (exports.DeleteAllTTSJobsCommand = DeleteAllTTSJobsCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteTTSJobByUuidCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ var DeleteTTSJobByUuidCommand;
7
+ (function (DeleteTTSJobByUuidCommand) {
8
+ DeleteTTSJobByUuidCommand.RequestSchema = zod_1.z.object({
9
+ userId: zod_1.z.string().uuid().nullable().optional(),
10
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
11
+ uuid: zod_1.z.string(),
12
+ });
13
+ DeleteTTSJobByUuidCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(zod_1.z.boolean());
14
+ })(DeleteTTSJobByUuidCommand || (exports.DeleteTTSJobByUuidCommand = DeleteTTSJobByUuidCommand = {}));
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./delete-tts-job-by-uuid.command"), exports);
18
+ __exportStar(require("./delete-all-tts-jobs.command"), exports);
19
+ __exportStar(require("./set-reaction-to-tts-job.command"), exports);
20
+ __exportStar(require("./tts.command"), exports);
21
+ __exportStar(require("./update-tts-job-title.command"), exports);