@purpleschool/gptbot 0.8.72 → 0.8.74

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.
@@ -10,6 +10,17 @@ 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
26
  data: zod_1.z.array(models_1.ResponseCommunityPostWithRelationsSchema),
@@ -2667,4 +2667,9 @@ exports.ERRORS = {
2667
2667
  message: 'Произошла ошибка при отметке работы как опубликованной.',
2668
2668
  httpCode: 500,
2669
2669
  },
2670
+ TASK_COMMUNITY_POST_NOT_PUBLISHED: {
2671
+ code: 'A564',
2672
+ message: 'Для получения награды опубликуйте работу в сообществе',
2673
+ httpCode: 400,
2674
+ },
2670
2675
  };
@@ -7,4 +7,5 @@ var TASK_TYPE;
7
7
  TASK_TYPE["TELEGRAM_CHANNEL_INVITE"] = "telegram_channel_invite";
8
8
  TASK_TYPE["REVIEW"] = "review";
9
9
  TASK_TYPE["NEW_YEAR_SUBSCRIBER_GIFT"] = "new_year_subscriber_gift";
10
+ TASK_TYPE["COMMUNITY_POST"] = "community_post";
10
11
  })(TASK_TYPE || (exports.TASK_TYPE = TASK_TYPE = {}));
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { DEFAULT_PAGINATION_LIMIT, SORT_ORDER } from '../../constants';
2
+ import { COMMUNITY_POST_TYPE, DEFAULT_PAGINATION_LIMIT, SORT_ORDER } from '../../constants';
3
3
  import { ResponseCommunityPostWithRelationsSchema } from '../../models';
4
4
 
5
5
  export namespace GetMyFavoriteCommunityPostsCommand {
@@ -7,6 +7,17 @@ export namespace GetMyFavoriteCommunityPostsCommand {
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
 
@@ -2675,4 +2675,9 @@ export const ERRORS = {
2675
2675
  message: 'Произошла ошибка при отметке работы как опубликованной.',
2676
2676
  httpCode: 500,
2677
2677
  },
2678
+ TASK_COMMUNITY_POST_NOT_PUBLISHED: {
2679
+ code: 'A564',
2680
+ message: 'Для получения награды опубликуйте работу в сообществе',
2681
+ httpCode: 400,
2682
+ },
2678
2683
  };
@@ -3,4 +3,5 @@ export enum TASK_TYPE {
3
3
  TELEGRAM_CHANNEL_INVITE = 'telegram_channel_invite',
4
4
  REVIEW = 'review',
5
5
  NEW_YEAR_SUBSCRIBER_GIFT = 'new_year_subscriber_gift',
6
+ COMMUNITY_POST = 'community_post',
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.8.72",
3
+ "version": "0.8.74",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",