@purpleschool/gptbot 0.7.71 → 0.7.74

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 (97) hide show
  1. package/api/controllers/http/index.ts +1 -0
  2. package/api/controllers/http/music.ts +16 -0
  3. package/api/controllers/http/promocode.ts +0 -1
  4. package/api/controllers/http/webmaster.ts +1 -1
  5. package/build/api/controllers/http/index.js +1 -0
  6. package/build/api/controllers/http/music.js +18 -0
  7. package/build/api/controllers/http/promocode.js +0 -1
  8. package/build/api/controllers/http/webmaster.js +1 -1
  9. package/build/commands/auth/register-user.command.js +2 -4
  10. package/build/commands/auth/vk-login.command.js +5 -2
  11. package/build/commands/auth/yandex-login.command.js +5 -2
  12. package/build/commands/cabinet/get-user-statistics-by-month.command.js +2 -0
  13. package/build/commands/product/buy-product.command.js +4 -0
  14. package/build/commands/promocode/index.js +0 -1
  15. package/build/commands/subscription/buy-subscription.command.js +4 -0
  16. package/build/commands/telegram-auth/create-telegram-auth-link.command.js +2 -0
  17. package/build/commands/telegram-profile/auth-with-telegram-web-app.command.js +4 -0
  18. package/build/commands/tools/index.js +1 -0
  19. package/build/commands/tools/music/convert-to-wav.command.js +16 -0
  20. package/build/commands/tools/music/delete-all-music-jobs.command.js +8 -0
  21. package/build/commands/tools/music/delete-music-job-by-uuid.command.js +11 -0
  22. package/build/commands/tools/music/find-music-job-by-uuid.command.js +14 -0
  23. package/build/commands/tools/music/find-music-jobs.command.js +18 -0
  24. package/build/commands/tools/music/generate-lyrics.command.js +16 -0
  25. package/build/commands/tools/music/generate-music.command.js +15 -0
  26. package/build/commands/tools/music/get-music-tool-config.command.js +11 -0
  27. package/build/commands/tools/music/index.js +27 -0
  28. package/build/commands/tools/music/retry-music-job.command.js +14 -0
  29. package/build/commands/tools/music/set-reaction-to-music-job.command.js +18 -0
  30. package/build/commands/tools/music/update-music-job-title.command.js +17 -0
  31. package/build/commands/user/get-me.command.js +1 -0
  32. package/build/constants/errors/errors.js +96 -3
  33. package/build/constants/index.js +1 -0
  34. package/build/constants/promocode/enums/promocode-promotion.enum.js +0 -1
  35. package/build/constants/tool-music/enums/index.js +21 -0
  36. package/build/constants/tool-music/enums/music-pricing-rule-type.enum.js +7 -0
  37. package/build/constants/tool-music/enums/music-strategy.enum.js +7 -0
  38. package/build/constants/tool-music/enums/music-vocal-gender.enum.js +8 -0
  39. package/build/constants/tool-music/enums/suno-mode-type.enum.js +10 -0
  40. package/build/constants/tool-music/enums/suno-model-type.enum.js +10 -0
  41. package/build/constants/tool-music/index.js +17 -0
  42. package/build/models/index.js +1 -0
  43. package/build/models/promocode.schema.js +0 -1
  44. package/build/models/tools/index.js +1 -0
  45. package/build/models/tools/music/index.js +20 -0
  46. package/build/models/tools/music/music-config.schema.js +8 -0
  47. package/build/models/tools/music/music-job.schema.js +40 -0
  48. package/build/models/tools/music/music-model.schema.js +32 -0
  49. package/build/models/tools/music/music-track.schema.js +17 -0
  50. package/build/models/user-referrals.schema.js +15 -0
  51. package/build/models/webmaster-balance.schema.js +0 -1
  52. package/commands/auth/register-user.command.ts +3 -5
  53. package/commands/auth/vk-login.command.ts +9 -6
  54. package/commands/auth/yandex-login.command.ts +7 -4
  55. package/commands/cabinet/get-user-statistics-by-month.command.ts +2 -0
  56. package/commands/product/buy-product.command.ts +4 -0
  57. package/commands/promocode/index.ts +0 -1
  58. package/commands/subscription/buy-subscription.command.ts +4 -0
  59. package/commands/telegram-auth/create-telegram-auth-link.command.ts +5 -0
  60. package/commands/telegram-profile/auth-with-telegram-web-app.command.ts +4 -0
  61. package/commands/tools/index.ts +1 -0
  62. package/commands/tools/music/convert-to-wav.command.ts +17 -0
  63. package/commands/tools/music/delete-all-music-jobs.command.ts +6 -0
  64. package/commands/tools/music/delete-music-job-by-uuid.command.ts +11 -0
  65. package/commands/tools/music/find-music-job-by-uuid.command.ts +16 -0
  66. package/commands/tools/music/find-music-jobs.command.ts +18 -0
  67. package/commands/tools/music/generate-lyrics.command.ts +17 -0
  68. package/commands/tools/music/generate-music.command.ts +16 -0
  69. package/commands/tools/music/get-music-tool-config.command.ts +10 -0
  70. package/commands/tools/music/index.ts +11 -0
  71. package/commands/tools/music/retry-music-job.command.ts +14 -0
  72. package/commands/tools/music/set-reaction-to-music-job.command.ts +20 -0
  73. package/commands/tools/music/update-music-job-title.command.ts +19 -0
  74. package/commands/user/get-me.command.ts +1 -0
  75. package/constants/errors/errors.ts +96 -3
  76. package/constants/index.ts +1 -0
  77. package/constants/promocode/enums/promocode-promotion.enum.ts +0 -1
  78. package/constants/tool-music/enums/index.ts +5 -0
  79. package/constants/tool-music/enums/music-pricing-rule-type.enum.ts +3 -0
  80. package/constants/tool-music/enums/music-strategy.enum.ts +3 -0
  81. package/constants/tool-music/enums/music-vocal-gender.enum.ts +4 -0
  82. package/constants/tool-music/enums/suno-mode-type.enum.ts +6 -0
  83. package/constants/tool-music/enums/suno-model-type.enum.ts +6 -0
  84. package/constants/tool-music/index.ts +1 -0
  85. package/models/index.ts +1 -0
  86. package/models/promocode.schema.ts +0 -1
  87. package/models/tools/index.ts +1 -0
  88. package/models/tools/music/index.ts +4 -0
  89. package/models/tools/music/music-config.schema.ts +6 -0
  90. package/models/tools/music/music-job.schema.ts +43 -0
  91. package/models/tools/music/music-model.schema.ts +33 -0
  92. package/models/tools/music/music-track.schema.ts +19 -0
  93. package/models/user-referrals.schema.ts +10 -0
  94. package/models/webmaster-balance.schema.ts +0 -1
  95. package/package.json +1 -1
  96. package/build/commands/promocode/get-webmaster-promocode.command.js +0 -17
  97. package/commands/promocode/get-webmaster-promocode.command.ts +0 -19
@@ -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("./enums"), exports);
@@ -68,3 +68,4 @@ __exportStar(require("./users-filter-notification.schema"), exports);
68
68
  __exportStar(require("./daily-streak"), exports);
69
69
  __exportStar(require("./webmaster.schema"), exports);
70
70
  __exportStar(require("./webmaster-balance.schema"), exports);
71
+ __exportStar(require("./user-referrals.schema"), exports);
@@ -15,7 +15,6 @@ exports.PromocodeSchema = zod_1.z.object({
15
15
  endDate: zod_1.z.date().nullable(),
16
16
  userId: zod_1.z.string().uuid().nullable(),
17
17
  unregisteredUserId: zod_1.z.string().uuid().nullable(),
18
- webmasterId: zod_1.z.string().uuid().nullable(),
19
18
  createdAt: zod_1.z.date(),
20
19
  updatedAt: zod_1.z.date(),
21
20
  });
@@ -22,3 +22,4 @@ __exportStar(require("./video"), exports);
22
22
  __exportStar(require("./writer"), exports);
23
23
  __exportStar(require("./image-editor"), exports);
24
24
  __exportStar(require("./video-editor"), exports);
25
+ __exportStar(require("./music"), 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("./music-config.schema"), exports);
18
+ __exportStar(require("./music-job.schema"), exports);
19
+ __exportStar(require("./music-model.schema"), exports);
20
+ __exportStar(require("./music-track.schema"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MusicConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const music_model_schema_1 = require("./music-model.schema");
6
+ exports.MusicConfigSchema = zod_1.z.object({
7
+ models: zod_1.z.array(music_model_schema_1.MusicModelSchema),
8
+ });
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MusicJobSchema = exports.MusicJobParamsSchema = 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
+ const music_track_schema_1 = require("./music-track.schema");
8
+ exports.MusicJobParamsSchema = zod_1.z.discriminatedUnion('mode', [
9
+ zod_1.z.object({
10
+ mode: zod_1.z.literal(constants_1.SUNO_MODE_TYPE.SIMPLE),
11
+ prompt: zod_1.z.string().min(1).max(450),
12
+ style: zod_1.z.string(),
13
+ vocalGender: zod_1.z.nativeEnum(constants_1.MUSIC_VOCAL_GENDER),
14
+ }),
15
+ zod_1.z.object({
16
+ mode: zod_1.z.literal(constants_1.SUNO_MODE_TYPE.SIMPLE_INSTRUMENTAL),
17
+ prompt: zod_1.z.string().min(1).max(450),
18
+ style: zod_1.z.string(),
19
+ }),
20
+ zod_1.z.object({
21
+ mode: zod_1.z.literal(constants_1.SUNO_MODE_TYPE.CUSTOM),
22
+ prompt: zod_1.z.string().min(1).max(5000),
23
+ title: zod_1.z.string().min(1).max(80),
24
+ style: zod_1.z.string().min(1).max(1000),
25
+ vocalGender: zod_1.z.nativeEnum(constants_1.MUSIC_VOCAL_GENDER),
26
+ }),
27
+ zod_1.z.object({
28
+ mode: zod_1.z.literal(constants_1.SUNO_MODE_TYPE.CUSTOM_INSTRUMENTAL),
29
+ title: zod_1.z.string().min(1).max(80),
30
+ style: zod_1.z.string().min(1).max(1000),
31
+ }),
32
+ ]);
33
+ exports.MusicJobSchema = tool_job_schema_1.ToolJobSchema.extend({
34
+ title: zod_1.z.string(),
35
+ prompt: zod_1.z.string(),
36
+ reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
37
+ tracks: zod_1.z.array(music_track_schema_1.MusicTrackSchema),
38
+ params: exports.MusicJobParamsSchema,
39
+ modelId: zod_1.z.string(),
40
+ });
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MusicModelSchema = exports.MusicModelParamsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
6
+ const unlocked_by_subscription_schema_1 = require("../../unlocked-by-subscription.schema");
7
+ const constants_1 = require("../../../constants");
8
+ exports.MusicModelParamsSchema = zod_1.z.object({
9
+ vocalGender: zod_1.z.object({
10
+ options: zod_1.z.array(zod_1.z.nativeEnum(constants_1.MUSIC_VOCAL_GENDER)),
11
+ }),
12
+ styles: zod_1.z.object({
13
+ maxStyles: zod_1.z.number(),
14
+ options: zod_1.z.array(zod_1.z.object({
15
+ title: zod_1.z.string(),
16
+ style: zod_1.z.string(),
17
+ })),
18
+ }),
19
+ });
20
+ exports.MusicModelSchema = zod_1.z.object({
21
+ uuid: zod_1.z.string(),
22
+ title: zod_1.z.string(),
23
+ description: zod_1.z.string(),
24
+ pricePerTrack: zod_1.z.number(),
25
+ order: zod_1.z.number(),
26
+ icons: icon_variants_schema_1.IconVariantsSchema,
27
+ maxPromptLength: zod_1.z.number(),
28
+ maxLyricsLength: zod_1.z.number(),
29
+ params: exports.MusicModelParamsSchema,
30
+ unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
31
+ canUse: zod_1.z.boolean(),
32
+ });
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MusicTrackSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.MusicTrackSchema = zod_1.z.object({
6
+ uuid: zod_1.z.string(),
7
+ title: zod_1.z.string(),
8
+ audioId: zod_1.z.string(),
9
+ audioUrl: zod_1.z.string(),
10
+ coverUrl: zod_1.z.string(),
11
+ tags: zod_1.z.string(),
12
+ duration: zod_1.z.number(),
13
+ genJobId: zod_1.z.string().nullable().optional(),
14
+ editorJobId: zod_1.z.string().nullable().optional(),
15
+ createdAt: zod_1.z.date(),
16
+ updatedAt: zod_1.z.date(),
17
+ });
@@ -0,0 +1,15 @@
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.UserReferralsSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.UserReferralsSchema = zod_1.default.object({
9
+ partnerId: zod_1.default.string().uuid().optional(),
10
+ webmasterAlias: zod_1.default.string().optional(),
11
+ webmasterReferralProvidedAt: zod_1.default
12
+ .string()
13
+ .transform((date) => new Date(date))
14
+ .optional(),
15
+ });
@@ -10,7 +10,6 @@ exports.WebmasterBalanceSchema = zod_1.default.object({
10
10
  uuid: zod_1.default.string().uuid(),
11
11
  webmasterId: zod_1.default.string().uuid(),
12
12
  orderId: zod_1.default.string().uuid().nullable(),
13
- promocodeId: zod_1.default.string().uuid().nullable(),
14
13
  sourceUserId: zod_1.default.string().uuid().nullable(),
15
14
  amount: zod_1.default.number(),
16
15
  type: zod_1.default.nativeEnum(constants_1.WEBMASTER_BALANCE_TYPE),
@@ -1,14 +1,12 @@
1
- import { UserSchema, UtmSchema } from '../../models';
1
+ import { UserReferralsSchema, UserSchema, UtmSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace RegisterUserCommand {
5
5
  export const RequestSchema = UserSchema.pick({ email: true, password: true })
6
- .extend({
7
- partnerId: z.string().optional(),
8
- })
9
6
  .extend({
10
7
  utm: UtmSchema.optional(),
11
- });
8
+ })
9
+ .merge(UserReferralsSchema);
12
10
 
13
11
  export type Request = z.infer<typeof RequestSchema>;
14
12
 
@@ -1,12 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { UserReferralsSchema } from '../../models';
2
3
 
3
4
  export namespace VKLoginCommand {
4
- export const RequestSchema = z.object({
5
- code: z.string(),
6
- code_verifier: z.string(),
7
- device_id: z.string(),
8
- state: z.string(),
9
- });
5
+ export const RequestSchema = z
6
+ .object({
7
+ code: z.string(),
8
+ code_verifier: z.string(),
9
+ device_id: z.string(),
10
+ state: z.string(),
11
+ })
12
+ .merge(UserReferralsSchema);
10
13
 
11
14
  export type Request = z.infer<typeof RequestSchema>;
12
15
 
@@ -1,10 +1,13 @@
1
1
  import { z } from 'zod';
2
+ import { UserReferralsSchema } from '../../models';
2
3
 
3
4
  export namespace YandexLoginCommand {
4
- export const RequestSchema = z.object({
5
- code: z.string(),
6
- code_verifier: z.string(),
7
- });
5
+ export const RequestSchema = z
6
+ .object({
7
+ code: z.string(),
8
+ code_verifier: z.string(),
9
+ })
10
+ .merge(UserReferralsSchema);
8
11
 
9
12
  export type Request = z.infer<typeof RequestSchema>;
10
13
 
@@ -13,6 +13,8 @@ export namespace GetUserStatisticsByMonthCommand {
13
13
  total_writers: z.number(),
14
14
  total_writer_actions: z.number(),
15
15
  }),
16
+ total_video_edits: z.number(),
17
+ total_musics: z.number(),
16
18
  });
17
19
 
18
20
  export const ResponseSchema = z.object({
@@ -36,6 +36,10 @@ export namespace BuyProductCommand {
36
36
  email: z.string().email(),
37
37
  partnerId: z.string().uuid().optional(),
38
38
  promocode: z.string().optional(),
39
+ webmasterAlias: z.string().optional(),
40
+ webmasterReferralProvidedAt: z
41
+ .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
42
+ .optional(),
39
43
  });
40
44
 
41
45
  export type RequestFast = z.infer<typeof RequestFastSchema>;
@@ -4,4 +4,3 @@ export * from './find-promocode.command';
4
4
  export * from './get-upsell-offer.command';
5
5
  export * from './update-promocode.command';
6
6
  export * from './validate-promocode.command';
7
- export * from './get-webmaster-promocode.command';
@@ -16,6 +16,10 @@ export namespace BuySubscriptionCommand {
16
16
  email: z.string().email(),
17
17
  partnerId: z.string().uuid().optional(),
18
18
  promocode: z.string().optional(),
19
+ webmasterAlias: z.string().optional(),
20
+ webmasterReferralProvidedAt: z
21
+ .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
22
+ .optional(),
19
23
  });
20
24
 
21
25
  export type RequestFast = z.infer<typeof RequestFastSchema>;
@@ -1,6 +1,11 @@
1
1
  import { z } from 'zod';
2
+ import { UserReferralsSchema } from '../../models';
2
3
 
3
4
  export namespace CreateTelegramAuthLinkCommand {
5
+ export const RequestSchema = UserReferralsSchema;
6
+
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
4
9
  export const ResponseSchema = z.object({
5
10
  data: z.object({
6
11
  uuid: z.string().uuid(),
@@ -6,6 +6,10 @@ export namespace AuthWithTelegramWebAppCommand {
6
6
  initData: z.string(),
7
7
  platform: z.string().nullable(),
8
8
  partnerId: z.string().optional(),
9
+ webmasterAlias: z.string().optional(),
10
+ webmasterReferralProvidedAt: z
11
+ .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
12
+ .optional(),
9
13
  utm: UtmSchema.optional(),
10
14
  });
11
15
 
@@ -7,3 +7,4 @@ export * from './video';
7
7
  export * from './writer';
8
8
  export * from './image-editor';
9
9
  export * from './video-editor';
10
+ export * from './music';
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export namespace ConvertToWavCommand {
3
+ export const RequestSchema = z.object({
4
+ taskId: z.string(),
5
+ audioId: z.string(),
6
+ });
7
+
8
+ export type Request = z.infer<typeof RequestSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: z.object({
12
+ url: z.string().url(),
13
+ }),
14
+ });
15
+
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllMusicJobsCommand {
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 DeleteMusicJobByUUIDCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
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 { MusicJobSchema, ToolJobSchema } from '../../../models';
3
+
4
+ export namespace FindMusicJobByUUIDCommand {
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: MusicJobSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { MusicJobSchema } from '../../../models';
3
+
4
+ export namespace FindMusicJobsCommand {
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(MusicJobSchema),
14
+ totalPages: z.number(),
15
+ page: z.number(),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export namespace GenerateLyricsCommand {
3
+ export const RequestSchema = z.object({
4
+ prompt: z.string(),
5
+ });
6
+
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
9
+ export const ResponseSchema = z.object({
10
+ data: z.object({
11
+ title: z.string(),
12
+ lyrics: z.string(),
13
+ }),
14
+ });
15
+
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { ToolJobSchema, MusicJobParamsSchema } from '../../../models';
3
+ export namespace MusicCommand {
4
+ export const RequestSchema = z.object({
5
+ modelId: z.string().uuid(),
6
+ params: MusicJobParamsSchema,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: ToolJobSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { MusicConfigSchema } from '../../../models';
3
+
4
+ export namespace GetMusicToolConfigCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: MusicConfigSchema,
7
+ });
8
+
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1,11 @@
1
+ export * from './delete-all-music-jobs.command';
2
+ export * from './delete-music-job-by-uuid.command';
3
+ export * from './find-music-job-by-uuid.command';
4
+ export * from './find-music-jobs.command';
5
+ export * from './get-music-tool-config.command';
6
+ export * from './retry-music-job.command';
7
+ export * from './set-reaction-to-music-job.command';
8
+ export * from './generate-music.command';
9
+ export * from './update-music-job-title.command';
10
+ export * from './convert-to-wav.command';
11
+ export * from './generate-lyrics.command';
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { MusicJobSchema } from '../../../models';
3
+
4
+ export namespace RetryMusicJobCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: MusicJobSchema,
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { MusicJobSchema } from '../../../models';
3
+ import { USER_REACTION } from '../../../constants';
4
+
5
+ export namespace SetReactionToMusicJobCommand {
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().uuid(),
13
+ });
14
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
15
+
16
+ export const ResponseSchema = z.object({
17
+ data: MusicJobSchema,
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { MusicJobSchema } from '../../../models';
3
+
4
+ export namespace UpdateMusicJobTitleCommand {
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().uuid(),
12
+ });
13
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: MusicJobSchema,
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -14,6 +14,7 @@ export namespace GetMeCommand {
14
14
  role: z.nativeEnum(ROLE),
15
15
  signupMethod: z.nativeEnum(SIGNUP_METHOD),
16
16
  telegramId: z.number().nullable(),
17
+ webmasterId: z.string().uuid().nullable(),
17
18
  }),
18
19
  });
19
20
 
@@ -2184,19 +2184,112 @@ export const ERRORS = {
2184
2184
  message: 'Произошла ошибка при установке реакции на документ',
2185
2185
  httpCode: 500,
2186
2186
  },
2187
- WRITER_MODEL_NOT_FOUND: {
2187
+ MUSIC_CONFIG_ERROR: {
2188
2188
  code: 'A446',
2189
+ message: 'Произошла ошибка при получении конфигурации инструмента для генерации музыки',
2190
+ httpCode: 500,
2191
+ },
2192
+ MUSIC_SEND_REQUEST_ERROR: {
2193
+ code: 'A447',
2194
+ message: 'Произошла ошибка при отправке запроса на генерацию музыки',
2195
+ httpCode: 500,
2196
+ },
2197
+ MUSIC_FIND_JOBS_ERROR: {
2198
+ code: 'A448',
2199
+ message: 'Произошла ошибка при получении списка заданий на генерацию музыки',
2200
+ httpCode: 500,
2201
+ },
2202
+ MUSIC_FIND_JOB_ERROR: {
2203
+ code: 'A449',
2204
+ message: 'Произошла ошибка при получении задания на генерацию музыки',
2205
+ httpCode: 500,
2206
+ },
2207
+ MUSIC_RETRY_JOB_ERROR: {
2208
+ code: 'A450',
2209
+ message: 'Произошла ошибка при повторном запросе на генерацию музыки',
2210
+ httpCode: 500,
2211
+ },
2212
+ MUSIC_SET_REACTION_ERROR: {
2213
+ code: 'A451',
2214
+ message: 'Произошла ошибка при установке оценки задания на генерацию музыки',
2215
+ httpCode: 500,
2216
+ },
2217
+ MUSIC_UPDATE_TITLE_ERROR: {
2218
+ code: 'A452',
2219
+ message: 'Произошла ошибка при обновлении названия задания на генерацию музыки',
2220
+ httpCode: 500,
2221
+ },
2222
+ MUSIC_DELETE_JOB_ERROR: {
2223
+ code: 'A453',
2224
+ message: 'Произошла ошибка при удалении задания на генерацию музыки',
2225
+ httpCode: 500,
2226
+ },
2227
+ MUSIC_DELETE_ALL_JOBS_ERROR: {
2228
+ code: 'A454',
2229
+ message: 'Произошла ошибка при удалении всех заданий на генерацию музыки',
2230
+ httpCode: 500,
2231
+ },
2232
+ MUSIC_MODEL_NOT_FOUND: {
2233
+ code: 'A455',
2234
+ message: 'Не удалось найти указанную модель для генерации музыки',
2235
+ httpCode: 400,
2236
+ },
2237
+ MUSIC_MODEL_INACTIVE: {
2238
+ code: 'A456',
2239
+ message: 'Модель для генерации музыки неактивна',
2240
+ httpCode: 400,
2241
+ },
2242
+ MUSIC_MODEL_NOT_AVAILABLE: {
2243
+ code: 'A457',
2244
+ message: 'Модель для генерации музыки недоступна для данного пользователя',
2245
+ httpCode: 403,
2246
+ },
2247
+ MUSIC_MAX_SYMBOLS_EXCEEDED: {
2248
+ code: 'A458',
2249
+ message: 'Превышена максимальная количество символов',
2250
+ },
2251
+ MUSIC_INVALID_VOCAL: {
2252
+ code: 'A459',
2253
+ message: 'Выбран неверный голос для вокала',
2254
+ },
2255
+ MUSIC_JOB_DELETE_ERROR: {
2256
+ code: 'A460',
2257
+ message: 'Произошла ошибка при удалении сообщения',
2258
+ httpCode: 500,
2259
+ },
2260
+ MUSIC_RETRY_REQUEST_ERROR: {
2261
+ code: 'A461',
2262
+ message: 'Произошла ошибка при повторном запросе на генерацию музыки',
2263
+ httpCode: 500,
2264
+ },
2265
+ MUSIC_LYRICS_GENERATION_ERROR: {
2266
+ code: 'A462',
2267
+ message: 'Произошла ошибка при запросе на генерацию текста песни',
2268
+ httpCode: 500,
2269
+ },
2270
+ MUSIC_CONVERT_TO_WAV_ERROR: {
2271
+ code: 'A463',
2272
+ message: 'Произошла ошибка при запросе на конвертацию mp3 в wav',
2273
+ httpCode: 500,
2274
+ },
2275
+ WRITER_MODEL_NOT_FOUND: {
2276
+ code: 'A464',
2189
2277
  message: 'Не удалось найти указанную модель для Writer',
2190
2278
  httpCode: 400,
2191
2279
  },
2192
2280
  WRITER_MODEL_INACTIVE: {
2193
- code: 'A447',
2281
+ code: 'A465',
2194
2282
  message: 'Модель Writer архивирована и недоступна для пользования',
2195
2283
  httpCode: 403,
2196
2284
  },
2197
2285
  WRITER_MODEL_ACCESS_DENIED: {
2198
- code: 'A448',
2286
+ code: 'A466',
2199
2287
  message: 'У вас нет доступа к этой модели Writer',
2200
2288
  httpCode: 403,
2201
2289
  },
2290
+ WEBMASTER_BONUS_APPLY_ERROR: {
2291
+ code: 'A449',
2292
+ message: 'Не удалось применить бонусы вебмастеру',
2293
+ httpCode: 500,
2294
+ },
2202
2295
  };
@@ -39,3 +39,4 @@ export * from './daily-streak';
39
39
  export * from './cabinet';
40
40
  export * from './webmaster';
41
41
  export * from './webmaster-balance';
42
+ export * from './tool-music';
@@ -2,5 +2,4 @@ export enum PROMOCODE_PROMOTION {
2
2
  BONUS = 'bonus',
3
3
  CHAT_UPSELL = 'chat_upsell',
4
4
  DAILY_STREAK = 'daily_streak',
5
- WEBMASTER = 'webmaster',
6
5
  }