@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.
Files changed (61) hide show
  1. package/api/controllers/http/community.ts +22 -0
  2. package/api/controllers/http/index.ts +1 -0
  3. package/api/routes.ts +26 -0
  4. package/build/api/controllers/http/community.js +23 -0
  5. package/build/api/controllers/http/index.js +1 -0
  6. package/build/api/routes.js +18 -0
  7. package/build/commands/community/archive-community-post.command.js +13 -0
  8. package/build/commands/community/create-community-post.command.js +35 -0
  9. package/build/commands/community/delete-community-post.command.js +13 -0
  10. package/build/commands/community/get-all-community-posts-by-criteria.command.js +25 -0
  11. package/build/commands/community/get-community-post-by-uuid.command.js +14 -0
  12. package/build/commands/community/get-my-community-posts-by-criteria.command.js +32 -0
  13. package/build/commands/community/get-my-favorite-community-posts.command.js +19 -0
  14. package/build/commands/community/get-my-likes-community-posts.command.js +19 -0
  15. package/build/commands/community/index.js +27 -0
  16. package/build/commands/community/set-favorite-community-post.command.js +13 -0
  17. package/build/commands/community/set-like-community-post.command.js +14 -0
  18. package/build/commands/community/share-my-community-post.command.js +13 -0
  19. package/build/commands/index.js +1 -0
  20. package/build/constants/community/default-pagination.constant.js +6 -0
  21. package/build/constants/community/enums/community-aspect-ratio.enum.js +11 -0
  22. package/build/constants/community/enums/community-post-visibility.enum.js +8 -0
  23. package/build/constants/community/enums/community-status.enum.js +9 -0
  24. package/build/constants/community/enums/community-tool-type.enum.js +10 -0
  25. package/build/constants/community/enums/community-type.enum.js +11 -0
  26. package/build/constants/community/enums/index.js +21 -0
  27. package/build/constants/community/index.js +18 -0
  28. package/build/constants/errors/errors.js +95 -0
  29. package/build/constants/index.js +1 -0
  30. package/build/models/community/community-post-media-data.schema.js +53 -0
  31. package/build/models/community/community-post.schema.js +43 -0
  32. package/build/models/community/index.js +18 -0
  33. package/build/models/index.js +1 -0
  34. package/commands/community/archive-community-post.command.ts +13 -0
  35. package/commands/community/create-community-post.command.ts +45 -0
  36. package/commands/community/delete-community-post.command.ts +13 -0
  37. package/commands/community/get-all-community-posts-by-criteria.command.ts +29 -0
  38. package/commands/community/get-community-post-by-uuid.command.ts +16 -0
  39. package/commands/community/get-my-community-posts-by-criteria.command.ts +40 -0
  40. package/commands/community/get-my-favorite-community-posts.command.ts +19 -0
  41. package/commands/community/get-my-likes-community-posts.command.ts +19 -0
  42. package/commands/community/index.ts +11 -0
  43. package/commands/community/set-favorite-community-post.command.ts +13 -0
  44. package/commands/community/set-like-community-post.command.ts +14 -0
  45. package/commands/community/share-my-community-post.command.ts +13 -0
  46. package/commands/index.ts +1 -0
  47. package/constants/community/default-pagination.constant.ts +4 -0
  48. package/constants/community/enums/community-aspect-ratio.enum.ts +7 -0
  49. package/constants/community/enums/community-post-visibility.enum.ts +4 -0
  50. package/constants/community/enums/community-status.enum.ts +5 -0
  51. package/constants/community/enums/community-tool-type.enum.ts +6 -0
  52. package/constants/community/enums/community-type.enum.ts +7 -0
  53. package/constants/community/enums/index.ts +5 -0
  54. package/constants/community/index.ts +2 -0
  55. package/constants/errors/errors.ts +95 -0
  56. package/constants/index.ts +1 -0
  57. package/models/community/community-post-media-data.schema.ts +65 -0
  58. package/models/community/community-post.schema.ts +47 -0
  59. package/models/community/index.ts +2 -0
  60. package/models/index.ts +1 -0
  61. 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
+ });
@@ -0,0 +1,2 @@
1
+ export * from './community-post.schema';
2
+ export * from './community-post-media-data.schema';
package/models/index.ts CHANGED
@@ -54,4 +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 './community';
57
58
  export * from './user-profile.schema';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.8.11",
3
+ "version": "0.8.12",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",