@purpleschool/gptbot 0.8.11 → 0.8.12
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/community.ts +22 -0
- package/api/controllers/http/index.ts +1 -0
- package/api/routes.ts +26 -0
- package/build/api/controllers/http/community.js +23 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/routes.js +18 -0
- package/build/commands/community/archive-community-post.command.js +13 -0
- package/build/commands/community/create-community-post.command.js +35 -0
- package/build/commands/community/delete-community-post.command.js +13 -0
- package/build/commands/community/get-all-community-posts-by-criteria.command.js +25 -0
- package/build/commands/community/get-community-post-by-uuid.command.js +14 -0
- package/build/commands/community/get-my-community-posts-by-criteria.command.js +32 -0
- package/build/commands/community/get-my-favorite-community-posts.command.js +19 -0
- package/build/commands/community/get-my-likes-community-posts.command.js +19 -0
- package/build/commands/community/index.js +27 -0
- package/build/commands/community/set-favorite-community-post.command.js +13 -0
- package/build/commands/community/set-like-community-post.command.js +14 -0
- package/build/commands/community/share-my-community-post.command.js +13 -0
- package/build/commands/index.js +1 -0
- package/build/constants/community/default-pagination.constant.js +6 -0
- package/build/constants/community/enums/community-aspect-ratio.enum.js +11 -0
- package/build/constants/community/enums/community-post-visibility.enum.js +8 -0
- package/build/constants/community/enums/community-status.enum.js +9 -0
- package/build/constants/community/enums/community-tool-type.enum.js +10 -0
- package/build/constants/community/enums/community-type.enum.js +11 -0
- package/build/constants/community/enums/index.js +21 -0
- package/build/constants/community/index.js +18 -0
- package/build/constants/errors/errors.js +95 -0
- package/build/constants/index.js +1 -0
- package/build/models/community/community-post-media-data.schema.js +53 -0
- package/build/models/community/community-post.schema.js +43 -0
- package/build/models/community/index.js +18 -0
- package/build/models/index.js +1 -0
- package/commands/community/archive-community-post.command.ts +13 -0
- package/commands/community/create-community-post.command.ts +45 -0
- package/commands/community/delete-community-post.command.ts +13 -0
- package/commands/community/get-all-community-posts-by-criteria.command.ts +29 -0
- package/commands/community/get-community-post-by-uuid.command.ts +16 -0
- package/commands/community/get-my-community-posts-by-criteria.command.ts +40 -0
- package/commands/community/get-my-favorite-community-posts.command.ts +19 -0
- package/commands/community/get-my-likes-community-posts.command.ts +19 -0
- package/commands/community/index.ts +11 -0
- package/commands/community/set-favorite-community-post.command.ts +13 -0
- package/commands/community/set-like-community-post.command.ts +14 -0
- package/commands/community/share-my-community-post.command.ts +13 -0
- package/commands/index.ts +1 -0
- package/constants/community/default-pagination.constant.ts +4 -0
- package/constants/community/enums/community-aspect-ratio.enum.ts +7 -0
- package/constants/community/enums/community-post-visibility.enum.ts +4 -0
- package/constants/community/enums/community-status.enum.ts +5 -0
- package/constants/community/enums/community-tool-type.enum.ts +6 -0
- package/constants/community/enums/community-type.enum.ts +7 -0
- package/constants/community/enums/index.ts +5 -0
- package/constants/community/index.ts +2 -0
- package/constants/errors/errors.ts +95 -0
- package/constants/index.ts +1 -0
- package/models/community/community-post-media-data.schema.ts +65 -0
- package/models/community/community-post.schema.ts +47 -0
- package/models/community/index.ts +2 -0
- package/models/index.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
COMMUNITY_POST_STATUS,
|
|
4
|
+
COMMUNITY_POST_TYPE,
|
|
5
|
+
COMMUNITY_POST_VISIBILITY,
|
|
6
|
+
COMMUNITY_TOOL_TYPE,
|
|
7
|
+
} from '../../constants';
|
|
8
|
+
import { CommunityPostMediaDataSchema } from './community-post-media-data.schema';
|
|
9
|
+
import { IconVariantsSchema } from '../icon-variants.schema';
|
|
10
|
+
|
|
11
|
+
export const CommunityPostSchema = z.object({
|
|
12
|
+
uuid: z.string().uuid(),
|
|
13
|
+
userId: z.string().uuid(),
|
|
14
|
+
caption: z.string().nullable(),
|
|
15
|
+
status: z.nativeEnum(COMMUNITY_POST_STATUS),
|
|
16
|
+
visibility: z.nativeEnum(COMMUNITY_POST_VISIBILITY),
|
|
17
|
+
type: z.nativeEnum(COMMUNITY_POST_TYPE),
|
|
18
|
+
mediaData: CommunityPostMediaDataSchema,
|
|
19
|
+
aiModelId: z.string().uuid(),
|
|
20
|
+
aiModelTitle: z.string(),
|
|
21
|
+
aiModelIcons: IconVariantsSchema,
|
|
22
|
+
messageId: z.string().nullable(),
|
|
23
|
+
toolJobId: z.string().nullable(),
|
|
24
|
+
toolType: z.nativeEnum(COMMUNITY_TOOL_TYPE).nullable(),
|
|
25
|
+
views: z.number(),
|
|
26
|
+
likesCount: z.number(),
|
|
27
|
+
publishedAt: z.date().nullable(),
|
|
28
|
+
archivedAt: z.date().nullable(),
|
|
29
|
+
createdAt: z.date(),
|
|
30
|
+
updatedAt: z.date(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const ResponseCommunityPostSchema = z.object({
|
|
34
|
+
uuid: z.string().uuid(),
|
|
35
|
+
userId: z.string().uuid(),
|
|
36
|
+
caption: z.string().nullable(),
|
|
37
|
+
status: z.nativeEnum(COMMUNITY_POST_STATUS),
|
|
38
|
+
visibility: z.nativeEnum(COMMUNITY_POST_VISIBILITY),
|
|
39
|
+
type: z.nativeEnum(COMMUNITY_POST_TYPE),
|
|
40
|
+
mediaData: CommunityPostMediaDataSchema,
|
|
41
|
+
aiModelId: z.string().uuid(),
|
|
42
|
+
aiModelTitle: z.string(),
|
|
43
|
+
aiModelIcons: IconVariantsSchema,
|
|
44
|
+
views: z.number(),
|
|
45
|
+
likesCount: z.number(),
|
|
46
|
+
publishedAt: z.date().nullable(),
|
|
47
|
+
});
|
package/models/index.ts
CHANGED