@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.
- package/api/controllers/http/index.ts +1 -0
- package/api/controllers/http/music.ts +16 -0
- package/api/controllers/http/promocode.ts +0 -1
- package/api/controllers/http/webmaster.ts +1 -1
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/controllers/http/music.js +18 -0
- package/build/api/controllers/http/promocode.js +0 -1
- package/build/api/controllers/http/webmaster.js +1 -1
- package/build/commands/auth/register-user.command.js +2 -4
- package/build/commands/auth/vk-login.command.js +5 -2
- package/build/commands/auth/yandex-login.command.js +5 -2
- package/build/commands/cabinet/get-user-statistics-by-month.command.js +2 -0
- package/build/commands/product/buy-product.command.js +4 -0
- package/build/commands/promocode/index.js +0 -1
- package/build/commands/subscription/buy-subscription.command.js +4 -0
- package/build/commands/telegram-auth/create-telegram-auth-link.command.js +2 -0
- package/build/commands/telegram-profile/auth-with-telegram-web-app.command.js +4 -0
- package/build/commands/tools/index.js +1 -0
- package/build/commands/tools/music/convert-to-wav.command.js +16 -0
- package/build/commands/tools/music/delete-all-music-jobs.command.js +8 -0
- package/build/commands/tools/music/delete-music-job-by-uuid.command.js +11 -0
- package/build/commands/tools/music/find-music-job-by-uuid.command.js +14 -0
- package/build/commands/tools/music/find-music-jobs.command.js +18 -0
- package/build/commands/tools/music/generate-lyrics.command.js +16 -0
- package/build/commands/tools/music/generate-music.command.js +15 -0
- package/build/commands/tools/music/get-music-tool-config.command.js +11 -0
- package/build/commands/tools/music/index.js +27 -0
- package/build/commands/tools/music/retry-music-job.command.js +14 -0
- package/build/commands/tools/music/set-reaction-to-music-job.command.js +18 -0
- package/build/commands/tools/music/update-music-job-title.command.js +17 -0
- package/build/commands/user/get-me.command.js +1 -0
- package/build/constants/errors/errors.js +96 -3
- package/build/constants/index.js +1 -0
- package/build/constants/promocode/enums/promocode-promotion.enum.js +0 -1
- package/build/constants/tool-music/enums/index.js +21 -0
- package/build/constants/tool-music/enums/music-pricing-rule-type.enum.js +7 -0
- package/build/constants/tool-music/enums/music-strategy.enum.js +7 -0
- package/build/constants/tool-music/enums/music-vocal-gender.enum.js +8 -0
- package/build/constants/tool-music/enums/suno-mode-type.enum.js +10 -0
- package/build/constants/tool-music/enums/suno-model-type.enum.js +10 -0
- package/build/constants/tool-music/index.js +17 -0
- package/build/models/index.js +1 -0
- package/build/models/promocode.schema.js +0 -1
- package/build/models/tools/index.js +1 -0
- package/build/models/tools/music/index.js +20 -0
- package/build/models/tools/music/music-config.schema.js +8 -0
- package/build/models/tools/music/music-job.schema.js +40 -0
- package/build/models/tools/music/music-model.schema.js +32 -0
- package/build/models/tools/music/music-track.schema.js +17 -0
- package/build/models/user-referrals.schema.js +15 -0
- package/build/models/webmaster-balance.schema.js +0 -1
- package/commands/auth/register-user.command.ts +3 -5
- package/commands/auth/vk-login.command.ts +9 -6
- package/commands/auth/yandex-login.command.ts +7 -4
- package/commands/cabinet/get-user-statistics-by-month.command.ts +2 -0
- package/commands/product/buy-product.command.ts +4 -0
- package/commands/promocode/index.ts +0 -1
- package/commands/subscription/buy-subscription.command.ts +4 -0
- package/commands/telegram-auth/create-telegram-auth-link.command.ts +5 -0
- package/commands/telegram-profile/auth-with-telegram-web-app.command.ts +4 -0
- package/commands/tools/index.ts +1 -0
- package/commands/tools/music/convert-to-wav.command.ts +17 -0
- package/commands/tools/music/delete-all-music-jobs.command.ts +6 -0
- package/commands/tools/music/delete-music-job-by-uuid.command.ts +11 -0
- package/commands/tools/music/find-music-job-by-uuid.command.ts +16 -0
- package/commands/tools/music/find-music-jobs.command.ts +18 -0
- package/commands/tools/music/generate-lyrics.command.ts +17 -0
- package/commands/tools/music/generate-music.command.ts +16 -0
- package/commands/tools/music/get-music-tool-config.command.ts +10 -0
- package/commands/tools/music/index.ts +11 -0
- package/commands/tools/music/retry-music-job.command.ts +14 -0
- package/commands/tools/music/set-reaction-to-music-job.command.ts +20 -0
- package/commands/tools/music/update-music-job-title.command.ts +19 -0
- package/commands/user/get-me.command.ts +1 -0
- package/constants/errors/errors.ts +96 -3
- package/constants/index.ts +1 -0
- package/constants/promocode/enums/promocode-promotion.enum.ts +0 -1
- package/constants/tool-music/enums/index.ts +5 -0
- package/constants/tool-music/enums/music-pricing-rule-type.enum.ts +3 -0
- package/constants/tool-music/enums/music-strategy.enum.ts +3 -0
- package/constants/tool-music/enums/music-vocal-gender.enum.ts +4 -0
- package/constants/tool-music/enums/suno-mode-type.enum.ts +6 -0
- package/constants/tool-music/enums/suno-model-type.enum.ts +6 -0
- package/constants/tool-music/index.ts +1 -0
- package/models/index.ts +1 -0
- package/models/promocode.schema.ts +0 -1
- package/models/tools/index.ts +1 -0
- package/models/tools/music/index.ts +4 -0
- package/models/tools/music/music-config.schema.ts +6 -0
- package/models/tools/music/music-job.schema.ts +43 -0
- package/models/tools/music/music-model.schema.ts +33 -0
- package/models/tools/music/music-track.schema.ts +19 -0
- package/models/user-referrals.schema.ts +10 -0
- package/models/webmaster-balance.schema.ts +0 -1
- package/package.json +1 -1
- package/build/commands/promocode/get-webmaster-promocode.command.js +0 -17
- package/commands/promocode/get-webmaster-promocode.command.ts +0 -19
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
package/models/index.ts
CHANGED
|
@@ -13,7 +13,6 @@ export const PromocodeSchema = z.object({
|
|
|
13
13
|
endDate: z.date().nullable(),
|
|
14
14
|
userId: z.string().uuid().nullable(),
|
|
15
15
|
unregisteredUserId: z.string().uuid().nullable(),
|
|
16
|
-
webmasterId: z.string().uuid().nullable(),
|
|
17
16
|
|
|
18
17
|
createdAt: z.date(),
|
|
19
18
|
updatedAt: z.date(),
|
package/models/tools/index.ts
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../tool-job.schema';
|
|
3
|
+
import { MUSIC_VOCAL_GENDER, SUNO_MODE_TYPE, USER_REACTION } from '../../../constants';
|
|
4
|
+
import { MusicTrackSchema } from './music-track.schema';
|
|
5
|
+
|
|
6
|
+
export const MusicJobParamsSchema = z.discriminatedUnion('mode', [
|
|
7
|
+
z.object({
|
|
8
|
+
mode: z.literal(SUNO_MODE_TYPE.SIMPLE),
|
|
9
|
+
prompt: z.string().min(1).max(450),
|
|
10
|
+
style: z.string(),
|
|
11
|
+
vocalGender: z.nativeEnum(MUSIC_VOCAL_GENDER),
|
|
12
|
+
}),
|
|
13
|
+
z.object({
|
|
14
|
+
mode: z.literal(SUNO_MODE_TYPE.SIMPLE_INSTRUMENTAL),
|
|
15
|
+
prompt: z.string().min(1).max(450),
|
|
16
|
+
style: z.string(),
|
|
17
|
+
}),
|
|
18
|
+
z.object({
|
|
19
|
+
mode: z.literal(SUNO_MODE_TYPE.CUSTOM),
|
|
20
|
+
prompt: z.string().min(1).max(5000),
|
|
21
|
+
title: z.string().min(1).max(80),
|
|
22
|
+
style: z.string().min(1).max(1000),
|
|
23
|
+
vocalGender: z.nativeEnum(MUSIC_VOCAL_GENDER),
|
|
24
|
+
}),
|
|
25
|
+
z.object({
|
|
26
|
+
mode: z.literal(SUNO_MODE_TYPE.CUSTOM_INSTRUMENTAL),
|
|
27
|
+
title: z.string().min(1).max(80),
|
|
28
|
+
style: z.string().min(1).max(1000),
|
|
29
|
+
}),
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
export type MusicJobParams = z.infer<typeof MusicJobParamsSchema>;
|
|
33
|
+
|
|
34
|
+
export const MusicJobSchema = ToolJobSchema.extend({
|
|
35
|
+
title: z.string(),
|
|
36
|
+
prompt: z.string(),
|
|
37
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
38
|
+
tracks: z.array(MusicTrackSchema),
|
|
39
|
+
params: MusicJobParamsSchema,
|
|
40
|
+
modelId: z.string(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export type MusicJob = z.infer<typeof MusicJobSchema>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
|
|
4
|
+
import { MUSIC_VOCAL_GENDER } from '../../../constants';
|
|
5
|
+
|
|
6
|
+
export const MusicModelParamsSchema = z.object({
|
|
7
|
+
vocalGender: z.object({
|
|
8
|
+
options: z.array(z.nativeEnum(MUSIC_VOCAL_GENDER)),
|
|
9
|
+
}),
|
|
10
|
+
styles: z.object({
|
|
11
|
+
maxStyles: z.number(),
|
|
12
|
+
options: z.array(
|
|
13
|
+
z.object({
|
|
14
|
+
title: z.string(),
|
|
15
|
+
style: z.string(),
|
|
16
|
+
}),
|
|
17
|
+
),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const MusicModelSchema = z.object({
|
|
22
|
+
uuid: z.string(),
|
|
23
|
+
title: z.string(),
|
|
24
|
+
description: z.string(),
|
|
25
|
+
pricePerTrack: z.number(),
|
|
26
|
+
order: z.number(),
|
|
27
|
+
icons: IconVariantsSchema,
|
|
28
|
+
maxPromptLength: z.number(),
|
|
29
|
+
maxLyricsLength: z.number(),
|
|
30
|
+
params: MusicModelParamsSchema,
|
|
31
|
+
unlockedBy: UnlockedBySchema.nullable(),
|
|
32
|
+
canUse: z.boolean(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const MusicTrackSchema = z.object({
|
|
4
|
+
uuid: z.string(),
|
|
5
|
+
title: z.string(),
|
|
6
|
+
audioId: z.string(),
|
|
7
|
+
audioUrl: z.string(),
|
|
8
|
+
coverUrl: z.string(),
|
|
9
|
+
tags: z.string(),
|
|
10
|
+
duration: z.number(),
|
|
11
|
+
|
|
12
|
+
genJobId: z.string().nullable().optional(),
|
|
13
|
+
editorJobId: z.string().nullable().optional(),
|
|
14
|
+
|
|
15
|
+
createdAt: z.date(),
|
|
16
|
+
updatedAt: z.date(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type MusicTrack = z.infer<typeof MusicTrackSchema>;
|
|
@@ -5,7 +5,6 @@ export const WebmasterBalanceSchema = z.object({
|
|
|
5
5
|
uuid: z.string().uuid(),
|
|
6
6
|
webmasterId: z.string().uuid(),
|
|
7
7
|
orderId: z.string().uuid().nullable(),
|
|
8
|
-
promocodeId: z.string().uuid().nullable(),
|
|
9
8
|
sourceUserId: z.string().uuid().nullable(),
|
|
10
9
|
amount: z.number(),
|
|
11
10
|
type: z.nativeEnum(WEBMASTER_BALANCE_TYPE),
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetWebmasterPromocodeCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../models");
|
|
6
|
-
var GetWebmasterPromocodeCommand;
|
|
7
|
-
(function (GetWebmasterPromocodeCommand) {
|
|
8
|
-
GetWebmasterPromocodeCommand.RequestSchema = models_1.WebmasterSchema.pick({ alias: true });
|
|
9
|
-
GetWebmasterPromocodeCommand.ResponseSchema = zod_1.z.object({
|
|
10
|
-
data: zod_1.z.object({
|
|
11
|
-
isEligible: zod_1.z.boolean(),
|
|
12
|
-
promocode: zod_1.z.string().nullable(),
|
|
13
|
-
amount: zod_1.z.number().nullable(),
|
|
14
|
-
endDate: zod_1.z.date().nullable(),
|
|
15
|
-
}),
|
|
16
|
-
});
|
|
17
|
-
})(GetWebmasterPromocodeCommand || (exports.GetWebmasterPromocodeCommand = GetWebmasterPromocodeCommand = {}));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { WebmasterSchema } from '../../models';
|
|
3
|
-
|
|
4
|
-
export namespace GetWebmasterPromocodeCommand {
|
|
5
|
-
export const RequestSchema = WebmasterSchema.pick({ alias: true });
|
|
6
|
-
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
|
-
export const ResponseSchema = z.object({
|
|
10
|
-
data: z.object({
|
|
11
|
-
isEligible: z.boolean(),
|
|
12
|
-
promocode: z.string().nullable(),
|
|
13
|
-
amount: z.number().nullable(),
|
|
14
|
-
endDate: z.date().nullable(),
|
|
15
|
-
}),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
-
}
|