@purpleschool/gptbot 0.7.58-presentations → 0.7.59-presentations
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/cabinet.ts +3 -2
- package/api/controllers/http/index.ts +3 -0
- package/api/controllers/http/music.ts +16 -0
- package/api/controllers/http/tool.ts +1 -0
- package/api/controllers/http/video-editor.ts +14 -0
- package/api/controllers/http/webmaster.ts +10 -0
- package/api/controllers/http/writer.ts +1 -0
- package/api/routes.ts +8 -1
- package/build/api/controllers/http/cabinet.js +3 -2
- package/build/api/controllers/http/index.js +3 -0
- package/build/api/controllers/http/music.js +18 -0
- package/build/api/controllers/http/tool.js +1 -0
- package/build/api/controllers/http/video-editor.js +16 -0
- package/build/api/controllers/http/webmaster.js +12 -0
- package/build/api/controllers/http/writer.js +1 -0
- package/build/api/routes.js +7 -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 +25 -0
- package/build/commands/cabinet/get-user-statistics-overview.command.js +26 -0
- package/build/commands/cabinet/index.js +2 -1
- package/build/commands/chat/check-limit.command.js +1 -0
- package/build/commands/index.js +1 -0
- package/build/commands/message/create-suggestions.command.js +1 -1
- package/build/commands/product/buy-product.command.js +4 -0
- 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/telegram-profile/bot-was-blocked-by-user.command.js +11 -0
- package/build/commands/telegram-profile/index.js +2 -0
- package/build/commands/telegram-profile/user-joined-telegram.command.js +11 -0
- package/build/commands/tools/index.js +2 -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/tools/tool/find-formatted-tools.command.js +11 -0
- package/build/commands/tools/tool/index.js +1 -0
- package/build/commands/tools/video-editor/delete-all-video-editor-jobs.command.js +11 -0
- package/build/commands/tools/video-editor/delete-video-editor-job-by-uuid.command.js +14 -0
- package/build/commands/tools/video-editor/edit-video.command.js +16 -0
- package/build/commands/tools/video-editor/find-video-editor-job-by-id.command.js +14 -0
- package/build/commands/tools/video-editor/find-video-editor-jobs.command.js +18 -0
- package/build/commands/tools/video-editor/get-video-editor-config.command.js +14 -0
- package/build/commands/tools/video-editor/index.js +25 -0
- package/build/commands/tools/video-editor/retry-video-editor-job.command.js +14 -0
- package/build/commands/tools/video-editor/set-reaction-to-video-editor-job.command.js +18 -0
- package/build/commands/tools/video-editor/update-video-editor-job-title.command.js +17 -0
- package/build/commands/tools/writer/generate-writer-document-contents.command.js +3 -0
- package/build/commands/tools/writer/index.js +1 -0
- package/build/commands/tools/writer/set-reaction.writer-document.command.js +18 -0
- package/build/commands/user/get-aggregated-user-data.command.js +1 -1
- package/build/commands/user/get-me.command.js +1 -0
- package/build/commands/webmaster/confirm-withdrawal.command.js +14 -0
- package/build/commands/webmaster/create-webmaster.command.js +16 -0
- package/build/commands/webmaster/create-withdrawal-request.command.js +16 -0
- package/build/commands/webmaster/get-my-webmaster.command.js +11 -0
- package/build/commands/webmaster/get-webmaster-balance-overview.command.js +26 -0
- package/build/commands/webmaster/index.js +22 -0
- package/build/commands/webmaster/update-webmaster.command.js +13 -0
- package/build/constants/ai-model/enums/ai-model-config-selector-type.enum.js +1 -0
- package/build/constants/cabinet/enums/group-by.enum.js +9 -0
- package/build/constants/cabinet/enums/index.js +17 -0
- package/build/constants/cabinet/index.js +17 -0
- package/build/constants/errors/errors.js +280 -2
- package/build/constants/file/enums/file-type.enum.js +1 -0
- package/build/constants/file/file.constants.js +4 -1
- package/build/constants/index.js +5 -0
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +3 -0
- 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/constants/tool-video-editor/enums/index.js +17 -0
- package/build/constants/tool-video-editor/enums/video-editor-model-strategy.enum.js +7 -0
- package/build/constants/tool-video-editor/index.js +17 -0
- package/build/constants/transaction/enums/user-balance-status.enum.js +1 -0
- package/build/constants/webmaster/enums/index.js +17 -0
- package/build/constants/webmaster/enums/organization-type.enum.js +9 -0
- package/build/constants/webmaster/index.js +17 -0
- package/build/constants/webmaster-balance/enums/index.js +18 -0
- package/build/constants/webmaster-balance/enums/webmaster-balance-status.enum.js +10 -0
- package/build/constants/webmaster-balance/enums/webmaster-balance-type.enum.js +8 -0
- package/build/constants/webmaster-balance/index.js +17 -0
- package/build/constants/writer/enums/index.js +1 -0
- package/build/constants/writer/enums/tool-model-status.enum.js +8 -0
- package/build/helpers/index.js +1 -0
- package/build/helpers/video-editor/calculate-video-editing-price.helper.js +6 -0
- package/build/helpers/video-editor/index.js +17 -0
- package/build/helpers/writer/calculate-writer-content-generation-price.util.js +2 -2
- package/build/models/index.js +3 -0
- package/build/models/page.schema.js +2 -0
- package/build/models/subscription-feature.schema.js +26 -1
- package/build/models/subscription.schema.js +1 -0
- package/build/models/tool.schema.js +8 -1
- package/build/models/tools/index.js +2 -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/tools/video-editor/index.js +19 -0
- package/build/models/tools/video-editor/video-editor-config.schema.js +8 -0
- package/build/models/tools/video-editor/video-editor-job.schema.js +14 -0
- package/build/models/tools/video-editor/video-editor-model.schema.js +25 -0
- package/build/models/tools/writer/writer-config.schema.js +2 -0
- package/build/models/tools/writer/writer-document.schema.js +2 -0
- package/build/models/tools/writer/writer-model.schema.js +21 -0
- package/build/models/user-referrals.schema.js +15 -0
- package/build/models/user-to-subscription.schema.js +2 -0
- package/build/models/webmaster-balance.schema.js +19 -0
- package/build/models/webmaster.schema.js +21 -0
- 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 +25 -0
- package/commands/cabinet/{get-user-statistics.command.ts → get-user-statistics-overview.command.ts} +5 -12
- package/commands/cabinet/index.ts +2 -1
- package/commands/chat/check-limit.command.ts +1 -0
- package/commands/index.ts +1 -0
- package/commands/message/create-suggestions.command.ts +1 -1
- package/commands/product/buy-product.command.ts +4 -0
- 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/telegram-profile/bot-was-blocked-by-user.command.ts +13 -0
- package/commands/telegram-profile/index.ts +2 -0
- package/commands/telegram-profile/user-joined-telegram.command.ts +13 -0
- package/commands/tools/index.ts +2 -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/tools/tool/find-formatted-tools.command.ts +11 -0
- package/commands/tools/tool/index.ts +1 -0
- package/commands/tools/video-editor/delete-all-video-editor-jobs.command.ts +13 -0
- package/commands/tools/video-editor/delete-video-editor-job-by-uuid.command.ts +16 -0
- package/commands/tools/video-editor/edit-video.command.ts +18 -0
- package/commands/tools/video-editor/find-video-editor-job-by-id.command.ts +16 -0
- package/commands/tools/video-editor/find-video-editor-jobs.command.ts +18 -0
- package/commands/tools/video-editor/get-video-editor-config.command.ts +16 -0
- package/commands/tools/video-editor/index.ts +9 -0
- package/commands/tools/video-editor/retry-video-editor-job.command.ts +16 -0
- package/commands/tools/video-editor/set-reaction-to-video-editor-job.command.ts +21 -0
- package/commands/tools/video-editor/update-video-editor-job-title.command.ts +20 -0
- package/commands/tools/writer/generate-writer-document-contents.command.ts +5 -0
- package/commands/tools/writer/index.ts +1 -0
- package/commands/tools/writer/set-reaction.writer-document.command.ts +21 -0
- package/commands/user/get-aggregated-user-data.command.ts +1 -1
- package/commands/user/get-me.command.ts +1 -0
- package/commands/webmaster/confirm-withdrawal.command.ts +16 -0
- package/commands/webmaster/create-webmaster.command.ts +18 -0
- package/commands/webmaster/create-withdrawal-request.command.ts +18 -0
- package/commands/webmaster/get-my-webmaster.command.ts +12 -0
- package/commands/webmaster/get-webmaster-balance-overview.command.ts +29 -0
- package/commands/webmaster/index.ts +6 -0
- package/commands/webmaster/update-webmaster.command.ts +18 -0
- package/constants/ai-model/enums/ai-model-config-selector-type.enum.ts +1 -0
- package/constants/cabinet/enums/group-by.enum.ts +5 -0
- package/constants/cabinet/enums/index.ts +1 -0
- package/constants/cabinet/index.ts +1 -0
- package/constants/errors/errors.ts +280 -2
- package/constants/file/enums/file-type.enum.ts +1 -0
- package/constants/file/file.constants.ts +4 -0
- package/constants/index.ts +5 -0
- package/constants/subscription/enums/subscription-feature-type.enum.ts +3 -0
- 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/constants/tool-video-editor/enums/index.ts +1 -0
- package/constants/tool-video-editor/enums/video-editor-model-strategy.enum.ts +3 -0
- package/constants/tool-video-editor/index.ts +1 -0
- package/constants/transaction/enums/user-balance-status.enum.ts +1 -0
- package/constants/webmaster/enums/index.ts +1 -0
- package/constants/webmaster/enums/organization-type.enum.ts +5 -0
- package/constants/webmaster/index.ts +1 -0
- package/constants/webmaster-balance/enums/index.ts +2 -0
- package/constants/webmaster-balance/enums/webmaster-balance-status.enum.ts +6 -0
- package/constants/webmaster-balance/enums/webmaster-balance-type.enum.ts +4 -0
- package/constants/webmaster-balance/index.ts +1 -0
- package/constants/writer/enums/index.ts +1 -0
- package/constants/writer/enums/tool-model-status.enum.ts +4 -0
- package/helpers/index.ts +1 -0
- package/helpers/video-editor/calculate-video-editing-price.helper.ts +9 -0
- package/helpers/video-editor/index.ts +1 -0
- package/helpers/writer/calculate-writer-content-generation-price.util.ts +4 -2
- package/models/index.ts +3 -0
- package/models/page.schema.ts +2 -0
- package/models/subscription-feature.schema.ts +30 -0
- package/models/subscription.schema.ts +1 -0
- package/models/tool.schema.ts +13 -0
- package/models/tools/index.ts +2 -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/tools/video-editor/index.ts +3 -0
- package/models/tools/video-editor/video-editor-config.schema.ts +6 -0
- package/models/tools/video-editor/video-editor-job.schema.ts +14 -0
- package/models/tools/video-editor/video-editor-model.schema.ts +24 -0
- package/models/tools/writer/writer-config.schema.ts +2 -0
- package/models/tools/writer/writer-document.schema.ts +3 -1
- package/models/tools/writer/writer-model.schema.ts +21 -0
- package/models/user-referrals.schema.ts +10 -0
- package/models/user-to-subscription.schema.ts +2 -0
- package/models/webmaster-balance.schema.ts +15 -0
- package/models/webmaster.schema.ts +18 -0
- package/package.json +1 -1
- package/build/commands/cabinet/get-user-statistics.command.js +0 -30
|
@@ -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>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../tool-job.schema';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export const VideoEditorJobSchema = ToolJobSchema.extend({
|
|
6
|
+
title: z.string(),
|
|
7
|
+
prompt: z.string(),
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
inputVideoUrl: z.string(),
|
|
10
|
+
outputVideoUrl: z.string().nullable(),
|
|
11
|
+
modelId: z.string(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type VideoEditorJob = z.infer<typeof VideoEditorJobSchema>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
|
|
4
|
+
|
|
5
|
+
export const VideoEditorModelParamsSchema = z.object({
|
|
6
|
+
supportedFormats: z.array(z.string()),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const VideoEditorModelSchema = z.object({
|
|
10
|
+
uuid: z.string(),
|
|
11
|
+
title: z.string(),
|
|
12
|
+
description: z.string(),
|
|
13
|
+
aiModel: z.string(),
|
|
14
|
+
pricePerSecond: z.number(),
|
|
15
|
+
order: z.number(),
|
|
16
|
+
icons: IconVariantsSchema,
|
|
17
|
+
maxPromptLength: z.number(),
|
|
18
|
+
maxInputVideoSizeBytes: z.number(),
|
|
19
|
+
supportedFormats: z.array(z.string()),
|
|
20
|
+
createdAt: z.date(),
|
|
21
|
+
updatedAt: z.date(),
|
|
22
|
+
unlockedBy: UnlockedBySchema.nullable(),
|
|
23
|
+
canUse: z.boolean(),
|
|
24
|
+
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { WriterDocumentTypeSchema } from './writer-document-type.schema';
|
|
3
3
|
import { WriterAiActionSchema } from './writer-ai-action.schema';
|
|
4
|
+
import { WriterModelSchema } from './writer-model.schema';
|
|
4
5
|
|
|
5
6
|
export const WriterConfigSchema = z.object({
|
|
6
7
|
maxPromptLength: z.number(),
|
|
7
8
|
documentTypes: z.array(WriterDocumentTypeSchema),
|
|
8
9
|
aiActions: z.array(WriterAiActionSchema),
|
|
10
|
+
models: z.array(WriterModelSchema),
|
|
9
11
|
});
|
|
10
12
|
export type WriterConfig = z.infer<typeof WriterConfigSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { WriterDocumentOutlineSchema } from './writer-document-outline.schema';
|
|
3
|
-
import { WRITER_DOCUMENT_STAGE } from '../../../constants';
|
|
3
|
+
import { USER_REACTION, WRITER_DOCUMENT_STAGE } from '../../../constants';
|
|
4
4
|
|
|
5
5
|
export const WriterDocumentSchema = z.object({
|
|
6
6
|
uuid: z.string().uuid(),
|
|
@@ -13,6 +13,8 @@ export const WriterDocumentSchema = z.object({
|
|
|
13
13
|
finalMd: z.string().nullable(),
|
|
14
14
|
userId: z.string().nullable(),
|
|
15
15
|
unregisteredUserId: z.string().nullable(),
|
|
16
|
+
modelId: z.string().nullable(),
|
|
17
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
16
18
|
pages: z.number(),
|
|
17
19
|
createdAt: z.date(),
|
|
18
20
|
updatedAt: z.date(),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
import { TOOL_MODEL_STATUS } from '../../../constants';
|
|
4
|
+
import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
|
|
5
|
+
|
|
6
|
+
export const WriterModelSchema = z.object({
|
|
7
|
+
uuid: z.string(),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
description: z.string(),
|
|
10
|
+
pricePerPage: z.number(),
|
|
11
|
+
order: z.number(),
|
|
12
|
+
icons: IconVariantsSchema,
|
|
13
|
+
maxInputLength: z.number(),
|
|
14
|
+
status: z.nativeEnum(TOOL_MODEL_STATUS),
|
|
15
|
+
createdAt: z.date(),
|
|
16
|
+
updatedAt: z.date(),
|
|
17
|
+
unlockedBy: UnlockedBySchema.nullable(),
|
|
18
|
+
canUse: z.boolean(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type WriterModel = z.infer<typeof WriterModelSchema>;
|
|
@@ -13,6 +13,8 @@ export const UserToSubscriptionSchema = z.object({
|
|
|
13
13
|
endDate: z.date().nullable(),
|
|
14
14
|
marks: z.array(z.string()),
|
|
15
15
|
intervalEndDate: z.date().nullable(),
|
|
16
|
+
carriedOverTokenBalance: z.number(),
|
|
17
|
+
initCarriedOverTokenBalance: z.number(),
|
|
16
18
|
createdAt: z.date(),
|
|
17
19
|
updatedAt: z.date(),
|
|
18
20
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { WEBMASTER_BALANCE_STATUS, WEBMASTER_BALANCE_TYPE } from '../constants';
|
|
3
|
+
|
|
4
|
+
export const WebmasterBalanceSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
webmasterId: z.string().uuid(),
|
|
7
|
+
orderId: z.string().uuid().nullable(),
|
|
8
|
+
sourceUserId: z.string().uuid().nullable(),
|
|
9
|
+
amount: z.number(),
|
|
10
|
+
type: z.nativeEnum(WEBMASTER_BALANCE_TYPE),
|
|
11
|
+
status: z.nativeEnum(WEBMASTER_BALANCE_STATUS),
|
|
12
|
+
|
|
13
|
+
createdAt: z.date(),
|
|
14
|
+
updatedAt: z.date(),
|
|
15
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { ORGANIZATION_TYPE } from '../constants/webmaster';
|
|
3
|
+
|
|
4
|
+
export const WebmasterSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
userId: z.string().uuid(),
|
|
7
|
+
organization: z.string(),
|
|
8
|
+
organizationType: z.nativeEnum(ORGANIZATION_TYPE),
|
|
9
|
+
tin: z.string().regex(/^\d{10}$|^\d{12}$/, 'ИНН должен быть длинной в 10 или 12 цифр'),
|
|
10
|
+
alias: z.string(),
|
|
11
|
+
|
|
12
|
+
createdAt: z.date(),
|
|
13
|
+
updatedAt: z.date(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const WebmasterWithBalanceSchema = WebmasterSchema.extend({
|
|
17
|
+
balance: z.number(),
|
|
18
|
+
});
|
package/package.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetUserStatisticsCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
var GetUserStatisticsCommand;
|
|
6
|
-
(function (GetUserStatisticsCommand) {
|
|
7
|
-
GetUserStatisticsCommand.RequestSchema = zod_1.z.object({
|
|
8
|
-
startDate: zod_1.z.string().refine((v) => !isNaN(Date.parse(v)), {
|
|
9
|
-
message: 'from must be a valid date string',
|
|
10
|
-
}),
|
|
11
|
-
endDate: zod_1.z.string().refine((v) => !isNaN(Date.parse(v)), {
|
|
12
|
-
message: 'to must be a valid date string',
|
|
13
|
-
}),
|
|
14
|
-
groupByDays: zod_1.z
|
|
15
|
-
.preprocess((val) => (val === undefined ? 1 : Number(val)), zod_1.z.number().int().positive().max(31))
|
|
16
|
-
.default(1),
|
|
17
|
-
});
|
|
18
|
-
GetUserStatisticsCommand.UserStatisticsResponseSchema = zod_1.z.object({
|
|
19
|
-
startDate: zod_1.z.string(),
|
|
20
|
-
endDate: zod_1.z.string(),
|
|
21
|
-
total_tokens: zod_1.z.number(),
|
|
22
|
-
total_messages: zod_1.z.number(),
|
|
23
|
-
total_images: zod_1.z.number(),
|
|
24
|
-
total_videos: zod_1.z.number(),
|
|
25
|
-
total_presentations: zod_1.z.number(),
|
|
26
|
-
});
|
|
27
|
-
GetUserStatisticsCommand.ResponseSchema = zod_1.z.object({
|
|
28
|
-
data: zod_1.z.array(GetUserStatisticsCommand.UserStatisticsResponseSchema),
|
|
29
|
-
});
|
|
30
|
-
})(GetUserStatisticsCommand || (exports.GetUserStatisticsCommand = GetUserStatisticsCommand = {}));
|