@purpleschool/gptbot 0.13.20 → 0.13.21

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.
@@ -6,6 +6,7 @@ export const AGENT_DIALOG_ROUTES = {
6
6
  UPDATE_STATUS: (id: string) => `${id}/status`,
7
7
  CLEAR_HISTORY: (id: string) => `${id}/history`,
8
8
  ADMIN_REPLY: (id: string) => `${id}/admin-reply`,
9
+ RENAME: (id: string) => `${id}/title`,
9
10
  CABINET_CONFIG: 'cabinet/config',
10
11
  CABINET_START_DIALOG: (agentId: string) => `${agentId}/cabinet/start`,
11
12
  CABINET_SEND_MESSAGE: (agentId: string, dialogId: string) =>
package/api/routes.ts CHANGED
@@ -211,6 +211,8 @@ export const REST_API = {
211
211
  `${ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.CLEAR_HISTORY(id)}`,
212
212
  ADMIN_REPLY: (id: string): string =>
213
213
  `${ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.ADMIN_REPLY(id)}`,
214
+ RENAME: (id: string): string =>
215
+ `${ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.RENAME(id)}`,
214
216
  CABINET_CONFIG: `${ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.CABINET_CONFIG}`,
215
217
  CABINET_START_DIALOG: (agentId: string): string =>
216
218
  `${ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.CABINET_START_DIALOG(agentId)}`,
@@ -8,6 +8,7 @@ exports.AGENT_DIALOG_ROUTES = {
8
8
  UPDATE_STATUS: (id) => `${id}/status`,
9
9
  CLEAR_HISTORY: (id) => `${id}/history`,
10
10
  ADMIN_REPLY: (id) => `${id}/admin-reply`,
11
+ RENAME: (id) => `${id}/title`,
11
12
  CABINET_CONFIG: 'cabinet/config',
12
13
  CABINET_START_DIALOG: (agentId) => `${agentId}/cabinet/start`,
13
14
  CABINET_SEND_MESSAGE: (agentId, dialogId) => `${agentId}/${dialogId}/cabinet/messages`,
@@ -191,6 +191,7 @@ exports.REST_API = {
191
191
  UPDATE_STATUS: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.UPDATE_STATUS(id)}`,
192
192
  CLEAR_HISTORY: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.CLEAR_HISTORY(id)}`,
193
193
  ADMIN_REPLY: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.ADMIN_REPLY(id)}`,
194
+ RENAME: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.RENAME(id)}`,
194
195
  CABINET_CONFIG: `${exports.ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.CABINET_CONFIG}`,
195
196
  CABINET_START_DIALOG: (agentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.CABINET_START_DIALOG(agentId)}`,
196
197
  CABINET_SEND_MESSAGE: (agentId, dialogId) => `${exports.ROOT}/${CONTROLLERS.AGENT_DIALOG_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DIALOG_ROUTES.CABINET_SEND_MESSAGE(agentId, dialogId)}`,
@@ -10,6 +10,7 @@ var FindAgentDialogsCommand;
10
10
  agentId: zod_1.z.string().uuid().optional(),
11
11
  status: zod_1.z.nativeEnum(enums_1.DIALOG_STATUS).optional(),
12
12
  source: zod_1.z.string().optional(),
13
+ search: zod_1.z.string().optional(),
13
14
  dateFrom: zod_1.z.coerce.date().optional(),
14
15
  dateTo: zod_1.z.coerce.date().optional(),
15
16
  limit: zod_1.z.coerce.number().optional(),
@@ -25,3 +25,4 @@ __exportStar(require("./get-dialog-context-length.command"), exports);
25
25
  __exportStar(require("./get-cabinet-price-preview.command"), exports);
26
26
  __exportStar(require("./stop-cabinet-stream.command"), exports);
27
27
  __exportStar(require("./get-cabinet-config.command"), exports);
28
+ __exportStar(require("./rename-agent-dialog.command"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RenameAgentDialogCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const dialog_schema_1 = require("../../../models/agents/dialog.schema");
6
+ var RenameAgentDialogCommand;
7
+ (function (RenameAgentDialogCommand) {
8
+ RenameAgentDialogCommand.RequestParamsSchema = zod_1.z.object({
9
+ dialogId: zod_1.z.string().uuid(),
10
+ });
11
+ RenameAgentDialogCommand.RequestBodySchema = zod_1.z.object({
12
+ title: zod_1.z.string(),
13
+ });
14
+ RenameAgentDialogCommand.ResponseSchema = zod_1.z.object({
15
+ data: dialog_schema_1.DialogSchema,
16
+ });
17
+ })(RenameAgentDialogCommand || (exports.RenameAgentDialogCommand = RenameAgentDialogCommand = {}));
@@ -7,6 +7,7 @@ export namespace FindAgentDialogsCommand {
7
7
  agentId: z.string().uuid().optional(),
8
8
  status: z.nativeEnum(DIALOG_STATUS).optional(),
9
9
  source: z.string().optional(),
10
+ search: z.string().optional(),
10
11
  dateFrom: z.coerce.date().optional(),
11
12
  dateTo: z.coerce.date().optional(),
12
13
  limit: z.coerce.number().optional(),
@@ -9,3 +9,4 @@ export * from './get-dialog-context-length.command';
9
9
  export * from './get-cabinet-price-preview.command';
10
10
  export * from './stop-cabinet-stream.command';
11
11
  export * from './get-cabinet-config.command';
12
+ export * from './rename-agent-dialog.command';
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { DialogSchema } from '../../../models/agents/dialog.schema';
3
+
4
+ export namespace RenameAgentDialogCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ dialogId: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const RequestBodySchema = z.object({
11
+ title: z.string(),
12
+ });
13
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: DialogSchema,
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.13.20",
3
+ "version": "0.13.21",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",