@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,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("./calculate-video-editing-price.helper"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateWriterContentGenerationPrice = calculateWriterContentGenerationPrice;
|
|
4
|
-
function calculateWriterContentGenerationPrice(pages) {
|
|
5
|
-
return Math.max(1, pages);
|
|
4
|
+
function calculateWriterContentGenerationPrice(pages, aiModel) {
|
|
5
|
+
return Math.max(1, pages * aiModel.pricePerPage);
|
|
6
6
|
}
|
package/build/models/index.js
CHANGED
|
@@ -66,3 +66,6 @@ __exportStar(require("./folder.schema"), exports);
|
|
|
66
66
|
__exportStar(require("./filters.schema"), exports);
|
|
67
67
|
__exportStar(require("./users-filter-notification.schema"), exports);
|
|
68
68
|
__exportStar(require("./daily-streak"), exports);
|
|
69
|
+
__exportStar(require("./webmaster.schema"), exports);
|
|
70
|
+
__exportStar(require("./webmaster-balance.schema"), exports);
|
|
71
|
+
__exportStar(require("./user-referrals.schema"), exports);
|
|
@@ -14,6 +14,8 @@ exports.PageSchema = zod_1.z.object({
|
|
|
14
14
|
categoryId: zod_1.z.string().uuid().nullable().optional(),
|
|
15
15
|
aIModelId: zod_1.z.string().uuid().nullable().optional(),
|
|
16
16
|
toolId: zod_1.z.string().uuid().nullable().optional(),
|
|
17
|
+
toolOptionId: zod_1.z.string().uuid().nullable().optional(),
|
|
18
|
+
toolTitle: zod_1.z.string().nullable(),
|
|
17
19
|
type: zod_1.z.nativeEnum(constants_1.PageType),
|
|
18
20
|
createdAt: zod_1.z.date(),
|
|
19
21
|
updatedAt: zod_1.z.date(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
|
|
3
|
+
exports.SubscriptionFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
|
|
@@ -8,6 +8,29 @@ exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
|
|
|
8
8
|
type: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_FEATURE_TYPE),
|
|
9
9
|
title: zod_1.z.string(),
|
|
10
10
|
});
|
|
11
|
+
const SubscriptionFeatureIconsSchema = zod_1.z.object({
|
|
12
|
+
light: zod_1.z.object({
|
|
13
|
+
png: zod_1.z.string(),
|
|
14
|
+
svg: zod_1.z.string(),
|
|
15
|
+
}),
|
|
16
|
+
dark: zod_1.z.object({
|
|
17
|
+
png: zod_1.z.string(),
|
|
18
|
+
svg: zod_1.z.string(),
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
22
|
+
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.BASE),
|
|
23
|
+
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.TOKENS),
|
|
24
|
+
tokens: zod_1.z.number(),
|
|
25
|
+
icons: SubscriptionFeatureIconsSchema,
|
|
26
|
+
});
|
|
27
|
+
exports.CarryoverBalanceFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
28
|
+
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.BASE),
|
|
29
|
+
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.CARRYOVER_BALANCE),
|
|
30
|
+
isAvailable: zod_1.z.boolean(),
|
|
31
|
+
tooltip: zod_1.z.array(zod_1.z.string()),
|
|
32
|
+
icons: SubscriptionFeatureIconsSchema,
|
|
33
|
+
});
|
|
11
34
|
exports.AiModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
12
35
|
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.AI_MODEL_ACCESS),
|
|
13
36
|
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.AI_MODEL),
|
|
@@ -102,4 +125,6 @@ exports.SubscriptionFeatureSchema = zod_1.z.union([
|
|
|
102
125
|
exports.VideoModelAccessFeatureSchema,
|
|
103
126
|
exports.ExtendedContextFeatureSchema,
|
|
104
127
|
exports.PresentationQuotaFeatureSchema,
|
|
128
|
+
exports.TokensFeatureSchema,
|
|
129
|
+
exports.CarryoverBalanceFeatureSchema,
|
|
105
130
|
]);
|
|
@@ -30,6 +30,7 @@ exports.SubscriptionSchema = zod_1.z.object({
|
|
|
30
30
|
features: zod_1.z.array(subscription_feature_schema_1.SubscriptionFeatureSchema),
|
|
31
31
|
maxInputLength: zod_1.z.number(),
|
|
32
32
|
maxInputTokens: zod_1.z.number(),
|
|
33
|
+
carryoverPercent: zod_1.z.number(),
|
|
33
34
|
createdAt: zod_1.z.date(),
|
|
34
35
|
updatedAt: zod_1.z.date(),
|
|
35
36
|
});
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToolSchema = void 0;
|
|
3
|
+
exports.ToolFormattedSchema = exports.ToolSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const page_schema_1 = require("./page.schema");
|
|
5
6
|
exports.ToolSchema = zod_1.z.object({
|
|
6
7
|
uuid: zod_1.z.string().uuid(),
|
|
7
8
|
title: zod_1.z.string(),
|
|
8
9
|
description: zod_1.z.string(),
|
|
9
10
|
icon: zod_1.z.string(),
|
|
10
11
|
order: zod_1.z.number(),
|
|
12
|
+
contentType: zod_1.z.string(),
|
|
11
13
|
});
|
|
14
|
+
exports.ToolFormattedSchema = zod_1.z.intersection(exports.ToolSchema, zod_1.z.object({
|
|
15
|
+
pages: zod_1.z.array(page_schema_1.PageSchema.pick({ alias: true, toolTitle: true, toolOptionId: true })
|
|
16
|
+
.optional()
|
|
17
|
+
.nullable()),
|
|
18
|
+
}));
|
|
@@ -22,3 +22,5 @@ __exportStar(require("./tts"), exports);
|
|
|
22
22
|
__exportStar(require("./video"), exports);
|
|
23
23
|
__exportStar(require("./writer"), exports);
|
|
24
24
|
__exportStar(require("./image-editor"), exports);
|
|
25
|
+
__exportStar(require("./video-editor"), exports);
|
|
26
|
+
__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,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("./video-editor-config.schema"), exports);
|
|
18
|
+
__exportStar(require("./video-editor-job.schema"), exports);
|
|
19
|
+
__exportStar(require("./video-editor-model.schema"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoEditorConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const video_editor_model_schema_1 = require("./video-editor-model.schema");
|
|
6
|
+
exports.VideoEditorConfigSchema = zod_1.z.object({
|
|
7
|
+
models: zod_1.z.array(video_editor_model_schema_1.VideoEditorModelSchema),
|
|
8
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoEditorJobSchema = 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.VideoEditorJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
prompt: zod_1.z.string(),
|
|
10
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
11
|
+
inputVideoUrl: zod_1.z.string(),
|
|
12
|
+
outputVideoUrl: zod_1.z.string().nullable(),
|
|
13
|
+
modelId: zod_1.z.string(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoEditorModelSchema = exports.VideoEditorModelParamsSchema = 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
|
+
exports.VideoEditorModelParamsSchema = zod_1.z.object({
|
|
8
|
+
supportedFormats: zod_1.z.array(zod_1.z.string()),
|
|
9
|
+
});
|
|
10
|
+
exports.VideoEditorModelSchema = zod_1.z.object({
|
|
11
|
+
uuid: zod_1.z.string(),
|
|
12
|
+
title: zod_1.z.string(),
|
|
13
|
+
description: zod_1.z.string(),
|
|
14
|
+
aiModel: zod_1.z.string(),
|
|
15
|
+
pricePerSecond: zod_1.z.number(),
|
|
16
|
+
order: zod_1.z.number(),
|
|
17
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
18
|
+
maxPromptLength: zod_1.z.number(),
|
|
19
|
+
maxInputVideoSizeBytes: zod_1.z.number(),
|
|
20
|
+
supportedFormats: zod_1.z.array(zod_1.z.string()),
|
|
21
|
+
createdAt: zod_1.z.date(),
|
|
22
|
+
updatedAt: zod_1.z.date(),
|
|
23
|
+
unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
|
|
24
|
+
canUse: zod_1.z.boolean(),
|
|
25
|
+
});
|
|
@@ -4,8 +4,10 @@ exports.WriterConfigSchema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const writer_document_type_schema_1 = require("./writer-document-type.schema");
|
|
6
6
|
const writer_ai_action_schema_1 = require("./writer-ai-action.schema");
|
|
7
|
+
const writer_model_schema_1 = require("./writer-model.schema");
|
|
7
8
|
exports.WriterConfigSchema = zod_1.z.object({
|
|
8
9
|
maxPromptLength: zod_1.z.number(),
|
|
9
10
|
documentTypes: zod_1.z.array(writer_document_type_schema_1.WriterDocumentTypeSchema),
|
|
10
11
|
aiActions: zod_1.z.array(writer_ai_action_schema_1.WriterAiActionSchema),
|
|
12
|
+
models: zod_1.z.array(writer_model_schema_1.WriterModelSchema),
|
|
11
13
|
});
|
|
@@ -15,6 +15,8 @@ exports.WriterDocumentSchema = zod_1.z.object({
|
|
|
15
15
|
finalMd: zod_1.z.string().nullable(),
|
|
16
16
|
userId: zod_1.z.string().nullable(),
|
|
17
17
|
unregisteredUserId: zod_1.z.string().nullable(),
|
|
18
|
+
modelId: zod_1.z.string().nullable(),
|
|
19
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
18
20
|
pages: zod_1.z.number(),
|
|
19
21
|
createdAt: zod_1.z.date(),
|
|
20
22
|
updatedAt: zod_1.z.date(),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriterModelSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const icon_variants_schema_1 = require("../../icon-variants.schema");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
const unlocked_by_subscription_schema_1 = require("../../unlocked-by-subscription.schema");
|
|
8
|
+
exports.WriterModelSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string(),
|
|
10
|
+
title: zod_1.z.string(),
|
|
11
|
+
description: zod_1.z.string(),
|
|
12
|
+
pricePerPage: zod_1.z.number(),
|
|
13
|
+
order: zod_1.z.number(),
|
|
14
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
15
|
+
maxInputLength: zod_1.z.number(),
|
|
16
|
+
status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
|
|
17
|
+
createdAt: zod_1.z.date(),
|
|
18
|
+
updatedAt: zod_1.z.date(),
|
|
19
|
+
unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
|
|
20
|
+
canUse: zod_1.z.boolean(),
|
|
21
|
+
});
|
|
@@ -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
|
+
});
|
|
@@ -15,6 +15,8 @@ exports.UserToSubscriptionSchema = zod_1.z.object({
|
|
|
15
15
|
endDate: zod_1.z.date().nullable(),
|
|
16
16
|
marks: zod_1.z.array(zod_1.z.string()),
|
|
17
17
|
intervalEndDate: zod_1.z.date().nullable(),
|
|
18
|
+
carriedOverTokenBalance: zod_1.z.number(),
|
|
19
|
+
initCarriedOverTokenBalance: zod_1.z.number(),
|
|
18
20
|
createdAt: zod_1.z.date(),
|
|
19
21
|
updatedAt: zod_1.z.date(),
|
|
20
22
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
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.WebmasterBalanceSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
exports.WebmasterBalanceSchema = zod_1.default.object({
|
|
10
|
+
uuid: zod_1.default.string().uuid(),
|
|
11
|
+
webmasterId: zod_1.default.string().uuid(),
|
|
12
|
+
orderId: zod_1.default.string().uuid().nullable(),
|
|
13
|
+
sourceUserId: zod_1.default.string().uuid().nullable(),
|
|
14
|
+
amount: zod_1.default.number(),
|
|
15
|
+
type: zod_1.default.nativeEnum(constants_1.WEBMASTER_BALANCE_TYPE),
|
|
16
|
+
status: zod_1.default.nativeEnum(constants_1.WEBMASTER_BALANCE_STATUS),
|
|
17
|
+
createdAt: zod_1.default.date(),
|
|
18
|
+
updatedAt: zod_1.default.date(),
|
|
19
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
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.WebmasterWithBalanceSchema = exports.WebmasterSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const webmaster_1 = require("../constants/webmaster");
|
|
9
|
+
exports.WebmasterSchema = zod_1.default.object({
|
|
10
|
+
uuid: zod_1.default.string().uuid(),
|
|
11
|
+
userId: zod_1.default.string().uuid(),
|
|
12
|
+
organization: zod_1.default.string(),
|
|
13
|
+
organizationType: zod_1.default.nativeEnum(webmaster_1.ORGANIZATION_TYPE),
|
|
14
|
+
tin: zod_1.default.string().regex(/^\d{10}$|^\d{12}$/, 'ИНН должен быть длинной в 10 или 12 цифр'),
|
|
15
|
+
alias: zod_1.default.string(),
|
|
16
|
+
createdAt: zod_1.default.date(),
|
|
17
|
+
updatedAt: zod_1.default.date(),
|
|
18
|
+
});
|
|
19
|
+
exports.WebmasterWithBalanceSchema = exports.WebmasterSchema.extend({
|
|
20
|
+
balance: zod_1.default.number(),
|
|
21
|
+
});
|
|
@@ -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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace GetUserStatisticsByMonthCommand {
|
|
4
|
+
export const UserStatisticsByMonthResponseSchema = z.object({
|
|
5
|
+
month: z.string(),
|
|
6
|
+
total_texts: z.number(),
|
|
7
|
+
total_audios: z.number(),
|
|
8
|
+
total_images: z.number(),
|
|
9
|
+
total_videos: z.number(),
|
|
10
|
+
total_presentations: z.number(),
|
|
11
|
+
total_paraphrases: z.number(),
|
|
12
|
+
writers: z.object({
|
|
13
|
+
total_writers: z.number(),
|
|
14
|
+
total_writer_actions: z.number(),
|
|
15
|
+
}),
|
|
16
|
+
total_video_edits: z.number(),
|
|
17
|
+
total_musics: z.number(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: z.array(UserStatisticsByMonthResponseSchema),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
package/commands/cabinet/{get-user-statistics.command.ts → get-user-statistics-overview.command.ts}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { GROUP_BY } from '../../constants';
|
|
2
3
|
|
|
3
|
-
export namespace
|
|
4
|
+
export namespace GetUserStatisticsOverviewCommand {
|
|
4
5
|
export const RequestSchema = z.object({
|
|
5
6
|
startDate: z.string().refine((v) => !isNaN(Date.parse(v)), {
|
|
6
7
|
message: 'from must be a valid date string',
|
|
@@ -8,28 +9,20 @@ export namespace GetUserStatisticsCommand {
|
|
|
8
9
|
endDate: z.string().refine((v) => !isNaN(Date.parse(v)), {
|
|
9
10
|
message: 'to must be a valid date string',
|
|
10
11
|
}),
|
|
11
|
-
|
|
12
|
-
.preprocess(
|
|
13
|
-
(val) => (val === undefined ? 1 : Number(val)),
|
|
14
|
-
z.number().int().positive().max(31),
|
|
15
|
-
)
|
|
16
|
-
.default(1),
|
|
12
|
+
groupBy: z.nativeEnum(GROUP_BY).default(GROUP_BY.DAY),
|
|
17
13
|
});
|
|
18
14
|
|
|
19
15
|
export type Request = z.infer<typeof RequestSchema>;
|
|
20
16
|
|
|
21
|
-
export const
|
|
17
|
+
export const UserStatisticsOverviewResponseSchema = z.object({
|
|
22
18
|
startDate: z.string(),
|
|
23
19
|
endDate: z.string(),
|
|
24
20
|
total_tokens: z.number(),
|
|
25
21
|
total_messages: z.number(),
|
|
26
|
-
total_images: z.number(),
|
|
27
|
-
total_videos: z.number(),
|
|
28
|
-
total_presentations: z.number(),
|
|
29
22
|
});
|
|
30
23
|
|
|
31
24
|
export const ResponseSchema = z.object({
|
|
32
|
-
data: z.array(
|
|
25
|
+
data: z.array(UserStatisticsOverviewResponseSchema),
|
|
33
26
|
});
|
|
34
27
|
|
|
35
28
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './get-user-statistics.command';
|
|
1
|
+
export * from './get-user-statistics-overview.command';
|
|
2
|
+
export * from './get-user-statistics-by-month.command';
|
package/commands/index.ts
CHANGED
|
@@ -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>;
|
|
@@ -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(),
|