@studious-lms/server 1.1.11 → 1.1.13
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.
- package/LAB_CHAT_API_SPEC.md +518 -0
- package/dist/routers/_app.d.ts +442 -0
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +2 -0
- package/dist/routers/conversation.d.ts +4 -0
- package/dist/routers/conversation.d.ts.map +1 -1
- package/dist/routers/conversation.js +7 -0
- package/dist/routers/folder.d.ts +13 -0
- package/dist/routers/folder.d.ts.map +1 -1
- package/dist/routers/folder.js +20 -1
- package/dist/routers/labChat.d.ts +206 -0
- package/dist/routers/labChat.d.ts.map +1 -0
- package/dist/routers/labChat.js +741 -0
- package/dist/utils/aiUser.d.ts +13 -0
- package/dist/utils/aiUser.d.ts.map +1 -0
- package/dist/utils/aiUser.js +57 -0
- package/dist/utils/inference.d.ts +56 -0
- package/dist/utils/inference.d.ts.map +1 -0
- package/dist/utils/inference.js +135 -0
- package/package.json +2 -1
- package/prisma/migrations/20250925072732_add_lab_chat_system/migration.sql +25 -0
- package/prisma/schema.prisma +18 -0
- package/src/routers/_app.ts +2 -0
- package/src/routers/conversation.ts +7 -0
- package/src/routers/folder.ts +23 -0
- package/src/routers/labChat.ts +824 -0
- package/src/utils/aiUser.ts +65 -0
- package/src/utils/inference.ts +193 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const labChatRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
|
+
ctx: import("../trpc.js").Context;
|
|
4
|
+
meta: object;
|
|
5
|
+
errorShape: {
|
|
6
|
+
data: {
|
|
7
|
+
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
+
prismaError: import("../utils/prismaErrorHandler.js").PrismaErrorInfo | null;
|
|
9
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
10
|
+
httpStatus: number;
|
|
11
|
+
path?: string;
|
|
12
|
+
stack?: string;
|
|
13
|
+
};
|
|
14
|
+
message: string;
|
|
15
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
16
|
+
};
|
|
17
|
+
transformer: false;
|
|
18
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
19
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
20
|
+
input: {
|
|
21
|
+
context: string;
|
|
22
|
+
title: string;
|
|
23
|
+
classId: string;
|
|
24
|
+
};
|
|
25
|
+
output: {
|
|
26
|
+
class: {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
subject: string;
|
|
30
|
+
section: string;
|
|
31
|
+
};
|
|
32
|
+
conversation: {
|
|
33
|
+
members: ({
|
|
34
|
+
user: {
|
|
35
|
+
id: string;
|
|
36
|
+
username: string;
|
|
37
|
+
profile: {
|
|
38
|
+
displayName: string | null;
|
|
39
|
+
profilePicture: string | null;
|
|
40
|
+
} | null;
|
|
41
|
+
};
|
|
42
|
+
} & {
|
|
43
|
+
id: string;
|
|
44
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
45
|
+
userId: string;
|
|
46
|
+
conversationId: string;
|
|
47
|
+
joinedAt: Date;
|
|
48
|
+
lastViewedAt: Date | null;
|
|
49
|
+
lastViewedMentionAt: Date | null;
|
|
50
|
+
})[];
|
|
51
|
+
} & {
|
|
52
|
+
type: import(".prisma/client").$Enums.ConversationType;
|
|
53
|
+
id: string;
|
|
54
|
+
name: string | null;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
updatedAt: Date;
|
|
57
|
+
displayInChat: boolean;
|
|
58
|
+
};
|
|
59
|
+
createdBy: {
|
|
60
|
+
id: string;
|
|
61
|
+
username: string;
|
|
62
|
+
profile: {
|
|
63
|
+
displayName: string | null;
|
|
64
|
+
} | null;
|
|
65
|
+
};
|
|
66
|
+
} & {
|
|
67
|
+
context: string;
|
|
68
|
+
id: string;
|
|
69
|
+
title: string;
|
|
70
|
+
classId: string;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
conversationId: string;
|
|
74
|
+
createdById: string;
|
|
75
|
+
};
|
|
76
|
+
meta: object;
|
|
77
|
+
}>;
|
|
78
|
+
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
79
|
+
input: {
|
|
80
|
+
labChatId: string;
|
|
81
|
+
};
|
|
82
|
+
output: {
|
|
83
|
+
class: {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
subject: string;
|
|
87
|
+
section: string;
|
|
88
|
+
};
|
|
89
|
+
conversation: {
|
|
90
|
+
members: ({
|
|
91
|
+
user: {
|
|
92
|
+
id: string;
|
|
93
|
+
username: string;
|
|
94
|
+
profile: {
|
|
95
|
+
displayName: string | null;
|
|
96
|
+
profilePicture: string | null;
|
|
97
|
+
} | null;
|
|
98
|
+
};
|
|
99
|
+
} & {
|
|
100
|
+
id: string;
|
|
101
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
102
|
+
userId: string;
|
|
103
|
+
conversationId: string;
|
|
104
|
+
joinedAt: Date;
|
|
105
|
+
lastViewedAt: Date | null;
|
|
106
|
+
lastViewedMentionAt: Date | null;
|
|
107
|
+
})[];
|
|
108
|
+
} & {
|
|
109
|
+
type: import(".prisma/client").$Enums.ConversationType;
|
|
110
|
+
id: string;
|
|
111
|
+
name: string | null;
|
|
112
|
+
createdAt: Date;
|
|
113
|
+
updatedAt: Date;
|
|
114
|
+
displayInChat: boolean;
|
|
115
|
+
};
|
|
116
|
+
createdBy: {
|
|
117
|
+
id: string;
|
|
118
|
+
username: string;
|
|
119
|
+
profile: {
|
|
120
|
+
displayName: string | null;
|
|
121
|
+
} | null;
|
|
122
|
+
};
|
|
123
|
+
} & {
|
|
124
|
+
context: string;
|
|
125
|
+
id: string;
|
|
126
|
+
title: string;
|
|
127
|
+
classId: string;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
updatedAt: Date;
|
|
130
|
+
conversationId: string;
|
|
131
|
+
createdById: string;
|
|
132
|
+
};
|
|
133
|
+
meta: object;
|
|
134
|
+
}>;
|
|
135
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
136
|
+
input: {
|
|
137
|
+
classId: string;
|
|
138
|
+
};
|
|
139
|
+
output: {
|
|
140
|
+
id: string;
|
|
141
|
+
title: string;
|
|
142
|
+
classId: string;
|
|
143
|
+
conversationId: string;
|
|
144
|
+
createdBy: {
|
|
145
|
+
id: string;
|
|
146
|
+
username: string;
|
|
147
|
+
profile: {
|
|
148
|
+
displayName: string | null;
|
|
149
|
+
} | null;
|
|
150
|
+
};
|
|
151
|
+
createdAt: Date;
|
|
152
|
+
updatedAt: Date;
|
|
153
|
+
lastMessage: {
|
|
154
|
+
sender: {
|
|
155
|
+
id: string;
|
|
156
|
+
username: string;
|
|
157
|
+
profile: {
|
|
158
|
+
displayName: string | null;
|
|
159
|
+
} | null;
|
|
160
|
+
};
|
|
161
|
+
} & {
|
|
162
|
+
id: string;
|
|
163
|
+
content: string;
|
|
164
|
+
createdAt: Date;
|
|
165
|
+
senderId: string;
|
|
166
|
+
conversationId: string;
|
|
167
|
+
};
|
|
168
|
+
messageCount: number;
|
|
169
|
+
}[];
|
|
170
|
+
meta: object;
|
|
171
|
+
}>;
|
|
172
|
+
postToLabChat: import("@trpc/server").TRPCMutationProcedure<{
|
|
173
|
+
input: {
|
|
174
|
+
content: string;
|
|
175
|
+
labChatId: string;
|
|
176
|
+
mentionedUserIds?: string[] | undefined;
|
|
177
|
+
};
|
|
178
|
+
output: {
|
|
179
|
+
id: string;
|
|
180
|
+
content: string;
|
|
181
|
+
senderId: string;
|
|
182
|
+
conversationId: string;
|
|
183
|
+
createdAt: Date;
|
|
184
|
+
sender: {
|
|
185
|
+
id: string;
|
|
186
|
+
username: string;
|
|
187
|
+
profile: {
|
|
188
|
+
displayName: string | null;
|
|
189
|
+
profilePicture: string | null;
|
|
190
|
+
} | null;
|
|
191
|
+
};
|
|
192
|
+
mentionedUserIds: string[];
|
|
193
|
+
};
|
|
194
|
+
meta: object;
|
|
195
|
+
}>;
|
|
196
|
+
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
197
|
+
input: {
|
|
198
|
+
labChatId: string;
|
|
199
|
+
};
|
|
200
|
+
output: {
|
|
201
|
+
success: boolean;
|
|
202
|
+
};
|
|
203
|
+
meta: object;
|
|
204
|
+
}>;
|
|
205
|
+
}>>;
|
|
206
|
+
//# sourceMappingURL=labChat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labChat.d.ts","sourceRoot":"","sources":["../../src/routers/labChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAonBxB,CAAC"}
|