@purpleschool/gptbot 0.8.71 → 0.8.73
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/community/get-my-favorite-community-posts.command.js +12 -1
- package/build/commands/community/get-my-likes-community-posts.command.js +1 -1
- package/commands/community/get-my-favorite-community-posts.command.ts +14 -3
- package/commands/community/get-my-likes-community-posts.command.ts +2 -2
- package/package.json +1 -1
|
@@ -10,9 +10,20 @@ var GetMyFavoriteCommunityPostsCommand;
|
|
|
10
10
|
offset: zod_1.z.coerce.number().int().min(0).default(0).optional(),
|
|
11
11
|
limit: zod_1.z.coerce.number().int().min(1).max(100).default(constants_1.DEFAULT_PAGINATION_LIMIT).optional(),
|
|
12
12
|
sortOrder: zod_1.z.nativeEnum(constants_1.SORT_ORDER).optional(),
|
|
13
|
+
type: zod_1.z
|
|
14
|
+
.preprocess((val) => {
|
|
15
|
+
if (val == null)
|
|
16
|
+
return undefined;
|
|
17
|
+
if (Array.isArray(val))
|
|
18
|
+
return val.length > 0 ? val : undefined;
|
|
19
|
+
if (typeof val === 'string' && val.trim() === '')
|
|
20
|
+
return undefined;
|
|
21
|
+
return [val];
|
|
22
|
+
}, zod_1.z.array(zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_TYPE)))
|
|
23
|
+
.optional(),
|
|
13
24
|
});
|
|
14
25
|
GetMyFavoriteCommunityPostsCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
-
data: zod_1.z.array(models_1.
|
|
26
|
+
data: zod_1.z.array(models_1.ResponseCommunityPostWithRelationsSchema),
|
|
16
27
|
page: zod_1.z.number(),
|
|
17
28
|
totalPages: zod_1.z.number(),
|
|
18
29
|
});
|
|
@@ -12,7 +12,7 @@ var GetMyLikesCommunityPostsCommand;
|
|
|
12
12
|
sortOrder: zod_1.z.nativeEnum(constants_1.SORT_ORDER).optional(),
|
|
13
13
|
});
|
|
14
14
|
GetMyLikesCommunityPostsCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
-
data: zod_1.z.array(models_1.
|
|
15
|
+
data: zod_1.z.array(models_1.ResponseCommunityPostWithRelationsSchema),
|
|
16
16
|
page: zod_1.z.number(),
|
|
17
17
|
totalPages: zod_1.z.number(),
|
|
18
18
|
});
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DEFAULT_PAGINATION_LIMIT, SORT_ORDER } from '../../constants';
|
|
3
|
-
import {
|
|
2
|
+
import { COMMUNITY_POST_TYPE, DEFAULT_PAGINATION_LIMIT, SORT_ORDER } from '../../constants';
|
|
3
|
+
import { ResponseCommunityPostWithRelationsSchema } from '../../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetMyFavoriteCommunityPostsCommand {
|
|
6
6
|
export const RequestQuerySchema = z.object({
|
|
7
7
|
offset: z.coerce.number().int().min(0).default(0).optional(),
|
|
8
8
|
limit: z.coerce.number().int().min(1).max(100).default(DEFAULT_PAGINATION_LIMIT).optional(),
|
|
9
9
|
sortOrder: z.nativeEnum(SORT_ORDER).optional(),
|
|
10
|
+
type: z
|
|
11
|
+
.preprocess(
|
|
12
|
+
(val) => {
|
|
13
|
+
if (val == null) return undefined;
|
|
14
|
+
if (Array.isArray(val)) return val.length > 0 ? val : undefined;
|
|
15
|
+
if (typeof val === 'string' && val.trim() === '') return undefined;
|
|
16
|
+
return [val];
|
|
17
|
+
},
|
|
18
|
+
z.array(z.nativeEnum(COMMUNITY_POST_TYPE)),
|
|
19
|
+
)
|
|
20
|
+
.optional(),
|
|
10
21
|
});
|
|
11
22
|
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
12
23
|
|
|
13
24
|
export const ResponseSchema = z.object({
|
|
14
|
-
data: z.array(
|
|
25
|
+
data: z.array(ResponseCommunityPostWithRelationsSchema),
|
|
15
26
|
page: z.number(),
|
|
16
27
|
totalPages: z.number(),
|
|
17
28
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { DEFAULT_PAGINATION_LIMIT, SORT_ORDER } from '../../constants';
|
|
3
|
-
import {
|
|
3
|
+
import { ResponseCommunityPostWithRelationsSchema } from '../../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetMyLikesCommunityPostsCommand {
|
|
6
6
|
export const RequestQuerySchema = z.object({
|
|
@@ -11,7 +11,7 @@ export namespace GetMyLikesCommunityPostsCommand {
|
|
|
11
11
|
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
12
12
|
|
|
13
13
|
export const ResponseSchema = z.object({
|
|
14
|
-
data: z.array(
|
|
14
|
+
data: z.array(ResponseCommunityPostWithRelationsSchema),
|
|
15
15
|
page: z.number(),
|
|
16
16
|
totalPages: z.number(),
|
|
17
17
|
});
|