@purpleschool/gptbot 0.5.89 → 0.5.90

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 (102) hide show
  1. package/api/controllers/http/index.ts +3 -1
  2. package/api/controllers/http/stt.ts +12 -0
  3. package/api/controllers/http/tts.ts +13 -0
  4. package/build/api/controllers/http/index.js +3 -1
  5. package/build/api/controllers/http/stt.js +14 -0
  6. package/build/api/controllers/http/tts.js +15 -0
  7. package/build/commands/index.js +1 -2
  8. package/build/commands/tools/index.js +20 -0
  9. package/build/commands/{tools-paraphrase → tools/paraphrase}/find-paraphrase-job-by-uuid.command.js +3 -3
  10. package/build/commands/{tools-paraphrase → tools/paraphrase}/get-paraphrase-tool-config.command.js +1 -1
  11. package/build/commands/{tools-paraphrase → tools/paraphrase}/paraphrase.command.js +2 -2
  12. package/build/commands/tools/stt/delete-all-stt-jobs.command.js +8 -0
  13. package/build/commands/tools/stt/delete-stt-job-by-uuid.command.js +11 -0
  14. package/build/commands/tools/stt/find-stt-job-by-uuid.command.js +14 -0
  15. package/build/commands/tools/stt/find-stt-jobs.command.js +18 -0
  16. package/build/commands/tools/stt/get-stt-tool-config.command.js +11 -0
  17. package/build/commands/tools/stt/index.js +23 -0
  18. package/build/commands/tools/stt/set-reaction-to-stt-job.command.js +18 -0
  19. package/build/commands/tools/stt/stt.command.js +15 -0
  20. package/build/commands/{tool → tools/tool}/find-all-tools.command.js +1 -1
  21. package/build/commands/tools/tts/delete-all-tts-jobs.command.js +8 -0
  22. package/build/commands/tools/tts/delete-tts-job-by-uuid.command.js +11 -0
  23. package/build/commands/tools/tts/find-tts-job-by-uuid.command.js +14 -0
  24. package/build/commands/tools/tts/find-tts-jobs.command.js +18 -0
  25. package/build/commands/tools/tts/get-tts-tool-config.command.js +11 -0
  26. package/build/commands/tools/tts/index.js +24 -0
  27. package/build/commands/tools/tts/set-reaction-to-tts-job.command.js +18 -0
  28. package/build/commands/tools/tts/tts.command.js +26 -0
  29. package/build/commands/tools/tts/update-tts-job-title.command.js +17 -0
  30. package/build/constants/errors/errors.js +96 -7
  31. package/build/constants/message/enums/user-reaction.enum.js +5 -4
  32. package/build/models/file.schema.js +2 -0
  33. package/build/models/icon-variants.schema.js +17 -0
  34. package/build/models/index.js +2 -4
  35. package/build/models/message.schema.js +1 -1
  36. package/build/models/tools/index.js +19 -0
  37. package/build/models/tools/paraphrase/index.js +20 -0
  38. package/build/models/tools/paraphrase/paraphrase-config.schema.js +11 -0
  39. package/build/models/{tool-paraphrase-job.schema.js → tools/paraphrase/paraphrase-job.schema.js} +1 -1
  40. package/build/models/tools/stt/index.js +20 -0
  41. package/build/models/tools/stt/stt-config.schema.js +8 -0
  42. package/build/models/tools/stt/stt-job.schema.js +14 -0
  43. package/build/models/tools/stt/stt-model.schema.js +15 -0
  44. package/build/models/tools/stt/stt-response.schema.js +8 -0
  45. package/build/models/tools/tts/index.js +19 -0
  46. package/build/models/tools/tts/tts-config.schema.js +8 -0
  47. package/build/models/tools/tts/tts-job.schema.js +21 -0
  48. package/build/models/tools/tts/tts-model.schema.js +49 -0
  49. package/commands/index.ts +1 -2
  50. package/commands/tools/index.ts +4 -0
  51. package/commands/{tools-paraphrase → tools/paraphrase}/find-paraphrase-job-by-uuid.command.ts +1 -1
  52. package/commands/{tools-paraphrase → tools/paraphrase}/get-paraphrase-tool-config.command.ts +1 -1
  53. package/commands/{tools-paraphrase → tools/paraphrase}/paraphrase.command.ts +2 -2
  54. package/commands/tools/stt/delete-all-stt-jobs.command.ts +6 -0
  55. package/commands/tools/stt/delete-stt-job-by-uuid.command.ts +11 -0
  56. package/commands/tools/stt/find-stt-job-by-uuid.command.ts +16 -0
  57. package/commands/tools/stt/find-stt-jobs.command.ts +18 -0
  58. package/commands/tools/stt/get-stt-tool-config.command.ts +10 -0
  59. package/commands/tools/stt/index.ts +7 -0
  60. package/commands/tools/stt/set-reaction-to-stt-job.command.ts +20 -0
  61. package/commands/tools/stt/stt.command.ts +17 -0
  62. package/commands/{tool → tools/tool}/find-all-tools.command.ts +1 -1
  63. package/commands/tools/tts/delete-all-tts-jobs.command.ts +6 -0
  64. package/commands/tools/tts/delete-tts-job-by-uuid.command.ts +11 -0
  65. package/commands/tools/tts/find-tts-job-by-uuid.command.ts +16 -0
  66. package/commands/tools/tts/find-tts-jobs.command.ts +18 -0
  67. package/commands/tools/tts/get-tts-tool-config.command.ts +10 -0
  68. package/commands/tools/tts/index.ts +8 -0
  69. package/commands/tools/tts/set-reaction-to-tts-job.command.ts +20 -0
  70. package/commands/tools/tts/tts.command.ts +28 -0
  71. package/commands/tools/tts/update-tts-job-title.command.ts +19 -0
  72. package/constants/errors/errors.ts +96 -7
  73. package/constants/message/enums/user-reaction.enum.ts +4 -6
  74. package/models/file.schema.ts +2 -0
  75. package/models/icon-variants.schema.ts +12 -0
  76. package/models/index.ts +2 -4
  77. package/models/message.schema.ts +2 -2
  78. package/models/tools/index.ts +3 -0
  79. package/models/tools/paraphrase/index.ts +4 -0
  80. package/models/{tool-paraphrase-config.schema.ts → tools/paraphrase/paraphrase-config.schema.ts} +2 -2
  81. package/models/{tool-paraphrase-job.schema.ts → tools/paraphrase/paraphrase-job.schema.ts} +1 -1
  82. package/models/tools/stt/index.ts +4 -0
  83. package/models/tools/stt/stt-config.schema.ts +8 -0
  84. package/models/tools/stt/stt-job.schema.ts +14 -0
  85. package/models/tools/stt/stt-model.schema.ts +15 -0
  86. package/models/tools/stt/stt-response.schema.ts +8 -0
  87. package/models/tools/tts/index.ts +3 -0
  88. package/models/tools/tts/tts-config.schema.ts +6 -0
  89. package/models/tools/tts/tts-job.schema.ts +23 -0
  90. package/models/tools/tts/tts-model.schema.ts +52 -0
  91. package/package.json +1 -1
  92. package/build/models/tool-paraphrase-config.schema.js +0 -11
  93. /package/api/controllers/http/{tool-paraphrase.ts → paraphrase.ts} +0 -0
  94. /package/build/api/controllers/http/{tool-paraphrase.js → paraphrase.js} +0 -0
  95. /package/build/commands/{tools-paraphrase → tools/paraphrase}/index.js +0 -0
  96. /package/build/commands/{tool → tools/tool}/index.js +0 -0
  97. /package/build/models/{tool-paraphrase-model.schema.js → tools/paraphrase/paraphrase-model.schema.js} +0 -0
  98. /package/build/models/{tool-paraphrase-style.schema.js → tools/paraphrase/paraphrase-style.schema.js} +0 -0
  99. /package/commands/{tools-paraphrase → tools/paraphrase}/index.ts +0 -0
  100. /package/commands/{tool → tools/tool}/index.ts +0 -0
  101. /package/models/{tool-paraphrase-model.schema.ts → tools/paraphrase/paraphrase-model.schema.ts} +0 -0
  102. /package/models/{tool-paraphrase-style.schema.ts → tools/paraphrase/paraphrase-style.schema.ts} +0 -0
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.IconVariantsSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.IconVariantsSchema = zod_1.default.object({
9
+ light: zod_1.default.object({
10
+ svg: zod_1.default.string(),
11
+ png: zod_1.default.string(),
12
+ }),
13
+ dark: zod_1.default.object({
14
+ svg: zod_1.default.string(),
15
+ png: zod_1.default.string(),
16
+ }),
17
+ });
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./tools"), exports);
17
18
  __exportStar(require("./ai-model-config.schema"), exports);
18
19
  __exportStar(require("./ai-model-formatted.schema"), exports);
19
20
  __exportStar(require("./ai-model.schema"), exports);
@@ -26,6 +27,7 @@ __exportStar(require("./course.schema"), exports);
26
27
  __exportStar(require("./date.schema"), exports);
27
28
  __exportStar(require("./feedback.schema"), exports);
28
29
  __exportStar(require("./file.schema"), exports);
30
+ __exportStar(require("./icon-variants.schema"), exports);
29
31
  __exportStar(require("./lesson.schema"), exports);
30
32
  __exportStar(require("./message.schema"), exports);
31
33
  __exportStar(require("./midjourney-job.schema"), exports);
@@ -44,10 +46,6 @@ __exportStar(require("./subscription-upgrade-schema"), exports);
44
46
  __exportStar(require("./subscription.schema"), exports);
45
47
  __exportStar(require("./telegram-user-data.schema"), exports);
46
48
  __exportStar(require("./tool-job.schema"), exports);
47
- __exportStar(require("./tool-paraphrase-config.schema"), exports);
48
- __exportStar(require("./tool-paraphrase-job.schema"), exports);
49
- __exportStar(require("./tool-paraphrase-model.schema"), exports);
50
- __exportStar(require("./tool-paraphrase-model.schema"), exports);
51
49
  __exportStar(require("./tool.schema"), exports);
52
50
  __exportStar(require("./unregistered-user.schema"), exports);
53
51
  __exportStar(require("./user-task.schema"), exports);
@@ -10,7 +10,7 @@ exports.MessageSchema = zod_1.z.object({
10
10
  chatId: zod_1.z.nullable(zod_1.z.string().uuid()),
11
11
  role: zod_1.z.string(),
12
12
  tokenUsage: zod_1.z.number(),
13
- userReaction: zod_1.z.nullable(zod_1.z.enum(Object.values(constants_1.USER_REACTION))),
13
+ userReaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
14
14
  files: zod_1.z.array(file_schema_1.FileSchema),
15
15
  imageFormat: zod_1.z.nullable(zod_1.z.nativeEnum(constants_1.IMAGE_FORMAT)),
16
16
  status: zod_1.z.nativeEnum(constants_1.MESSAGE_STATUS),
@@ -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("./paraphrase"), exports);
18
+ __exportStar(require("./stt"), exports);
19
+ __exportStar(require("./tts"), 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("./paraphrase-config.schema"), exports);
18
+ __exportStar(require("./paraphrase-job.schema"), exports);
19
+ __exportStar(require("./paraphrase-model.schema"), exports);
20
+ __exportStar(require("./paraphrase-style.schema"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParaphraseToolConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const paraphrase_style_schema_1 = require("./paraphrase-style.schema");
6
+ const paraphrase_model_schema_1 = require("./paraphrase-model.schema");
7
+ exports.ParaphraseToolConfigSchema = zod_1.z.object({
8
+ maxSymbols: zod_1.z.number(),
9
+ styles: zod_1.z.array(paraphrase_style_schema_1.ParaphraseStyleSchema),
10
+ types: zod_1.z.array(paraphrase_model_schema_1.ParaphraseModelSchema),
11
+ });
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ParaphraseToolJobSchema = void 0;
4
- const tool_job_schema_1 = require("./tool-job.schema");
5
4
  const zod_1 = require("zod");
5
+ const tool_job_schema_1 = require("../../tool-job.schema");
6
6
  exports.ParaphraseToolJobSchema = tool_job_schema_1.ToolJobSchema.extend({
7
7
  styleId: zod_1.z.string().uuid().nullable().optional(),
8
8
  modelId: zod_1.z.string().uuid().nullable().optional(),
@@ -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-model.schema"), exports);
18
+ __exportStar(require("./stt-response.schema"), exports);
19
+ __exportStar(require("./stt-job.schema"), exports);
20
+ __exportStar(require("./stt-config.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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STTJobSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const stt_response_schema_1 = require("./stt-response.schema");
6
+ const tool_job_schema_1 = require("../../tool-job.schema");
7
+ const constants_1 = require("../../../constants");
8
+ exports.STTJobSchema = tool_job_schema_1.ToolJobSchema.extend({
9
+ modelId: zod_1.z.string(),
10
+ title: zod_1.z.string(),
11
+ reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
12
+ fileUrl: zod_1.z.string(),
13
+ aiResponse: stt_response_schema_1.STTResponseSchema.nullable(),
14
+ });
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STTModelSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
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
+ pricePerMin: zod_1.z.number(),
11
+ order: zod_1.z.number(),
12
+ icons: icon_variants_schema_1.IconVariantsSchema,
13
+ maxDurationSeconds: zod_1.z.number(),
14
+ maxSizeMB: zod_1.z.number(),
15
+ });
@@ -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,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("./tts-config.schema"), exports);
18
+ __exportStar(require("./tts-job.schema"), exports);
19
+ __exportStar(require("./tts-model.schema"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TTSConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const tts_model_schema_1 = require("./tts-model.schema");
6
+ exports.TTSConfigSchema = zod_1.z.object({
7
+ models: zod_1.z.array(tts_model_schema_1.TTSModelSchema),
8
+ });
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TTSJobSchema = exports.TTSJobParamsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const tool_job_schema_1 = require("../../tool-job.schema");
6
+ const constants_1 = require("../../../constants");
7
+ exports.TTSJobParamsSchema = zod_1.z.object({
8
+ speed: zod_1.z.number().optional(),
9
+ similarity: zod_1.z.number().optional(),
10
+ stability: zod_1.z.number().optional(),
11
+ style: zod_1.z.number().optional(),
12
+ });
13
+ exports.TTSJobSchema = tool_job_schema_1.ToolJobSchema.extend({
14
+ userInput: zod_1.z.string(),
15
+ title: zod_1.z.string(),
16
+ reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
17
+ aiResponse: zod_1.z.string().nullable(),
18
+ params: exports.TTSJobParamsSchema,
19
+ modelId: zod_1.z.string(),
20
+ voiceId: zod_1.z.string(),
21
+ });
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TTSModelSchema = exports.TTSModelParams = exports.TTSSliderSchema = exports.TTSVoiceSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
6
+ exports.TTSVoiceSchema = zod_1.z.object({
7
+ id: zod_1.z.string(),
8
+ icon: zod_1.z.string(),
9
+ title: zod_1.z.string(),
10
+ previewUrl: zod_1.z.string(),
11
+ description: zod_1.z.string(),
12
+ languages: zod_1.z.array(zod_1.z.object({
13
+ code: zod_1.z.string(),
14
+ title: zod_1.z.string(),
15
+ icon: zod_1.z.string(),
16
+ order: zod_1.z.number(),
17
+ })),
18
+ order: zod_1.z.number(),
19
+ });
20
+ exports.TTSSliderSchema = zod_1.z.object({
21
+ title: zod_1.z.string(),
22
+ description: zod_1.z.string(),
23
+ icons: icon_variants_schema_1.IconVariantsSchema,
24
+ min: zod_1.z.number(),
25
+ minLabel: zod_1.z.string(),
26
+ max: zod_1.z.number(),
27
+ maxLabel: zod_1.z.string(),
28
+ step: zod_1.z.number(),
29
+ default: zod_1.z.number(),
30
+ });
31
+ exports.TTSModelParams = zod_1.z
32
+ .object({
33
+ speed: exports.TTSSliderSchema,
34
+ stability: exports.TTSSliderSchema,
35
+ similarity: exports.TTSSliderSchema,
36
+ style: exports.TTSSliderSchema,
37
+ })
38
+ .partial();
39
+ exports.TTSModelSchema = zod_1.z.object({
40
+ uuid: zod_1.z.string(),
41
+ title: zod_1.z.string(),
42
+ description: zod_1.z.string(),
43
+ pricePerThousandSymbols: zod_1.z.number(),
44
+ order: zod_1.z.number(),
45
+ icons: icon_variants_schema_1.IconVariantsSchema,
46
+ maxInputLength: zod_1.z.number(),
47
+ params: exports.TTSModelParams,
48
+ voices: zod_1.z.array(exports.TTSVoiceSchema),
49
+ });
package/commands/index.ts CHANGED
@@ -20,8 +20,7 @@ export * from './task';
20
20
  export * from './telegram';
21
21
  export * from './telegram-auth';
22
22
  export * from './telegram-profile';
23
- export * from './tool';
24
- export * from './tools-paraphrase';
23
+ export * from './tools';
25
24
  export * from './unregistered-user';
26
25
  export * from './user';
27
26
  export * from './user-to-subscription';
@@ -0,0 +1,4 @@
1
+ export * from './paraphrase';
2
+ export * from './stt';
3
+ export * from './tool';
4
+ export * from './tts';
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { ParaphraseToolJobSchema } from '../../models/tool-paraphrase-job.schema';
2
+ import { ParaphraseToolJobSchema } from '../../../models';
3
3
 
4
4
  export namespace FindParaphraseJobByUUIDCommand {
5
5
  export const RequestParamsSchema = ParaphraseToolJobSchema.pick({
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { ParaphraseToolConfigSchema } from '../../models';
2
+ import { ParaphraseToolConfigSchema } from '../../../models';
3
3
 
4
4
  export namespace GetParaphraseToolConfigCommand {
5
5
  export const ResponseSchema = z.object({
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { ToolJobSchema } from '../../models';
3
- import { PARAPHRASING_INTENSITY } from '../../constants';
2
+ import { PARAPHRASING_INTENSITY } from '../../../constants';
3
+ import { ToolJobSchema } from '../../../models';
4
4
 
5
5
  export namespace ParaphraseCommand {
6
6
  export const RequestSchema = z.object({
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllSTTJobsCommand {
4
+ export const ResponseSchema = z.void();
5
+ export type Response = z.infer<typeof ResponseSchema>;
6
+ }
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteSTTJobByUUIDCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const ResponseSchema = z.void();
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { STTJobSchema, ToolJobSchema } from '../../../models';
3
+
4
+ export namespace FindSTTJobByUUIDCommand {
5
+ export const RequestParamsSchema = ToolJobSchema.pick({
6
+ uuid: true,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: STTJobSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { STTJobSchema } from '../../../models';
3
+
4
+ export namespace FindSTTJobsCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ limit: z.coerce.number().min(1).optional(),
7
+ offset: z.coerce.number().min(0).default(0).optional(),
8
+ title: z.string().optional(),
9
+ });
10
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: z.array(STTJobSchema),
14
+ totalPages: z.number(),
15
+ page: z.number(),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { STTConfigSchema } from '../../../models';
3
+
4
+ export namespace GetSTTToolConfigCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: STTConfigSchema,
7
+ });
8
+
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1,7 @@
1
+ export * from './delete-all-stt-jobs.command';
2
+ export * from './delete-stt-job-by-uuid.command';
3
+ export * from './find-stt-job-by-uuid.command';
4
+ export * from './find-stt-jobs.command';
5
+ export * from './get-stt-tool-config.command';
6
+ export * from './set-reaction-to-stt-job.command';
7
+ export * from './stt.command';
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { STTJobSchema } from '../../../models';
3
+ import { USER_REACTION } from '../../../constants';
4
+
5
+ export namespace SetReactionToSTTJobCommand {
6
+ export const RequestSchema = z.object({
7
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
8
+ });
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const RequestParamsSchema = z.object({
12
+ uuid: z.string(),
13
+ });
14
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
15
+
16
+ export const ResponseSchema = z.object({
17
+ data: STTJobSchema,
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { ToolJobSchema } from '../../../models';
3
+
4
+ export namespace STTCommand {
5
+ export const RequestSchema = z.object({
6
+ fileId: z.string().uuid(),
7
+ modelId: z.string().uuid(),
8
+ });
9
+
10
+ export type Request = z.infer<typeof RequestSchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: ToolJobSchema,
14
+ });
15
+
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -1,4 +1,4 @@
1
- import { ToolSchema } from '../../models';
1
+ import { ToolSchema } from '../../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace FindAllToolsCommand {
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllTTSJobsCommand {
4
+ export const ResponseSchema = z.void();
5
+ export type Response = z.infer<typeof ResponseSchema>;
6
+ }
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteTTSJobByUUIDCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const ResponseSchema = z.void();
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { TTSJobSchema, ToolJobSchema } from '../../../models';
3
+
4
+ export namespace FindTTSJobByUUIDCommand {
5
+ export const RequestParamsSchema = ToolJobSchema.pick({
6
+ uuid: true,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: TTSJobSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { TTSJobSchema } from '../../../models';
3
+
4
+ export namespace FindTTSJobsCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ limit: z.coerce.number().min(1).optional(),
7
+ offset: z.coerce.number().min(0).default(0).optional(),
8
+ title: z.string().optional(),
9
+ });
10
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: z.array(TTSJobSchema),
14
+ totalPages: z.number(),
15
+ page: z.number(),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { TTSConfigSchema } from '../../../models';
3
+
4
+ export namespace GetTTSToolConfigCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: TTSConfigSchema,
7
+ });
8
+
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1,8 @@
1
+ export * from './delete-all-tts-jobs.command';
2
+ export * from './delete-tts-job-by-uuid.command';
3
+ export * from './find-tts-job-by-uuid.command';
4
+ export * from './find-tts-jobs.command';
5
+ export * from './get-tts-tool-config.command';
6
+ export * from './set-reaction-to-tts-job.command';
7
+ export * from './tts.command';
8
+ export * from './update-tts-job-title.command';
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { TTSJobSchema } from '../../../models';
3
+ import { USER_REACTION } from '../../../constants';
4
+
5
+ export namespace SetReactionToTTSJobCommand {
6
+ export const RequestSchema = z.object({
7
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
8
+ });
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const RequestParamsSchema = z.object({
12
+ uuid: z.string(),
13
+ });
14
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
15
+
16
+ export const ResponseSchema = z.object({
17
+ data: TTSJobSchema,
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { ToolJobSchema } from '../../../models';
3
+
4
+ export namespace TTSCommand {
5
+ export const RequestSchema = z.object({
6
+ modelId: z.string().uuid(),
7
+ voiceId: z.string().uuid(),
8
+ text: z.string(),
9
+ params: z
10
+ .object({
11
+ speed: z.number().optional(),
12
+ similarity: z.number().optional(),
13
+ stability: z.number().optional(),
14
+ style: z.number().optional(),
15
+ language: z.string().optional(),
16
+ })
17
+ .optional()
18
+ .default({}),
19
+ });
20
+
21
+ export type Request = z.infer<typeof RequestSchema>;
22
+
23
+ export const ResponseSchema = z.object({
24
+ data: ToolJobSchema,
25
+ });
26
+
27
+ export type Response = z.infer<typeof ResponseSchema>;
28
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { TTSJobSchema } from '../../../models';
3
+
4
+ export namespace UpdateTTSJobTitleCommand {
5
+ export const RequestSchema = z.object({
6
+ title: z.string().min(1).max(40).trim(),
7
+ });
8
+ export type Request = z.infer<typeof RequestSchema>;
9
+
10
+ export const RequestParamsSchema = z.object({
11
+ uuid: z.string(),
12
+ });
13
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: TTSJobSchema,
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }