@purpleschool/gptbot 0.7.53 → 0.7.54

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.
@@ -2,4 +2,5 @@ export const TOOL_CONTROLLER = 'tools';
2
2
 
3
3
  export const TOOL_ROUTES = {
4
4
  FIND_ALL: 'all',
5
+ GET_FORMATTED: 'formatted',
5
6
  };
@@ -4,4 +4,5 @@ exports.TOOL_ROUTES = exports.TOOL_CONTROLLER = void 0;
4
4
  exports.TOOL_CONTROLLER = 'tools';
5
5
  exports.TOOL_ROUTES = {
6
6
  FIND_ALL: 'all',
7
+ GET_FORMATTED: 'formatted',
7
8
  };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindFormattedToolsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var FindFormattedToolsCommand;
7
+ (function (FindFormattedToolsCommand) {
8
+ FindFormattedToolsCommand.ResponseSchema = zod_1.z.object({
9
+ data: zod_1.z.array(models_1.ToolFormattedSchema),
10
+ });
11
+ })(FindFormattedToolsCommand || (exports.FindFormattedToolsCommand = FindFormattedToolsCommand = {}));
@@ -15,3 +15,4 @@ 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-formatted-tools.command"), exports);
@@ -2006,4 +2006,14 @@ exports.ERRORS = {
2006
2006
  message: 'не удалось получить статистику пользователя',
2007
2007
  httpCode: 500,
2008
2008
  },
2009
+ TOOL_GET_FORMATTED_ERROR: {
2010
+ code: 'A412',
2011
+ message: 'Ошибка при получении отформатированных тулов',
2012
+ httpCode: 500,
2013
+ },
2014
+ TOOL_FIND_ALL_ERROR: {
2015
+ code: 'A413',
2016
+ message: 'Ошибка при получении всех тулов',
2017
+ httpCode: 500,
2018
+ },
2009
2019
  };
@@ -14,6 +14,8 @@ exports.PageSchema = zod_1.z.object({
14
14
  categoryId: zod_1.z.string().uuid().nullable().optional(),
15
15
  aIModelId: zod_1.z.string().uuid().nullable().optional(),
16
16
  toolId: zod_1.z.string().uuid().nullable().optional(),
17
+ toolOptionId: zod_1.z.string().uuid().nullable().optional(),
18
+ toolTitle: zod_1.z.string().nullable(),
17
19
  type: zod_1.z.nativeEnum(constants_1.PageType),
18
20
  createdAt: zod_1.z.date(),
19
21
  updatedAt: zod_1.z.date(),
@@ -1,11 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToolSchema = void 0;
3
+ exports.ToolFormattedSchema = exports.ToolSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const page_schema_1 = require("./page.schema");
5
6
  exports.ToolSchema = zod_1.z.object({
6
7
  uuid: zod_1.z.string().uuid(),
7
8
  title: zod_1.z.string(),
8
9
  description: zod_1.z.string(),
9
10
  icon: zod_1.z.string(),
10
11
  order: zod_1.z.number(),
12
+ contentType: zod_1.z.string(),
11
13
  });
14
+ exports.ToolFormattedSchema = zod_1.z.intersection(exports.ToolSchema, zod_1.z.object({
15
+ pages: zod_1.z.array(page_schema_1.PageSchema.pick({ alias: true, toolTitle: true, toolOptionId: true })
16
+ .optional()
17
+ .nullable()),
18
+ }));
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { ToolFormattedSchema } from '../../../models';
3
+
4
+ export namespace FindFormattedToolsCommand {
5
+ export type Request = void;
6
+
7
+ export const ResponseSchema = z.object({
8
+ data: z.array(ToolFormattedSchema),
9
+ });
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -1 +1,2 @@
1
1
  export * from './find-all-tools.command';
2
+ export * from './find-formatted-tools.command';
@@ -2014,4 +2014,14 @@ export const ERRORS = {
2014
2014
  message: 'не удалось получить статистику пользователя',
2015
2015
  httpCode: 500,
2016
2016
  },
2017
+ TOOL_GET_FORMATTED_ERROR: {
2018
+ code: 'A412',
2019
+ message: 'Ошибка при получении отформатированных тулов',
2020
+ httpCode: 500,
2021
+ },
2022
+ TOOL_FIND_ALL_ERROR: {
2023
+ code: 'A413',
2024
+ message: 'Ошибка при получении всех тулов',
2025
+ httpCode: 500,
2026
+ },
2017
2027
  };
@@ -12,6 +12,8 @@ export const PageSchema = z.object({
12
12
  categoryId: z.string().uuid().nullable().optional(),
13
13
  aIModelId: z.string().uuid().nullable().optional(),
14
14
  toolId: z.string().uuid().nullable().optional(),
15
+ toolOptionId: z.string().uuid().nullable().optional(),
16
+ toolTitle: z.string().nullable(),
15
17
  type: z.nativeEnum(PageType),
16
18
 
17
19
  createdAt: z.date(),
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { PageSchema } from './page.schema';
2
3
 
3
4
  export const ToolSchema = z.object({
4
5
  uuid: z.string().uuid(),
@@ -6,4 +7,16 @@ export const ToolSchema = z.object({
6
7
  description: z.string(),
7
8
  icon: z.string(),
8
9
  order: z.number(),
10
+ contentType: z.string(),
9
11
  });
12
+
13
+ export const ToolFormattedSchema = z.intersection(
14
+ ToolSchema,
15
+ z.object({
16
+ pages: z.array(
17
+ PageSchema.pick({ alias: true, toolTitle: true, toolOptionId: true })
18
+ .optional()
19
+ .nullable(),
20
+ ),
21
+ }),
22
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.7.53",
3
+ "version": "0.7.54",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",