@purpleschool/gptbot 0.9.47 → 0.9.48

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.
@@ -13,6 +13,7 @@ export const COMMUNITY_ROUTES_PRIVATE = {
13
13
  DELETE: (uuid: string) => `${uuid}`,
14
14
  LIKE: (uuid: string) => `${uuid}/like`,
15
15
  FAVORITE: (uuid: string) => `${uuid}/favorite`,
16
+ SET_VISIBILITY: (uuid: string) => `${uuid}/visibility`,
16
17
  REJECT: (uuid: string) => `${uuid}/reject`,
17
18
  REPORT: (uuid: string) => `report/${uuid}`,
18
19
  LIKES_COUNT: (userId: string) => `${userId}/likes/count`,
package/api/routes.ts CHANGED
@@ -963,6 +963,8 @@ export const REST_API = {
963
963
  `${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.LIKE(uuid)}`,
964
964
  FAVORITE: (uuid: string) =>
965
965
  `${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.FAVORITE(uuid)}`,
966
+ SET_VISIBILITY: (uuid: string) =>
967
+ `${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.SET_VISIBILITY(uuid)}`,
966
968
  REPORT: (uuid: string) =>
967
969
  `${ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.REPORT(uuid)}`,
968
970
  LIKES_COUNT: (userId: string) =>
@@ -15,6 +15,7 @@ exports.COMMUNITY_ROUTES_PRIVATE = {
15
15
  DELETE: (uuid) => `${uuid}`,
16
16
  LIKE: (uuid) => `${uuid}/like`,
17
17
  FAVORITE: (uuid) => `${uuid}/favorite`,
18
+ SET_VISIBILITY: (uuid) => `${uuid}/visibility`,
18
19
  REJECT: (uuid) => `${uuid}/reject`,
19
20
  REPORT: (uuid) => `report/${uuid}`,
20
21
  LIKES_COUNT: (userId) => `${userId}/likes/count`,
@@ -735,6 +735,7 @@ exports.REST_API = {
735
735
  GET_MY_FAVORITE: `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.GET_MY_FAVORITE}`,
736
736
  LIKE: (uuid) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.LIKE(uuid)}`,
737
737
  FAVORITE: (uuid) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.FAVORITE(uuid)}`,
738
+ SET_VISIBILITY: (uuid) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.SET_VISIBILITY(uuid)}`,
738
739
  REPORT: (uuid) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.REPORT(uuid)}`,
739
740
  LIKES_COUNT: (userId) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.LIKES_COUNT(userId)}`,
740
741
  REJECT: (uuid) => `${exports.ROOT}/${CONTROLLERS.COMMUNITY_CONTROLLER_PRIVATE}/${CONTROLLERS.COMMUNITY_ROUTES_PRIVATE.REJECT(uuid)}`,
@@ -28,3 +28,4 @@ __exportStar(require("./get-my-favorite-community-posts.command"), exports);
28
28
  __exportStar(require("./send-report-to-community-post.command"), exports);
29
29
  __exportStar(require("./get-count-of-likes-on-user-posts.command"), exports);
30
30
  __exportStar(require("./set-reject-community-post.command"), exports);
31
+ __exportStar(require("./set-visibility-community-post.command"), exports);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetVisibilityCommunityPostCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ var SetVisibilityCommunityPostCommand;
7
+ (function (SetVisibilityCommunityPostCommand) {
8
+ SetVisibilityCommunityPostCommand.HTTP_METHOD = 'POST';
9
+ SetVisibilityCommunityPostCommand.RequestParamsSchema = zod_1.z.object({
10
+ uuid: zod_1.z.string().uuid(),
11
+ });
12
+ SetVisibilityCommunityPostCommand.RequestBodySchema = zod_1.z.object({
13
+ visibility: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_VISIBILITY),
14
+ });
15
+ SetVisibilityCommunityPostCommand.ResponseSchema = zod_1.z.object({
16
+ data: zod_1.z.object({
17
+ uuid: zod_1.z.string().uuid(),
18
+ visibility: zod_1.z.nativeEnum(constants_1.COMMUNITY_POST_VISIBILITY),
19
+ }),
20
+ });
21
+ })(SetVisibilityCommunityPostCommand || (exports.SetVisibilityCommunityPostCommand = SetVisibilityCommunityPostCommand = {}));
@@ -12,3 +12,4 @@ export * from './get-my-favorite-community-posts.command';
12
12
  export * from './send-report-to-community-post.command';
13
13
  export * from './get-count-of-likes-on-user-posts.command';
14
14
  export * from './set-reject-community-post.command';
15
+ export * from './set-visibility-community-post.command';
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import { COMMUNITY_POST_VISIBILITY } from '../../constants';
3
+
4
+ export namespace SetVisibilityCommunityPostCommand {
5
+ export const HTTP_METHOD = 'POST' as const;
6
+
7
+ export const RequestParamsSchema = z.object({
8
+ uuid: z.string().uuid(),
9
+ });
10
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
11
+
12
+ export const RequestBodySchema = z.object({
13
+ visibility: z.nativeEnum(COMMUNITY_POST_VISIBILITY),
14
+ });
15
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
16
+
17
+ export const ResponseSchema = z.object({
18
+ data: z.object({
19
+ uuid: z.string().uuid(),
20
+ visibility: z.nativeEnum(COMMUNITY_POST_VISIBILITY),
21
+ }),
22
+ });
23
+ export type Response = z.infer<typeof ResponseSchema>;
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.9.47",
3
+ "version": "0.9.48",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",