@studious-lms/server 1.4.5 → 1.4.7
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/dist/lib/config/cors.d.ts.map +1 -1
- package/dist/lib/config/cors.js +8 -3
- package/dist/lib/config/cors.js.map +1 -1
- package/dist/models/access.d.ts +112 -0
- package/dist/models/access.d.ts.map +1 -0
- package/dist/models/access.js +49 -0
- package/dist/models/access.js.map +1 -0
- package/dist/models/announcement.d.ts +17 -2
- package/dist/models/announcement.d.ts.map +1 -1
- package/dist/models/announcement.js +21 -4
- package/dist/models/announcement.js.map +1 -1
- package/dist/models/assignment.d.ts +37 -37
- package/dist/models/assignment.d.ts.map +1 -1
- package/dist/models/assignment.js +15 -15
- package/dist/models/assignment.js.map +1 -1
- package/dist/models/attendance.d.ts +1 -1
- package/dist/models/attendance.d.ts.map +1 -1
- package/dist/models/attendance.js +6 -5
- package/dist/models/attendance.js.map +1 -1
- package/dist/models/auth.d.ts +5 -5
- package/dist/models/auth.d.ts.map +1 -1
- package/dist/models/auth.js +7 -11
- package/dist/models/auth.js.map +1 -1
- package/dist/models/class.d.ts +26 -26
- package/dist/models/class.d.ts.map +1 -1
- package/dist/models/class.js +7 -11
- package/dist/models/class.js.map +1 -1
- package/dist/models/comment.d.ts +233 -6
- package/dist/models/comment.d.ts.map +1 -1
- package/dist/models/comment.js +133 -3
- package/dist/models/comment.js.map +1 -1
- package/dist/models/conversation.d.ts +7 -7
- package/dist/models/event.d.ts +52 -3
- package/dist/models/event.d.ts.map +1 -1
- package/dist/models/event.js +56 -6
- package/dist/models/event.js.map +1 -1
- package/dist/models/file.d.ts +178 -103
- package/dist/models/file.d.ts.map +1 -1
- package/dist/models/file.js +54 -14
- package/dist/models/file.js.map +1 -1
- package/dist/models/folder.d.ts +22 -22
- package/dist/models/folder.d.ts.map +1 -1
- package/dist/models/folder.js +5 -4
- package/dist/models/folder.js.map +1 -1
- package/dist/models/labChat.d.ts +20 -20
- package/dist/models/labChat.d.ts.map +1 -1
- package/dist/models/labChat.js +8 -10
- package/dist/models/labChat.js.map +1 -1
- package/dist/models/marketing.d.ts +1 -1
- package/dist/models/message.d.ts +6 -6
- package/dist/models/newtonChat.d.ts +5 -5
- package/dist/models/school.d.ts +361 -0
- package/dist/models/school.d.ts.map +1 -0
- package/dist/models/school.js +314 -0
- package/dist/models/school.js.map +1 -0
- package/dist/models/section.d.ts +1 -1
- package/dist/models/section.d.ts.map +1 -1
- package/dist/models/section.js +5 -4
- package/dist/models/section.js.map +1 -1
- package/dist/models/user.d.ts +4 -4
- package/dist/models/worksheet.d.ts +67 -65
- package/dist/models/worksheet.d.ts.map +1 -1
- package/dist/models/worksheet.js +6 -14
- package/dist/models/worksheet.js.map +1 -1
- package/dist/pipelines/aiLabChat.d.ts.map +1 -1
- package/dist/pipelines/aiLabChat.js +4 -3
- package/dist/pipelines/aiLabChat.js.map +1 -1
- package/dist/pipelines/gradeWorksheet.d.ts +2 -2
- package/dist/pipelines/pdfToWorksheet.d.ts +1 -1
- package/dist/routers/_app.d.ts +2462 -1104
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +4 -2
- package/dist/routers/_app.js.map +1 -1
- package/dist/routers/announcement.d.ts +13 -5
- package/dist/routers/announcement.d.ts.map +1 -1
- package/dist/routers/announcement.js +25 -5
- package/dist/routers/announcement.js.map +1 -1
- package/dist/routers/assignment.d.ts +266 -36
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/assignment.js +221 -3
- package/dist/routers/assignment.js.map +1 -1
- package/dist/routers/class.d.ts +21 -20
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/class.js +3 -2
- package/dist/routers/class.js.map +1 -1
- package/dist/routers/comment.d.ts +40 -3
- package/dist/routers/comment.d.ts.map +1 -1
- package/dist/routers/comment.js +14 -5
- package/dist/routers/comment.js.map +1 -1
- package/dist/routers/conversation.d.ts +6 -6
- package/dist/routers/event.d.ts +21 -2
- package/dist/routers/event.d.ts.map +1 -1
- package/dist/routers/file.d.ts +2 -2
- package/dist/routers/folder.d.ts +24 -24
- package/dist/routers/labChat.d.ts +7 -7
- package/dist/routers/school.d.ts +384 -0
- package/dist/routers/school.d.ts.map +1 -0
- package/dist/routers/school.js +79 -0
- package/dist/routers/school.js.map +1 -0
- package/dist/routers/search.d.ts +1 -1
- package/dist/routers/worksheet.d.ts +23 -21
- package/dist/routers/worksheet.d.ts.map +1 -1
- package/dist/services/announcement.d.ts.map +1 -1
- package/dist/services/announcement.js +10 -6
- package/dist/services/announcement.js.map +1 -1
- package/dist/services/assignment.d.ts +36 -36
- package/dist/services/class.d.ts +20 -19
- package/dist/services/class.d.ts.map +1 -1
- package/dist/services/class.js +22 -3
- package/dist/services/class.js.map +1 -1
- package/dist/services/comment.d.ts +31 -5
- package/dist/services/comment.d.ts.map +1 -1
- package/dist/services/comment.js +102 -19
- package/dist/services/comment.js.map +1 -1
- package/dist/services/conversation.d.ts +6 -6
- package/dist/services/event.d.ts +21 -2
- package/dist/services/event.d.ts.map +1 -1
- package/dist/services/event.js +11 -7
- package/dist/services/event.js.map +1 -1
- package/dist/services/file.d.ts +2 -2
- package/dist/services/file.d.ts.map +1 -1
- package/dist/services/file.js +17 -8
- package/dist/services/file.js.map +1 -1
- package/dist/services/folder.d.ts +24 -24
- package/dist/services/labChat.d.ts +7 -7
- package/dist/services/school.d.ts +299 -0
- package/dist/services/school.d.ts.map +1 -0
- package/dist/services/school.js +225 -0
- package/dist/services/school.js.map +1 -0
- package/dist/services/worksheet.d.ts +23 -21
- package/dist/services/worksheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260502230500_assignment_submission_comments/migration.sql +60 -0
- package/prisma/migrations/20260504071500_school_memberships/migration.sql +81 -0
- package/prisma/schema.prisma +75 -2
- package/src/lib/config/cors.ts +8 -1
- package/src/models/access.ts +48 -0
- package/src/models/announcement.ts +19 -2
- package/src/models/assignment.ts +17 -13
- package/src/models/attendance.ts +4 -3
- package/src/models/auth.ts +8 -9
- package/src/models/class.ts +8 -9
- package/src/models/comment.ts +137 -1
- package/src/models/event.ts +54 -4
- package/src/models/file.ts +53 -12
- package/src/models/folder.ts +3 -2
- package/src/models/labChat.ts +9 -8
- package/src/models/school.ts +361 -0
- package/src/models/section.ts +3 -2
- package/src/models/worksheet.ts +7 -12
- package/src/pipelines/aiLabChat.ts +2 -1
- package/src/routers/_app.ts +2 -0
- package/src/routers/announcement.ts +30 -4
- package/src/routers/assignment.ts +243 -2
- package/src/routers/class.ts +1 -0
- package/src/routers/comment.ts +19 -2
- package/src/routers/school.ts +122 -0
- package/src/services/announcement.ts +12 -4
- package/src/services/class.ts +25 -2
- package/src/services/comment.ts +122 -18
- package/src/services/event.ts +23 -6
- package/src/services/file.ts +20 -6
- package/src/services/school.ts +308 -0
- package/tests/lib/cors.test.ts +13 -1
- package/tests/routers/assignment.test.ts +68 -2
- package/tests/routers/comment.test.ts +42 -1
- package/vercel.json +8 -0
package/dist/models/comment.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export declare const commentSelect: {
|
|
2
2
|
readonly id: true;
|
|
3
3
|
readonly content: true;
|
|
4
|
+
readonly announcementId: true;
|
|
5
|
+
readonly assignmentId: true;
|
|
6
|
+
readonly submissionId: true;
|
|
7
|
+
readonly parentCommentId: true;
|
|
4
8
|
readonly createdAt: true;
|
|
5
9
|
readonly modifiedAt: true;
|
|
6
10
|
readonly author: {
|
|
@@ -38,6 +42,10 @@ export declare const commentSelect: {
|
|
|
38
42
|
/** @returns Comment by ID with author and reactions. */
|
|
39
43
|
export declare function findCommentById(id: string): import(".prisma/client").Prisma.Prisma__CommentClient<{
|
|
40
44
|
id: string;
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
assignmentId: string | null;
|
|
47
|
+
submissionId: string | null;
|
|
48
|
+
announcementId: string | null;
|
|
41
49
|
reactions: {
|
|
42
50
|
type: import(".prisma/client").$Enums.ReactionType;
|
|
43
51
|
user: {
|
|
@@ -50,9 +58,9 @@ export declare function findCommentById(id: string): import(".prisma/client").Pr
|
|
|
50
58
|
} | null;
|
|
51
59
|
};
|
|
52
60
|
}[];
|
|
53
|
-
createdAt: Date;
|
|
54
61
|
modifiedAt: Date | null;
|
|
55
62
|
content: string;
|
|
63
|
+
parentCommentId: string | null;
|
|
56
64
|
author: {
|
|
57
65
|
id: string;
|
|
58
66
|
username: string;
|
|
@@ -83,8 +91,10 @@ export declare function findRepliesByCommentId(commentId: string): import(".pris
|
|
|
83
91
|
} & {
|
|
84
92
|
status: import(".prisma/client").$Enums.GenerationStatus | null;
|
|
85
93
|
id: string;
|
|
86
|
-
announcementId: string | null;
|
|
87
94
|
createdAt: Date;
|
|
95
|
+
assignmentId: string | null;
|
|
96
|
+
submissionId: string | null;
|
|
97
|
+
announcementId: string | null;
|
|
88
98
|
modifiedAt: Date | null;
|
|
89
99
|
content: string;
|
|
90
100
|
authorId: string;
|
|
@@ -96,11 +106,17 @@ export declare function createComment(data: {
|
|
|
96
106
|
parentCommentId: string;
|
|
97
107
|
content: string;
|
|
98
108
|
authorId: string;
|
|
109
|
+
announcementId?: string | null;
|
|
110
|
+
assignmentId?: string | null;
|
|
111
|
+
submissionId?: string | null;
|
|
112
|
+
studentQuestionProgressId?: string | null;
|
|
99
113
|
}): import(".prisma/client").Prisma.Prisma__CommentClient<{
|
|
100
114
|
status: import(".prisma/client").$Enums.GenerationStatus | null;
|
|
101
115
|
id: string;
|
|
102
|
-
announcementId: string | null;
|
|
103
116
|
createdAt: Date;
|
|
117
|
+
assignmentId: string | null;
|
|
118
|
+
submissionId: string | null;
|
|
119
|
+
announcementId: string | null;
|
|
104
120
|
modifiedAt: Date | null;
|
|
105
121
|
content: string;
|
|
106
122
|
authorId: string;
|
|
@@ -117,9 +133,9 @@ export declare function createComment(data: {
|
|
|
117
133
|
export declare function findReactionByUserAndComment(userId: string, commentId: string): import(".prisma/client").Prisma.Prisma__ReactionClient<{
|
|
118
134
|
type: import(".prisma/client").$Enums.ReactionType;
|
|
119
135
|
id: string;
|
|
136
|
+
createdAt: Date;
|
|
120
137
|
userId: string;
|
|
121
138
|
announcementId: string | null;
|
|
122
|
-
createdAt: Date;
|
|
123
139
|
commentId: string | null;
|
|
124
140
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
125
141
|
datasources: {
|
|
@@ -146,9 +162,9 @@ export declare function upsertReaction(data: {
|
|
|
146
162
|
} & {
|
|
147
163
|
type: import(".prisma/client").$Enums.ReactionType;
|
|
148
164
|
id: string;
|
|
165
|
+
createdAt: Date;
|
|
149
166
|
userId: string;
|
|
150
167
|
announcementId: string | null;
|
|
151
|
-
createdAt: Date;
|
|
152
168
|
commentId: string | null;
|
|
153
169
|
}, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
154
170
|
datasources: {
|
|
@@ -161,9 +177,9 @@ export declare function upsertReaction(data: {
|
|
|
161
177
|
export declare function deleteReactionById(id: string): import(".prisma/client").Prisma.Prisma__ReactionClient<{
|
|
162
178
|
type: import(".prisma/client").$Enums.ReactionType;
|
|
163
179
|
id: string;
|
|
180
|
+
createdAt: Date;
|
|
164
181
|
userId: string;
|
|
165
182
|
announcementId: string | null;
|
|
166
|
-
createdAt: Date;
|
|
167
183
|
commentId: string | null;
|
|
168
184
|
}, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
169
185
|
datasources: {
|
|
@@ -180,8 +196,219 @@ export declare function findCommentWithAnnouncement(commentId: string): import("
|
|
|
180
196
|
} & {
|
|
181
197
|
status: import(".prisma/client").$Enums.GenerationStatus | null;
|
|
182
198
|
id: string;
|
|
199
|
+
createdAt: Date;
|
|
200
|
+
assignmentId: string | null;
|
|
201
|
+
submissionId: string | null;
|
|
183
202
|
announcementId: string | null;
|
|
203
|
+
modifiedAt: Date | null;
|
|
204
|
+
content: string;
|
|
205
|
+
authorId: string;
|
|
206
|
+
parentCommentId: string | null;
|
|
207
|
+
studentQuestionProgressId: string | null;
|
|
208
|
+
}) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
209
|
+
datasources: {
|
|
210
|
+
db: {
|
|
211
|
+
url: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
}>;
|
|
215
|
+
/** @returns Comment with the owning class context for authorization. */
|
|
216
|
+
export declare function findCommentWithContext(commentId: string): import(".prisma/client").Prisma.Prisma__CommentClient<({
|
|
217
|
+
assignment: {
|
|
218
|
+
class: {
|
|
219
|
+
school: {
|
|
220
|
+
users: {
|
|
221
|
+
id: string;
|
|
222
|
+
}[];
|
|
223
|
+
memberships: {
|
|
224
|
+
userId: string;
|
|
225
|
+
}[];
|
|
226
|
+
} | null;
|
|
227
|
+
id: string;
|
|
228
|
+
teachers: {
|
|
229
|
+
id: string;
|
|
230
|
+
}[];
|
|
231
|
+
students: {
|
|
232
|
+
id: string;
|
|
233
|
+
}[];
|
|
234
|
+
};
|
|
235
|
+
} | null;
|
|
236
|
+
submission: {
|
|
237
|
+
assignment: {
|
|
238
|
+
class: {
|
|
239
|
+
school: {
|
|
240
|
+
users: {
|
|
241
|
+
id: string;
|
|
242
|
+
}[];
|
|
243
|
+
memberships: {
|
|
244
|
+
userId: string;
|
|
245
|
+
}[];
|
|
246
|
+
} | null;
|
|
247
|
+
id: string;
|
|
248
|
+
teachers: {
|
|
249
|
+
id: string;
|
|
250
|
+
}[];
|
|
251
|
+
students: {
|
|
252
|
+
id: string;
|
|
253
|
+
}[];
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
studentId: string;
|
|
257
|
+
} | null;
|
|
258
|
+
announcement: {
|
|
259
|
+
class: {
|
|
260
|
+
school: {
|
|
261
|
+
users: {
|
|
262
|
+
id: string;
|
|
263
|
+
}[];
|
|
264
|
+
memberships: {
|
|
265
|
+
userId: string;
|
|
266
|
+
}[];
|
|
267
|
+
} | null;
|
|
268
|
+
id: string;
|
|
269
|
+
teachers: {
|
|
270
|
+
id: string;
|
|
271
|
+
}[];
|
|
272
|
+
students: {
|
|
273
|
+
id: string;
|
|
274
|
+
}[];
|
|
275
|
+
};
|
|
276
|
+
} | null;
|
|
277
|
+
studentQuestionProgress: {
|
|
278
|
+
studentId: string;
|
|
279
|
+
studentWorksheetResponse: {
|
|
280
|
+
submission: {
|
|
281
|
+
assignment: {
|
|
282
|
+
class: {
|
|
283
|
+
school: {
|
|
284
|
+
users: {
|
|
285
|
+
id: string;
|
|
286
|
+
}[];
|
|
287
|
+
memberships: {
|
|
288
|
+
userId: string;
|
|
289
|
+
}[];
|
|
290
|
+
} | null;
|
|
291
|
+
id: string;
|
|
292
|
+
teachers: {
|
|
293
|
+
id: string;
|
|
294
|
+
}[];
|
|
295
|
+
students: {
|
|
296
|
+
id: string;
|
|
297
|
+
}[];
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
studentId: string;
|
|
301
|
+
} | null;
|
|
302
|
+
} | null;
|
|
303
|
+
} | null;
|
|
304
|
+
parentComment: ({
|
|
305
|
+
assignment: {
|
|
306
|
+
class: {
|
|
307
|
+
school: {
|
|
308
|
+
users: {
|
|
309
|
+
id: string;
|
|
310
|
+
}[];
|
|
311
|
+
memberships: {
|
|
312
|
+
userId: string;
|
|
313
|
+
}[];
|
|
314
|
+
} | null;
|
|
315
|
+
id: string;
|
|
316
|
+
teachers: {
|
|
317
|
+
id: string;
|
|
318
|
+
}[];
|
|
319
|
+
students: {
|
|
320
|
+
id: string;
|
|
321
|
+
}[];
|
|
322
|
+
};
|
|
323
|
+
} | null;
|
|
324
|
+
submission: {
|
|
325
|
+
assignment: {
|
|
326
|
+
class: {
|
|
327
|
+
school: {
|
|
328
|
+
users: {
|
|
329
|
+
id: string;
|
|
330
|
+
}[];
|
|
331
|
+
memberships: {
|
|
332
|
+
userId: string;
|
|
333
|
+
}[];
|
|
334
|
+
} | null;
|
|
335
|
+
id: string;
|
|
336
|
+
teachers: {
|
|
337
|
+
id: string;
|
|
338
|
+
}[];
|
|
339
|
+
students: {
|
|
340
|
+
id: string;
|
|
341
|
+
}[];
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
studentId: string;
|
|
345
|
+
} | null;
|
|
346
|
+
announcement: {
|
|
347
|
+
class: {
|
|
348
|
+
school: {
|
|
349
|
+
users: {
|
|
350
|
+
id: string;
|
|
351
|
+
}[];
|
|
352
|
+
memberships: {
|
|
353
|
+
userId: string;
|
|
354
|
+
}[];
|
|
355
|
+
} | null;
|
|
356
|
+
id: string;
|
|
357
|
+
teachers: {
|
|
358
|
+
id: string;
|
|
359
|
+
}[];
|
|
360
|
+
students: {
|
|
361
|
+
id: string;
|
|
362
|
+
}[];
|
|
363
|
+
};
|
|
364
|
+
} | null;
|
|
365
|
+
studentQuestionProgress: {
|
|
366
|
+
studentId: string;
|
|
367
|
+
studentWorksheetResponse: {
|
|
368
|
+
submission: {
|
|
369
|
+
assignment: {
|
|
370
|
+
class: {
|
|
371
|
+
school: {
|
|
372
|
+
users: {
|
|
373
|
+
id: string;
|
|
374
|
+
}[];
|
|
375
|
+
memberships: {
|
|
376
|
+
userId: string;
|
|
377
|
+
}[];
|
|
378
|
+
} | null;
|
|
379
|
+
id: string;
|
|
380
|
+
teachers: {
|
|
381
|
+
id: string;
|
|
382
|
+
}[];
|
|
383
|
+
students: {
|
|
384
|
+
id: string;
|
|
385
|
+
}[];
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
studentId: string;
|
|
389
|
+
} | null;
|
|
390
|
+
} | null;
|
|
391
|
+
} | null;
|
|
392
|
+
} & {
|
|
393
|
+
status: import(".prisma/client").$Enums.GenerationStatus | null;
|
|
394
|
+
id: string;
|
|
395
|
+
createdAt: Date;
|
|
396
|
+
assignmentId: string | null;
|
|
397
|
+
submissionId: string | null;
|
|
398
|
+
announcementId: string | null;
|
|
399
|
+
modifiedAt: Date | null;
|
|
400
|
+
content: string;
|
|
401
|
+
authorId: string;
|
|
402
|
+
parentCommentId: string | null;
|
|
403
|
+
studentQuestionProgressId: string | null;
|
|
404
|
+
}) | null;
|
|
405
|
+
} & {
|
|
406
|
+
status: import(".prisma/client").$Enums.GenerationStatus | null;
|
|
407
|
+
id: string;
|
|
184
408
|
createdAt: Date;
|
|
409
|
+
assignmentId: string | null;
|
|
410
|
+
submissionId: string | null;
|
|
411
|
+
announcementId: string | null;
|
|
185
412
|
modifiedAt: Date | null;
|
|
186
413
|
content: string;
|
|
187
414
|
authorId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.d.ts","sourceRoot":"/","sources":["models/comment.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"comment.d.ts","sourceRoot":"/","sources":["models/comment.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwChB,CAAC;AAuBX,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKzC;AAED,qCAAqC;AACrC,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;MAmBvD;AAED,gCAAgC;AAChC,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,yBAAyB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;;;;;;;;;;;;;;;;;;GAIA;AAED,6CAA6C;AAC7C,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;GAM7E;AAED,2CAA2C;AAC3C,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;;;;;;;;;;;;;;;;;;;;;;;GA0BA;AAED,yBAAyB;AACzB,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;GAI5C;AAED,kDAAkD;AAClD,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;GAO5D;AAED,wEAAwE;AACxE,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGvD;AAED,sDAAsD;AACtD,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM;;;;;;;;GAM7D"}
|
package/dist/models/comment.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Comment model – comments, replies, and reactions
|
|
2
|
+
* Comment model – comments, replies, and reactions.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
5
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4e10262a-c8cd-5388-9b97-3cf8d34902b6")}catch(e){}}();
|
|
6
6
|
import { prisma } from "../lib/prisma.js";
|
|
7
7
|
export const commentSelect = {
|
|
8
8
|
id: true,
|
|
9
9
|
content: true,
|
|
10
|
+
announcementId: true,
|
|
11
|
+
assignmentId: true,
|
|
12
|
+
submissionId: true,
|
|
13
|
+
parentCommentId: true,
|
|
10
14
|
createdAt: true,
|
|
11
15
|
modifiedAt: true,
|
|
12
16
|
author: {
|
|
@@ -41,6 +45,26 @@ export const commentSelect = {
|
|
|
41
45
|
},
|
|
42
46
|
},
|
|
43
47
|
};
|
|
48
|
+
const commentClassAuthSelect = {
|
|
49
|
+
id: true,
|
|
50
|
+
teachers: { select: { id: true } },
|
|
51
|
+
students: { select: { id: true } },
|
|
52
|
+
school: {
|
|
53
|
+
select: {
|
|
54
|
+
users: {
|
|
55
|
+
where: { role: "ADMIN" },
|
|
56
|
+
select: { id: true },
|
|
57
|
+
},
|
|
58
|
+
memberships: {
|
|
59
|
+
where: {
|
|
60
|
+
role: "ADMIN",
|
|
61
|
+
status: "ACTIVE",
|
|
62
|
+
},
|
|
63
|
+
select: { userId: true },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
44
68
|
/** @returns Comment by ID with author and reactions. */
|
|
45
69
|
export function findCommentById(id) {
|
|
46
70
|
return prisma.comment.findUnique({
|
|
@@ -126,6 +150,112 @@ export function findCommentWithAnnouncement(commentId) {
|
|
|
126
150
|
},
|
|
127
151
|
});
|
|
128
152
|
}
|
|
153
|
+
/** @returns Comment with the owning class context for authorization. */
|
|
154
|
+
export function findCommentWithContext(commentId) {
|
|
155
|
+
return prisma.comment.findUnique({
|
|
156
|
+
where: { id: commentId },
|
|
157
|
+
include: {
|
|
158
|
+
announcement: {
|
|
159
|
+
select: {
|
|
160
|
+
class: {
|
|
161
|
+
select: commentClassAuthSelect,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
assignment: {
|
|
166
|
+
select: {
|
|
167
|
+
class: {
|
|
168
|
+
select: commentClassAuthSelect,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
submission: {
|
|
173
|
+
select: {
|
|
174
|
+
studentId: true,
|
|
175
|
+
assignment: {
|
|
176
|
+
select: {
|
|
177
|
+
class: {
|
|
178
|
+
select: commentClassAuthSelect,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
studentQuestionProgress: {
|
|
185
|
+
select: {
|
|
186
|
+
studentId: true,
|
|
187
|
+
studentWorksheetResponse: {
|
|
188
|
+
select: {
|
|
189
|
+
submission: {
|
|
190
|
+
select: {
|
|
191
|
+
studentId: true,
|
|
192
|
+
assignment: {
|
|
193
|
+
select: {
|
|
194
|
+
class: {
|
|
195
|
+
select: commentClassAuthSelect,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
parentComment: {
|
|
206
|
+
include: {
|
|
207
|
+
announcement: {
|
|
208
|
+
select: {
|
|
209
|
+
class: {
|
|
210
|
+
select: commentClassAuthSelect,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
assignment: {
|
|
215
|
+
select: {
|
|
216
|
+
class: {
|
|
217
|
+
select: commentClassAuthSelect,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
submission: {
|
|
222
|
+
select: {
|
|
223
|
+
studentId: true,
|
|
224
|
+
assignment: {
|
|
225
|
+
select: {
|
|
226
|
+
class: {
|
|
227
|
+
select: commentClassAuthSelect,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
studentQuestionProgress: {
|
|
234
|
+
select: {
|
|
235
|
+
studentId: true,
|
|
236
|
+
studentWorksheetResponse: {
|
|
237
|
+
select: {
|
|
238
|
+
submission: {
|
|
239
|
+
select: {
|
|
240
|
+
studentId: true,
|
|
241
|
+
assignment: {
|
|
242
|
+
select: {
|
|
243
|
+
class: {
|
|
244
|
+
select: commentClassAuthSelect,
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
}
|
|
129
259
|
/** @returns Reaction counts by type for a comment. */
|
|
130
260
|
export function getReactionCountsByCommentId(commentId) {
|
|
131
261
|
return prisma.reaction.groupBy({
|
|
@@ -135,4 +265,4 @@ export function getReactionCountsByCommentId(commentId) {
|
|
|
135
265
|
});
|
|
136
266
|
}
|
|
137
267
|
//# sourceMappingURL=comment.js.map
|
|
138
|
-
//# debugId=
|
|
268
|
+
//# debugId=4e10262a-c8cd-5388-9b97-3cf8d34902b6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comment.js","sources":["models/comment.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Comment model – comments, replies, and reactions (for announcements/worksheets).\n */\nimport { prisma } from \"../lib/prisma.js\";\nimport type { ReactionType } from \"@prisma/client\";\n\nexport const commentSelect = {\n id: true,\n content: true,\n createdAt: true,\n modifiedAt: true,\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n reactions: {\n select: {\n type: true,\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n} as const;\n\n/** @returns Comment by ID with author and reactions. */\nexport function findCommentById(id: string) {\n return prisma.comment.findUnique({\n where: { id },\n select: commentSelect,\n });\n}\n\n/** @returns Replies to a comment. */\nexport function findRepliesByCommentId(commentId: string) {\n return prisma.comment.findMany({\n where: { parentCommentId: commentId },\n include: {\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Create a comment (reply). */\nexport function createComment(data: {\n parentCommentId: string;\n content: string;\n authorId: string;\n}) {\n return prisma.comment.create({\n data,\n });\n}\n\n/** @returns User's reaction on a comment. */\nexport function findReactionByUserAndComment(userId: string, commentId: string) {\n return prisma.reaction.findUnique({\n where: {\n userId_commentId: { userId, commentId },\n },\n });\n}\n\n/** Add or update reaction on a comment. */\nexport function upsertReaction(data: {\n userId: string;\n commentId: string;\n type: string;\n}) {\n return prisma.reaction.upsert({\n where: {\n userId_commentId: {\n userId: data.userId,\n commentId: data.commentId,\n },\n },\n update: { type: data.type as ReactionType },\n create: { ...data, type: data.type as ReactionType },\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Delete a reaction. */\nexport function deleteReactionById(id: string) {\n return prisma.reaction.delete({\n where: { id },\n });\n}\n\n/** @returns Comment with announcement classId. */\nexport function findCommentWithAnnouncement(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: { select: { classId: true } },\n },\n });\n}\n\n/** @returns Reaction counts by type for a comment. */\nexport function getReactionCountsByCommentId(commentId: string) {\n return prisma.reaction.groupBy({\n by: [\"type\"],\n where: { commentId },\n _count: { type: true },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,UA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B,OAAO,EAAE;YACP,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;SAC5C;KACF,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC7B,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,KAAK,EAAE,EAAE,SAAS,EAAE;QACpB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KACvB,CAAC,CAAC;AACL,CAAC","debug_id":"ca426704-cab3-590c-bf53-62a421ec814d"}
|
|
1
|
+
{"version":3,"file":"comment.js","sources":["models/comment.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Comment model – comments, replies, and reactions.\n */\nimport { prisma } from \"../lib/prisma.js\";\nimport type { ReactionType } from \"@prisma/client\";\n\nexport const commentSelect = {\n id: true,\n content: true,\n announcementId: true,\n assignmentId: true,\n submissionId: true,\n parentCommentId: true,\n createdAt: true,\n modifiedAt: true,\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n reactions: {\n select: {\n type: true,\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n} as const;\n\nconst commentClassAuthSelect = {\n id: true,\n teachers: { select: { id: true } },\n students: { select: { id: true } },\n school: {\n select: {\n users: {\n where: { role: \"ADMIN\" as const },\n select: { id: true },\n },\n memberships: {\n where: {\n role: \"ADMIN\" as const,\n status: \"ACTIVE\" as const,\n },\n select: { userId: true },\n },\n },\n },\n} as const;\n\n/** @returns Comment by ID with author and reactions. */\nexport function findCommentById(id: string) {\n return prisma.comment.findUnique({\n where: { id },\n select: commentSelect,\n });\n}\n\n/** @returns Replies to a comment. */\nexport function findRepliesByCommentId(commentId: string) {\n return prisma.comment.findMany({\n where: { parentCommentId: commentId },\n include: {\n author: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Create a comment (reply). */\nexport function createComment(data: {\n parentCommentId: string;\n content: string;\n authorId: string;\n announcementId?: string | null;\n assignmentId?: string | null;\n submissionId?: string | null;\n studentQuestionProgressId?: string | null;\n}) {\n return prisma.comment.create({\n data,\n });\n}\n\n/** @returns User's reaction on a comment. */\nexport function findReactionByUserAndComment(userId: string, commentId: string) {\n return prisma.reaction.findUnique({\n where: {\n userId_commentId: { userId, commentId },\n },\n });\n}\n\n/** Add or update reaction on a comment. */\nexport function upsertReaction(data: {\n userId: string;\n commentId: string;\n type: string;\n}) {\n return prisma.reaction.upsert({\n where: {\n userId_commentId: {\n userId: data.userId,\n commentId: data.commentId,\n },\n },\n update: { type: data.type as ReactionType },\n create: { ...data, type: data.type as ReactionType },\n include: {\n user: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n });\n}\n\n/** Delete a reaction. */\nexport function deleteReactionById(id: string) {\n return prisma.reaction.delete({\n where: { id },\n });\n}\n\n/** @returns Comment with announcement classId. */\nexport function findCommentWithAnnouncement(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: { select: { classId: true } },\n },\n });\n}\n\n/** @returns Comment with the owning class context for authorization. */\nexport function findCommentWithContext(commentId: string) {\n return prisma.comment.findUnique({\n where: { id: commentId },\n include: {\n announcement: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n studentQuestionProgress: {\n select: {\n studentId: true,\n studentWorksheetResponse: {\n select: {\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n parentComment: {\n include: {\n announcement: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n studentQuestionProgress: {\n select: {\n studentId: true,\n studentWorksheetResponse: {\n select: {\n submission: {\n select: {\n studentId: true,\n assignment: {\n select: {\n class: {\n select: commentClassAuthSelect,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n });\n}\n\n/** @returns Reaction counts by type for a comment. */\nexport function getReactionCountsByCommentId(commentId: string) {\n return prisma.reaction.groupBy({\n by: [\"type\"],\n where: { commentId },\n _count: { type: true },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,IAAI;IACR,OAAO,EAAE,IAAI;IACb,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE;QACN,MAAM,EAAE;YACN,EAAE,EAAE,IAAI;YACR,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,MAAM,EAAE;oBACN,WAAW,EAAE,IAAI;oBACjB,cAAc,EAAE,IAAI;oBACpB,uBAAuB,EAAE,IAAI;iBAC9B;aACF;SACF;KACF;IACD,SAAS,EAAE;QACT,MAAM,EAAE;YACN,IAAI,EAAE,IAAI;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI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AM,EAAE,sBAAsB;6BAC/B;yBACF;qBACF;oBACD,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,KAAK,EAAE;gCACL,MAAM,EAAE,sBAAsB;6BAC/B;yBACF;qBACF;oBACD,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,SAAS,EAAE,IAAI;4BACf,UAAU,EAAE;gCACV,MAAM,EAAE;oCACN,KAAK,EAAE;wCACL,MAAM,EAAE,sBAAsB;qCAC/B;iCACF;6BACF;yBACF;qBACF;oBACD,uBAAuB,EAAE;wBACvB,MAAM,EAAE;4BACN,SAAS,EAAE,IAAI;4BACf,wBAAwB,EAAE;gCACxB,MAAM,EAAE;oCACN,UAAU,EAAE;wCACV,MAAM,EAAE;4CACN,SAAS,EAAE,IAAI;4CACf,UAAU,EAAE;gDACV,MAAM,EAAE;oDACN,KAAK,EAAE;wDACL,MAAM,EAAE,sBAAsB;qDAC/B;iDACF;6CACF;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC7B,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,KAAK,EAAE,EAAE,SAAS,EAAE;QACpB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;KACvB,CAAC,CAAC;AACL,CAAC","debug_id":"4e10262a-c8cd-5388-9b97-3cf8d34902b6"}
|
|
@@ -15,9 +15,9 @@ export declare function findConversationsByUserId(userId: string): import(".pris
|
|
|
15
15
|
};
|
|
16
16
|
} & {
|
|
17
17
|
id: string;
|
|
18
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
18
19
|
userId: string;
|
|
19
20
|
conversationId: string;
|
|
20
|
-
role: import(".prisma/client").$Enums.ConversationRole;
|
|
21
21
|
joinedAt: Date;
|
|
22
22
|
hiddenAt: Date | null;
|
|
23
23
|
lastViewedAt: Date | null;
|
|
@@ -35,8 +35,8 @@ export declare function findConversationsByUserId(userId: string): import(".pris
|
|
|
35
35
|
status: import(".prisma/client").$Enums.GenerationStatus | null;
|
|
36
36
|
meta: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
37
37
|
id: string;
|
|
38
|
-
conversationId: string;
|
|
39
38
|
createdAt: Date;
|
|
39
|
+
conversationId: string;
|
|
40
40
|
content: string;
|
|
41
41
|
senderId: string;
|
|
42
42
|
})[];
|
|
@@ -101,9 +101,9 @@ export declare function createConversation(data: {
|
|
|
101
101
|
};
|
|
102
102
|
} & {
|
|
103
103
|
id: string;
|
|
104
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
104
105
|
userId: string;
|
|
105
106
|
conversationId: string;
|
|
106
|
-
role: import(".prisma/client").$Enums.ConversationRole;
|
|
107
107
|
joinedAt: Date;
|
|
108
108
|
hiddenAt: Date | null;
|
|
109
109
|
lastViewedAt: Date | null;
|
|
@@ -136,9 +136,9 @@ export declare function findConversationByIdAndMember(conversationId: string, us
|
|
|
136
136
|
};
|
|
137
137
|
} & {
|
|
138
138
|
id: string;
|
|
139
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
139
140
|
userId: string;
|
|
140
141
|
conversationId: string;
|
|
141
|
-
role: import(".prisma/client").$Enums.ConversationRole;
|
|
142
142
|
joinedAt: Date;
|
|
143
143
|
hiddenAt: Date | null;
|
|
144
144
|
lastViewedAt: Date | null;
|
|
@@ -165,9 +165,9 @@ export declare function createConversationMember(data: {
|
|
|
165
165
|
role: string;
|
|
166
166
|
}): import(".prisma/client").Prisma.Prisma__ConversationMemberClient<{
|
|
167
167
|
id: string;
|
|
168
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
168
169
|
userId: string;
|
|
169
170
|
conversationId: string;
|
|
170
|
-
role: import(".prisma/client").$Enums.ConversationRole;
|
|
171
171
|
joinedAt: Date;
|
|
172
172
|
hiddenAt: Date | null;
|
|
173
173
|
lastViewedAt: Date | null;
|
|
@@ -182,9 +182,9 @@ export declare function createConversationMember(data: {
|
|
|
182
182
|
/** Hide a conversation for a single member until new activity occurs. */
|
|
183
183
|
export declare function hideConversationMember(userId: string, conversationId: string): import(".prisma/client").Prisma.Prisma__ConversationMemberClient<{
|
|
184
184
|
id: string;
|
|
185
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
185
186
|
userId: string;
|
|
186
187
|
conversationId: string;
|
|
187
|
-
role: import(".prisma/client").$Enums.ConversationRole;
|
|
188
188
|
joinedAt: Date;
|
|
189
189
|
hiddenAt: Date | null;
|
|
190
190
|
lastViewedAt: Date | null;
|
|
@@ -199,9 +199,9 @@ export declare function hideConversationMember(userId: string, conversationId: s
|
|
|
199
199
|
/** Remove a member from a conversation. */
|
|
200
200
|
export declare function deleteConversationMember(userId: string, conversationId: string): import(".prisma/client").Prisma.Prisma__ConversationMemberClient<{
|
|
201
201
|
id: string;
|
|
202
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
202
203
|
userId: string;
|
|
203
204
|
conversationId: string;
|
|
204
|
-
role: import(".prisma/client").$Enums.ConversationRole;
|
|
205
205
|
joinedAt: Date;
|
|
206
206
|
hiddenAt: Date | null;
|
|
207
207
|
lastViewedAt: Date | null;
|
package/dist/models/event.d.ts
CHANGED
|
@@ -9,7 +9,26 @@ export declare function findEventById(id: string): import(".prisma/client").Pris
|
|
|
9
9
|
role: import(".prisma/client").$Enums.UserRole;
|
|
10
10
|
schoolId: string | null;
|
|
11
11
|
} | null;
|
|
12
|
-
class: {
|
|
12
|
+
class: ({
|
|
13
|
+
school: ({
|
|
14
|
+
users: {
|
|
15
|
+
id: string;
|
|
16
|
+
}[];
|
|
17
|
+
memberships: {
|
|
18
|
+
userId: string;
|
|
19
|
+
}[];
|
|
20
|
+
} & {
|
|
21
|
+
name: string;
|
|
22
|
+
id: string;
|
|
23
|
+
logoId: string | null;
|
|
24
|
+
subdomain: string | null;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
updatedAt: Date;
|
|
27
|
+
}) | null;
|
|
28
|
+
teachers: {
|
|
29
|
+
id: string;
|
|
30
|
+
}[];
|
|
31
|
+
} & {
|
|
13
32
|
name: string;
|
|
14
33
|
id: string;
|
|
15
34
|
schoolId: string | null;
|
|
@@ -17,7 +36,7 @@ export declare function findEventById(id: string): import(".prisma/client").Pris
|
|
|
17
36
|
color: string | null;
|
|
18
37
|
section: string;
|
|
19
38
|
syllabus: string | null;
|
|
20
|
-
} | null;
|
|
39
|
+
}) | null;
|
|
21
40
|
assignmentsAttached: {
|
|
22
41
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
23
42
|
id: string;
|
|
@@ -58,7 +77,7 @@ export declare function findEventById(id: string): import(".prisma/client").Pris
|
|
|
58
77
|
};
|
|
59
78
|
};
|
|
60
79
|
}>;
|
|
61
|
-
/** @returns Class if user is a teacher. */
|
|
80
|
+
/** @returns Class if user is a teacher or school admin. */
|
|
62
81
|
export declare function findClassWithTeachers(classId: string, teacherId: string): import(".prisma/client").Prisma.Prisma__ClassClient<{
|
|
63
82
|
name: string;
|
|
64
83
|
id: string;
|
|
@@ -152,6 +171,21 @@ export declare function deleteEventById(id: string): import(".prisma/client").Pr
|
|
|
152
171
|
/** @returns Event with class and teachers. */
|
|
153
172
|
export declare function findEventWithClass(eventId: string): import(".prisma/client").Prisma.Prisma__EventClient<({
|
|
154
173
|
class: ({
|
|
174
|
+
school: ({
|
|
175
|
+
users: {
|
|
176
|
+
id: string;
|
|
177
|
+
}[];
|
|
178
|
+
memberships: {
|
|
179
|
+
userId: string;
|
|
180
|
+
}[];
|
|
181
|
+
} & {
|
|
182
|
+
name: string;
|
|
183
|
+
id: string;
|
|
184
|
+
logoId: string | null;
|
|
185
|
+
subdomain: string | null;
|
|
186
|
+
createdAt: Date;
|
|
187
|
+
updatedAt: Date;
|
|
188
|
+
}) | null;
|
|
155
189
|
teachers: {
|
|
156
190
|
id: string;
|
|
157
191
|
}[];
|
|
@@ -184,6 +218,21 @@ export declare function findEventWithClass(eventId: string): import(".prisma/cli
|
|
|
184
218
|
/** @returns Assignment with class and teachers. */
|
|
185
219
|
export declare function findAssignmentWithClass(assignmentId: string): import(".prisma/client").Prisma.Prisma__AssignmentClient<({
|
|
186
220
|
class: {
|
|
221
|
+
school: ({
|
|
222
|
+
users: {
|
|
223
|
+
id: string;
|
|
224
|
+
}[];
|
|
225
|
+
memberships: {
|
|
226
|
+
userId: string;
|
|
227
|
+
}[];
|
|
228
|
+
} & {
|
|
229
|
+
name: string;
|
|
230
|
+
id: string;
|
|
231
|
+
logoId: string | null;
|
|
232
|
+
subdomain: string | null;
|
|
233
|
+
createdAt: Date;
|
|
234
|
+
updatedAt: Date;
|
|
235
|
+
}) | null;
|
|
187
236
|
teachers: {
|
|
188
237
|
id: string;
|
|
189
238
|
}[];
|