@purpleschool/gptbot 0.12.29 → 0.12.31

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.
@@ -3,4 +3,5 @@ export const TOOL_CONTROLLER = 'tools';
3
3
  export const TOOL_ROUTES = {
4
4
  FIND_ALL: 'all',
5
5
  GET_FORMATTED: 'formatted',
6
+ GROUP_ALL: 'group/all',
6
7
  };
package/api/routes.ts CHANGED
@@ -394,6 +394,7 @@ export const REST_API = {
394
394
  TOOL: {
395
395
  FIND_ALL: `${ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.FIND_ALL}`,
396
396
  GET_FORMATTED: `${ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.GET_FORMATTED}`,
397
+ GROUP_ALL: `${ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.GROUP_ALL}`,
397
398
  },
398
399
  TOOL_JOB_PRIVATE: {
399
400
  FIND_BY_UUID: (uuid: string) =>
@@ -5,4 +5,5 @@ exports.TOOL_CONTROLLER = 'tools';
5
5
  exports.TOOL_ROUTES = {
6
6
  FIND_ALL: 'all',
7
7
  GET_FORMATTED: 'formatted',
8
+ GROUP_ALL: 'group/all',
8
9
  };
@@ -349,6 +349,7 @@ exports.REST_API = {
349
349
  TOOL: {
350
350
  FIND_ALL: `${exports.ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.FIND_ALL}`,
351
351
  GET_FORMATTED: `${exports.ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.GET_FORMATTED}`,
352
+ GROUP_ALL: `${exports.ROOT}/${CONTROLLERS.TOOL_CONTROLLER}/${CONTROLLERS.TOOL_ROUTES.GROUP_ALL}`,
352
353
  },
353
354
  TOOL_JOB_PRIVATE: {
354
355
  FIND_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.TOOL_JOB_CONTROLLER_PRIVATE}/${CONTROLLERS.TOOL_JOB_ROUTES.FIND_BY_UUID(uuid)}`,
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindGroupedToolsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var FindGroupedToolsCommand;
7
+ (function (FindGroupedToolsCommand) {
8
+ FindGroupedToolsCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.array(models_1.ToolGroupSchema),
10
+ });
11
+ })(FindGroupedToolsCommand || (exports.FindGroupedToolsCommand = FindGroupedToolsCommand = {}));
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./find-all-tools.command"), exports);
18
+ __exportStar(require("./find-grouped-tools.command"), exports);
18
19
  __exportStar(require("./find-formatted-tools.command"), exports);
@@ -7,6 +7,7 @@ var UnregisteredUserCommand;
7
7
  UnregisteredUserCommand.ResponseSchema = zod_1.z.object({
8
8
  data: zod_1.z.object({
9
9
  accessToken: zod_1.z.string(),
10
+ uuid: zod_1.z.string(),
10
11
  }),
11
12
  });
12
13
  })(UnregisteredUserCommand || (exports.UnregisteredUserCommand = UnregisteredUserCommand = {}));
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./tool-content-type.enum"), exports);
18
+ __exportStar(require("./tool-group.enum"), exports);
18
19
  __exportStar(require("./tool-job-status.enum"), exports);
19
20
  __exportStar(require("./job-request-origin.enum"), exports);
20
21
  __exportStar(require("./tool-type.enum"), exports);
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOOL_GROUP = void 0;
4
+ var TOOL_GROUP;
5
+ (function (TOOL_GROUP) {
6
+ TOOL_GROUP["TEXT"] = "TEXT";
7
+ TOOL_GROUP["IMAGE"] = "IMAGE";
8
+ TOOL_GROUP["AUDIO"] = "AUDIO";
9
+ TOOL_GROUP["VIDEO"] = "VIDEO";
10
+ TOOL_GROUP["EDUCATION"] = "EDUCATION";
11
+ TOOL_GROUP["DESIGN"] = "DESIGN";
12
+ })(TOOL_GROUP || (exports.TOOL_GROUP = TOOL_GROUP = {}));
@@ -51,6 +51,7 @@ __exportStar(require("./subscription-upgrade-schema"), exports);
51
51
  __exportStar(require("./subscription.schema"), exports);
52
52
  __exportStar(require("./telegram-user-data.schema"), exports);
53
53
  __exportStar(require("./tool-job.schema"), exports);
54
+ __exportStar(require("./tool-group.schema"), exports);
54
55
  __exportStar(require("./tool.schema"), exports);
55
56
  __exportStar(require("./unlocked-by-subscription.schema"), exports);
56
57
  __exportStar(require("./unregistered-user.schema"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolGroupSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../constants");
6
+ const tool_schema_1 = require("./tool.schema");
7
+ exports.ToolGroupSchema = zod_1.z.object({
8
+ group: zod_1.z.nativeEnum(constants_1.TOOL_GROUP),
9
+ title: zod_1.z.string(),
10
+ tools: zod_1.z.array(tool_schema_1.ToolSchema),
11
+ });
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { ToolGroupSchema } from '../../../models';
3
+
4
+ export namespace FindGroupedToolsCommand {
5
+ export type Request = void;
6
+
7
+ export const ResponseSchema = z.object({
8
+ data: z.array(ToolGroupSchema),
9
+ });
10
+
11
+ export type Response = z.infer<typeof ResponseSchema>;
12
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './find-all-tools.command';
2
+ export * from './find-grouped-tools.command';
2
3
  export * from './find-formatted-tools.command';
@@ -4,6 +4,7 @@ export namespace UnregisteredUserCommand {
4
4
  export const ResponseSchema = z.object({
5
5
  data: z.object({
6
6
  accessToken: z.string(),
7
+ uuid: z.string(),
7
8
  }),
8
9
  });
9
10
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1,4 +1,5 @@
1
1
  export * from './tool-content-type.enum';
2
+ export * from './tool-group.enum';
2
3
  export * from './tool-job-status.enum';
3
4
  export * from './job-request-origin.enum';
4
5
  export * from './tool-type.enum';
@@ -0,0 +1,8 @@
1
+ export enum TOOL_GROUP {
2
+ TEXT = 'TEXT',
3
+ IMAGE = 'IMAGE',
4
+ AUDIO = 'AUDIO',
5
+ VIDEO = 'VIDEO',
6
+ EDUCATION = 'EDUCATION',
7
+ DESIGN = 'DESIGN',
8
+ }
package/models/index.ts CHANGED
@@ -35,6 +35,7 @@ export * from './subscription-upgrade-schema';
35
35
  export * from './subscription.schema';
36
36
  export * from './telegram-user-data.schema';
37
37
  export * from './tool-job.schema';
38
+ export * from './tool-group.schema';
38
39
  export * from './tool.schema';
39
40
  export * from './unlocked-by-subscription.schema';
40
41
  export * from './unregistered-user.schema';
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_GROUP } from '../constants';
3
+ import { ToolSchema } from './tool.schema';
4
+
5
+ export const ToolGroupSchema = z.object({
6
+ group: z.nativeEnum(TOOL_GROUP),
7
+ title: z.string(),
8
+ tools: z.array(ToolSchema),
9
+ });
10
+
11
+ export type ToolGroup = z.infer<typeof ToolGroupSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.12.29",
3
+ "version": "0.12.31",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",