@studious-lms/server 1.13.0 → 1.14.0

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.
Files changed (306) hide show
  1. package/.dockerignore +28 -0
  2. package/.env.example +5 -0
  3. package/.github/workflows/deploy.yml +123 -0
  4. package/Dockerfile +54 -0
  5. package/dist/index.js +5 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/lib/config/cors.d.ts.map +1 -1
  8. package/dist/lib/config/cors.js +31 -11
  9. package/dist/lib/config/cors.js.map +1 -1
  10. package/dist/lib/config/env.d.ts +17 -0
  11. package/dist/lib/config/env.d.ts.map +1 -1
  12. package/dist/lib/config/env.js +8 -2
  13. package/dist/lib/config/env.js.map +1 -1
  14. package/dist/lib/googleCloudStorage.d.ts +10 -0
  15. package/dist/lib/googleCloudStorage.d.ts.map +1 -1
  16. package/dist/lib/googleCloudStorage.js +22 -2
  17. package/dist/lib/googleCloudStorage.js.map +1 -1
  18. package/dist/lib/prisma.d.ts +104 -5
  19. package/dist/lib/prisma.d.ts.map +1 -1
  20. package/dist/lib/prisma.js +33 -2
  21. package/dist/lib/prisma.js.map +1 -1
  22. package/dist/models/agenda.d.ts +20 -20
  23. package/dist/models/announcement.d.ts +177 -69
  24. package/dist/models/announcement.d.ts.map +1 -1
  25. package/dist/models/assignment.d.ts +551 -353
  26. package/dist/models/assignment.d.ts.map +1 -1
  27. package/dist/models/attendance.d.ts +197 -71
  28. package/dist/models/attendance.d.ts.map +1 -1
  29. package/dist/models/auth.d.ts +348 -114
  30. package/dist/models/auth.d.ts.map +1 -1
  31. package/dist/models/class.d.ts +324 -198
  32. package/dist/models/class.d.ts.map +1 -1
  33. package/dist/models/class.js +2 -2
  34. package/dist/models/class.js.map +1 -1
  35. package/dist/models/cloudStorage.d.ts +146 -56
  36. package/dist/models/cloudStorage.d.ts.map +1 -1
  37. package/dist/models/comment.d.ts +267 -115
  38. package/dist/models/comment.d.ts.map +1 -1
  39. package/dist/models/conversation.d.ts +199 -73
  40. package/dist/models/conversation.d.ts.map +1 -1
  41. package/dist/models/department.d.ts +196 -70
  42. package/dist/models/department.d.ts.map +1 -1
  43. package/dist/models/event.d.ts +287 -125
  44. package/dist/models/event.d.ts.map +1 -1
  45. package/dist/models/file.d.ts +389 -263
  46. package/dist/models/file.d.ts.map +1 -1
  47. package/dist/models/folder.d.ts +433 -181
  48. package/dist/models/folder.d.ts.map +1 -1
  49. package/dist/models/labChat.d.ts +209 -83
  50. package/dist/models/labChat.d.ts.map +1 -1
  51. package/dist/models/marketing.d.ts +80 -26
  52. package/dist/models/marketing.d.ts.map +1 -1
  53. package/dist/models/message.d.ts +95 -41
  54. package/dist/models/message.d.ts.map +1 -1
  55. package/dist/models/newtonChat.d.ts +83 -29
  56. package/dist/models/newtonChat.d.ts.map +1 -1
  57. package/dist/models/notification.d.ts +61 -25
  58. package/dist/models/notification.d.ts.map +1 -1
  59. package/dist/models/school.d.ts +349 -133
  60. package/dist/models/school.d.ts.map +1 -1
  61. package/dist/models/section.d.ts +216 -72
  62. package/dist/models/section.d.ts.map +1 -1
  63. package/dist/models/tag.d.ts +156 -48
  64. package/dist/models/tag.d.ts.map +1 -1
  65. package/dist/models/user.d.ts +82 -28
  66. package/dist/models/user.d.ts.map +1 -1
  67. package/dist/models/worksheet.d.ts +1020 -411
  68. package/dist/models/worksheet.d.ts.map +1 -1
  69. package/dist/models/worksheet.js +8 -2
  70. package/dist/models/worksheet.js.map +1 -1
  71. package/dist/pipelines/aiLabChat.d.ts +0 -8
  72. package/dist/pipelines/aiLabChat.d.ts.map +1 -1
  73. package/dist/pipelines/aiLabChat.js +50 -67
  74. package/dist/pipelines/aiLabChat.js.map +1 -1
  75. package/dist/pipelines/aiLabChatContract.d.ts +393 -388
  76. package/dist/pipelines/aiLabChatContract.d.ts.map +1 -1
  77. package/dist/pipelines/aiLabChatContract.js +63 -69
  78. package/dist/pipelines/aiLabChatContract.js.map +1 -1
  79. package/dist/pipelines/aiNewtonChat.d.ts.map +1 -1
  80. package/dist/pipelines/aiNewtonChat.js +41 -41
  81. package/dist/pipelines/aiNewtonChat.js.map +1 -1
  82. package/dist/pipelines/gradeWorksheet.d.ts +8 -8
  83. package/dist/pipelines/labChatPrompt.d.ts +10 -8
  84. package/dist/pipelines/labChatPrompt.d.ts.map +1 -1
  85. package/dist/pipelines/labChatPrompt.js +47 -67
  86. package/dist/pipelines/labChatPrompt.js.map +1 -1
  87. package/dist/pipelines/pdfToWorksheet.d.ts +2 -2
  88. package/dist/routers/_app.d.ts +2203 -1957
  89. package/dist/routers/_app.d.ts.map +1 -1
  90. package/dist/routers/_app.js +4 -2
  91. package/dist/routers/_app.js.map +1 -1
  92. package/dist/routers/admin.d.ts +13 -13
  93. package/dist/routers/agenda.d.ts +18 -18
  94. package/dist/routers/announcement.d.ts +32 -32
  95. package/dist/routers/assignment.d.ts +335 -335
  96. package/dist/routers/attendance.d.ts +10 -10
  97. package/dist/routers/auth.d.ts +2 -2
  98. package/dist/routers/class.d.ts +147 -147
  99. package/dist/routers/comment.d.ts +22 -22
  100. package/dist/routers/conversation.d.ts +17 -17
  101. package/dist/routers/department.d.ts +34 -34
  102. package/dist/routers/discussion.d.ts +65 -53
  103. package/dist/routers/discussion.d.ts.map +1 -1
  104. package/dist/routers/discussion.js +6 -2
  105. package/dist/routers/discussion.js.map +1 -1
  106. package/dist/routers/embedding.d.ts +69 -0
  107. package/dist/routers/embedding.d.ts.map +1 -0
  108. package/dist/routers/embedding.js +143 -0
  109. package/dist/routers/embedding.js.map +1 -0
  110. package/dist/routers/event.d.ts +39 -39
  111. package/dist/routers/file.d.ts +12 -12
  112. package/dist/routers/folder.d.ts +38 -38
  113. package/dist/routers/labChat.d.ts +19 -19
  114. package/dist/routers/marketing.d.ts +2 -2
  115. package/dist/routers/message.d.ts +13 -13
  116. package/dist/routers/newtonChat.d.ts +4 -4
  117. package/dist/routers/notifications.d.ts +9 -9
  118. package/dist/routers/permissions.d.ts +14 -14
  119. package/dist/routers/school.d.ts +55 -55
  120. package/dist/routers/search.d.ts +22 -1
  121. package/dist/routers/search.d.ts.map +1 -1
  122. package/dist/routers/search.js +9 -3
  123. package/dist/routers/search.js.map +1 -1
  124. package/dist/routers/section.d.ts +4 -4
  125. package/dist/routers/studentProgress.d.ts +1 -1
  126. package/dist/routers/tag.d.ts +7 -7
  127. package/dist/routers/user.d.ts +10 -10
  128. package/dist/routers/worksheet.d.ts +95 -57
  129. package/dist/routers/worksheet.d.ts.map +1 -1
  130. package/dist/routers/worksheet.js +26 -2
  131. package/dist/routers/worksheet.js.map +1 -1
  132. package/dist/routes/aiStream.d.ts +2 -0
  133. package/dist/routes/aiStream.d.ts.map +1 -0
  134. package/dist/routes/aiStream.js +696 -0
  135. package/dist/routes/aiStream.js.map +1 -0
  136. package/dist/seedDatabase.d.ts +2 -2
  137. package/dist/seedDatabase.js +6 -6
  138. package/dist/seedDatabase.js.map +1 -1
  139. package/dist/services/adminInstitution.d.ts +8 -8
  140. package/dist/services/adminRunJob.d.ts +4 -4
  141. package/dist/services/agenda.d.ts +18 -18
  142. package/dist/services/aiChatStream.d.ts +68 -0
  143. package/dist/services/aiChatStream.d.ts.map +1 -0
  144. package/dist/services/aiChatStream.js +157 -0
  145. package/dist/services/aiChatStream.js.map +1 -0
  146. package/dist/services/aiModifierTools.d.ts +32 -0
  147. package/dist/services/aiModifierTools.d.ts.map +1 -0
  148. package/dist/services/aiModifierTools.js +165 -0
  149. package/dist/services/aiModifierTools.js.map +1 -0
  150. package/dist/services/aiProposalTools.d.ts +32 -0
  151. package/dist/services/aiProposalTools.d.ts.map +1 -0
  152. package/dist/services/aiProposalTools.js +207 -0
  153. package/dist/services/aiProposalTools.js.map +1 -0
  154. package/dist/services/aiStream.d.ts +22 -0
  155. package/dist/services/aiStream.d.ts.map +1 -0
  156. package/dist/services/aiStream.js +142 -0
  157. package/dist/services/aiStream.js.map +1 -0
  158. package/dist/services/aiTools.d.ts +16 -0
  159. package/dist/services/aiTools.d.ts.map +1 -0
  160. package/dist/services/aiTools.js +271 -0
  161. package/dist/services/aiTools.js.map +1 -0
  162. package/dist/services/announcement.d.ts +12 -12
  163. package/dist/services/announcement.d.ts.map +1 -1
  164. package/dist/services/announcement.js +7 -2
  165. package/dist/services/announcement.js.map +1 -1
  166. package/dist/services/assignment.d.ts +293 -293
  167. package/dist/services/assignment.d.ts.map +1 -1
  168. package/dist/services/assignment.js +28 -9
  169. package/dist/services/assignment.js.map +1 -1
  170. package/dist/services/attendance.d.ts +10 -10
  171. package/dist/services/auth.d.ts +2 -2
  172. package/dist/services/class.d.ts +138 -138
  173. package/dist/services/class.d.ts.map +1 -1
  174. package/dist/services/class.js +19 -3
  175. package/dist/services/class.js.map +1 -1
  176. package/dist/services/comment.d.ts +22 -22
  177. package/dist/services/conversation.d.ts +17 -17
  178. package/dist/services/department.d.ts +33 -33
  179. package/dist/services/discussion.d.ts +58 -58
  180. package/dist/services/discussion.d.ts.map +1 -1
  181. package/dist/services/discussion.js +8 -8
  182. package/dist/services/discussion.js.map +1 -1
  183. package/dist/services/discussionSummary.d.ts +21 -0
  184. package/dist/services/discussionSummary.d.ts.map +1 -0
  185. package/dist/services/discussionSummary.js +179 -0
  186. package/dist/services/discussionSummary.js.map +1 -0
  187. package/dist/services/embedding.d.ts +67 -0
  188. package/dist/services/embedding.d.ts.map +1 -0
  189. package/dist/services/embedding.js +226 -0
  190. package/dist/services/embedding.js.map +1 -0
  191. package/dist/services/event.d.ts +37 -37
  192. package/dist/services/file.d.ts +24 -24
  193. package/dist/services/folder.d.ts +36 -36
  194. package/dist/services/labChat.d.ts +19 -19
  195. package/dist/services/marketing.d.ts +2 -2
  196. package/dist/services/message.d.ts +11 -11
  197. package/dist/services/message.d.ts.map +1 -1
  198. package/dist/services/message.js +2 -2
  199. package/dist/services/message.js.map +1 -1
  200. package/dist/services/newtonChat.d.ts +4 -4
  201. package/dist/services/notification.d.ts +9 -9
  202. package/dist/services/notification.d.ts.map +1 -1
  203. package/dist/services/permissions.d.ts +14 -14
  204. package/dist/services/school.d.ts +50 -50
  205. package/dist/services/search.d.ts +12 -0
  206. package/dist/services/search.d.ts.map +1 -1
  207. package/dist/services/search.js +120 -2
  208. package/dist/services/search.js.map +1 -1
  209. package/dist/services/section.d.ts +3 -3
  210. package/dist/services/tag.d.ts +4 -4
  211. package/dist/services/user.d.ts +4 -4
  212. package/dist/services/user.d.ts.map +1 -1
  213. package/dist/services/user.js +10 -15
  214. package/dist/services/user.js.map +1 -1
  215. package/dist/services/worksheet.d.ts +60 -48
  216. package/dist/services/worksheet.d.ts.map +1 -1
  217. package/dist/services/worksheet.js +11 -4
  218. package/dist/services/worksheet.js.map +1 -1
  219. package/dist/utils/streamBroadcast.d.ts +11 -0
  220. package/dist/utils/streamBroadcast.d.ts.map +1 -0
  221. package/dist/utils/streamBroadcast.js +32 -0
  222. package/dist/utils/streamBroadcast.js.map +1 -0
  223. package/dist/workers/connection.d.ts +15 -0
  224. package/dist/workers/connection.d.ts.map +1 -1
  225. package/dist/workers/connection.js +20 -2
  226. package/dist/workers/connection.js.map +1 -1
  227. package/dist/workers/index.js +4 -2
  228. package/dist/workers/index.js.map +1 -1
  229. package/dist/workers/processors/createRunJobWorker.d.ts.map +1 -1
  230. package/dist/workers/processors/createRunJobWorker.js +31 -8
  231. package/dist/workers/processors/createRunJobWorker.js.map +1 -1
  232. package/dist/workers/processors/embedContent.d.ts +8 -0
  233. package/dist/workers/processors/embedContent.d.ts.map +1 -0
  234. package/dist/workers/processors/embedContent.js +76 -0
  235. package/dist/workers/processors/embedContent.js.map +1 -0
  236. package/dist/workers/queues.d.ts +6 -0
  237. package/dist/workers/queues.d.ts.map +1 -1
  238. package/dist/workers/queues.js +5 -3
  239. package/dist/workers/queues.js.map +1 -1
  240. package/package.json +5 -1
  241. package/prisma/migrations/20260609215135_init/migration.sql +1412 -0
  242. package/prisma/migrations/20260610130000_add_worksheet_tags/migration.sql +13 -0
  243. package/prisma/schema.prisma +38 -7
  244. package/src/index.ts +4 -0
  245. package/src/lib/config/cors.ts +32 -9
  246. package/src/lib/config/env.ts +6 -0
  247. package/src/lib/googleCloudStorage.ts +21 -0
  248. package/src/lib/prisma.ts +40 -1
  249. package/src/models/class.ts +3 -2
  250. package/src/models/worksheet.ts +5 -2
  251. package/src/pipelines/aiLabChat.ts +54 -79
  252. package/src/pipelines/aiLabChatContract.ts +69 -69
  253. package/src/pipelines/aiNewtonChat.ts +46 -43
  254. package/src/pipelines/labChatPrompt.ts +63 -88
  255. package/src/routers/_app.ts +2 -0
  256. package/src/routers/discussion.ts +7 -0
  257. package/src/routers/embedding.ts +159 -0
  258. package/src/routers/search.ts +10 -1
  259. package/src/routers/worksheet.ts +27 -0
  260. package/src/routes/aiStream.ts +789 -0
  261. package/src/seedDatabase.ts +4 -4
  262. package/src/services/aiChatStream.ts +219 -0
  263. package/src/services/aiModifierTools.ts +188 -0
  264. package/src/services/aiProposalTools.ts +272 -0
  265. package/src/services/aiStream.ts +175 -0
  266. package/src/services/aiTools.ts +290 -0
  267. package/src/services/announcement.ts +7 -0
  268. package/src/services/assignment.ts +28 -7
  269. package/src/services/class.ts +20 -1
  270. package/src/services/discussion.ts +9 -8
  271. package/src/services/discussionSummary.ts +226 -0
  272. package/src/services/embedding.ts +285 -0
  273. package/src/services/message.ts +2 -2
  274. package/src/services/search.ts +138 -0
  275. package/src/services/user.ts +9 -17
  276. package/src/services/worksheet.ts +9 -2
  277. package/src/utils/streamBroadcast.ts +48 -0
  278. package/src/workers/connection.ts +19 -0
  279. package/src/workers/index.ts +2 -0
  280. package/src/workers/processors/createRunJobWorker.ts +32 -6
  281. package/src/workers/processors/embedContent.ts +90 -0
  282. package/src/workers/queues.ts +5 -1
  283. package/tests/unit/pipelines/aiLabChatContract.test.ts +38 -21
  284. package/tests/unit/pipelines/labChatPrompt.test.ts +23 -36
  285. package/prisma/migrations/20250807062924_init/migration.sql +0 -436
  286. package/prisma/migrations/20250919063704_init2/migration.sql +0 -24
  287. package/prisma/migrations/20250920143543_add_profile_fields/migration.sql +0 -15
  288. package/prisma/migrations/20250922165147_add_chat_models/migration.sql +0 -68
  289. package/prisma/migrations/20250922165314_add_chat_roles/migration.sql +0 -5
  290. package/prisma/migrations/20250922171242_refactor_notification_system/migration.sql +0 -20
  291. package/prisma/migrations/20250922172208_add_mentions_system/migration.sql +0 -21
  292. package/prisma/migrations/20250925072732_add_lab_chat_system/migration.sql +0 -25
  293. package/prisma/migrations/20251020151505_add_upload_tracking_fields/migration.sql +0 -57
  294. package/prisma/migrations/20251109122857_annuoncements_comments/migration.sql +0 -30
  295. package/prisma/migrations/20251109135555_reactions_announcements_comments/migration.sql +0 -35
  296. package/prisma/migrations/20260410124000_add_submission_recommendation_state/migration.sql +0 -14
  297. package/prisma/migrations/20260415103500_add_session_type/migration.sql +0 -33
  298. package/prisma/migrations/20260415133000_add_ai_usage_logs/migration.sql +0 -19
  299. package/prisma/migrations/20260417083000_add_conversation_member_hidden_at/migration.sql +0 -2
  300. package/prisma/migrations/20260502230500_assignment_submission_comments/migration.sql +0 -60
  301. package/prisma/migrations/20260504071500_school_memberships/migration.sql +0 -81
  302. package/prisma/migrations/20260506162500_consolidate_run_job_and_unify_job_status/migration.sql +0 -166
  303. package/prisma/migrations/20260509220000_institution_overhaul/migration.sql +0 -184
  304. package/prisma/migrations/20260510170000_add_folder_permissions/migration.sql +0 -93
  305. package/prisma/migrations/20260510183000_add_discussions/migration.sql +0 -151
  306. /package/.github/workflows/{npm.yml → npm-publish.yml} +0 -0
@@ -41,66 +41,84 @@ export declare const commentSelect: {
41
41
  };
42
42
  };
43
43
  /** @returns Comment by ID with author and reactions. */
44
- export declare function findCommentById(id: string): import(".prisma/client").Prisma.Prisma__CommentClient<{
44
+ export declare function findCommentById(id: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
45
+ result: {
46
+ userProfile: {
47
+ profilePicture: () => {
48
+ needs: {
49
+ profilePicture: true;
50
+ };
51
+ compute(profile: {
52
+ profilePicture: string | null;
53
+ }): string | null;
54
+ };
55
+ profilePictureThumbnail: () => {
56
+ needs: {
57
+ profilePictureThumbnail: true;
58
+ };
59
+ compute(profile: {
60
+ profilePictureThumbnail: string | null;
61
+ }): string | null;
62
+ };
63
+ };
64
+ };
65
+ model: {};
66
+ query: {};
67
+ client: {};
68
+ }, {}>, "Comment", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
45
69
  id: string;
46
70
  createdAt: Date;
47
- assignmentId: string | null;
48
- submissionId: string | null;
49
- announcementId: string | null;
50
71
  reactions: {
51
72
  type: import(".prisma/client").$Enums.ReactionType;
52
73
  user: {
53
74
  id: string;
54
75
  username: string;
55
76
  profile: {
56
- displayName: string | null;
57
77
  profilePicture: string | null;
78
+ displayName: string | null;
58
79
  profilePictureThumbnail: string | null;
59
80
  } | null;
60
81
  };
61
82
  }[];
62
- modifiedAt: Date | null;
63
83
  content: string;
64
- parentCommentId: string | null;
84
+ assignmentId: string | null;
85
+ submissionId: string | null;
86
+ modifiedAt: Date | null;
87
+ announcementId: string | null;
65
88
  isPinned: boolean;
66
89
  author: {
67
90
  id: string;
68
91
  username: string;
69
92
  profile: {
70
- displayName: string | null;
71
93
  profilePicture: string | null;
94
+ displayName: string | null;
72
95
  profilePictureThumbnail: string | null;
73
96
  } | null;
74
97
  };
75
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
76
- datasources: {
77
- db: {
78
- url: string;
79
- };
80
- };
81
- }>;
98
+ parentCommentId: string | null;
99
+ } | null>;
82
100
  /** @returns Replies to a comment. */
83
- export declare function findRepliesByCommentId(commentId: string): import(".prisma/client").Prisma.PrismaPromise<({
101
+ export declare function findRepliesByCommentId(commentId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
84
102
  author: {
85
103
  id: string;
86
104
  username: string;
87
105
  profile: {
88
- displayName: string | null;
89
106
  profilePicture: string | null;
107
+ displayName: string | null;
90
108
  profilePictureThumbnail: string | null;
91
109
  } | null;
92
110
  };
93
111
  } & {
94
112
  id: string;
95
113
  createdAt: Date;
114
+ content: string;
96
115
  assignmentId: string | null;
97
116
  submissionId: string | null;
98
- announcementId: string | null;
99
117
  modifiedAt: Date | null;
100
- content: string;
118
+ announcementId: string | null;
101
119
  authorId: string;
102
- parentCommentId: string | null;
103
120
  isPinned: boolean;
121
+ parentCommentId: string | null;
104
122
  studentQuestionProgressId: string | null;
105
123
  })[]>;
106
124
  /** Create a comment (reply). */
@@ -112,116 +130,230 @@ export declare function createComment(data: {
112
130
  assignmentId?: string | null;
113
131
  submissionId?: string | null;
114
132
  studentQuestionProgressId?: string | null;
115
- }): import(".prisma/client").Prisma.Prisma__CommentClient<{
133
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
134
+ result: {
135
+ userProfile: {
136
+ profilePicture: () => {
137
+ needs: {
138
+ profilePicture: true;
139
+ };
140
+ compute(profile: {
141
+ profilePicture: string | null;
142
+ }): string | null;
143
+ };
144
+ profilePictureThumbnail: () => {
145
+ needs: {
146
+ profilePictureThumbnail: true;
147
+ };
148
+ compute(profile: {
149
+ profilePictureThumbnail: string | null;
150
+ }): string | null;
151
+ };
152
+ };
153
+ };
154
+ model: {};
155
+ query: {};
156
+ client: {};
157
+ }, {}>, "Comment", "create", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
116
158
  id: string;
117
159
  createdAt: Date;
160
+ content: string;
118
161
  assignmentId: string | null;
119
162
  submissionId: string | null;
120
- announcementId: string | null;
121
163
  modifiedAt: Date | null;
122
- content: string;
164
+ announcementId: string | null;
123
165
  authorId: string;
124
- parentCommentId: string | null;
125
166
  isPinned: boolean;
167
+ parentCommentId: string | null;
126
168
  studentQuestionProgressId: string | null;
127
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
128
- datasources: {
129
- db: {
130
- url: string;
131
- };
132
- };
133
169
  }>;
134
170
  /** @returns User's reaction on a comment. */
135
- export declare function findReactionByUserAndComment(userId: string, commentId: string): import(".prisma/client").Prisma.Prisma__ReactionClient<{
171
+ export declare function findReactionByUserAndComment(userId: string, commentId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
172
+ result: {
173
+ userProfile: {
174
+ profilePicture: () => {
175
+ needs: {
176
+ profilePicture: true;
177
+ };
178
+ compute(profile: {
179
+ profilePicture: string | null;
180
+ }): string | null;
181
+ };
182
+ profilePictureThumbnail: () => {
183
+ needs: {
184
+ profilePictureThumbnail: true;
185
+ };
186
+ compute(profile: {
187
+ profilePictureThumbnail: string | null;
188
+ }): string | null;
189
+ };
190
+ };
191
+ };
192
+ model: {};
193
+ query: {};
194
+ client: {};
195
+ }, {}>, "Reaction", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
136
196
  type: import(".prisma/client").$Enums.ReactionType;
137
197
  id: string;
138
- createdAt: Date;
139
198
  userId: string;
199
+ createdAt: Date;
140
200
  announcementId: string | null;
141
201
  discussionId: string | null;
142
202
  discussionReplyId: string | null;
143
203
  commentId: string | null;
144
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
145
- datasources: {
146
- db: {
147
- url: string;
148
- };
149
- };
150
- }>;
204
+ } | null>;
151
205
  /** Add or update reaction on a comment. */
152
206
  export declare function upsertReaction(data: {
153
207
  userId: string;
154
208
  commentId: string;
155
209
  type: string;
156
- }): import(".prisma/client").Prisma.Prisma__ReactionClient<{
210
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
211
+ result: {
212
+ userProfile: {
213
+ profilePicture: () => {
214
+ needs: {
215
+ profilePicture: true;
216
+ };
217
+ compute(profile: {
218
+ profilePicture: string | null;
219
+ }): string | null;
220
+ };
221
+ profilePictureThumbnail: () => {
222
+ needs: {
223
+ profilePictureThumbnail: true;
224
+ };
225
+ compute(profile: {
226
+ profilePictureThumbnail: string | null;
227
+ }): string | null;
228
+ };
229
+ };
230
+ };
231
+ model: {};
232
+ query: {};
233
+ client: {};
234
+ }, {}>, "Reaction", "upsert", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
157
235
  user: {
158
236
  id: string;
159
237
  username: string;
160
238
  profile: {
161
- displayName: string | null;
162
239
  profilePicture: string | null;
240
+ displayName: string | null;
163
241
  profilePictureThumbnail: string | null;
164
242
  } | null;
165
243
  };
166
244
  } & {
167
245
  type: import(".prisma/client").$Enums.ReactionType;
168
246
  id: string;
169
- createdAt: Date;
170
247
  userId: string;
248
+ createdAt: Date;
171
249
  announcementId: string | null;
172
250
  discussionId: string | null;
173
251
  discussionReplyId: string | null;
174
252
  commentId: string | null;
175
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
176
- datasources: {
177
- db: {
178
- url: string;
179
- };
180
- };
181
253
  }>;
182
254
  /** Delete a reaction. */
183
- export declare function deleteReactionById(id: string): import(".prisma/client").Prisma.Prisma__ReactionClient<{
255
+ export declare function deleteReactionById(id: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
256
+ result: {
257
+ userProfile: {
258
+ profilePicture: () => {
259
+ needs: {
260
+ profilePicture: true;
261
+ };
262
+ compute(profile: {
263
+ profilePicture: string | null;
264
+ }): string | null;
265
+ };
266
+ profilePictureThumbnail: () => {
267
+ needs: {
268
+ profilePictureThumbnail: true;
269
+ };
270
+ compute(profile: {
271
+ profilePictureThumbnail: string | null;
272
+ }): string | null;
273
+ };
274
+ };
275
+ };
276
+ model: {};
277
+ query: {};
278
+ client: {};
279
+ }, {}>, "Reaction", "delete", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
184
280
  type: import(".prisma/client").$Enums.ReactionType;
185
281
  id: string;
186
- createdAt: Date;
187
282
  userId: string;
283
+ createdAt: Date;
188
284
  announcementId: string | null;
189
285
  discussionId: string | null;
190
286
  discussionReplyId: string | null;
191
287
  commentId: string | null;
192
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
193
- datasources: {
194
- db: {
195
- url: string;
196
- };
197
- };
198
288
  }>;
199
289
  /** @returns Comment with announcement classId. */
200
- export declare function findCommentWithAnnouncement(commentId: string): import(".prisma/client").Prisma.Prisma__CommentClient<({
290
+ export declare function findCommentWithAnnouncement(commentId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
291
+ result: {
292
+ userProfile: {
293
+ profilePicture: () => {
294
+ needs: {
295
+ profilePicture: true;
296
+ };
297
+ compute(profile: {
298
+ profilePicture: string | null;
299
+ }): string | null;
300
+ };
301
+ profilePictureThumbnail: () => {
302
+ needs: {
303
+ profilePictureThumbnail: true;
304
+ };
305
+ compute(profile: {
306
+ profilePictureThumbnail: string | null;
307
+ }): string | null;
308
+ };
309
+ };
310
+ };
311
+ model: {};
312
+ query: {};
313
+ client: {};
314
+ }, {}>, "Comment", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<({
201
315
  announcement: {
202
316
  classId: string;
203
317
  } | null;
204
318
  } & {
205
319
  id: string;
206
320
  createdAt: Date;
321
+ content: string;
207
322
  assignmentId: string | null;
208
323
  submissionId: string | null;
209
- announcementId: string | null;
210
324
  modifiedAt: Date | null;
211
- content: string;
325
+ announcementId: string | null;
212
326
  authorId: string;
213
- parentCommentId: string | null;
214
327
  isPinned: boolean;
328
+ parentCommentId: string | null;
215
329
  studentQuestionProgressId: string | null;
216
- }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
217
- datasources: {
218
- db: {
219
- url: string;
330
+ }) | null>;
331
+ /** @returns Comment with the owning class context for authorization. */
332
+ export declare function findCommentWithContext(commentId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
333
+ result: {
334
+ userProfile: {
335
+ profilePicture: () => {
336
+ needs: {
337
+ profilePicture: true;
338
+ };
339
+ compute(profile: {
340
+ profilePicture: string | null;
341
+ }): string | null;
342
+ };
343
+ profilePictureThumbnail: () => {
344
+ needs: {
345
+ profilePictureThumbnail: true;
346
+ };
347
+ compute(profile: {
348
+ profilePictureThumbnail: string | null;
349
+ }): string | null;
350
+ };
220
351
  };
221
352
  };
222
- }>;
223
- /** @returns Comment with the owning class context for authorization. */
224
- export declare function findCommentWithContext(commentId: string): import(".prisma/client").Prisma.Prisma__CommentClient<({
353
+ model: {};
354
+ query: {};
355
+ client: {};
356
+ }, {}>, "Comment", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<({
225
357
  assignment: {
226
358
  class: {
227
359
  school: {
@@ -238,6 +370,22 @@ export declare function findCommentWithContext(commentId: string): import(".pris
238
370
  }[];
239
371
  };
240
372
  } | null;
373
+ announcement: {
374
+ class: {
375
+ school: {
376
+ memberships: {
377
+ userId: string;
378
+ }[];
379
+ } | null;
380
+ id: string;
381
+ teachers: {
382
+ id: string;
383
+ }[];
384
+ students: {
385
+ id: string;
386
+ }[];
387
+ };
388
+ } | null;
241
389
  submission: {
242
390
  assignment: {
243
391
  class: {
@@ -257,24 +405,7 @@ export declare function findCommentWithContext(commentId: string): import(".pris
257
405
  };
258
406
  studentId: string;
259
407
  } | null;
260
- announcement: {
261
- class: {
262
- school: {
263
- memberships: {
264
- userId: string;
265
- }[];
266
- } | null;
267
- id: string;
268
- teachers: {
269
- id: string;
270
- }[];
271
- students: {
272
- id: string;
273
- }[];
274
- };
275
- } | null;
276
408
  studentQuestionProgress: {
277
- studentId: string;
278
409
  studentWorksheetResponse: {
279
410
  submission: {
280
411
  assignment: {
@@ -296,6 +427,7 @@ export declare function findCommentWithContext(commentId: string): import(".pris
296
427
  studentId: string;
297
428
  } | null;
298
429
  } | null;
430
+ studentId: string;
299
431
  } | null;
300
432
  parentComment: ({
301
433
  assignment: {
@@ -314,6 +446,22 @@ export declare function findCommentWithContext(commentId: string): import(".pris
314
446
  }[];
315
447
  };
316
448
  } | null;
449
+ announcement: {
450
+ class: {
451
+ school: {
452
+ memberships: {
453
+ userId: string;
454
+ }[];
455
+ } | null;
456
+ id: string;
457
+ teachers: {
458
+ id: string;
459
+ }[];
460
+ students: {
461
+ id: string;
462
+ }[];
463
+ };
464
+ } | null;
317
465
  submission: {
318
466
  assignment: {
319
467
  class: {
@@ -333,24 +481,7 @@ export declare function findCommentWithContext(commentId: string): import(".pris
333
481
  };
334
482
  studentId: string;
335
483
  } | null;
336
- announcement: {
337
- class: {
338
- school: {
339
- memberships: {
340
- userId: string;
341
- }[];
342
- } | null;
343
- id: string;
344
- teachers: {
345
- id: string;
346
- }[];
347
- students: {
348
- id: string;
349
- }[];
350
- };
351
- } | null;
352
484
  studentQuestionProgress: {
353
- studentId: string;
354
485
  studentWorksheetResponse: {
355
486
  submission: {
356
487
  assignment: {
@@ -372,41 +503,60 @@ export declare function findCommentWithContext(commentId: string): import(".pris
372
503
  studentId: string;
373
504
  } | null;
374
505
  } | null;
506
+ studentId: string;
375
507
  } | null;
376
508
  } & {
377
509
  id: string;
378
510
  createdAt: Date;
511
+ content: string;
379
512
  assignmentId: string | null;
380
513
  submissionId: string | null;
381
- announcementId: string | null;
382
514
  modifiedAt: Date | null;
383
- content: string;
515
+ announcementId: string | null;
384
516
  authorId: string;
385
- parentCommentId: string | null;
386
517
  isPinned: boolean;
518
+ parentCommentId: string | null;
387
519
  studentQuestionProgressId: string | null;
388
520
  }) | null;
389
521
  } & {
390
522
  id: string;
391
523
  createdAt: Date;
524
+ content: string;
392
525
  assignmentId: string | null;
393
526
  submissionId: string | null;
394
- announcementId: string | null;
395
527
  modifiedAt: Date | null;
396
- content: string;
528
+ announcementId: string | null;
397
529
  authorId: string;
398
- parentCommentId: string | null;
399
530
  isPinned: boolean;
531
+ parentCommentId: string | null;
400
532
  studentQuestionProgressId: string | null;
401
- }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
402
- datasources: {
403
- db: {
404
- url: string;
533
+ }) | null>;
534
+ /** @returns Reaction counts by type for a comment. */
535
+ export declare function getReactionCountsByCommentId(commentId: string): import("@prisma/client/runtime/library.js").PrismaPromise<(import("@prisma/client/runtime/library.js").GetAggregateResult<import(".prisma/client").Prisma.$ReactionPayload<import("@prisma/client/runtime/library.js").InternalArgs & {
536
+ result: {
537
+ userProfile: {
538
+ profilePicture: () => {
539
+ needs: {
540
+ profilePicture: true;
541
+ };
542
+ compute(profile: {
543
+ profilePicture: string | null;
544
+ }): string | null;
545
+ };
546
+ profilePictureThumbnail: () => {
547
+ needs: {
548
+ profilePictureThumbnail: true;
549
+ };
550
+ compute(profile: {
551
+ profilePictureThumbnail: string | null;
552
+ }): string | null;
553
+ };
405
554
  };
406
555
  };
407
- }>;
408
- /** @returns Reaction counts by type for a comment. */
409
- export declare function getReactionCountsByCommentId(commentId: string): import(".prisma/client").Prisma.GetReactionGroupByPayload<{
556
+ model: {};
557
+ query: {};
558
+ client: {};
559
+ }>, {
410
560
  by: "type"[];
411
561
  where: {
412
562
  commentId: string;
@@ -414,5 +564,7 @@ export declare function getReactionCountsByCommentId(commentId: string): import(
414
564
  _count: {
415
565
  type: true;
416
566
  };
417
- }>;
567
+ }> & {
568
+ type: import(".prisma/client").$Enums.ReactionType;
569
+ })[]>;
418
570
  //# sourceMappingURL=comment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"comment.d.ts","sourceRoot":"/","sources":["models/comment.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyChB,CAAC;AAmBX,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKzC;AAED,qCAA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