MCPcopy Create free account
hub / github.com/async-labs/async / IChatModel

Interface IChatModel

api/server/models/Chat.ts:33–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33interface IChatModel extends mongoose.Model<IChatDocument> {
34 getChatList({ userId, teamId }: { userId: string; teamId: string }): Promise<IChatDocument[]>;
35
36 createOrUpdate({
37 chatParticipantIds,
38 userId,
39 teamId,
40 id,
41 content,
42 }: {
43 chatParticipantIds: string[];
44 userId: string;
45 teamId: string;
46 id: string;
47 content: string;
48 }): Promise<{ newOrUpdatedChat: IChatDocument; initialMessages: IMessageDocument[] }>;
49
50 delete({ userId, chatId }: { userId: string; chatId: string }): Promise<{ teamId: string }>;
51
52 clearHistory({ userId, chatId }: { userId: string; chatId: string }): Promise<{ teamId: string }>;
53
54 searchWithinChat({
55 userId,
56 teamId,
57 chatId,
58 query,
59 }: {
60 userId: string;
61 teamId: string;
62 chatId: string;
63 query: string;
64 }): Promise<{ foundMessages: IMessageDocument[]; contextMessages: IMessageDocument[] }>;
65
66 checkPermission({
67 userId,
68 teamId,
69 chat,
70 }: {
71 userId: string;
72 teamId: string;
73 chat?: IChatDocument;
74 }): Promise<any>;
75}
76
77class ChatClass extends mongoose.Model {
78 public static async getChatList(params) {

Callers 10

loadChatsDataFunction · 0.65
team-member.tsFile · 0.65
team-member.tsFile · 0.65
team-member.tsFile · 0.65
deleteTeamMethod · 0.65
deleteMethod · 0.65
team-member.tsFile · 0.65
team-member.tsFile · 0.65

Implementers 1

ChatClassapi/server/models/Chat.ts

Calls

no outgoing calls

Tested by

no test coverage detected