@purpleschool/gptbot 0.13.7 → 0.13.8

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.
@@ -5,6 +5,7 @@ export const AGENT_ROUTES = {
5
5
  LIST: '',
6
6
  CREATE: '',
7
7
  GET_BY_ID: (id: string) => `${id}`,
8
+ GET_AGGREGATE: (id: string) => `${id}/aggregate`,
8
9
  UPDATE: (id: string) => `${id}`,
9
10
  DELETE: (id: string) => `${id}`,
10
11
  CABINET_START_DIALOG: (agentId: string) => `${agentId}/dialogs/cabinet/start`,
@@ -7,6 +7,7 @@ exports.AGENT_ROUTES = {
7
7
  LIST: '',
8
8
  CREATE: '',
9
9
  GET_BY_ID: (id) => `${id}`,
10
+ GET_AGGREGATE: (id) => `${id}/aggregate`,
10
11
  UPDATE: (id) => `${id}`,
11
12
  DELETE: (id) => `${id}`,
12
13
  CABINET_START_DIALOG: (agentId) => `${agentId}/dialogs/cabinet/start`,
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetAgentAggregateCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const agent_aggregate_schema_1 = require("../../../models/agents/agent-aggregate.schema");
6
+ const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
7
+ var GetAgentAggregateCommand;
8
+ (function (GetAgentAggregateCommand) {
9
+ GetAgentAggregateCommand.RequestParamsSchema = zod_1.z.object({
10
+ id: zod_1.z.string().uuid(),
11
+ });
12
+ GetAgentAggregateCommand.RequestSchema = zod_1.z.object({
13
+ id: zod_1.z.string().uuid(),
14
+ userId: zod_1.z.string().uuid(),
15
+ teamAccountId: zod_1.z.string().uuid(),
16
+ teamMemberRole: zod_1.z.string(),
17
+ locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
18
+ });
19
+ GetAgentAggregateCommand.ResponseSchema = zod_1.z.object({
20
+ data: agent_aggregate_schema_1.AgentAggregateSchema,
21
+ });
22
+ })(GetAgentAggregateCommand || (exports.GetAgentAggregateCommand = GetAgentAggregateCommand = {}));
@@ -19,4 +19,5 @@ __exportStar(require("./delete-agent.command"), exports);
19
19
  __exportStar(require("./find-agents.command"), exports);
20
20
  __exportStar(require("./get-agent-by-id.command"), exports);
21
21
  __exportStar(require("./get-agent-public-info.command"), exports);
22
+ __exportStar(require("./get-agent-aggregate.command"), exports);
22
23
  __exportStar(require("./update-agent.command"), exports);
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentAggregateSchema = exports.AgentTemplateWithRelationsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const agent_schema_1 = require("./agent.schema");
6
+ const agent_template_schema_1 = require("./agent-template.schema");
7
+ const agent_template_category_schema_1 = require("./agent-template-category.schema");
8
+ const agent_template_instruction_schema_1 = require("./agent-template-instruction.schema");
9
+ const agent_lead_form_schema_1 = require("./agent-lead-form.schema");
10
+ const agent_document_schema_1 = require("./agent-document.schema");
11
+ const agent_channel_schema_1 = require("./agent-channel.schema");
12
+ const agent_tool_schema_1 = require("./agent-tool.schema");
13
+ const agent_ai_model_schema_1 = require("./agent-ai-model.schema");
14
+ exports.AgentTemplateWithRelationsSchema = agent_template_schema_1.AgentTemplateSchema.extend({
15
+ category: agent_template_category_schema_1.AgentTemplateCategorySchema,
16
+ instructions: zod_1.z.array(agent_template_instruction_schema_1.AgentTemplateInstructionSchema),
17
+ });
18
+ exports.AgentAggregateSchema = agent_schema_1.AgentSchema.extend({
19
+ aiModel: agent_ai_model_schema_1.AgentAiModelSchema.nullable(),
20
+ template: exports.AgentTemplateWithRelationsSchema.nullable(),
21
+ leadForm: agent_lead_form_schema_1.AgentLeadFormSchema.nullable(),
22
+ documents: zod_1.z.array(agent_document_schema_1.AgentDocumentSchema),
23
+ channels: zod_1.z.array(agent_channel_schema_1.AgentChannelSchema),
24
+ tools: zod_1.z.array(agent_tool_schema_1.AgentToolSchema),
25
+ });
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgentChannelSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const enums_1 = require("../../constants/agents/enums");
6
- const agent_channel_credentials_schema_1 = require("./agent-channel-credentials.schema");
7
6
  exports.AgentChannelSchema = zod_1.z.object({
8
7
  id: zod_1.z.string().uuid(),
9
8
  agentId: zod_1.z.string().uuid(),
10
9
  channelType: zod_1.z.nativeEnum(enums_1.AGENT_CHANNEL_TYPE),
11
10
  status: zod_1.z.nativeEnum(enums_1.AGENT_CHANNEL_STATUS),
12
- credentials: agent_channel_credentials_schema_1.AgentChannelCredentialsSchema,
13
11
  lastCheckedAt: zod_1.z.date().nullable(),
14
12
  lastError: zod_1.z.string().nullable(),
15
13
  createdAt: zod_1.z.date(),
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgentToolSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const enums_1 = require("../../constants/agents/enums");
6
- const agent_tool_credentials_schema_1 = require("./agent-tool-credentials.schema");
7
6
  exports.AgentToolSchema = zod_1.z.object({
8
7
  id: zod_1.z.string().uuid(),
9
8
  agentId: zod_1.z.string().uuid(),
10
9
  toolType: zod_1.z.nativeEnum(enums_1.AGENT_TOOL_TYPE),
11
10
  status: zod_1.z.nativeEnum(enums_1.AGENT_TOOL_STATUS),
12
- credentials: agent_tool_credentials_schema_1.AgentToolCredentialsSchema,
13
11
  createdAt: zod_1.z.date(),
14
12
  updatedAt: zod_1.z.date(),
15
13
  });
@@ -38,4 +38,5 @@ __exportStar(require("./agent-document-find-result.schema"), exports);
38
38
  __exportStar(require("./agent-document-chunk.schema"), exports);
39
39
  __exportStar(require("./agent-document-search-result.schema"), exports);
40
40
  __exportStar(require("./agent.schema"), exports);
41
+ __exportStar(require("./agent-aggregate.schema"), exports);
41
42
  __exportStar(require("./channel.schema"), exports);
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import { AgentAggregateSchema } from '../../../models/agents/agent-aggregate.schema';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace GetAgentAggregateCommand {
6
+ export const RequestParamsSchema = z.object({
7
+ id: z.string().uuid(),
8
+ });
9
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const RequestSchema = z.object({
12
+ id: z.string().uuid(),
13
+ userId: z.string().uuid(),
14
+ teamAccountId: z.string().uuid(),
15
+ teamMemberRole: z.string(),
16
+ locale: z.nativeEnum(LOCALE),
17
+ });
18
+ export type Request = z.infer<typeof RequestSchema>;
19
+
20
+ export const ResponseSchema = z.object({
21
+ data: AgentAggregateSchema,
22
+ });
23
+ export type Response = z.infer<typeof ResponseSchema>;
24
+ }
@@ -3,4 +3,5 @@ export * from './delete-agent.command';
3
3
  export * from './find-agents.command';
4
4
  export * from './get-agent-by-id.command';
5
5
  export * from './get-agent-public-info.command';
6
+ export * from './get-agent-aggregate.command';
6
7
  export * from './update-agent.command';
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { AgentSchema } from './agent.schema';
3
+ import { AgentTemplateSchema } from './agent-template.schema';
4
+ import { AgentTemplateCategorySchema } from './agent-template-category.schema';
5
+ import { AgentTemplateInstructionSchema } from './agent-template-instruction.schema';
6
+ import { AgentLeadFormSchema } from './agent-lead-form.schema';
7
+ import { AgentDocumentSchema } from './agent-document.schema';
8
+ import { AgentChannelSchema } from './agent-channel.schema';
9
+ import { AgentToolSchema } from './agent-tool.schema';
10
+ import { AgentAiModelSchema } from './agent-ai-model.schema';
11
+
12
+ export const AgentTemplateWithRelationsSchema = AgentTemplateSchema.extend({
13
+ category: AgentTemplateCategorySchema,
14
+ instructions: z.array(AgentTemplateInstructionSchema),
15
+ });
16
+
17
+ export type AgentTemplateWithRelations = z.infer<typeof AgentTemplateWithRelationsSchema>;
18
+
19
+ export const AgentAggregateSchema = AgentSchema.extend({
20
+ aiModel: AgentAiModelSchema.nullable(),
21
+ template: AgentTemplateWithRelationsSchema.nullable(),
22
+ leadForm: AgentLeadFormSchema.nullable(),
23
+ documents: z.array(AgentDocumentSchema),
24
+ channels: z.array(AgentChannelSchema),
25
+ tools: z.array(AgentToolSchema),
26
+ });
27
+
28
+ export type AgentAggregate = z.infer<typeof AgentAggregateSchema>;
@@ -1,13 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { AGENT_CHANNEL_STATUS, AGENT_CHANNEL_TYPE } from '../../constants/agents/enums';
3
- import { AgentChannelCredentialsSchema } from './agent-channel-credentials.schema';
4
3
 
5
4
  export const AgentChannelSchema = z.object({
6
5
  id: z.string().uuid(),
7
6
  agentId: z.string().uuid(),
8
7
  channelType: z.nativeEnum(AGENT_CHANNEL_TYPE),
9
8
  status: z.nativeEnum(AGENT_CHANNEL_STATUS),
10
- credentials: AgentChannelCredentialsSchema,
11
9
  lastCheckedAt: z.date().nullable(),
12
10
  lastError: z.string().nullable(),
13
11
  createdAt: z.date(),
@@ -1,13 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { AGENT_TOOL_STATUS, AGENT_TOOL_TYPE } from '../../constants/agents/enums';
3
- import { AgentToolCredentialsSchema } from './agent-tool-credentials.schema';
4
3
 
5
4
  export const AgentToolSchema = z.object({
6
5
  id: z.string().uuid(),
7
6
  agentId: z.string().uuid(),
8
7
  toolType: z.nativeEnum(AGENT_TOOL_TYPE),
9
8
  status: z.nativeEnum(AGENT_TOOL_STATUS),
10
- credentials: AgentToolCredentialsSchema,
11
9
  createdAt: z.date(),
12
10
  updatedAt: z.date(),
13
11
  });
@@ -22,4 +22,5 @@ export * from './agent-document-find-result.schema';
22
22
  export * from './agent-document-chunk.schema';
23
23
  export * from './agent-document-search-result.schema';
24
24
  export * from './agent.schema';
25
+ export * from './agent-aggregate.schema';
25
26
  export * from './channel.schema';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.13.7",
3
+ "version": "0.13.8",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",