@purpleschool/gptbot 0.7.60 → 0.7.61

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.
@@ -12,8 +12,6 @@ var CreateChatCommand;
12
12
  folderId: zod_1.z.string().uuid().optional(),
13
13
  });
14
14
  CreateChatCommand.ResponseSchema = zod_1.z.object({
15
- data: models_1.ChatSchema.extend({
16
- messages: zod_1.z.array(models_1.MessageSchema),
17
- }),
15
+ data: models_1.ChatWithMessagesSchema,
18
16
  });
19
17
  })(CreateChatCommand || (exports.CreateChatCommand = CreateChatCommand = {}));
@@ -9,6 +9,6 @@ var FindChatByUUIDCommand;
9
9
  uuid: true,
10
10
  });
11
11
  FindChatByUUIDCommand.ResponseSchema = zod_1.z.object({
12
- data: models_1.ChatSchema,
12
+ data: models_1.ChatWithMessagesSchema,
13
13
  });
14
14
  })(FindChatByUUIDCommand || (exports.FindChatByUUIDCommand = FindChatByUUIDCommand = {}));
@@ -13,9 +13,7 @@ var FindChatsCommand;
13
13
  const QuerySchema = zod_1.z.intersection(models_1.ChatSchema.pick({ categoryId: true, aIModelId: true }).partial(), models_1.AiModelSchema.pick({ contentType: true }).partial());
14
14
  FindChatsCommand.RequestQuerySchema = zod_1.z.intersection(QuerySchema, PaginationQuerySchema);
15
15
  FindChatsCommand.ResponseSchema = zod_1.z.object({
16
- data: zod_1.z.array(models_1.ChatSchema.extend({
17
- messages: zod_1.z.array(models_1.MessageSchema),
18
- })),
16
+ data: zod_1.z.array(models_1.ChatSchema),
19
17
  page: zod_1.z.number(),
20
18
  totalPages: zod_1.z.number(),
21
19
  });
@@ -10,6 +10,6 @@ var GetLastActiveChatCommand;
10
10
  aIModelId: true,
11
11
  });
12
12
  GetLastActiveChatCommand.Response = zod_1.z.object({
13
- data: models_1.ChatSchema,
13
+ data: models_1.ChatWithMessagesSchema,
14
14
  });
15
15
  })(GetLastActiveChatCommand || (exports.GetLastActiveChatCommand = GetLastActiveChatCommand = {}));
@@ -17,9 +17,7 @@ var FindFolderByUuidWithChatsCommand;
17
17
  });
18
18
  FindFolderByUuidWithChatsCommand.ResponseSchema = zod_1.default.object({
19
19
  data: models_1.FolderSchema.extend({
20
- chats: zod_1.default.array(models_1.ChatSchema.extend({
21
- messages: zod_1.default.array(models_1.MessageSchema),
22
- })),
20
+ chats: zod_1.default.array(models_1.ChatSchema),
23
21
  }),
24
22
  page: zod_1.default.number(),
25
23
  totalPages: zod_1.default.number(),
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatWithMessagesSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const chat_schema_1 = require("./chat.schema");
6
+ const message_schema_1 = require("./message.schema");
7
+ exports.ChatWithMessagesSchema = chat_schema_1.ChatSchema.extend({
8
+ messages: zod_1.z.array(message_schema_1.MessageSchema),
9
+ });
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChatSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
- const message_schema_1 = require("./message.schema");
7
6
  exports.ChatSchema = zod_1.z.object({
8
7
  uuid: zod_1.z.string().uuid(),
9
8
  userId: zod_1.z.nullable(zod_1.z.string().uuid()),
@@ -12,7 +11,6 @@ exports.ChatSchema = zod_1.z.object({
12
11
  aIModelId: zod_1.z.string().uuid(),
13
12
  title: zod_1.z.string(),
14
13
  chatStatus: zod_1.z.enum(Object.values(constants_1.CHAT_STATUS_ENUM)),
15
- messages: zod_1.z.array(message_schema_1.MessageSchema),
16
14
  folderId: zod_1.z.string().nullable(),
17
15
  createdAt: zod_1.z.date(),
18
16
  updatedAt: zod_1.z.date(),
@@ -20,6 +20,7 @@ __exportStar(require("./ai-model-formatted.schema"), exports);
20
20
  __exportStar(require("./ai-model.schema"), exports);
21
21
  __exportStar(require("./ai-vendor.schema"), exports);
22
22
  __exportStar(require("./category.schema"), exports);
23
+ __exportStar(require("./chat-with-messages.schema"), exports);
23
24
  __exportStar(require("./chat.schema"), exports);
24
25
  __exportStar(require("./cloud-payments-receipt.schema"), exports);
25
26
  __exportStar(require("./course-author.schema"), exports);
@@ -1,4 +1,4 @@
1
- import { ChatSchema, MessageSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace CreateChatCommand {
@@ -12,9 +12,7 @@ export namespace CreateChatCommand {
12
12
  export type RequestSchema = z.infer<typeof RequestSchema>;
13
13
 
14
14
  export const ResponseSchema = z.object({
15
- data: ChatSchema.extend({
16
- messages: z.array(MessageSchema),
17
- }),
15
+ data: ChatWithMessagesSchema,
18
16
  });
19
17
 
20
18
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1,4 +1,4 @@
1
- import { ChatSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace FindChatByUUIDCommand {
@@ -9,7 +9,7 @@ export namespace FindChatByUUIDCommand {
9
9
  export type Request = z.infer<typeof RequestParamsSchema>;
10
10
 
11
11
  export const ResponseSchema = z.object({
12
- data: ChatSchema,
12
+ data: ChatWithMessagesSchema,
13
13
  });
14
14
 
15
15
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1,4 +1,4 @@
1
- import { AiModelSchema, ChatSchema, MessageSchema } from '../../models';
1
+ import { AiModelSchema, ChatSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace FindChatsCommand {
@@ -18,11 +18,7 @@ export namespace FindChatsCommand {
18
18
  export type RequestQuery = z.infer<typeof RequestQuerySchema>;
19
19
 
20
20
  export const ResponseSchema = z.object({
21
- data: z.array(
22
- ChatSchema.extend({
23
- messages: z.array(MessageSchema),
24
- }),
25
- ),
21
+ data: z.array(ChatSchema),
26
22
  page: z.number(),
27
23
  totalPages: z.number(),
28
24
  });
@@ -1,4 +1,4 @@
1
- import { ChatSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace GetLastActiveChatCommand {
@@ -8,7 +8,7 @@ export namespace GetLastActiveChatCommand {
8
8
  });
9
9
 
10
10
  export const Response = z.object({
11
- data: ChatSchema,
11
+ data: ChatWithMessagesSchema,
12
12
  });
13
13
 
14
14
  export type Response = z.infer<typeof Response>;
@@ -1,5 +1,5 @@
1
1
  import z from 'zod';
2
- import { ChatSchema, FolderSchema, MessageSchema } from '../../models';
2
+ import { ChatSchema, FolderSchema } from '../../models';
3
3
 
4
4
  export namespace FindFolderByUuidWithChatsCommand {
5
5
  export const RequestParamSchema = FolderSchema.pick({
@@ -17,11 +17,7 @@ export namespace FindFolderByUuidWithChatsCommand {
17
17
 
18
18
  export const ResponseSchema = z.object({
19
19
  data: FolderSchema.extend({
20
- chats: z.array(
21
- ChatSchema.extend({
22
- messages: z.array(MessageSchema),
23
- }),
24
- ),
20
+ chats: z.array(ChatSchema),
25
21
  }),
26
22
  page: z.number(),
27
23
  totalPages: z.number(),
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { ChatSchema } from './chat.schema';
3
+ import { MessageSchema } from './message.schema';
4
+
5
+ export const ChatWithMessagesSchema = ChatSchema.extend({
6
+ messages: z.array(MessageSchema),
7
+ });
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { CHAT_STATUS_ENUM, TChatStatusEnum } from '../constants';
3
- import { MessageSchema } from './message.schema';
4
3
 
5
4
  export const ChatSchema = z.object({
6
5
  uuid: z.string().uuid(),
@@ -10,7 +9,6 @@ export const ChatSchema = z.object({
10
9
  aIModelId: z.string().uuid(),
11
10
  title: z.string(),
12
11
  chatStatus: z.enum(Object.values(CHAT_STATUS_ENUM) as [TChatStatusEnum]),
13
- messages: z.array(MessageSchema),
14
12
  folderId: z.string().nullable(),
15
13
 
16
14
  createdAt: z.date(),
package/models/index.ts CHANGED
@@ -4,6 +4,7 @@ export * from './ai-model-formatted.schema';
4
4
  export * from './ai-model.schema';
5
5
  export * from './ai-vendor.schema';
6
6
  export * from './category.schema';
7
+ export * from './chat-with-messages.schema';
7
8
  export * from './chat.schema';
8
9
  export * from './cloud-payments-receipt.schema';
9
10
  export * from './course-author.schema';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.7.60",
3
+ "version": "0.7.61",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",