@purpleschool/gptbot 0.8.63 → 0.8.65

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.
@@ -15,7 +15,17 @@ var GetAllCommunityPostsCommand;
15
15
  sortOrder: zod_1.z.nativeEnum(constants_1.SORT_ORDER).optional(),
16
16
  // Criteria
17
17
  userId: zod_1.z.string().uuid().optional(),
18
- type: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_TYPE).optional(),
18
+ type: zod_1.z
19
+ .preprocess((val) => {
20
+ if (val == null)
21
+ return undefined;
22
+ if (Array.isArray(val))
23
+ return val.length > 0 ? val : undefined;
24
+ if (typeof val === 'string' && val.trim() === '')
25
+ return undefined;
26
+ return [val];
27
+ }, zod_1.z.array(zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_TYPE)))
28
+ .optional(),
19
29
  });
20
30
  GetAllCommunityPostsCommand.ResponseSchema = zod_1.z.object({
21
31
  data: zod_1.z.array(models_1.ResponseCommunityPostWithRelationsSchema),
@@ -21,7 +21,17 @@ var GetMyCommunityPostsByCriteriaCommand;
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(),
24
- type: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_TYPE).optional(),
24
+ type: zod_1.z
25
+ .preprocess((val) => {
26
+ if (val == null)
27
+ return undefined;
28
+ if (Array.isArray(val))
29
+ return val.length > 0 ? val : undefined;
30
+ if (typeof val === 'string' && val.trim() === '')
31
+ return undefined;
32
+ return [val];
33
+ }, zod_1.z.array(zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_TYPE)))
34
+ .optional(),
25
35
  status: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_STATUS).optional(),
26
36
  });
27
37
  GetMyCommunityPostsByCriteriaCommand.ResponseSchema = zod_1.z.object({
@@ -16,6 +16,12 @@ exports.VideoJobSchema = tool_job_schema_1.ToolJobSchema.extend({
16
16
  prompt: zod_1.z.string(),
17
17
  reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
18
18
  videoUrl: zod_1.z.string().nullable(),
19
+ video: zod_1.z
20
+ .object({
21
+ uuid: zod_1.z.string(),
22
+ url: zod_1.z.string(),
23
+ })
24
+ .nullable(),
19
25
  params: exports.VideoJobParamsSchema,
20
26
  modelId: zod_1.z.string(),
21
27
  });
@@ -14,7 +14,17 @@ export namespace GetAllCommunityPostsCommand {
14
14
 
15
15
  // Criteria
16
16
  userId: z.string().uuid().optional(),
17
- type: z.nativeEnum(COMMUNITY_POST_TYPE).optional(),
17
+ type: z
18
+ .preprocess(
19
+ (val) => {
20
+ if (val == null) return undefined;
21
+ if (Array.isArray(val)) return val.length > 0 ? val : undefined;
22
+ if (typeof val === 'string' && val.trim() === '') return undefined;
23
+ return [val];
24
+ },
25
+ z.array(z.nativeEnum(COMMUNITY_POST_TYPE)),
26
+ )
27
+ .optional(),
18
28
  });
19
29
 
20
30
  export type RequestQuery = z.infer<typeof RequestQuerySchema>;
@@ -26,7 +26,17 @@ export namespace GetMyCommunityPostsByCriteriaCommand {
26
26
 
27
27
  // Criteria
28
28
  visibility: z.nativeEnum(COMMUNITY_POST_VISIBILITY).optional(),
29
- type: z.nativeEnum(COMMUNITY_POST_TYPE).optional(),
29
+ type: z
30
+ .preprocess(
31
+ (val) => {
32
+ if (val == null) return undefined;
33
+ if (Array.isArray(val)) return val.length > 0 ? val : undefined;
34
+ if (typeof val === 'string' && val.trim() === '') return undefined;
35
+ return [val];
36
+ },
37
+ z.array(z.nativeEnum(COMMUNITY_POST_TYPE)),
38
+ )
39
+ .optional(),
30
40
  status: z.nativeEnum(COMMUNITY_POST_STATUS).optional(),
31
41
  });
32
42
  export type RequestQuery = z.infer<typeof RequestQuerySchema>;
@@ -17,6 +17,12 @@ export const VideoJobSchema = ToolJobSchema.extend({
17
17
  prompt: z.string(),
18
18
  reaction: z.nativeEnum(USER_REACTION).nullable(),
19
19
  videoUrl: z.string().nullable(),
20
+ video: z
21
+ .object({
22
+ uuid: z.string(),
23
+ url: z.string(),
24
+ })
25
+ .nullable(),
20
26
  params: VideoJobParamsSchema,
21
27
  modelId: z.string(),
22
28
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.8.63",
3
+ "version": "0.8.65",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",