@purpleschool/gptbot 0.9.42 → 0.9.44
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/unregistered-user.ts +5 -0
- package/api/controllers/http/user.ts +1 -0
- package/api/routes.ts +2 -0
- package/build/api/controllers/http/unregistered-user.js +5 -1
- package/build/api/controllers/http/user.js +1 -0
- package/build/api/routes.js +2 -0
- package/build/commands/unregistered-user/index.js +1 -0
- package/build/commands/unregistered-user/patch-locale.command.js +16 -0
- package/build/commands/user/get-me.command.js +1 -0
- package/build/commands/user/index.js +1 -0
- package/build/commands/user/patch-locale.command.js +16 -0
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +0 -1
- package/build/constants/user/enums/index.js +1 -0
- package/build/constants/user/enums/locale.enum.js +8 -0
- package/build/models/user.schema.js +2 -0
- package/commands/unregistered-user/index.ts +1 -0
- package/commands/unregistered-user/patch-locale.command.ts +18 -0
- package/commands/user/get-me.command.ts +2 -1
- package/commands/user/index.ts +1 -0
- package/commands/user/patch-locale.command.ts +18 -0
- package/constants/subscription/enums/subscription-feature-type.enum.ts +0 -1
- package/constants/user/enums/index.ts +1 -0
- package/constants/user/enums/locale.enum.ts +4 -0
- package/models/user.schema.ts +2 -0
- package/package.json +1 -1
package/api/routes.ts
CHANGED
|
@@ -17,6 +17,7 @@ export const REST_API = {
|
|
|
17
17
|
},
|
|
18
18
|
USERS: {
|
|
19
19
|
GET: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
|
|
20
|
+
PATCH_LOCALE: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.PATCH_LOCALE}`,
|
|
20
21
|
POST: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.POST}`,
|
|
21
22
|
CHECK_EMAIL: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.CHECK_EMAIL}`,
|
|
22
23
|
FIND_BY_CRITERIA: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_CRITERIA}`,
|
|
@@ -77,6 +78,7 @@ export const REST_API = {
|
|
|
77
78
|
},
|
|
78
79
|
UNREGISTERED_USER: {
|
|
79
80
|
PUT: `${ROOT}/${CONTROLLERS.UNREGISTERED_USER_CONTROLLER}`,
|
|
81
|
+
PATCH_LOCALE: `${ROOT}/${CONTROLLERS.UNREGISTERED_USER_CONTROLLER}/${CONTROLLERS.UNREGISTERED_USER_ROUTES.PATCH_LOCALE}`,
|
|
80
82
|
},
|
|
81
83
|
AI_MODULE_PRIVATE: {
|
|
82
84
|
GET: `${ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AI_MODEL_ROUTES.GET_ALL}`,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UNREGISTERED_USER_CONTROLLER = void 0;
|
|
3
|
+
exports.UNREGISTERED_USER_ROUTES = exports.UNREGISTERED_USER_CONTROLLER = void 0;
|
|
4
4
|
exports.UNREGISTERED_USER_CONTROLLER = 'unregistered-user';
|
|
5
|
+
exports.UNREGISTERED_USER_ROUTES = {
|
|
6
|
+
PUT: '',
|
|
7
|
+
PATCH_LOCALE: 'locale',
|
|
8
|
+
};
|
package/build/api/routes.js
CHANGED
|
@@ -52,6 +52,7 @@ exports.REST_API = {
|
|
|
52
52
|
},
|
|
53
53
|
USERS: {
|
|
54
54
|
GET: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
|
|
55
|
+
PATCH_LOCALE: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.PATCH_LOCALE}`,
|
|
55
56
|
POST: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.POST}`,
|
|
56
57
|
CHECK_EMAIL: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.CHECK_EMAIL}`,
|
|
57
58
|
FIND_BY_CRITERIA: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.FIND_BY_CRITERIA}`,
|
|
@@ -100,6 +101,7 @@ exports.REST_API = {
|
|
|
100
101
|
},
|
|
101
102
|
UNREGISTERED_USER: {
|
|
102
103
|
PUT: `${exports.ROOT}/${CONTROLLERS.UNREGISTERED_USER_CONTROLLER}`,
|
|
104
|
+
PATCH_LOCALE: `${exports.ROOT}/${CONTROLLERS.UNREGISTERED_USER_CONTROLLER}/${CONTROLLERS.UNREGISTERED_USER_ROUTES.PATCH_LOCALE}`,
|
|
103
105
|
},
|
|
104
106
|
AI_MODULE_PRIVATE: {
|
|
105
107
|
GET: `${exports.ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AI_MODEL_ROUTES.GET_ALL}`,
|
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./create-unregistered-user.command"), exports);
|
|
18
|
+
__exportStar(require("./patch-locale.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PatchUnregisteredUserLocaleCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
var PatchUnregisteredUserLocaleCommand;
|
|
7
|
+
(function (PatchUnregisteredUserLocaleCommand) {
|
|
8
|
+
PatchUnregisteredUserLocaleCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
locale: zod_1.z.nativeEnum(constants_1.LOCALE),
|
|
10
|
+
});
|
|
11
|
+
PatchUnregisteredUserLocaleCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.object({
|
|
13
|
+
locale: zod_1.z.nativeEnum(constants_1.LOCALE),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
})(PatchUnregisteredUserLocaleCommand || (exports.PatchUnregisteredUserLocaleCommand = PatchUnregisteredUserLocaleCommand = {}));
|
|
@@ -17,6 +17,7 @@ var GetMeCommand;
|
|
|
17
17
|
telegramId: zod_1.z.number().nullable(),
|
|
18
18
|
telegramUserName: zod_1.z.string().nullable(),
|
|
19
19
|
webmasterId: zod_1.z.string().uuid().nullable(),
|
|
20
|
+
locale: zod_1.z.nativeEnum(constants_1.LOCALE),
|
|
20
21
|
profile: models_1.UserProfileResponseSchema,
|
|
21
22
|
}),
|
|
22
23
|
});
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./check-email.command"), exports);
|
|
18
18
|
__exportStar(require("./find-user-by-uuid.command"), exports);
|
|
19
19
|
__exportStar(require("./get-me.command"), exports);
|
|
20
|
+
__exportStar(require("./patch-locale.command"), exports);
|
|
20
21
|
__exportStar(require("./up-token-bonus-balance.command"), exports);
|
|
21
22
|
__exportStar(require("./find-users-by-criteria.command"), exports);
|
|
22
23
|
__exportStar(require("./get-user-balance.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PatchUserLocaleCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
var PatchUserLocaleCommand;
|
|
7
|
+
(function (PatchUserLocaleCommand) {
|
|
8
|
+
PatchUserLocaleCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
locale: zod_1.z.nativeEnum(constants_1.LOCALE),
|
|
10
|
+
});
|
|
11
|
+
PatchUserLocaleCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.object({
|
|
13
|
+
locale: zod_1.z.nativeEnum(constants_1.LOCALE),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
})(PatchUserLocaleCommand || (exports.PatchUserLocaleCommand = PatchUserLocaleCommand = {}));
|
|
@@ -43,7 +43,6 @@ var SUBSCRIPTION_FEATURE_KIND;
|
|
|
43
43
|
SUBSCRIPTION_FEATURE_KIND["IMAGE_GENERATION"] = "image_generation";
|
|
44
44
|
SUBSCRIPTION_FEATURE_KIND["TTS"] = "tts";
|
|
45
45
|
SUBSCRIPTION_FEATURE_KIND["STT"] = "stt";
|
|
46
|
-
SUBSCRIPTION_FEATURE_KIND["PRESENTATIONS"] = "presentations";
|
|
47
46
|
SUBSCRIPTION_FEATURE_KIND["VIDEO"] = "video";
|
|
48
47
|
SUBSCRIPTION_FEATURE_KIND["PRESENTATION"] = "presentation";
|
|
49
48
|
SUBSCRIPTION_FEATURE_KIND["BASE"] = "base";
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./singup-method.enum"), exports);
|
|
|
18
18
|
__exportStar(require("./user-status"), exports);
|
|
19
19
|
__exportStar(require("./user-sort-by.enum"), exports);
|
|
20
20
|
__exportStar(require("./sort-order.enum"), exports);
|
|
21
|
+
__exportStar(require("./locale.enum"), exports);
|
|
@@ -4,6 +4,7 @@ exports.UserAggregateSchema = exports.UserSchema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const user_to_subscription_schema_1 = require("./user-to-subscription.schema");
|
|
6
6
|
const user_to_product_schema_1 = require("./user-to-product.schema");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
7
8
|
exports.UserSchema = zod_1.z.object({
|
|
8
9
|
uuid: zod_1.z.string().uuid(),
|
|
9
10
|
email: zod_1.z.string().email(),
|
|
@@ -15,6 +16,7 @@ exports.UserSchema = zod_1.z.object({
|
|
|
15
16
|
restoreTokenHash: zod_1.z.string(),
|
|
16
17
|
tokenBonusBalance: zod_1.z.number(),
|
|
17
18
|
role: zod_1.z.string(),
|
|
19
|
+
locale: zod_1.z.nativeEnum(constants_1.LOCALE),
|
|
18
20
|
createdAt: zod_1.z.date(),
|
|
19
21
|
updatedAt: zod_1.z.date(),
|
|
20
22
|
deletedAt: zod_1.z.date().nullable(),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '../../constants';
|
|
3
|
+
|
|
4
|
+
export namespace PatchUnregisteredUserLocaleCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
locale: z.nativeEnum(LOCALE),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: z.object({
|
|
13
|
+
locale: z.nativeEnum(LOCALE),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ROLE, SIGNUP_METHOD, USER_STATUS } from '../../constants';
|
|
2
|
+
import { LOCALE, ROLE, SIGNUP_METHOD, USER_STATUS } from '../../constants';
|
|
3
3
|
import { UserProfileResponseSchema } from '../../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetMeCommand {
|
|
@@ -17,6 +17,7 @@ export namespace GetMeCommand {
|
|
|
17
17
|
telegramId: z.number().nullable(),
|
|
18
18
|
telegramUserName: z.string().nullable(),
|
|
19
19
|
webmasterId: z.string().uuid().nullable(),
|
|
20
|
+
locale: z.nativeEnum(LOCALE),
|
|
20
21
|
profile: UserProfileResponseSchema,
|
|
21
22
|
}),
|
|
22
23
|
});
|
package/commands/user/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './check-email.command';
|
|
2
2
|
export * from './find-user-by-uuid.command';
|
|
3
3
|
export * from './get-me.command';
|
|
4
|
+
export * from './patch-locale.command';
|
|
4
5
|
export * from './up-token-bonus-balance.command';
|
|
5
6
|
export * from './find-users-by-criteria.command';
|
|
6
7
|
export * from './get-user-balance.command';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '../../constants';
|
|
3
|
+
|
|
4
|
+
export namespace PatchUserLocaleCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
locale: z.nativeEnum(LOCALE),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: z.object({
|
|
13
|
+
locale: z.nativeEnum(LOCALE),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
package/models/user.schema.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { UserToSubscriptionSchema } from './user-to-subscription.schema';
|
|
3
3
|
import { UserToProductSchema } from './user-to-product.schema';
|
|
4
|
+
import { LOCALE } from '../constants';
|
|
4
5
|
|
|
5
6
|
export const UserSchema = z.object({
|
|
6
7
|
uuid: z.string().uuid(),
|
|
@@ -13,6 +14,7 @@ export const UserSchema = z.object({
|
|
|
13
14
|
restoreTokenHash: z.string(),
|
|
14
15
|
tokenBonusBalance: z.number(),
|
|
15
16
|
role: z.string(),
|
|
17
|
+
locale: z.nativeEnum(LOCALE),
|
|
16
18
|
|
|
17
19
|
createdAt: z.date(),
|
|
18
20
|
updatedAt: z.date(),
|