@purpleschool/gptbot 0.7.78 → 0.7.80
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/presentation.ts +0 -10
- package/build/api/controllers/http/presentation.js +0 -7
- package/build/commands/auth/register-user.command.js +18 -1
- package/build/commands/auth/vk-login.command.js +18 -1
- package/build/commands/auth/yandex-login.command.js +18 -1
- package/build/commands/product/buy-product.command.js +25 -1
- package/build/commands/subscription/buy-subscription.command.js +25 -1
- package/build/commands/telegram-auth/create-telegram-auth-link.command.js +19 -1
- package/build/commands/telegram-profile/auth-with-telegram-web-app.command.js +7 -0
- package/build/commands/tools/presentation/index.js +0 -7
- package/build/commands/tools/presentation/update-presentation.command.js +3 -4
- package/build/commands/user/get-aggregated-user-data.command.js +1 -0
- package/build/commands/user/index.js +1 -0
- package/build/constants/errors/errors.js +6 -9
- package/build/constants/presentation/enums/index.js +0 -4
- package/build/constants/webmaster/enums/organization-type.enum.js +0 -1
- package/build/helpers/index.js +0 -1
- package/build/models/tools/index.js +0 -1
- package/build/models/tools/presentation/index.js +0 -1
- package/build/models/tools/presentation/presentation-config.schema.js +0 -3
- package/build/models/tools/presentation/presentation.schema.js +0 -2
- package/build/models/tools/presentation/slide-content.schema.js +20 -22
- package/build/models/tools/presentation/slide.schema.js +1 -39
- package/build/models/user-referrals.schema.js +6 -0
- package/commands/auth/register-user.command.ts +23 -1
- package/commands/auth/vk-login.command.ts +23 -1
- package/commands/auth/yandex-login.command.ts +23 -1
- package/commands/product/buy-product.command.ts +38 -9
- package/commands/subscription/buy-subscription.command.ts +38 -9
- package/commands/telegram-auth/create-telegram-auth-link.command.ts +24 -1
- package/commands/telegram-profile/auth-with-telegram-web-app.command.ts +7 -0
- package/commands/tools/presentation/index.ts +0 -7
- package/commands/tools/presentation/update-presentation.command.ts +4 -5
- package/commands/user/get-aggregated-user-data.command.ts +1 -0
- package/commands/user/index.ts +1 -0
- package/constants/errors/errors.ts +6 -9
- package/constants/presentation/enums/index.ts +0 -4
- package/constants/webmaster/enums/organization-type.enum.ts +0 -1
- package/helpers/index.ts +0 -1
- package/models/tools/index.ts +0 -1
- package/models/tools/presentation/index.ts +0 -1
- package/models/tools/presentation/presentation-config.schema.ts +0 -3
- package/models/tools/presentation/presentation.schema.ts +0 -2
- package/models/tools/presentation/slide-content.schema.ts +32 -119
- package/models/tools/presentation/slide.schema.ts +0 -47
- package/models/user-referrals.schema.ts +6 -0
- package/package.json +1 -1
- package/build/commands/tools/presentation/build-blank-slide.command.js +0 -21
- package/build/commands/tools/presentation/generate-and-insert-slide.command.js +0 -22
- package/build/commands/tools/presentation/presentation-generate-report.command.js +0 -17
- package/build/commands/tools/presentation/presentation-paraphrase.command.js +0 -20
- package/build/commands/tools/presentation/update-presentation-slides.command.js +0 -25
- package/build/commands/tools/presentation/update-slide-image-slot.command.js +0 -34
- package/build/commands/tools/presentation/update-slide.command.js +0 -19
- package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +0 -9
- package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +0 -8
- package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +0 -8
- package/build/constants/presentation/enums/slide-image-slot-action.enum.js +0 -8
- package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +0 -16
- package/build/helpers/presentation/index.js +0 -17
- package/build/models/tools/presentation/presentation-ai-action.schema.js +0 -27
- package/build/models/tools/presentation/slide-content-edit.schema.js +0 -129
- package/commands/tools/presentation/build-blank-slide.command.ts +0 -23
- package/commands/tools/presentation/generate-and-insert-slide.command.ts +0 -27
- package/commands/tools/presentation/presentation-generate-report.command.ts +0 -21
- package/commands/tools/presentation/presentation-paraphrase.command.ts +0 -26
- package/commands/tools/presentation/update-presentation-slides.command.ts +0 -32
- package/commands/tools/presentation/update-slide-image-slot.command.ts +0 -40
- package/commands/tools/presentation/update-slide.command.ts +0 -25
- package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +0 -5
- package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +0 -4
- package/constants/presentation/enums/presentation-ai-action-type.enum.ts +0 -4
- package/constants/presentation/enums/slide-image-slot-action.enum.ts +0 -4
- package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +0 -20
- package/helpers/presentation/index.ts +0 -1
- package/models/tools/presentation/presentation-ai-action.schema.ts +0 -33
- package/models/tools/presentation/slide-content-edit.schema.ts +0 -154
|
@@ -16,16 +16,6 @@ export const PRESENTATION_ROUTES = {
|
|
|
16
16
|
UPDATE_PRESENTATION_OUTLINE: (uuid: string) => `${uuid}/outline`,
|
|
17
17
|
UPDATE_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
18
18
|
`${presentationId}/outline/${slideOutlineId}`,
|
|
19
|
-
UPDATE_PRESENTATION_SLIDES: (uuid: string) => `${uuid}/slides`,
|
|
20
|
-
GENERATE_AND_INSERT_SLIDE: (uuid: string) => `${uuid}/slides/generate-and-insert`,
|
|
21
|
-
BUILD_BLANK_SLIDE: 'slides/blank',
|
|
22
|
-
UPDATE_SLIDE_IMAGE_SLOT: (presentationId: string, slideId: string, slotId: string) =>
|
|
23
|
-
`${presentationId}/slides/${slideId}/image-slots/${slotId}`,
|
|
24
|
-
UPDATE_SLIDE: (presentationId: string, slideId: string) =>
|
|
25
|
-
`${presentationId}/slides/${slideId}`,
|
|
26
|
-
PARAPHRASE: (presentationId: string, slideId: string) =>
|
|
27
|
-
`${presentationId}/slides/${slideId}/paraphrase`,
|
|
28
|
-
GENERATE_REPORT: (presentationId: string) => `${presentationId}/generate-report`,
|
|
29
19
|
REPOSITION_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
30
20
|
`${presentationId}/outline/${slideOutlineId}/move`,
|
|
31
21
|
DELETE_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
@@ -17,13 +17,6 @@ exports.PRESENTATION_ROUTES = {
|
|
|
17
17
|
GENERATE_SLIDES: (uuid) => `${uuid}/slides/generate`,
|
|
18
18
|
UPDATE_PRESENTATION_OUTLINE: (uuid) => `${uuid}/outline`,
|
|
19
19
|
UPDATE_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${presentationId}/outline/${slideOutlineId}`,
|
|
20
|
-
UPDATE_PRESENTATION_SLIDES: (uuid) => `${uuid}/slides`,
|
|
21
|
-
GENERATE_AND_INSERT_SLIDE: (uuid) => `${uuid}/slides/generate-and-insert`,
|
|
22
|
-
BUILD_BLANK_SLIDE: 'slides/blank',
|
|
23
|
-
UPDATE_SLIDE_IMAGE_SLOT: (presentationId, slideId, slotId) => `${presentationId}/slides/${slideId}/image-slots/${slotId}`,
|
|
24
|
-
UPDATE_SLIDE: (presentationId, slideId) => `${presentationId}/slides/${slideId}`,
|
|
25
|
-
PARAPHRASE: (presentationId, slideId) => `${presentationId}/slides/${slideId}/paraphrase`,
|
|
26
|
-
GENERATE_REPORT: (presentationId) => `${presentationId}/generate-report`,
|
|
27
20
|
REPOSITION_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${presentationId}/outline/${slideOutlineId}/move`,
|
|
28
21
|
DELETE_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${presentationId}/outline/${slideOutlineId}`,
|
|
29
22
|
CREATE_SLIDE_OUTLINE: (presentationId) => `${presentationId}/outline`,
|
|
@@ -8,8 +8,25 @@ var RegisterUserCommand;
|
|
|
8
8
|
RegisterUserCommand.RequestSchema = models_1.UserSchema.pick({ email: true, password: true })
|
|
9
9
|
.extend({
|
|
10
10
|
utm: models_1.UtmSchema.optional(),
|
|
11
|
+
marketingConsent: zod_1.z.boolean().default(false),
|
|
11
12
|
})
|
|
12
|
-
.merge(models_1.UserReferralsSchema)
|
|
13
|
+
.merge(models_1.UserReferralsSchema)
|
|
14
|
+
.refine((data) => {
|
|
15
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
16
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
17
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
18
|
+
}, {
|
|
19
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
20
|
+
path: ['admitadUid'],
|
|
21
|
+
})
|
|
22
|
+
.refine((data) => {
|
|
23
|
+
if (!data.admitadClickDate)
|
|
24
|
+
return true;
|
|
25
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
26
|
+
}, {
|
|
27
|
+
message: 'admitadClickDate cannot be in the future',
|
|
28
|
+
path: ['admitadClickDate'],
|
|
29
|
+
});
|
|
13
30
|
RegisterUserCommand.ResponseSchema = zod_1.z.object({
|
|
14
31
|
data: zod_1.z.object({
|
|
15
32
|
accessToken: zod_1.z.string(),
|
|
@@ -11,8 +11,25 @@ var VKLoginCommand;
|
|
|
11
11
|
code_verifier: zod_1.z.string(),
|
|
12
12
|
device_id: zod_1.z.string(),
|
|
13
13
|
state: zod_1.z.string(),
|
|
14
|
+
marketingConsent: zod_1.z.boolean().default(false),
|
|
14
15
|
})
|
|
15
|
-
.merge(models_1.UserReferralsSchema)
|
|
16
|
+
.merge(models_1.UserReferralsSchema)
|
|
17
|
+
.refine((data) => {
|
|
18
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
19
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
20
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
21
|
+
}, {
|
|
22
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
23
|
+
path: ['admitadUid'],
|
|
24
|
+
})
|
|
25
|
+
.refine((data) => {
|
|
26
|
+
if (!data.admitadClickDate)
|
|
27
|
+
return true;
|
|
28
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
29
|
+
}, {
|
|
30
|
+
message: 'admitadClickDate cannot be in the future',
|
|
31
|
+
path: ['admitadClickDate'],
|
|
32
|
+
});
|
|
16
33
|
VKLoginCommand.ResponseSchema = zod_1.z.object({
|
|
17
34
|
data: zod_1.z.object({
|
|
18
35
|
accessToken: zod_1.z.string(),
|
|
@@ -9,8 +9,25 @@ var YandexLoginCommand;
|
|
|
9
9
|
.object({
|
|
10
10
|
code: zod_1.z.string(),
|
|
11
11
|
code_verifier: zod_1.z.string(),
|
|
12
|
+
marketingConsent: zod_1.z.boolean().default(false),
|
|
12
13
|
})
|
|
13
|
-
.merge(models_1.UserReferralsSchema)
|
|
14
|
+
.merge(models_1.UserReferralsSchema)
|
|
15
|
+
.refine((data) => {
|
|
16
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
17
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
18
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
19
|
+
}, {
|
|
20
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
21
|
+
path: ['admitadUid'],
|
|
22
|
+
})
|
|
23
|
+
.refine((data) => {
|
|
24
|
+
if (!data.admitadClickDate)
|
|
25
|
+
return true;
|
|
26
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
27
|
+
}, {
|
|
28
|
+
message: 'admitadClickDate cannot be in the future',
|
|
29
|
+
path: ['admitadClickDate'],
|
|
30
|
+
});
|
|
14
31
|
YandexLoginCommand.ResponseSchema = zod_1.z.object({
|
|
15
32
|
data: zod_1.z.object({
|
|
16
33
|
accessToken: zod_1.z.string(),
|
|
@@ -26,7 +26,8 @@ var BuyProductCommand;
|
|
|
26
26
|
electronic: zod_1.z.number(),
|
|
27
27
|
}),
|
|
28
28
|
});
|
|
29
|
-
BuyProductCommand.RequestFastSchema = zod_1.z
|
|
29
|
+
BuyProductCommand.RequestFastSchema = zod_1.z
|
|
30
|
+
.object({
|
|
30
31
|
email: zod_1.z.string().email(),
|
|
31
32
|
partnerId: zod_1.z.string().uuid().optional(),
|
|
32
33
|
promocode: zod_1.z.string().optional(),
|
|
@@ -34,6 +35,29 @@ var BuyProductCommand;
|
|
|
34
35
|
webmasterReferralProvidedAt: zod_1.z
|
|
35
36
|
.preprocess((val) => (typeof val === 'string' ? new Date(val) : val), zod_1.z.date())
|
|
36
37
|
.optional(),
|
|
38
|
+
admitadUid: zod_1.z.string().optional(),
|
|
39
|
+
admitadClickDate: zod_1.z
|
|
40
|
+
.string()
|
|
41
|
+
.datetime()
|
|
42
|
+
.transform((date) => new Date(date))
|
|
43
|
+
.optional(),
|
|
44
|
+
marketingConsent: zod_1.z.boolean().default(false),
|
|
45
|
+
})
|
|
46
|
+
.refine((data) => {
|
|
47
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
48
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
49
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
50
|
+
}, {
|
|
51
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
52
|
+
path: ['admitadUid'],
|
|
53
|
+
})
|
|
54
|
+
.refine((data) => {
|
|
55
|
+
if (!data.admitadClickDate)
|
|
56
|
+
return true;
|
|
57
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
58
|
+
}, {
|
|
59
|
+
message: 'admitadClickDate cannot be in the future',
|
|
60
|
+
path: ['admitadClickDate'],
|
|
37
61
|
});
|
|
38
62
|
BuyProductCommand.ResponseSchema = zod_1.z.object({
|
|
39
63
|
publicId: zod_1.z.string(),
|
|
@@ -12,7 +12,8 @@ var BuySubscriptionCommand;
|
|
|
12
12
|
useDiscount: zod_1.z.boolean(),
|
|
13
13
|
promocode: zod_1.z.string().optional(),
|
|
14
14
|
});
|
|
15
|
-
BuySubscriptionCommand.RequestFastSchema = zod_1.z
|
|
15
|
+
BuySubscriptionCommand.RequestFastSchema = zod_1.z
|
|
16
|
+
.object({
|
|
16
17
|
email: zod_1.z.string().email(),
|
|
17
18
|
partnerId: zod_1.z.string().uuid().optional(),
|
|
18
19
|
promocode: zod_1.z.string().optional(),
|
|
@@ -20,6 +21,29 @@ var BuySubscriptionCommand;
|
|
|
20
21
|
webmasterReferralProvidedAt: zod_1.z
|
|
21
22
|
.preprocess((val) => (typeof val === 'string' ? new Date(val) : val), zod_1.z.date())
|
|
22
23
|
.optional(),
|
|
24
|
+
admitadUid: zod_1.z.string().optional(),
|
|
25
|
+
admitadClickDate: zod_1.z
|
|
26
|
+
.string()
|
|
27
|
+
.datetime()
|
|
28
|
+
.transform((date) => new Date(date))
|
|
29
|
+
.optional(),
|
|
30
|
+
marketingConsent: zod_1.z.boolean().default(false),
|
|
31
|
+
})
|
|
32
|
+
.refine((data) => {
|
|
33
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
34
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
35
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
36
|
+
}, {
|
|
37
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
38
|
+
path: ['admitadUid'],
|
|
39
|
+
})
|
|
40
|
+
.refine((data) => {
|
|
41
|
+
if (!data.admitadClickDate)
|
|
42
|
+
return true;
|
|
43
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
44
|
+
}, {
|
|
45
|
+
message: 'admitadClickDate cannot be in the future',
|
|
46
|
+
path: ['admitadClickDate'],
|
|
23
47
|
});
|
|
24
48
|
const IReceiptOrderSchema = zod_1.z.object({
|
|
25
49
|
items: zod_1.z.array(zod_1.z.object({
|
|
@@ -5,7 +5,25 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
6
|
var CreateTelegramAuthLinkCommand;
|
|
7
7
|
(function (CreateTelegramAuthLinkCommand) {
|
|
8
|
-
CreateTelegramAuthLinkCommand.RequestSchema = models_1.UserReferralsSchema
|
|
8
|
+
CreateTelegramAuthLinkCommand.RequestSchema = models_1.UserReferralsSchema.extend({
|
|
9
|
+
marketingConsent: zod_1.z.boolean().default(false),
|
|
10
|
+
})
|
|
11
|
+
.refine((data) => {
|
|
12
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
13
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
14
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
15
|
+
}, {
|
|
16
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
17
|
+
path: ['admitadUid'],
|
|
18
|
+
})
|
|
19
|
+
.refine((data) => {
|
|
20
|
+
if (!data.admitadClickDate)
|
|
21
|
+
return true;
|
|
22
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
23
|
+
}, {
|
|
24
|
+
message: 'admitadClickDate cannot be in the future',
|
|
25
|
+
path: ['admitadClickDate'],
|
|
26
|
+
});
|
|
9
27
|
CreateTelegramAuthLinkCommand.ResponseSchema = zod_1.z.object({
|
|
10
28
|
data: zod_1.z.object({
|
|
11
29
|
uuid: zod_1.z.string().uuid(),
|
|
@@ -14,6 +14,13 @@ var AuthWithTelegramWebAppCommand;
|
|
|
14
14
|
.preprocess((val) => (typeof val === 'string' ? new Date(val) : val), zod_1.z.date())
|
|
15
15
|
.optional(),
|
|
16
16
|
utm: models_1.UtmSchema.optional(),
|
|
17
|
+
admitadUid: zod_1.z.string().optional(),
|
|
18
|
+
admitadClickDate: zod_1.z
|
|
19
|
+
.string()
|
|
20
|
+
.datetime()
|
|
21
|
+
.transform((date) => new Date(date))
|
|
22
|
+
.optional(),
|
|
23
|
+
marketingConsent: zod_1.z.boolean().default(false),
|
|
17
24
|
});
|
|
18
25
|
AuthWithTelegramWebAppCommand.ResponseSchema = zod_1.z.object({
|
|
19
26
|
data: zod_1.z.object({
|
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./build-blank-slide.command"), exports);
|
|
18
17
|
__exportStar(require("./create-presentation.command"), exports);
|
|
19
18
|
__exportStar(require("./delete-all-user-presentations.command"), exports);
|
|
20
19
|
__exportStar(require("./delete-slide-outline.command"), exports);
|
|
@@ -24,15 +23,9 @@ __exportStar(require("./find-presentation-by-uuid.command"), exports);
|
|
|
24
23
|
__exportStar(require("./find-presentation-outline.command"), exports);
|
|
25
24
|
__exportStar(require("./find-presentations.command"), exports);
|
|
26
25
|
__exportStar(require("./generate-presentation-slides.command"), exports);
|
|
27
|
-
__exportStar(require("./generate-and-insert-slide.command"), exports);
|
|
28
26
|
__exportStar(require("./get-presentation-config.command"), exports);
|
|
29
27
|
__exportStar(require("./reposition-slide-outline.command"), exports);
|
|
30
28
|
__exportStar(require("./update-slide-outline.command"), exports);
|
|
31
29
|
__exportStar(require("./update-presentation-outline.command"), exports);
|
|
32
30
|
__exportStar(require("./update-presentation.command"), exports);
|
|
33
|
-
__exportStar(require("./update-presentation-slides.command"), exports);
|
|
34
|
-
__exportStar(require("./update-slide-image-slot.command"), exports);
|
|
35
31
|
__exportStar(require("./update-slide-outline.command"), exports);
|
|
36
|
-
__exportStar(require("./presentation-paraphrase.command"), exports);
|
|
37
|
-
__exportStar(require("./presentation-generate-report.command"), exports);
|
|
38
|
-
__exportStar(require("./update-slide.command"), exports);
|
|
@@ -8,10 +8,9 @@ var UpdatePresentationCommand;
|
|
|
8
8
|
UpdatePresentationCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
9
|
uuid: zod_1.z.string().uuid(),
|
|
10
10
|
});
|
|
11
|
-
UpdatePresentationCommand.RequestBodySchema =
|
|
12
|
-
title:
|
|
13
|
-
|
|
14
|
-
}).partial();
|
|
11
|
+
UpdatePresentationCommand.RequestBodySchema = zod_1.z.object({
|
|
12
|
+
title: zod_1.z.string(),
|
|
13
|
+
});
|
|
15
14
|
UpdatePresentationCommand.ResponseSchema = zod_1.z.object({
|
|
16
15
|
data: presentation_1.PresentationSchema,
|
|
17
16
|
});
|
|
@@ -17,6 +17,7 @@ var GetAggregatedUserData;
|
|
|
17
17
|
hasActiveSubscription: zod_1.z.boolean(),
|
|
18
18
|
hasActiveProduct: zod_1.z.boolean(),
|
|
19
19
|
isCustomer: zod_1.z.boolean(),
|
|
20
|
+
marketingConsent: zod_1.z.boolean(),
|
|
20
21
|
});
|
|
21
22
|
GetAggregatedUserData.ResponseSchema = zod_1.z.object({
|
|
22
23
|
data: zod_1.z.array(GetAggregatedUserData.AggregatedUserSchema),
|
|
@@ -24,3 +24,4 @@ __exportStar(require("./get-user-orders.command"), exports);
|
|
|
24
24
|
__exportStar(require("./get-user-subscriptions.command"), exports);
|
|
25
25
|
__exportStar(require("./get-user-products.command"), exports);
|
|
26
26
|
__exportStar(require("./delete-account.command"), exports);
|
|
27
|
+
__exportStar(require("./get-aggregated-user-data.command"), exports);
|
|
@@ -2239,10 +2239,12 @@ exports.ERRORS = {
|
|
|
2239
2239
|
MUSIC_MAX_SYMBOLS_EXCEEDED: {
|
|
2240
2240
|
code: 'A458',
|
|
2241
2241
|
message: 'Превышена максимальная количество символов',
|
|
2242
|
+
httpCode: 400,
|
|
2242
2243
|
},
|
|
2243
2244
|
MUSIC_INVALID_VOCAL: {
|
|
2244
2245
|
code: 'A459',
|
|
2245
2246
|
message: 'Выбран неверный голос для вокала',
|
|
2247
|
+
httpCode: 400,
|
|
2246
2248
|
},
|
|
2247
2249
|
MUSIC_JOB_DELETE_ERROR: {
|
|
2248
2250
|
code: 'A460',
|
|
@@ -2280,18 +2282,13 @@ exports.ERRORS = {
|
|
|
2280
2282
|
httpCode: 403,
|
|
2281
2283
|
},
|
|
2282
2284
|
WEBMASTER_BONUS_APPLY_ERROR: {
|
|
2283
|
-
code: '
|
|
2285
|
+
code: 'A467',
|
|
2284
2286
|
message: 'Не удалось применить бонусы вебмастеру',
|
|
2285
2287
|
httpCode: 500,
|
|
2286
2288
|
},
|
|
2287
|
-
|
|
2288
|
-
code: '
|
|
2289
|
-
message: '
|
|
2290
|
-
httpCode: 500,
|
|
2291
|
-
},
|
|
2292
|
-
FILE_TYPE_NOT_SUPPORTED: {
|
|
2293
|
-
code: 'A451',
|
|
2294
|
-
message: 'Неподдерживаемый тип файла',
|
|
2289
|
+
WEBMASTER_BALANCE_LESS_THAN_MINIMUM_ERROR: {
|
|
2290
|
+
code: 'A468',
|
|
2291
|
+
message: 'Минимальная сумма для вывода 5000 рублей',
|
|
2295
2292
|
httpCode: 400,
|
|
2296
2293
|
},
|
|
2297
2294
|
};
|
|
@@ -19,7 +19,3 @@ __exportStar(require("./slide-content-type.enum"), exports);
|
|
|
19
19
|
__exportStar(require("./slide-icon-slot-status.enum"), exports);
|
|
20
20
|
__exportStar(require("./slide-image-slot.status.enum"), exports);
|
|
21
21
|
__exportStar(require("./slide-layout.enum"), exports);
|
|
22
|
-
__exportStar(require("./slide-image-slot-action.enum"), exports);
|
|
23
|
-
__exportStar(require("./presentation-ai-action-type.enum"), exports);
|
|
24
|
-
__exportStar(require("./presentation-ai-action-pricing-type.enum"), exports);
|
|
25
|
-
__exportStar(require("./presentation-ai-action-call-status.enum"), exports);
|
|
@@ -5,5 +5,4 @@ var ORGANIZATION_TYPE;
|
|
|
5
5
|
(function (ORGANIZATION_TYPE) {
|
|
6
6
|
ORGANIZATION_TYPE["INDIVIDUAL_ENTREPRENEUR"] = "\u0418\u041F";
|
|
7
7
|
ORGANIZATION_TYPE["LEGAL_ENTITY"] = "\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0435 \u043B\u0438\u0446\u043E";
|
|
8
|
-
ORGANIZATION_TYPE["SELF_EMPLOYED"] = "\u0421\u0430\u043C\u043E\u0437\u0430\u043D\u044F\u0442\u044B\u0439";
|
|
9
8
|
})(ORGANIZATION_TYPE || (exports.ORGANIZATION_TYPE = ORGANIZATION_TYPE = {}));
|
package/build/helpers/index.js
CHANGED
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ai-model"), exports);
|
|
18
|
-
__exportStar(require("./presentation"), exports);
|
|
19
18
|
__exportStar(require("./stt"), exports);
|
|
20
19
|
__exportStar(require("./subscription"), exports);
|
|
21
20
|
__exportStar(require("./tts"), exports);
|
|
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./language"), exports);
|
|
18
18
|
__exportStar(require("./paraphrase"), exports);
|
|
19
|
-
__exportStar(require("./presentation"), exports);
|
|
20
19
|
__exportStar(require("./stt"), exports);
|
|
21
20
|
__exportStar(require("./tts"), exports);
|
|
22
21
|
__exportStar(require("./video"), exports);
|
|
@@ -21,4 +21,3 @@ __exportStar(require("./slide-outline.schema"), exports);
|
|
|
21
21
|
__exportStar(require("./slide.schema"), exports);
|
|
22
22
|
__exportStar(require("./slide-content.schema"), exports);
|
|
23
23
|
__exportStar(require("./presentation-config.schema"), exports);
|
|
24
|
-
__exportStar(require("./presentation-ai-action.schema"), exports);
|
|
@@ -5,17 +5,14 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const slide_content_type_schema_1 = require("./slide-content-type.schema");
|
|
6
6
|
const language_1 = require("../language");
|
|
7
7
|
const presentation_template_schema_1 = require("./presentation-template.schema");
|
|
8
|
-
const presentation_ai_action_schema_1 = require("./presentation-ai-action.schema");
|
|
9
8
|
exports.PresentationConfigSchema = zod_1.z.object({
|
|
10
9
|
slideContentTypes: zod_1.z.array(slide_content_type_schema_1.SlideContentTypeSchema),
|
|
11
10
|
languages: zod_1.z.array(language_1.LanguageSchema),
|
|
12
11
|
templates: zod_1.z.array(presentation_template_schema_1.PresentationTemplateSchema),
|
|
13
|
-
aiActions: zod_1.z.array(presentation_ai_action_schema_1.PresentationAiActionSchema),
|
|
14
12
|
slideGenerationPrice: zod_1.z.number(),
|
|
15
13
|
maxSlides: zod_1.z.number(),
|
|
16
14
|
minSlides: zod_1.z.number(),
|
|
17
15
|
maxSlideTitleLength: zod_1.z.number(),
|
|
18
16
|
maxSlideOutlineLength: zod_1.z.number(),
|
|
19
17
|
maxPromptLength: zod_1.z.number(),
|
|
20
|
-
imageGenerationPrice: zod_1.z.number(),
|
|
21
18
|
});
|
|
@@ -15,8 +15,6 @@ exports.PresentationSchema = zod_1.z.object({
|
|
|
15
15
|
templateId: zod_1.z.string(),
|
|
16
16
|
downloadUrl: zod_1.z.string().nullable(),
|
|
17
17
|
slideCount: zod_1.z.number(),
|
|
18
|
-
lastContentUpdateAt: zod_1.z.date().nullable(),
|
|
19
|
-
lastPptxExportedAt: zod_1.z.date().nullable(),
|
|
20
18
|
createdAt: zod_1.z.date(),
|
|
21
19
|
updatedAt: zod_1.z.date(),
|
|
22
20
|
});
|
|
@@ -19,7 +19,9 @@ exports.IconSlotSchema = zod_1.z.object({
|
|
|
19
19
|
.string()
|
|
20
20
|
.uuid()
|
|
21
21
|
.describe('Generate a valid uuid for icon slot, that will be used for future lookups'),
|
|
22
|
-
prompt: zod_1.z
|
|
22
|
+
prompt: zod_1.z
|
|
23
|
+
.string()
|
|
24
|
+
.describe('Icons are stored locally. Provide a search query for a fitting icon. MUST BE IN ENGLISH'),
|
|
23
25
|
});
|
|
24
26
|
exports.CoverSlideDataSchema = zod_1.z.object({
|
|
25
27
|
contentType: zod_1.z.literal(constants_1.SLIDE_CONTENT_TYPE.COVER),
|
|
@@ -44,17 +46,15 @@ exports.CoverSlideDataSchema = zod_1.z.object({
|
|
|
44
46
|
});
|
|
45
47
|
exports.ThankYouSlideDataSchema = zod_1.z.object({
|
|
46
48
|
contentType: zod_1.z.literal(constants_1.SLIDE_CONTENT_TYPE.THANK_YOU),
|
|
47
|
-
title: zod_1.z
|
|
48
|
-
.string()
|
|
49
|
-
.describe('"Thank you for your attention" in presentation\'s language')
|
|
50
|
-
.min(10)
|
|
51
|
-
.max(150),
|
|
49
|
+
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
52
50
|
author: zod_1.z.object({
|
|
53
|
-
label: zod_1.z.string().describe('"Author" in presentation\'s language'),
|
|
54
|
-
value: zod_1.z
|
|
51
|
+
label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
|
|
52
|
+
value: zod_1.z
|
|
53
|
+
.string()
|
|
54
|
+
.describe('Literal "Author of the presentation" in presentation\'s language'),
|
|
55
55
|
}),
|
|
56
56
|
date: zod_1.z.object({
|
|
57
|
-
label: zod_1.z.string().describe('"Date" in presentation\'s language'),
|
|
57
|
+
label: zod_1.z.string().describe('Literal "Date" in presentation\'s language'),
|
|
58
58
|
value: zod_1.z
|
|
59
59
|
.string()
|
|
60
60
|
.describe('Date of the presentation in the "dd month yyyy" format in presentation\'s locale'),
|
|
@@ -82,9 +82,9 @@ exports.TextSlideDataSchema = zod_1.z.object({
|
|
|
82
82
|
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
83
83
|
description: zod_1.z
|
|
84
84
|
.string()
|
|
85
|
-
.describe(
|
|
85
|
+
.describe('Fairly long textual description of the point presented in the title. A couple of paragraphs.')
|
|
86
86
|
.min(300)
|
|
87
|
-
.max(
|
|
87
|
+
.max(500),
|
|
88
88
|
version: zod_1.z.literal(1),
|
|
89
89
|
});
|
|
90
90
|
exports.ContentsSlideDataSchema = zod_1.z.object({
|
|
@@ -137,9 +137,9 @@ exports.TableSlideDataSchema = zod_1.z.object({
|
|
|
137
137
|
.max(10)
|
|
138
138
|
.describe('Array of column header labels'),
|
|
139
139
|
rows: zod_1.z
|
|
140
|
-
.array(zod_1.z.array(zod_1.z.string().min(1).max(
|
|
141
|
-
.min(
|
|
142
|
-
.max(
|
|
140
|
+
.array(zod_1.z.array(zod_1.z.string().min(1).max(150)))
|
|
141
|
+
.min(2)
|
|
142
|
+
.max(10)
|
|
143
143
|
.describe('Table rows; each row must have exactly the same number of cells as columnHeaders'),
|
|
144
144
|
hasRowHeaders: zod_1.z.boolean().describe('If table needs special row headers, set this to true'),
|
|
145
145
|
hasSummaryRow: zod_1.z.boolean().describe('If table needs a summary row, set this to true'),
|
|
@@ -150,15 +150,13 @@ exports.TableSlideDataSchema = zod_1.z.object({
|
|
|
150
150
|
exports.BarChartSlideDataSchema = zod_1.z.object({
|
|
151
151
|
type: zod_1.z.literal(SLIDE_CHART_TYPE.BAR),
|
|
152
152
|
categories: zod_1.z
|
|
153
|
-
.array(zod_1.z.string())
|
|
153
|
+
.array(zod_1.z.string().min(1).max(12))
|
|
154
154
|
.min(1)
|
|
155
155
|
.max(12)
|
|
156
156
|
.describe('Category labels (e.g., months, products, regions)'),
|
|
157
157
|
series: zod_1.z
|
|
158
158
|
.array(zod_1.z.object({
|
|
159
|
-
name: zod_1.z
|
|
160
|
-
.string()
|
|
161
|
-
.describe('Series name for legend. Try to include measurements if needed'),
|
|
159
|
+
name: zod_1.z.string().min(1).max(12).describe('Series name for legend'),
|
|
162
160
|
data: zod_1.z.array(zod_1.z.number()).describe('Values corresponding to categories'),
|
|
163
161
|
type: zod_1.z
|
|
164
162
|
.number()
|
|
@@ -167,16 +165,16 @@ exports.BarChartSlideDataSchema = zod_1.z.object({
|
|
|
167
165
|
.describe('Series type. Used to discriminate colors when applying theme'),
|
|
168
166
|
}))
|
|
169
167
|
.min(1)
|
|
170
|
-
.max(
|
|
171
|
-
.describe('Data series for the chart
|
|
168
|
+
.max(12)
|
|
169
|
+
.describe('Data series for the chart'),
|
|
172
170
|
yAxisLabel: zod_1.z.string().max(40).optional().describe('Y-axis label'),
|
|
173
171
|
unit: zod_1.z.string().max(10).optional().describe('Unit symbol (%, $, etc.)'),
|
|
174
172
|
version: zod_1.z.literal(1),
|
|
175
173
|
});
|
|
176
174
|
exports.ChartSlideDataSchema = zod_1.z.object({
|
|
177
175
|
contentType: zod_1.z.literal(constants_1.SLIDE_CONTENT_TYPE.CHART),
|
|
178
|
-
title: zod_1.z.string().describe('Slide title in about
|
|
179
|
-
description: zod_1.z.string().describe("Information on slide's topic").max(
|
|
176
|
+
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(200),
|
|
177
|
+
description: zod_1.z.string().describe("Information on slide's topic").min(10).max(400),
|
|
180
178
|
chart: zod_1.z.discriminatedUnion('type', [exports.BarChartSlideDataSchema]),
|
|
181
179
|
version: zod_1.z.literal(1),
|
|
182
180
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SlideSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const slide_content_schema_1 = require("./slide-content.schema");
|
|
6
6
|
const constants_1 = require("../../../constants");
|
|
7
7
|
const slide_icon_slot_schema_1 = require("./slide-icon-slot.schema");
|
|
8
8
|
const slide_image_slot_schema_1 = require("./slide-image-slot.schema");
|
|
9
|
-
const slide_content_edit_schema_1 = require("./slide-content-edit.schema");
|
|
10
9
|
exports.SlideSchema = zod_1.z.object({
|
|
11
10
|
uuid: zod_1.z.string().uuid(),
|
|
12
11
|
order: zod_1.z.number(),
|
|
@@ -19,40 +18,3 @@ exports.SlideSchema = zod_1.z.object({
|
|
|
19
18
|
createdAt: zod_1.z.date(),
|
|
20
19
|
updatedAt: zod_1.z.date(),
|
|
21
20
|
});
|
|
22
|
-
exports.SlideUpdateSchema = exports.SlideSchema.pick({
|
|
23
|
-
layoutId: true,
|
|
24
|
-
})
|
|
25
|
-
.extend({
|
|
26
|
-
content: slide_content_edit_schema_1.SlideContentUserEditSchema,
|
|
27
|
-
})
|
|
28
|
-
.partial();
|
|
29
|
-
exports.SlideBulkUpdateSchema = exports.SlideSchema.pick({
|
|
30
|
-
order: true,
|
|
31
|
-
contentTypeId: true,
|
|
32
|
-
layoutId: true,
|
|
33
|
-
presentationId: true,
|
|
34
|
-
})
|
|
35
|
-
.extend({
|
|
36
|
-
uuid: zod_1.z.string().uuid().optional(),
|
|
37
|
-
content: slide_content_edit_schema_1.SlideContentUserEditSchema,
|
|
38
|
-
})
|
|
39
|
-
.array()
|
|
40
|
-
.min(1, 'Must include at least one slide')
|
|
41
|
-
.refine((arr) => {
|
|
42
|
-
const orders = arr.map((s) => s.order);
|
|
43
|
-
const unique = new Set(orders);
|
|
44
|
-
if (unique.size !== orders.length)
|
|
45
|
-
return false;
|
|
46
|
-
const sorted = [...orders].sort((a, b) => a - b);
|
|
47
|
-
return sorted.every((val, idx) => val === idx);
|
|
48
|
-
}, {
|
|
49
|
-
message: 'Slide orders must be unique and sequential starting at 0',
|
|
50
|
-
path: ['order'],
|
|
51
|
-
})
|
|
52
|
-
.refine((arr) => {
|
|
53
|
-
const [firstId, ...rest] = arr.map((s) => s.presentationId);
|
|
54
|
-
return rest.every((id) => id === firstId);
|
|
55
|
-
}, {
|
|
56
|
-
message: 'All slides must belong to the same presentation',
|
|
57
|
-
path: ['presentationId'],
|
|
58
|
-
});
|
|
@@ -12,4 +12,10 @@ exports.UserReferralsSchema = zod_1.default.object({
|
|
|
12
12
|
.string()
|
|
13
13
|
.transform((date) => new Date(date))
|
|
14
14
|
.optional(),
|
|
15
|
+
admitadUid: zod_1.default.string().optional(),
|
|
16
|
+
admitadClickDate: zod_1.default
|
|
17
|
+
.string()
|
|
18
|
+
.datetime()
|
|
19
|
+
.transform((date) => new Date(date))
|
|
20
|
+
.optional(),
|
|
15
21
|
});
|
|
@@ -5,8 +5,30 @@ export namespace RegisterUserCommand {
|
|
|
5
5
|
export const RequestSchema = UserSchema.pick({ email: true, password: true })
|
|
6
6
|
.extend({
|
|
7
7
|
utm: UtmSchema.optional(),
|
|
8
|
+
marketingConsent: z.boolean().default(false),
|
|
8
9
|
})
|
|
9
|
-
.merge(UserReferralsSchema)
|
|
10
|
+
.merge(UserReferralsSchema)
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
14
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
15
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
19
|
+
path: ['admitadUid'],
|
|
20
|
+
},
|
|
21
|
+
)
|
|
22
|
+
.refine(
|
|
23
|
+
(data) => {
|
|
24
|
+
if (!data.admitadClickDate) return true;
|
|
25
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
message: 'admitadClickDate cannot be in the future',
|
|
29
|
+
path: ['admitadClickDate'],
|
|
30
|
+
},
|
|
31
|
+
);
|
|
10
32
|
|
|
11
33
|
export type Request = z.infer<typeof RequestSchema>;
|
|
12
34
|
|
|
@@ -8,8 +8,30 @@ export namespace VKLoginCommand {
|
|
|
8
8
|
code_verifier: z.string(),
|
|
9
9
|
device_id: z.string(),
|
|
10
10
|
state: z.string(),
|
|
11
|
+
marketingConsent: z.boolean().default(false),
|
|
11
12
|
})
|
|
12
|
-
.merge(UserReferralsSchema)
|
|
13
|
+
.merge(UserReferralsSchema)
|
|
14
|
+
.refine(
|
|
15
|
+
(data) => {
|
|
16
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
17
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
18
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
22
|
+
path: ['admitadUid'],
|
|
23
|
+
},
|
|
24
|
+
)
|
|
25
|
+
.refine(
|
|
26
|
+
(data) => {
|
|
27
|
+
if (!data.admitadClickDate) return true;
|
|
28
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
message: 'admitadClickDate cannot be in the future',
|
|
32
|
+
path: ['admitadClickDate'],
|
|
33
|
+
},
|
|
34
|
+
);
|
|
13
35
|
|
|
14
36
|
export type Request = z.infer<typeof RequestSchema>;
|
|
15
37
|
|