@purpleschool/gptbot 0.7.76 → 0.7.77
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/build/commands/auth/register-user.command.js +1 -0
- package/build/commands/auth/vk-login.command.js +1 -0
- package/build/commands/auth/yandex-login.command.js +1 -0
- package/build/commands/product/buy-product.command.js +1 -0
- package/build/commands/subscription/buy-subscription.command.js +1 -0
- package/build/commands/telegram-auth/create-telegram-auth-link.command.js +6 -2
- package/build/commands/telegram-profile/auth-with-telegram-web-app.command.js +1 -0
- package/build/constants/webmaster/enums/organization-type.enum.js +0 -1
- package/commands/auth/register-user.command.ts +1 -0
- package/commands/auth/vk-login.command.ts +1 -0
- package/commands/auth/yandex-login.command.ts +1 -0
- package/commands/product/buy-product.command.ts +1 -0
- package/commands/subscription/buy-subscription.command.ts +1 -0
- package/commands/telegram-auth/create-telegram-auth-link.command.ts +24 -20
- package/commands/telegram-profile/auth-with-telegram-web-app.command.ts +1 -0
- package/constants/webmaster/enums/organization-type.enum.ts +0 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ 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
13
|
.merge(models_1.UserReferralsSchema)
|
|
13
14
|
.refine((data) => {
|
|
@@ -5,14 +5,18 @@ 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) => {
|
|
9
12
|
const hasAdmitadUid = !!data.admitadUid;
|
|
10
13
|
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
11
14
|
return hasAdmitadUid === hasAdmitadClickDate;
|
|
12
15
|
}, {
|
|
13
16
|
message: 'admitadUid and admitadClickDate must be provided together',
|
|
14
17
|
path: ['admitadUid'],
|
|
15
|
-
})
|
|
18
|
+
})
|
|
19
|
+
.refine((data) => {
|
|
16
20
|
if (!data.admitadClickDate)
|
|
17
21
|
return true;
|
|
18
22
|
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
@@ -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 = {}));
|
|
@@ -2,26 +2,30 @@ import { z } from 'zod';
|
|
|
2
2
|
import { UserReferralsSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace CreateTelegramAuthLinkCommand {
|
|
5
|
-
export const RequestSchema = UserReferralsSchema.
|
|
6
|
-
(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
export const RequestSchema = UserReferralsSchema.extend({
|
|
6
|
+
marketingConsent: z.boolean().default(false),
|
|
7
|
+
})
|
|
8
|
+
.refine(
|
|
9
|
+
(data) => {
|
|
10
|
+
const hasAdmitadUid = !!data.admitadUid;
|
|
11
|
+
const hasAdmitadClickDate = !!data.admitadClickDate;
|
|
12
|
+
return hasAdmitadUid === hasAdmitadClickDate;
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
message: 'admitadUid and admitadClickDate must be provided together',
|
|
16
|
+
path: ['admitadUid'],
|
|
17
|
+
},
|
|
18
|
+
)
|
|
19
|
+
.refine(
|
|
20
|
+
(data) => {
|
|
21
|
+
if (!data.admitadClickDate) return true;
|
|
22
|
+
return new Date(data.admitadClickDate).getTime() <= Date.now();
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
message: 'admitadClickDate cannot be in the future',
|
|
26
|
+
path: ['admitadClickDate'],
|
|
27
|
+
},
|
|
28
|
+
);
|
|
25
29
|
|
|
26
30
|
export type Request = z.infer<typeof RequestSchema>;
|
|
27
31
|
|