@purpleschool/gptbot 0.8.60 → 0.8.62
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/chat-private.ts +1 -0
- package/api/controllers/http/index.ts +1 -1
- package/api/controllers/http/kie.ts +5 -0
- package/api/controllers/http/task.ts +1 -0
- package/api/routes.ts +8 -8
- package/build/api/controllers/http/chat-private.js +1 -0
- package/build/api/controllers/http/index.js +1 -1
- package/build/api/controllers/http/kie.js +7 -0
- package/build/api/controllers/http/task.js +1 -0
- package/build/api/routes.js +6 -8
- package/build/commands/community/create-community-post.command.js +4 -19
- package/build/commands/community/get-all-community-posts-by-criteria.command.js +4 -4
- package/build/commands/community/get-community-post-by-uuid.command.js +1 -1
- package/build/commands/community/get-my-community-posts-by-criteria.command.js +5 -5
- package/build/commands/community/set-like-community-post.command.js +1 -1
- package/build/commands/index.js +0 -1
- package/build/commands/{b2b/send-image-request.command.js → message/create-image-message.command.js} +12 -11
- package/build/commands/message/index.js +1 -0
- package/build/commands/task/get-task-statistics.command.js +15 -0
- package/build/commands/task/index.js +1 -0
- package/build/constants/community/enums/community-tool-type.enum.js +1 -0
- package/build/constants/errors/errors.js +11 -16
- package/build/constants/form-submission/enums/form-type.enum.js +0 -1
- package/build/constants/task/enums/task-type.enum.js +1 -0
- package/build/models/community/community-post-media-data.schema.js +2 -2
- package/build/models/community/community-post.schema.js +19 -1
- package/build/models/index.js +0 -1
- package/commands/community/create-community-post.command.ts +7 -28
- package/commands/community/get-all-community-posts-by-criteria.command.ts +5 -5
- package/commands/community/get-community-post-by-uuid.command.ts +2 -2
- package/commands/community/get-my-community-posts-by-criteria.command.ts +6 -6
- package/commands/community/set-like-community-post.command.ts +2 -2
- package/commands/index.ts +0 -1
- package/commands/{b2b/send-image-request.command.ts → message/create-image-message.command.ts} +8 -6
- package/commands/message/index.ts +1 -0
- package/commands/task/get-task-statistics.command.ts +15 -0
- package/commands/task/index.ts +1 -0
- package/constants/community/enums/community-tool-type.enum.ts +1 -0
- package/constants/errors/errors.ts +11 -17
- package/constants/form-submission/enums/form-type.enum.ts +0 -1
- package/constants/task/enums/task-type.enum.ts +1 -0
- package/models/community/community-post-media-data.schema.ts +7 -9
- package/models/community/community-post.schema.ts +19 -0
- package/models/index.ts +0 -1
- package/package.json +1 -1
- package/api/controllers/http/b2b.ts +0 -10
- package/build/api/controllers/http/b2b.js +0 -12
- package/build/commands/b2b/get-api-key.command.js +0 -12
- package/build/commands/b2b/index.js +0 -21
- package/build/commands/b2b/refresh-api-key.command.js +0 -12
- package/build/commands/b2b/send-text-request.command.js +0 -22
- package/build/commands/b2b/submit-balance-top-up-form.command.js +0 -21
- package/build/models/api-key.schema.js +0 -15
- package/commands/b2b/get-api-key.command.ts +0 -11
- package/commands/b2b/index.ts +0 -5
- package/commands/b2b/refresh-api-key.command.ts +0 -11
- package/commands/b2b/send-text-request.command.ts +0 -26
- package/commands/b2b/submit-balance-top-up-form.command.ts +0 -22
- package/models/api-key.schema.ts +0 -10
|
@@ -9,6 +9,7 @@ export const CHAT_PRIVATE_ROUTES = {
|
|
|
9
9
|
FIND_MANY: '',
|
|
10
10
|
FIND_BY_UUID: (uuid: string) => `${uuid}`,
|
|
11
11
|
SEND_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/text`,
|
|
12
|
+
SEND_IMAGE_MESSAGE: (uuid: string) => `${uuid}/messages/image`,
|
|
12
13
|
ARCHIVE: 'archive',
|
|
13
14
|
DELETE: (uuid: string) => `${uuid}`,
|
|
14
15
|
UPDATE: (uuid: string) => `${uuid}`,
|
|
@@ -14,6 +14,7 @@ export * from './form-submission';
|
|
|
14
14
|
export * from './key-value';
|
|
15
15
|
export * from './referral';
|
|
16
16
|
export * from './message';
|
|
17
|
+
export * from './kie';
|
|
17
18
|
export * from './page';
|
|
18
19
|
export * from './payment';
|
|
19
20
|
export * from './presentation';
|
|
@@ -52,7 +53,6 @@ export * from './cabinet';
|
|
|
52
53
|
export * from './webmaster';
|
|
53
54
|
export * from './music';
|
|
54
55
|
export * from './webmaster-click';
|
|
55
|
-
export * from './b2b';
|
|
56
56
|
export * from './community';
|
|
57
57
|
export * from './user-profile';
|
|
58
58
|
export * from './image-generation';
|
package/api/routes.ts
CHANGED
|
@@ -104,6 +104,8 @@ export const REST_API = {
|
|
|
104
104
|
`${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.SEND_TEXT_MESSAGE(uuid)}`,
|
|
105
105
|
CREATE_SUGGESTIONS: (uuid: string) =>
|
|
106
106
|
`${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.CREATE_SUGGESTIONS(uuid)}`,
|
|
107
|
+
SEND_IMAGE_MESSAGE: (uuid: string) =>
|
|
108
|
+
`${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.SEND_IMAGE_MESSAGE(uuid)}`,
|
|
107
109
|
ARCHIVE: `${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.ARCHIVE}`,
|
|
108
110
|
DELETE: (uuid: string) =>
|
|
109
111
|
`${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.DELETE(uuid)}`,
|
|
@@ -807,6 +809,8 @@ export const REST_API = {
|
|
|
807
809
|
},
|
|
808
810
|
TASK: {
|
|
809
811
|
ACTIVE: `${ROOT}/${CONTROLLERS.TASK_CONTROLLER}/${CONTROLLERS.TASK_ROUTES.ACTIVE}`,
|
|
812
|
+
STATISTICS: (taskId: string) =>
|
|
813
|
+
`${ROOT}/${CONTROLLERS.TASK_CONTROLLER}/${CONTROLLERS.TASK_ROUTES.STATISTICS(taskId)}`,
|
|
810
814
|
},
|
|
811
815
|
PAYMENT: {
|
|
812
816
|
HISTORY: `${ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.HISTORY}`,
|
|
@@ -842,17 +846,12 @@ export const REST_API = {
|
|
|
842
846
|
DELETE_BY_KEY: (namespace: string, key: string) =>
|
|
843
847
|
`${ROOT}/${CONTROLLERS.KEY_VALUE_NAMESPACE_CONTROLLER}/${CONTROLLERS.KEY_VALUE_NAMESPACE_ROUTES.DELETE_BY_KEY(namespace, key)}`,
|
|
844
848
|
},
|
|
849
|
+
KIE: {
|
|
850
|
+
CALLBACK: `${ROOT}/${CONTROLLERS.KIE_CONTROLLER}/${CONTROLLERS.KIE_ROUTES.CALLBACK}`,
|
|
851
|
+
},
|
|
845
852
|
CLOUD_PAYMENTS: {
|
|
846
853
|
CALLBACK: `${ROOT}/${CONTROLLERS.CLOUD_PAYMENTS_CONTROLLER}/${CONTROLLERS.CLOUD_PAYMENTS_ROUTES.CALLBACK}`,
|
|
847
854
|
},
|
|
848
|
-
B2B: {
|
|
849
|
-
GET_API_TOKEN: `${ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.GET_API_TOKEN}`,
|
|
850
|
-
REFRESH_API_TOKEN: `${ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.REFRESH_API_TOKEN}`,
|
|
851
|
-
SEND_TEXT_REQUEST: `${ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.SEND_TEXT_REQUEST}`,
|
|
852
|
-
SEND_IMAGE_REQUEST: `${ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.SEND_IMAGE_REQUEST}`,
|
|
853
|
-
FILE_UPLOAD: `${ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.FILE_UPLOAD}`,
|
|
854
|
-
BALANCE_TOP_UP: `${ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.BALANCE_TOP_UP}`,
|
|
855
|
-
},
|
|
856
855
|
COMMUNITY_PRIVATE: {
|
|
857
856
|
GET_ALL: `${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.GET_ALL}`,
|
|
858
857
|
GET_MY: `${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.GET_MY}`,
|
|
@@ -875,6 +874,7 @@ export const REST_API = {
|
|
|
875
874
|
`${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.FAVORITE(uuid)}`,
|
|
876
875
|
REPORT: (uuid: string) =>
|
|
877
876
|
`${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.REPORT(uuid)}`,
|
|
877
|
+
LIKES_COUNT: `${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.LIKES_COUNT}`,
|
|
878
878
|
},
|
|
879
879
|
COMMUNITY_PUBLIC: {
|
|
880
880
|
GET_ALL: `${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PUBLIC}/${CONTROLLERS.COMMUNITY_ROUTES_PUBLIC.GET_ALL}`,
|
|
@@ -11,6 +11,7 @@ exports.CHAT_PRIVATE_ROUTES = {
|
|
|
11
11
|
FIND_MANY: '',
|
|
12
12
|
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
13
13
|
SEND_TEXT_MESSAGE: (uuid) => `${uuid}/messages/text`,
|
|
14
|
+
SEND_IMAGE_MESSAGE: (uuid) => `${uuid}/messages/image`,
|
|
14
15
|
ARCHIVE: 'archive',
|
|
15
16
|
DELETE: (uuid) => `${uuid}`,
|
|
16
17
|
UPDATE: (uuid) => `${uuid}`,
|
|
@@ -30,6 +30,7 @@ __exportStar(require("./form-submission"), exports);
|
|
|
30
30
|
__exportStar(require("./key-value"), exports);
|
|
31
31
|
__exportStar(require("./referral"), exports);
|
|
32
32
|
__exportStar(require("./message"), exports);
|
|
33
|
+
__exportStar(require("./kie"), exports);
|
|
33
34
|
__exportStar(require("./page"), exports);
|
|
34
35
|
__exportStar(require("./payment"), exports);
|
|
35
36
|
__exportStar(require("./presentation"), exports);
|
|
@@ -68,7 +69,6 @@ __exportStar(require("./cabinet"), exports);
|
|
|
68
69
|
__exportStar(require("./webmaster"), exports);
|
|
69
70
|
__exportStar(require("./music"), exports);
|
|
70
71
|
__exportStar(require("./webmaster-click"), exports);
|
|
71
|
-
__exportStar(require("./b2b"), exports);
|
|
72
72
|
__exportStar(require("./community"), exports);
|
|
73
73
|
__exportStar(require("./user-profile"), exports);
|
|
74
74
|
__exportStar(require("./image-generation"), exports);
|
package/build/api/routes.js
CHANGED
|
@@ -123,6 +123,7 @@ exports.REST_API = {
|
|
|
123
123
|
FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
124
124
|
SEND_TEXT_MESSAGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.SEND_TEXT_MESSAGE(uuid)}`,
|
|
125
125
|
CREATE_SUGGESTIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.CREATE_SUGGESTIONS(uuid)}`,
|
|
126
|
+
SEND_IMAGE_MESSAGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.SEND_IMAGE_MESSAGE(uuid)}`,
|
|
126
127
|
ARCHIVE: `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.ARCHIVE}`,
|
|
127
128
|
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.DELETE(uuid)}`,
|
|
128
129
|
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.UPDATE(uuid)}`,
|
|
@@ -624,6 +625,7 @@ exports.REST_API = {
|
|
|
624
625
|
},
|
|
625
626
|
TASK: {
|
|
626
627
|
ACTIVE: `${exports.ROOT}/${CONTROLLERS.TASK_CONTROLLER}/${CONTROLLERS.TASK_ROUTES.ACTIVE}`,
|
|
628
|
+
STATISTICS: (taskId) => `${exports.ROOT}/${CONTROLLERS.TASK_CONTROLLER}/${CONTROLLERS.TASK_ROUTES.STATISTICS(taskId)}`,
|
|
627
629
|
},
|
|
628
630
|
PAYMENT: {
|
|
629
631
|
HISTORY: `${exports.ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.HISTORY}`,
|
|
@@ -651,17 +653,12 @@ exports.REST_API = {
|
|
|
651
653
|
CREATE: (namespace) => `${exports.ROOT}/${CONTROLLERS.KEY_VALUE_NAMESPACE_CONTROLLER}/${CONTROLLERS.KEY_VALUE_NAMESPACE_ROUTES.CREATE(namespace)}`,
|
|
652
654
|
DELETE_BY_KEY: (namespace, key) => `${exports.ROOT}/${CONTROLLERS.KEY_VALUE_NAMESPACE_CONTROLLER}/${CONTROLLERS.KEY_VALUE_NAMESPACE_ROUTES.DELETE_BY_KEY(namespace, key)}`,
|
|
653
655
|
},
|
|
656
|
+
KIE: {
|
|
657
|
+
CALLBACK: `${exports.ROOT}/${CONTROLLERS.KIE_CONTROLLER}/${CONTROLLERS.KIE_ROUTES.CALLBACK}`,
|
|
658
|
+
},
|
|
654
659
|
CLOUD_PAYMENTS: {
|
|
655
660
|
CALLBACK: `${exports.ROOT}/${CONTROLLERS.CLOUD_PAYMENTS_CONTROLLER}/${CONTROLLERS.CLOUD_PAYMENTS_ROUTES.CALLBACK}`,
|
|
656
661
|
},
|
|
657
|
-
B2B: {
|
|
658
|
-
GET_API_TOKEN: `${exports.ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.GET_API_TOKEN}`,
|
|
659
|
-
REFRESH_API_TOKEN: `${exports.ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.REFRESH_API_TOKEN}`,
|
|
660
|
-
SEND_TEXT_REQUEST: `${exports.ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.SEND_TEXT_REQUEST}`,
|
|
661
|
-
SEND_IMAGE_REQUEST: `${exports.ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.SEND_IMAGE_REQUEST}`,
|
|
662
|
-
FILE_UPLOAD: `${exports.ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.FILE_UPLOAD}`,
|
|
663
|
-
BALANCE_TOP_UP: `${exports.ROOT}/${CONTROLLERS.B2B_CONTROLLER}/${CONTROLLERS.B2B_ROUTES.BALANCE_TOP_UP}`,
|
|
664
|
-
},
|
|
665
662
|
COMMUNITY_PRIVATE: {
|
|
666
663
|
GET_ALL: `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.GET_ALL}`,
|
|
667
664
|
GET_MY: `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.GET_MY}`,
|
|
@@ -676,6 +673,7 @@ exports.REST_API = {
|
|
|
676
673
|
LIKE: (uuid) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.LIKE(uuid)}`,
|
|
677
674
|
FAVORITE: (uuid) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.FAVORITE(uuid)}`,
|
|
678
675
|
REPORT: (uuid) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.REPORT(uuid)}`,
|
|
676
|
+
LIKES_COUNT: `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.LIKES_COUNT}`,
|
|
679
677
|
},
|
|
680
678
|
COMMUNITY_PUBLIC: {
|
|
681
679
|
GET_ALL: `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PUBLIC}/${CONTROLLERS.COMMUNITY_ROUTES_PUBLIC.GET_ALL}`,
|
|
@@ -6,27 +6,12 @@ const models_1 = require("../../models");
|
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
7
7
|
var CreateCommunityPostCommand;
|
|
8
8
|
(function (CreateCommunityPostCommand) {
|
|
9
|
-
CreateCommunityPostCommand.RequestBodySchema = zod_1.z
|
|
10
|
-
.object({
|
|
9
|
+
CreateCommunityPostCommand.RequestBodySchema = zod_1.z.object({
|
|
11
10
|
visibility: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_VISIBILITY),
|
|
12
11
|
caption: zod_1.z.string().max(500).nullable().optional(),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
.refine((data) => {
|
|
18
|
-
const hasMessageId = data.messageId != null;
|
|
19
|
-
const hasToolJobId = data.toolJobId != null;
|
|
20
|
-
if (!(hasMessageId !== hasToolJobId)) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (hasToolJobId && data.toolType == null) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
return true;
|
|
27
|
-
}, {
|
|
28
|
-
message: 'Either messageId or toolJobId must be provided, but not both.',
|
|
29
|
-
path: ['messageId'],
|
|
12
|
+
toolJobId: zod_1.z.string().uuid(),
|
|
13
|
+
toolType: zod_1.z.nativeEnum(constants_1.COMMUNITY_TOOL_TYPE),
|
|
14
|
+
trackIndex: zod_1.z.number().optional(),
|
|
30
15
|
});
|
|
31
16
|
CreateCommunityPostCommand.ResponseSchema = zod_1.z.object({
|
|
32
17
|
data: models_1.ResponseCommunityPostSchema,
|
|
@@ -7,8 +7,8 @@ const constants_1 = require("../../constants");
|
|
|
7
7
|
var GetAllCommunityPostsCommand;
|
|
8
8
|
(function (GetAllCommunityPostsCommand) {
|
|
9
9
|
GetAllCommunityPostsCommand.RequestQuerySchema = zod_1.z.object({
|
|
10
|
-
// Pagination
|
|
11
|
-
cursor: zod_1.z.string().
|
|
10
|
+
// Pagination (cursor is base64url encoded keyset cursor)
|
|
11
|
+
cursor: zod_1.z.string().nullable().optional(),
|
|
12
12
|
limit: zod_1.z.coerce.number().int().positive().max(100).default(30).optional(),
|
|
13
13
|
// Sorting
|
|
14
14
|
sortBy: zod_1.z.enum(['publishedAt', 'views', 'likesCount']).optional(),
|
|
@@ -18,8 +18,8 @@ var GetAllCommunityPostsCommand;
|
|
|
18
18
|
type: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_TYPE).optional(),
|
|
19
19
|
});
|
|
20
20
|
GetAllCommunityPostsCommand.ResponseSchema = zod_1.z.object({
|
|
21
|
-
data: zod_1.z.array(models_1.
|
|
22
|
-
cursor: zod_1.z.string().
|
|
21
|
+
data: zod_1.z.array(models_1.ResponseCommunityPostWithRelationsSchema),
|
|
22
|
+
cursor: zod_1.z.string().nullable(),
|
|
23
23
|
hasNext: zod_1.z.boolean(),
|
|
24
24
|
});
|
|
25
25
|
})(GetAllCommunityPostsCommand || (exports.GetAllCommunityPostsCommand = GetAllCommunityPostsCommand = {}));
|
|
@@ -9,6 +9,6 @@ var GetCommunityPostByUuidCommand;
|
|
|
9
9
|
uuid: zod_1.z.string().uuid(),
|
|
10
10
|
});
|
|
11
11
|
GetCommunityPostByUuidCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
data: models_1.
|
|
12
|
+
data: models_1.ResponseCommunityPostWithRelationsSchema,
|
|
13
13
|
});
|
|
14
14
|
})(GetCommunityPostByUuidCommand || (exports.GetCommunityPostByUuidCommand = GetCommunityPostByUuidCommand = {}));
|
|
@@ -7,8 +7,8 @@ const constants_1 = require("../../constants");
|
|
|
7
7
|
var GetMyCommunityPostsByCriteriaCommand;
|
|
8
8
|
(function (GetMyCommunityPostsByCriteriaCommand) {
|
|
9
9
|
GetMyCommunityPostsByCriteriaCommand.RequestQuerySchema = zod_1.z.object({
|
|
10
|
-
// Pagination
|
|
11
|
-
cursor: zod_1.z.string().
|
|
10
|
+
// Pagination (cursor is base64url encoded keyset cursor)
|
|
11
|
+
cursor: zod_1.z.string().nullable().optional(),
|
|
12
12
|
limit: zod_1.z.coerce
|
|
13
13
|
.number()
|
|
14
14
|
.int()
|
|
@@ -17,7 +17,7 @@ var GetMyCommunityPostsByCriteriaCommand;
|
|
|
17
17
|
.default(constants_1.DEFAULT_PAGINATION_LIMIT)
|
|
18
18
|
.optional(),
|
|
19
19
|
// Sorting
|
|
20
|
-
sortBy: zod_1.z.enum(['publishedAt', 'views', 'likesCount']).optional(),
|
|
20
|
+
sortBy: zod_1.z.enum(['publishedAt', 'views', 'likesCount', 'type']).optional(),
|
|
21
21
|
sortOrder: zod_1.z.nativeEnum(constants_1.SORT_ORDER).optional(),
|
|
22
22
|
// Criteria
|
|
23
23
|
visibility: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_VISIBILITY).optional(),
|
|
@@ -25,8 +25,8 @@ var GetMyCommunityPostsByCriteriaCommand;
|
|
|
25
25
|
status: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_STATUS).optional(),
|
|
26
26
|
});
|
|
27
27
|
GetMyCommunityPostsByCriteriaCommand.ResponseSchema = zod_1.z.object({
|
|
28
|
-
data: zod_1.z.array(models_1.
|
|
29
|
-
cursor: zod_1.z.string().
|
|
28
|
+
data: zod_1.z.array(models_1.ResponseCommunityPostWithRelationsSchema),
|
|
29
|
+
cursor: zod_1.z.string().nullable(),
|
|
30
30
|
hasNext: zod_1.z.boolean(),
|
|
31
31
|
});
|
|
32
32
|
})(GetMyCommunityPostsByCriteriaCommand || (exports.GetMyCommunityPostsByCriteriaCommand = GetMyCommunityPostsByCriteriaCommand = {}));
|
|
@@ -9,6 +9,6 @@ var SetLikeCommunityPostCommand;
|
|
|
9
9
|
uuid: zod_1.z.string().uuid(),
|
|
10
10
|
});
|
|
11
11
|
SetLikeCommunityPostCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
data: models_1.
|
|
12
|
+
data: models_1.ResponseCommunityPostWithRelationsSchema,
|
|
13
13
|
});
|
|
14
14
|
})(SetLikeCommunityPostCommand || (exports.SetLikeCommunityPostCommand = SetLikeCommunityPostCommand = {}));
|
package/build/commands/index.js
CHANGED
|
@@ -55,6 +55,5 @@ __exportStar(require("./daily-streak"), exports);
|
|
|
55
55
|
__exportStar(require("./cabinet"), exports);
|
|
56
56
|
__exportStar(require("./webmaster"), exports);
|
|
57
57
|
__exportStar(require("./webmaster-click"), exports);
|
|
58
|
-
__exportStar(require("./b2b"), exports);
|
|
59
58
|
__exportStar(require("./community"), exports);
|
|
60
59
|
__exportStar(require("./user-profile"), exports);
|
package/build/commands/{b2b/send-image-request.command.js → message/create-image-message.command.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CreateImageMessageCommand = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
const constants_1 = require("../../constants");
|
|
6
|
-
var
|
|
7
|
-
(function (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
prompt: zod_1.z.string(),
|
|
7
|
+
var CreateImageMessageCommand;
|
|
8
|
+
(function (CreateImageMessageCommand) {
|
|
9
|
+
CreateImageMessageCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
text: zod_1.z.string(),
|
|
11
11
|
params: zod_1.z.array(zod_1.z.object({
|
|
12
12
|
type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONFIG_PARAM),
|
|
13
13
|
option: zod_1.z.string().uuid(),
|
|
@@ -16,9 +16,10 @@ var SendImageRequestCommand;
|
|
|
16
16
|
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional().default([]),
|
|
17
17
|
files: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
urls: zod_1.z.array(zod_1.z.string()),
|
|
22
|
-
}),
|
|
19
|
+
CreateImageMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
|
|
20
|
+
uuid: true,
|
|
23
21
|
});
|
|
24
|
-
|
|
22
|
+
CreateImageMessageCommand.ResponseSchema = zod_1.z.object({
|
|
23
|
+
data: models_1.MessageSchema,
|
|
24
|
+
});
|
|
25
|
+
})(CreateImageMessageCommand || (exports.CreateImageMessageCommand = CreateImageMessageCommand = {}));
|
|
@@ -14,6 +14,7 @@ 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("./create-image-message.command"), exports);
|
|
17
18
|
__exportStar(require("./create-text-message.command"), exports);
|
|
18
19
|
__exportStar(require("./find-message-by-uuid.command"), exports);
|
|
19
20
|
__exportStar(require("./rate-message.command"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetTaskStatisticsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var GetTaskStatisticsCommand;
|
|
6
|
+
(function (GetTaskStatisticsCommand) {
|
|
7
|
+
GetTaskStatisticsCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
GetTaskStatisticsCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
globalCompletions: zod_1.z.number().describe('Total number of users who completed this task'),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(GetTaskStatisticsCommand || (exports.GetTaskStatisticsCommand = GetTaskStatisticsCommand = {}));
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./find-all-active-tasks.command"), exports);
|
|
18
18
|
__exportStar(require("./get-potential-tasks-rewards.command"), exports);
|
|
19
|
+
__exportStar(require("./get-task-statistics.command"), exports);
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.COMMUNITY_TOOL_TYPE = void 0;
|
|
4
4
|
var COMMUNITY_TOOL_TYPE;
|
|
5
5
|
(function (COMMUNITY_TOOL_TYPE) {
|
|
6
|
+
COMMUNITY_TOOL_TYPE["IMAGE"] = "image";
|
|
6
7
|
COMMUNITY_TOOL_TYPE["IMAGE_EDITOR"] = "image_editor";
|
|
7
8
|
COMMUNITY_TOOL_TYPE["VIDEO"] = "video";
|
|
8
9
|
COMMUNITY_TOOL_TYPE["VIDEO_EDITOR"] = "video_editor";
|
|
@@ -1484,7 +1484,7 @@ exports.ERRORS = {
|
|
|
1484
1484
|
},
|
|
1485
1485
|
CHECK_USER_HAS_ACTIVE_SUBSCRIPTION_OR_PRODUCT_ERROR: {
|
|
1486
1486
|
code: 'A310',
|
|
1487
|
-
message: 'Произошла ошибка при проверке наличия активной подписки
|
|
1487
|
+
message: 'Произошла ошибка при проверке наличия активной подписки у пользователя',
|
|
1488
1488
|
httpCode: 500,
|
|
1489
1489
|
},
|
|
1490
1490
|
PROMPT_CATEGORY_CONFLICT_ERROR: {
|
|
@@ -2607,29 +2607,24 @@ exports.ERRORS = {
|
|
|
2607
2607
|
message: 'Произошла ошибка при установке оценки презентации',
|
|
2608
2608
|
httpCode: 500,
|
|
2609
2609
|
},
|
|
2610
|
-
|
|
2610
|
+
USER_NOT_FOUND_AGGREGATE_ERROR: {
|
|
2611
2611
|
code: 'A532',
|
|
2612
|
-
message: '
|
|
2612
|
+
message: 'Произошла ошибка при получении пользователя',
|
|
2613
2613
|
httpCode: 500,
|
|
2614
2614
|
},
|
|
2615
|
-
|
|
2615
|
+
IMAGE_GENERATION_MODEL_FIND_ERROR: {
|
|
2616
2616
|
code: 'A533',
|
|
2617
|
-
message: '
|
|
2617
|
+
message: 'Произошла ошибка при получении модели для генерации изображений',
|
|
2618
2618
|
httpCode: 500,
|
|
2619
2619
|
},
|
|
2620
|
-
|
|
2620
|
+
COMMUNITY_POST_TRACK_INDEX_REQUIRED: {
|
|
2621
2621
|
code: 'A534',
|
|
2622
|
-
message: '
|
|
2623
|
-
httpCode:
|
|
2622
|
+
message: 'Индекс трека обязателен для музыкального поста',
|
|
2623
|
+
httpCode: 400,
|
|
2624
2624
|
},
|
|
2625
|
-
|
|
2625
|
+
COMMUNITY_POST_TRACK_INDEX_OUT_OF_RANGE: {
|
|
2626
2626
|
code: 'A535',
|
|
2627
|
-
message: '
|
|
2628
|
-
httpCode:
|
|
2629
|
-
},
|
|
2630
|
-
API_KEY_ALREADY_EXISTS: {
|
|
2631
|
-
code: 'A536',
|
|
2632
|
-
message: 'Ключ API уже существует, если потеряли ключ воспользуйтесь GET token/refresh',
|
|
2633
|
-
httpCode: 409,
|
|
2627
|
+
message: 'Индекс трека выходит за пределы допустимого диапазона',
|
|
2628
|
+
httpCode: 400,
|
|
2634
2629
|
},
|
|
2635
2630
|
};
|
|
@@ -6,4 +6,5 @@ var TASK_TYPE;
|
|
|
6
6
|
TASK_TYPE["CLICK"] = "click";
|
|
7
7
|
TASK_TYPE["TELEGRAM_CHANNEL_INVITE"] = "telegram_channel_invite";
|
|
8
8
|
TASK_TYPE["REVIEW"] = "review";
|
|
9
|
+
TASK_TYPE["NEW_YEAR_SUBSCRIBER_GIFT"] = "new_year_subscriber_gift";
|
|
9
10
|
})(TASK_TYPE || (exports.TASK_TYPE = TASK_TYPE = {}));
|
|
@@ -36,13 +36,13 @@ exports.MusicCommunityMediaSchema = zod_1.z.object({
|
|
|
36
36
|
type: zod_1.z.literal(constants_1.COMMUNITY_POST_TYPE.MUSIC),
|
|
37
37
|
params: tools_1.MusicJobParamsSchema,
|
|
38
38
|
prompt: zod_1.z.string(),
|
|
39
|
-
|
|
39
|
+
track: music_track_schema_1.MusicTrackSchema.pick({
|
|
40
40
|
audioUrl: true,
|
|
41
41
|
coverUrl: true,
|
|
42
42
|
duration: true,
|
|
43
43
|
title: true,
|
|
44
44
|
tags: true,
|
|
45
|
-
})
|
|
45
|
+
}),
|
|
46
46
|
});
|
|
47
47
|
exports.CommunityPostMediaDataSchema = zod_1.z.discriminatedUnion('type', [
|
|
48
48
|
exports.ImageCommunityMediaSchema,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResponseCommunityPostSchema = exports.CommunityPostSchema = void 0;
|
|
3
|
+
exports.ResponseCommunityPostWithRelationsSchema = exports.ResponseCommunityPostSchema = exports.CommunityPostSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const community_post_media_data_schema_1 = require("./community-post-media-data.schema");
|
|
7
7
|
const icon_variants_schema_1 = require("../icon-variants.schema");
|
|
8
|
+
const user_profile_schema_1 = require("../user-profile.schema");
|
|
8
9
|
exports.CommunityPostSchema = zod_1.z.object({
|
|
9
10
|
uuid: zod_1.z.string().uuid(),
|
|
10
11
|
userId: zod_1.z.string().uuid(),
|
|
@@ -42,3 +43,20 @@ exports.ResponseCommunityPostSchema = zod_1.z.object({
|
|
|
42
43
|
likesCount: zod_1.z.number(),
|
|
43
44
|
publishedAt: zod_1.z.date().nullable(),
|
|
44
45
|
});
|
|
46
|
+
exports.ResponseCommunityPostWithRelationsSchema = zod_1.z.object({
|
|
47
|
+
uuid: zod_1.z.string().uuid(),
|
|
48
|
+
userProfile: user_profile_schema_1.UserProfileResponseSchema,
|
|
49
|
+
caption: zod_1.z.string().nullable(),
|
|
50
|
+
status: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_STATUS),
|
|
51
|
+
visibility: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_VISIBILITY),
|
|
52
|
+
type: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_TYPE),
|
|
53
|
+
mediaData: community_post_media_data_schema_1.CommunityPostMediaDataSchema,
|
|
54
|
+
aiModelId: zod_1.z.string().uuid(),
|
|
55
|
+
aiModelTitle: zod_1.z.string(),
|
|
56
|
+
aiModelIcons: icon_variants_schema_1.IconVariantsSchema,
|
|
57
|
+
isLikedByCurrentUser: zod_1.z.boolean(),
|
|
58
|
+
isFavoritedByCurrentUser: zod_1.z.boolean(),
|
|
59
|
+
views: zod_1.z.number(),
|
|
60
|
+
likesCount: zod_1.z.number(),
|
|
61
|
+
publishedAt: zod_1.z.date().nullable(),
|
|
62
|
+
});
|
package/build/models/index.js
CHANGED
|
@@ -70,6 +70,5 @@ __exportStar(require("./webmaster.schema"), exports);
|
|
|
70
70
|
__exportStar(require("./webmaster-balance.schema"), exports);
|
|
71
71
|
__exportStar(require("./user-referrals.schema"), exports);
|
|
72
72
|
__exportStar(require("./webmaster-click.schema"), exports);
|
|
73
|
-
__exportStar(require("./api-key.schema"), exports);
|
|
74
73
|
__exportStar(require("./community"), exports);
|
|
75
74
|
__exportStar(require("./user-profile.schema"), exports);
|
|
@@ -3,34 +3,13 @@ import { ResponseCommunityPostSchema } from '../../models';
|
|
|
3
3
|
import { COMMUNITY_POST_VISIBILITY, COMMUNITY_TOOL_TYPE } from '../../constants';
|
|
4
4
|
|
|
5
5
|
export namespace CreateCommunityPostCommand {
|
|
6
|
-
export const RequestBodySchema = z
|
|
7
|
-
.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
.refine(
|
|
15
|
-
(data) => {
|
|
16
|
-
const hasMessageId = data.messageId != null;
|
|
17
|
-
const hasToolJobId = data.toolJobId != null;
|
|
18
|
-
|
|
19
|
-
if (!(hasMessageId !== hasToolJobId)) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (hasToolJobId && data.toolType == null) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return true;
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
message: 'Either messageId or toolJobId must be provided, but not both.',
|
|
31
|
-
path: ['messageId'],
|
|
32
|
-
},
|
|
33
|
-
);
|
|
6
|
+
export const RequestBodySchema = z.object({
|
|
7
|
+
visibility: z.nativeEnum(COMMUNITY_POST_VISIBILITY),
|
|
8
|
+
caption: z.string().max(500).nullable().optional(),
|
|
9
|
+
toolJobId: z.string().uuid(),
|
|
10
|
+
toolType: z.nativeEnum(COMMUNITY_TOOL_TYPE),
|
|
11
|
+
trackIndex: z.number().optional(),
|
|
12
|
+
});
|
|
34
13
|
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
35
14
|
|
|
36
15
|
export const ResponseSchema = z.object({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { ResponseCommunityPostWithRelationsSchema } from '../../models';
|
|
3
3
|
import { SORT_ORDER, COMMUNITY_POST_TYPE } from '../../constants';
|
|
4
4
|
|
|
5
5
|
export namespace GetAllCommunityPostsCommand {
|
|
6
6
|
export const RequestQuerySchema = z.object({
|
|
7
|
-
// Pagination
|
|
8
|
-
cursor: z.string().
|
|
7
|
+
// Pagination (cursor is base64url encoded keyset cursor)
|
|
8
|
+
cursor: z.string().nullable().optional(),
|
|
9
9
|
limit: z.coerce.number().int().positive().max(100).default(30).optional(),
|
|
10
10
|
|
|
11
11
|
// Sorting
|
|
@@ -20,8 +20,8 @@ export namespace GetAllCommunityPostsCommand {
|
|
|
20
20
|
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
21
21
|
|
|
22
22
|
export const ResponseSchema = z.object({
|
|
23
|
-
data: z.array(
|
|
24
|
-
cursor: z.string().
|
|
23
|
+
data: z.array(ResponseCommunityPostWithRelationsSchema),
|
|
24
|
+
cursor: z.string().nullable(),
|
|
25
25
|
hasNext: z.boolean(),
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { ResponseCommunityPostWithRelationsSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace GetCommunityPostByUuidCommand {
|
|
5
5
|
export const RequestSchema = z.object({
|
|
@@ -9,7 +9,7 @@ export namespace GetCommunityPostByUuidCommand {
|
|
|
9
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
10
10
|
|
|
11
11
|
export const ResponseSchema = z.object({
|
|
12
|
-
data:
|
|
12
|
+
data: ResponseCommunityPostWithRelationsSchema,
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { ResponseCommunityPostWithRelationsSchema } from '../../models';
|
|
3
3
|
import {
|
|
4
4
|
COMMUNITY_POST_STATUS,
|
|
5
5
|
COMMUNITY_POST_TYPE,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
|
|
11
11
|
export namespace GetMyCommunityPostsByCriteriaCommand {
|
|
12
12
|
export const RequestQuerySchema = z.object({
|
|
13
|
-
// Pagination
|
|
14
|
-
cursor: z.string().
|
|
13
|
+
// Pagination (cursor is base64url encoded keyset cursor)
|
|
14
|
+
cursor: z.string().nullable().optional(),
|
|
15
15
|
limit: z.coerce
|
|
16
16
|
.number()
|
|
17
17
|
.int()
|
|
@@ -21,7 +21,7 @@ export namespace GetMyCommunityPostsByCriteriaCommand {
|
|
|
21
21
|
.optional(),
|
|
22
22
|
|
|
23
23
|
// Sorting
|
|
24
|
-
sortBy: z.enum(['publishedAt', 'views', 'likesCount']).optional(),
|
|
24
|
+
sortBy: z.enum(['publishedAt', 'views', 'likesCount', 'type']).optional(),
|
|
25
25
|
sortOrder: z.nativeEnum(SORT_ORDER).optional(),
|
|
26
26
|
|
|
27
27
|
// Criteria
|
|
@@ -32,8 +32,8 @@ export namespace GetMyCommunityPostsByCriteriaCommand {
|
|
|
32
32
|
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
33
33
|
|
|
34
34
|
export const ResponseSchema = z.object({
|
|
35
|
-
data: z.array(
|
|
36
|
-
cursor: z.string().
|
|
35
|
+
data: z.array(ResponseCommunityPostWithRelationsSchema),
|
|
36
|
+
cursor: z.string().nullable(),
|
|
37
37
|
hasNext: z.boolean(),
|
|
38
38
|
});
|
|
39
39
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { ResponseCommunityPostWithRelationsSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace SetLikeCommunityPostCommand {
|
|
5
5
|
export const RequestParamsSchema = z.object({
|
|
@@ -8,7 +8,7 @@ export namespace SetLikeCommunityPostCommand {
|
|
|
8
8
|
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
9
|
|
|
10
10
|
export const ResponseSchema = z.object({
|
|
11
|
-
data:
|
|
11
|
+
data: ResponseCommunityPostWithRelationsSchema,
|
|
12
12
|
});
|
|
13
13
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
14
|
}
|
package/commands/index.ts
CHANGED
package/commands/{b2b/send-image-request.command.ts → message/create-image-message.command.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ChatSchema, MessageSchema } from '../../models';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { AI_MODEL_CONFIG_PARAM, AI_MODEL_FEATURE } from '../../constants';
|
|
3
4
|
|
|
4
|
-
export namespace
|
|
5
|
+
export namespace CreateImageMessageCommand {
|
|
5
6
|
export const RequestSchema = z.object({
|
|
6
|
-
|
|
7
|
-
prompt: z.string(),
|
|
7
|
+
text: z.string(),
|
|
8
8
|
params: z.array(
|
|
9
9
|
z.object({
|
|
10
10
|
type: z.nativeEnum(AI_MODEL_CONFIG_PARAM),
|
|
@@ -16,12 +16,14 @@ export namespace SendImageRequestCommand {
|
|
|
16
16
|
files: z.array(z.string().uuid()).optional().default([]),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
export const RequestParamSchema = ChatSchema.pick({
|
|
20
|
+
uuid: true,
|
|
21
|
+
});
|
|
22
|
+
|
|
19
23
|
export type Request = z.infer<typeof RequestSchema>;
|
|
20
24
|
|
|
21
25
|
export const ResponseSchema = z.object({
|
|
22
|
-
data:
|
|
23
|
-
urls: z.array(z.string()),
|
|
24
|
-
}),
|
|
26
|
+
data: MessageSchema,
|
|
25
27
|
});
|
|
26
28
|
|
|
27
29
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace GetTaskStatisticsCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const ResponseSchema = z.object({
|
|
9
|
+
data: z.object({
|
|
10
|
+
globalCompletions: z.number().describe('Total number of users who completed this task'),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
package/commands/task/index.ts
CHANGED
|
@@ -1488,8 +1488,7 @@ export const ERRORS = {
|
|
|
1488
1488
|
},
|
|
1489
1489
|
CHECK_USER_HAS_ACTIVE_SUBSCRIPTION_OR_PRODUCT_ERROR: {
|
|
1490
1490
|
code: 'A310',
|
|
1491
|
-
message:
|
|
1492
|
-
'Произошла ошибка при проверке наличия активной подписки или пакета у пользователя',
|
|
1491
|
+
message: 'Произошла ошибка при проверке наличия активной подписки у пользователя',
|
|
1493
1492
|
httpCode: 500,
|
|
1494
1493
|
},
|
|
1495
1494
|
PROMPT_CATEGORY_CONFLICT_ERROR: {
|
|
@@ -2616,29 +2615,24 @@ export const ERRORS = {
|
|
|
2616
2615
|
message: 'Произошла ошибка при установке оценки презентации',
|
|
2617
2616
|
httpCode: 500,
|
|
2618
2617
|
},
|
|
2619
|
-
|
|
2618
|
+
USER_NOT_FOUND_AGGREGATE_ERROR: {
|
|
2620
2619
|
code: 'A532',
|
|
2621
|
-
message: '
|
|
2620
|
+
message: 'Произошла ошибка при получении пользователя',
|
|
2622
2621
|
httpCode: 500,
|
|
2623
2622
|
},
|
|
2624
|
-
|
|
2623
|
+
IMAGE_GENERATION_MODEL_FIND_ERROR: {
|
|
2625
2624
|
code: 'A533',
|
|
2626
|
-
message: '
|
|
2625
|
+
message: 'Произошла ошибка при получении модели для генерации изображений',
|
|
2627
2626
|
httpCode: 500,
|
|
2628
2627
|
},
|
|
2629
|
-
|
|
2628
|
+
COMMUNITY_POST_TRACK_INDEX_REQUIRED: {
|
|
2630
2629
|
code: 'A534',
|
|
2631
|
-
message: '
|
|
2632
|
-
httpCode:
|
|
2630
|
+
message: 'Индекс трека обязателен для музыкального поста',
|
|
2631
|
+
httpCode: 400,
|
|
2633
2632
|
},
|
|
2634
|
-
|
|
2633
|
+
COMMUNITY_POST_TRACK_INDEX_OUT_OF_RANGE: {
|
|
2635
2634
|
code: 'A535',
|
|
2636
|
-
message: '
|
|
2637
|
-
httpCode:
|
|
2638
|
-
},
|
|
2639
|
-
API_KEY_ALREADY_EXISTS: {
|
|
2640
|
-
code: 'A536',
|
|
2641
|
-
message: 'Ключ API уже существует, если потеряли ключ воспользуйтесь GET token/refresh',
|
|
2642
|
-
httpCode: 409,
|
|
2635
|
+
message: 'Индекс трека выходит за пределы допустимого диапазона',
|
|
2636
|
+
httpCode: 400,
|
|
2643
2637
|
},
|
|
2644
2638
|
};
|
|
@@ -38,15 +38,13 @@ export const MusicCommunityMediaSchema = z.object({
|
|
|
38
38
|
type: z.literal(COMMUNITY_POST_TYPE.MUSIC),
|
|
39
39
|
params: MusicJobParamsSchema,
|
|
40
40
|
prompt: z.string(),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}),
|
|
49
|
-
),
|
|
41
|
+
track: MusicTrackSchema.pick({
|
|
42
|
+
audioUrl: true,
|
|
43
|
+
coverUrl: true,
|
|
44
|
+
duration: true,
|
|
45
|
+
title: true,
|
|
46
|
+
tags: true,
|
|
47
|
+
}),
|
|
50
48
|
});
|
|
51
49
|
|
|
52
50
|
export const CommunityPostMediaDataSchema = z.discriminatedUnion('type', [
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from '../../constants';
|
|
8
8
|
import { CommunityPostMediaDataSchema } from './community-post-media-data.schema';
|
|
9
9
|
import { IconVariantsSchema } from '../icon-variants.schema';
|
|
10
|
+
import { UserProfileResponseSchema } from '../user-profile.schema';
|
|
10
11
|
|
|
11
12
|
export const CommunityPostSchema = z.object({
|
|
12
13
|
uuid: z.string().uuid(),
|
|
@@ -46,3 +47,21 @@ export const ResponseCommunityPostSchema = z.object({
|
|
|
46
47
|
likesCount: z.number(),
|
|
47
48
|
publishedAt: z.date().nullable(),
|
|
48
49
|
});
|
|
50
|
+
|
|
51
|
+
export const ResponseCommunityPostWithRelationsSchema = z.object({
|
|
52
|
+
uuid: z.string().uuid(),
|
|
53
|
+
userProfile: UserProfileResponseSchema,
|
|
54
|
+
caption: z.string().nullable(),
|
|
55
|
+
status: z.nativeEnum(COMMUNITY_POST_STATUS),
|
|
56
|
+
visibility: z.nativeEnum(COMMUNITY_POST_VISIBILITY),
|
|
57
|
+
type: z.nativeEnum(COMMUNITY_POST_TYPE),
|
|
58
|
+
mediaData: CommunityPostMediaDataSchema,
|
|
59
|
+
aiModelId: z.string().uuid(),
|
|
60
|
+
aiModelTitle: z.string(),
|
|
61
|
+
aiModelIcons: IconVariantsSchema,
|
|
62
|
+
isLikedByCurrentUser: z.boolean(),
|
|
63
|
+
isFavoritedByCurrentUser: z.boolean(),
|
|
64
|
+
views: z.number(),
|
|
65
|
+
likesCount: z.number(),
|
|
66
|
+
publishedAt: z.date().nullable(),
|
|
67
|
+
});
|
package/models/index.ts
CHANGED
|
@@ -54,6 +54,5 @@ export * from './webmaster.schema';
|
|
|
54
54
|
export * from './webmaster-balance.schema';
|
|
55
55
|
export * from './user-referrals.schema';
|
|
56
56
|
export * from './webmaster-click.schema';
|
|
57
|
-
export * from './api-key.schema';
|
|
58
57
|
export * from './community';
|
|
59
58
|
export * from './user-profile.schema';
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const B2B_CONTROLLER = 'private/b2b' as const;
|
|
2
|
-
|
|
3
|
-
export const B2B_ROUTES = {
|
|
4
|
-
GET_API_TOKEN: 'token',
|
|
5
|
-
REFRESH_API_TOKEN: 'token/refresh',
|
|
6
|
-
SEND_TEXT_REQUEST: 'completions',
|
|
7
|
-
SEND_IMAGE_REQUEST: 'image/generation',
|
|
8
|
-
FILE_UPLOAD: 'file/upload',
|
|
9
|
-
BALANCE_TOP_UP: 'balance/top-up',
|
|
10
|
-
} as const;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.B2B_ROUTES = exports.B2B_CONTROLLER = void 0;
|
|
4
|
-
exports.B2B_CONTROLLER = 'private/b2b';
|
|
5
|
-
exports.B2B_ROUTES = {
|
|
6
|
-
GET_API_TOKEN: 'token',
|
|
7
|
-
REFRESH_API_TOKEN: 'token/refresh',
|
|
8
|
-
SEND_TEXT_REQUEST: 'completions',
|
|
9
|
-
SEND_IMAGE_REQUEST: 'image/generation',
|
|
10
|
-
FILE_UPLOAD: 'file/upload',
|
|
11
|
-
BALANCE_TOP_UP: 'balance/top-up',
|
|
12
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetApiKeyCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
var GetApiKeyCommand;
|
|
6
|
-
(function (GetApiKeyCommand) {
|
|
7
|
-
GetApiKeyCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
-
data: zod_1.z.object({
|
|
9
|
-
apiKey: zod_1.z.string(),
|
|
10
|
-
}),
|
|
11
|
-
});
|
|
12
|
-
})(GetApiKeyCommand || (exports.GetApiKeyCommand = GetApiKeyCommand = {}));
|
|
@@ -1,21 +0,0 @@
|
|
|
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("./get-api-key.command"), exports);
|
|
18
|
-
__exportStar(require("./refresh-api-key.command"), exports);
|
|
19
|
-
__exportStar(require("./send-text-request.command"), exports);
|
|
20
|
-
__exportStar(require("./send-image-request.command"), exports);
|
|
21
|
-
__exportStar(require("./submit-balance-top-up-form.command"), exports);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RefreshApiKeyCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
var RefreshApiKeyCommand;
|
|
6
|
-
(function (RefreshApiKeyCommand) {
|
|
7
|
-
RefreshApiKeyCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
-
data: zod_1.z.object({
|
|
9
|
-
apiKey: zod_1.z.string(),
|
|
10
|
-
}),
|
|
11
|
-
});
|
|
12
|
-
})(RefreshApiKeyCommand || (exports.RefreshApiKeyCommand = RefreshApiKeyCommand = {}));
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SendTextRequestCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const constants_1 = require("../../constants");
|
|
6
|
-
var SendTextRequestCommand;
|
|
7
|
-
(function (SendTextRequestCommand) {
|
|
8
|
-
SendTextRequestCommand.BodySchema = zod_1.z.object({
|
|
9
|
-
model: zod_1.z.string(),
|
|
10
|
-
prompt: zod_1.z.string(),
|
|
11
|
-
files: zod_1.z.array(zod_1.z.string().uuid()),
|
|
12
|
-
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)),
|
|
13
|
-
});
|
|
14
|
-
SendTextRequestCommand.HeadersSchema = zod_1.z.object({
|
|
15
|
-
'x-rugpt-key': zod_1.z.string(),
|
|
16
|
-
});
|
|
17
|
-
SendTextRequestCommand.ResponseSchema = zod_1.z.object({
|
|
18
|
-
data: zod_1.z.object({
|
|
19
|
-
text: zod_1.z.string(),
|
|
20
|
-
}),
|
|
21
|
-
});
|
|
22
|
-
})(SendTextRequestCommand || (exports.SendTextRequestCommand = SendTextRequestCommand = {}));
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubmitBalanceTopUpFormCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const constants_1 = require("../../constants");
|
|
6
|
-
var SubmitBalanceTopUpFormCommand;
|
|
7
|
-
(function (SubmitBalanceTopUpFormCommand) {
|
|
8
|
-
SubmitBalanceTopUpFormCommand.BodySchema = zod_1.z.object({
|
|
9
|
-
organizationType: zod_1.z.nativeEnum(constants_1.ORGANIZATION_TYPE),
|
|
10
|
-
tin: zod_1.z.string().regex(/^\d{10}$|^\d{12}$/, 'ИНН должен быть длинной в 10 или 12 цифр'),
|
|
11
|
-
telegram: zod_1.z.string(),
|
|
12
|
-
amount: zod_1.z.number().int().min(10000, {
|
|
13
|
-
message: 'Minimum top-up amount is 10000',
|
|
14
|
-
}),
|
|
15
|
-
});
|
|
16
|
-
SubmitBalanceTopUpFormCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
-
data: zod_1.z.object({
|
|
18
|
-
isSuccess: zod_1.z.boolean(),
|
|
19
|
-
}),
|
|
20
|
-
});
|
|
21
|
-
})(SubmitBalanceTopUpFormCommand || (exports.SubmitBalanceTopUpFormCommand = SubmitBalanceTopUpFormCommand = {}));
|
|
@@ -1,15 +0,0 @@
|
|
|
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.ApiKeySchema = void 0;
|
|
7
|
-
const zod_1 = __importDefault(require("zod"));
|
|
8
|
-
exports.ApiKeySchema = zod_1.default.object({
|
|
9
|
-
uuid: zod_1.default.string().uuid(),
|
|
10
|
-
userId: zod_1.default.string().uuid(),
|
|
11
|
-
key: zod_1.default.string(),
|
|
12
|
-
isActive: zod_1.default.boolean(),
|
|
13
|
-
createdAt: zod_1.default.date(),
|
|
14
|
-
updatedAt: zod_1.default.date(),
|
|
15
|
-
});
|
package/commands/b2b/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { AI_MODEL_FEATURE } from '../../constants';
|
|
3
|
-
|
|
4
|
-
export namespace SendTextRequestCommand {
|
|
5
|
-
export const BodySchema = z.object({
|
|
6
|
-
model: z.string(),
|
|
7
|
-
prompt: z.string(),
|
|
8
|
-
files: z.array(z.string().uuid()),
|
|
9
|
-
features: z.array(z.nativeEnum(AI_MODEL_FEATURE)),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const HeadersSchema = z.object({
|
|
13
|
-
'x-rugpt-key': z.string(),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export const ResponseSchema = z.object({
|
|
17
|
-
data: z.object({
|
|
18
|
-
text: z.string(),
|
|
19
|
-
}),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// ✅ Types
|
|
23
|
-
export type Body = z.infer<typeof BodySchema>;
|
|
24
|
-
export type Headers = z.infer<typeof HeadersSchema>;
|
|
25
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { ORGANIZATION_TYPE } from '../../constants';
|
|
3
|
-
|
|
4
|
-
export namespace SubmitBalanceTopUpFormCommand {
|
|
5
|
-
export const BodySchema = z.object({
|
|
6
|
-
organizationType: z.nativeEnum(ORGANIZATION_TYPE),
|
|
7
|
-
tin: z.string().regex(/^\d{10}$|^\d{12}$/, 'ИНН должен быть длинной в 10 или 12 цифр'),
|
|
8
|
-
telegram: z.string(),
|
|
9
|
-
amount: z.number().int().min(10000, {
|
|
10
|
-
message: 'Minimum top-up amount is 10000',
|
|
11
|
-
}),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const ResponseSchema = z.object({
|
|
15
|
-
data: z.object({
|
|
16
|
-
isSuccess: z.boolean(),
|
|
17
|
-
}),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export type Body = z.infer<typeof BodySchema>;
|
|
21
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
-
}
|