@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
@@ -4,33 +4,22 @@
4
4
  */
5
5
  import { Class, Folder } from "@prisma/client";
6
6
  /** @returns Classes where user is a teacher. */
7
- export declare function findTeacherClasses(userId: string): import(".prisma/client").Prisma.PrismaPromise<({
7
+ export declare function findTeacherClasses(userId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
8
8
  school: {
9
- name: string;
10
9
  id: string;
10
+ name: string;
11
11
  } | null;
12
12
  department: {
13
- name: string;
14
13
  id: string;
14
+ name: string;
15
15
  color: string | null;
16
16
  } | null;
17
- assignments: {
18
- type: import(".prisma/client").$Enums.AssignmentType;
19
- id: string;
20
- submissions: {
21
- studentId: string;
22
- submitted: boolean | null;
23
- returned: boolean | null;
24
- }[];
25
- title: string;
26
- dueDate: Date;
27
- }[];
28
17
  teachers: {
29
18
  id: string;
30
19
  username: string;
31
20
  profile: {
32
- displayName: string | null;
33
21
  profilePicture: string | null;
22
+ displayName: string | null;
34
23
  profilePictureThumbnail: string | null;
35
24
  } | null;
36
25
  }[];
@@ -38,18 +27,29 @@ export declare function findTeacherClasses(userId: string): import(".prisma/clie
38
27
  id: string;
39
28
  username: string;
40
29
  profile: {
41
- displayName: string | null;
42
30
  profilePicture: string | null;
31
+ displayName: string | null;
43
32
  profilePictureThumbnail: string | null;
44
33
  } | null;
45
34
  }[];
35
+ assignments: {
36
+ type: import(".prisma/client").$Enums.AssignmentType;
37
+ id: string;
38
+ submissions: {
39
+ studentId: string;
40
+ submitted: boolean | null;
41
+ returned: boolean | null;
42
+ }[];
43
+ title: string;
44
+ dueDate: Date;
45
+ }[];
46
46
  } & {
47
- name: string;
47
+ section: string;
48
48
  id: string;
49
+ name: string;
49
50
  schoolId: string | null;
50
- subject: string;
51
51
  color: string | null;
52
- section: string;
52
+ subject: string;
53
53
  syllabus: string | null;
54
54
  departmentId: string | null;
55
55
  discussionsEnabled: boolean;
@@ -57,33 +57,22 @@ export declare function findTeacherClasses(userId: string): import(".prisma/clie
57
57
  studentsCanReply: boolean;
58
58
  })[]>;
59
59
  /** @returns Classes where user is a student. */
60
- export declare function findStudentClasses(userId: string): import(".prisma/client").Prisma.PrismaPromise<({
60
+ export declare function findStudentClasses(userId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
61
61
  school: {
62
- name: string;
63
62
  id: string;
63
+ name: string;
64
64
  } | null;
65
65
  department: {
66
- name: string;
67
66
  id: string;
67
+ name: string;
68
68
  color: string | null;
69
69
  } | null;
70
- assignments: {
71
- type: import(".prisma/client").$Enums.AssignmentType;
72
- id: string;
73
- submissions: {
74
- studentId: string;
75
- submitted: boolean | null;
76
- returned: boolean | null;
77
- }[];
78
- title: string;
79
- dueDate: Date;
80
- }[];
81
70
  teachers: {
82
71
  id: string;
83
72
  username: string;
84
73
  profile: {
85
- displayName: string | null;
86
74
  profilePicture: string | null;
75
+ displayName: string | null;
87
76
  profilePictureThumbnail: string | null;
88
77
  } | null;
89
78
  }[];
@@ -91,18 +80,29 @@ export declare function findStudentClasses(userId: string): import(".prisma/clie
91
80
  id: string;
92
81
  username: string;
93
82
  profile: {
94
- displayName: string | null;
95
83
  profilePicture: string | null;
84
+ displayName: string | null;
96
85
  profilePictureThumbnail: string | null;
97
86
  } | null;
98
87
  }[];
88
+ assignments: {
89
+ type: import(".prisma/client").$Enums.AssignmentType;
90
+ id: string;
91
+ submissions: {
92
+ studentId: string;
93
+ submitted: boolean | null;
94
+ returned: boolean | null;
95
+ }[];
96
+ title: string;
97
+ dueDate: Date;
98
+ }[];
99
99
  } & {
100
- name: string;
100
+ section: string;
101
101
  id: string;
102
+ name: string;
102
103
  schoolId: string | null;
103
- subject: string;
104
104
  color: string | null;
105
- section: string;
105
+ subject: string;
106
106
  syllabus: string | null;
107
107
  departmentId: string | null;
108
108
  discussionsEnabled: boolean;
@@ -110,38 +110,106 @@ export declare function findStudentClasses(userId: string): import(".prisma/clie
110
110
  studentsCanReply: boolean;
111
111
  })[]>;
112
112
  /** @returns Class if user is a teacher or school admin. */
113
- export declare function isTeacherInClass(classId: string, userId: string): import(".prisma/client").Prisma.Prisma__ClassClient<{
114
- name: string;
113
+ export declare function isTeacherInClass(classId: string, userId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
114
+ result: {
115
+ userProfile: {
116
+ profilePicture: () => {
117
+ needs: {
118
+ profilePicture: true;
119
+ };
120
+ compute(profile: {
121
+ profilePicture: string | null;
122
+ }): string | null;
123
+ };
124
+ profilePictureThumbnail: () => {
125
+ needs: {
126
+ profilePictureThumbnail: true;
127
+ };
128
+ compute(profile: {
129
+ profilePictureThumbnail: string | null;
130
+ }): string | null;
131
+ };
132
+ };
133
+ };
134
+ model: {};
135
+ query: {};
136
+ client: {};
137
+ }, {}>, "Class", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
138
+ section: string;
115
139
  id: string;
140
+ name: string;
116
141
  schoolId: string | null;
117
- subject: string;
118
142
  color: string | null;
119
- section: string;
143
+ subject: string;
120
144
  syllabus: string | null;
121
145
  departmentId: string | null;
122
146
  discussionsEnabled: boolean;
123
147
  studentsCanCreateDiscussions: boolean;
124
148
  studentsCanReply: boolean;
125
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
126
- datasources: {
127
- db: {
128
- url: string;
129
- };
130
- };
131
- }>;
149
+ } | null>;
132
150
  /** @returns Class with assignments. Students see only assigned; teachers see all. */
133
151
  export declare function findClassWithAssignments(classId: string, options: {
134
152
  isTeacher: boolean;
135
153
  userId?: string;
136
- }): import(".prisma/client").Prisma.Prisma__ClassClient<({
154
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
155
+ result: {
156
+ userProfile: {
157
+ profilePicture: () => {
158
+ needs: {
159
+ profilePicture: true;
160
+ };
161
+ compute(profile: {
162
+ profilePicture: string | null;
163
+ }): string | null;
164
+ };
165
+ profilePictureThumbnail: () => {
166
+ needs: {
167
+ profilePictureThumbnail: true;
168
+ };
169
+ compute(profile: {
170
+ profilePictureThumbnail: string | null;
171
+ }): string | null;
172
+ };
173
+ };
174
+ };
175
+ model: {};
176
+ query: {};
177
+ client: {};
178
+ }, {}>, "Class", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<({
179
+ teachers: {
180
+ id: string;
181
+ username: string;
182
+ profile: {
183
+ profilePicture: string | null;
184
+ displayName: string | null;
185
+ profilePictureThumbnail: string | null;
186
+ } | null;
187
+ }[];
188
+ students: {
189
+ id: string;
190
+ username: string;
191
+ profile: {
192
+ profilePicture: string | null;
193
+ displayName: string | null;
194
+ profilePictureThumbnail: string | null;
195
+ } | null;
196
+ }[];
137
197
  assignments: {
138
198
  type: import(".prisma/client").$Enums.AssignmentType;
139
- id: string;
140
- createdAt: Date | null;
199
+ markScheme: {
200
+ id: string;
201
+ structured: string;
202
+ } | null;
203
+ gradingBoundary: {
204
+ id: string;
205
+ structured: string;
206
+ } | null;
141
207
  section: {
142
- name: string;
143
208
  id: string;
209
+ name: string;
144
210
  } | null;
211
+ id: string;
212
+ createdAt: Date | null;
145
213
  submissions: {
146
214
  id: string;
147
215
  studentId: string;
@@ -153,146 +221,192 @@ export declare function findClassWithAssignments(classId: string, options: {
153
221
  returned: boolean | null;
154
222
  }[];
155
223
  title: string;
156
- instructions: string;
157
224
  dueDate: Date;
158
- graded: boolean;
159
225
  maxGrade: number | null;
226
+ instructions: string;
227
+ graded: boolean;
160
228
  weight: number;
161
229
  inProgress: boolean;
162
230
  order: number | null;
163
- markScheme: {
164
- id: string;
165
- structured: string;
166
- } | null;
167
- gradingBoundary: {
168
- id: string;
169
- structured: string;
170
- } | null;
171
231
  }[];
172
232
  announcements: {
173
233
  id: string;
174
234
  createdAt: Date;
175
- modifiedAt: Date | null;
176
235
  remarks: string;
236
+ modifiedAt: Date | null;
177
237
  teacher: {
178
238
  id: string;
179
239
  username: string;
180
240
  profile: {
181
- displayName: string | null;
182
241
  profilePicture: string | null;
242
+ displayName: string | null;
183
243
  profilePictureThumbnail: string | null;
184
244
  } | null;
185
245
  };
186
246
  }[];
187
- teachers: {
188
- id: string;
189
- username: string;
190
- profile: {
191
- displayName: string | null;
192
- profilePicture: string | null;
193
- profilePictureThumbnail: string | null;
194
- } | null;
195
- }[];
196
- students: {
197
- id: string;
198
- username: string;
199
- profile: {
200
- displayName: string | null;
201
- profilePicture: string | null;
202
- profilePictureThumbnail: string | null;
203
- } | null;
204
- }[];
205
247
  } & {
206
- name: string;
248
+ section: string;
207
249
  id: string;
250
+ name: string;
208
251
  schoolId: string | null;
209
- subject: string;
210
252
  color: string | null;
211
- section: string;
253
+ subject: string;
212
254
  syllabus: string | null;
213
255
  departmentId: string | null;
214
256
  discussionsEnabled: boolean;
215
257
  studentsCanCreateDiscussions: boolean;
216
258
  studentsCanReply: boolean;
217
- }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
218
- datasources: {
219
- db: {
220
- url: string;
259
+ }) | null>;
260
+ /** @returns Class by ID (minimal). */
261
+ export declare function findClassByIdBasic(classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
262
+ result: {
263
+ userProfile: {
264
+ profilePicture: () => {
265
+ needs: {
266
+ profilePicture: true;
267
+ };
268
+ compute(profile: {
269
+ profilePicture: string | null;
270
+ }): string | null;
271
+ };
272
+ profilePictureThumbnail: () => {
273
+ needs: {
274
+ profilePictureThumbnail: true;
275
+ };
276
+ compute(profile: {
277
+ profilePictureThumbnail: string | null;
278
+ }): string | null;
279
+ };
221
280
  };
222
281
  };
223
- }>;
224
- /** @returns Class by ID (minimal). */
225
- export declare function findClassByIdBasic(classId: string): import(".prisma/client").Prisma.Prisma__ClassClient<{
226
- name: string;
282
+ model: {};
283
+ query: {};
284
+ client: {};
285
+ }, {}>, "Class", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
286
+ section: string;
227
287
  id: string;
288
+ name: string;
228
289
  schoolId: string | null;
229
- subject: string;
230
290
  color: string | null;
231
- section: string;
291
+ subject: string;
232
292
  syllabus: string | null;
233
293
  departmentId: string | null;
234
294
  discussionsEnabled: boolean;
235
295
  studentsCanCreateDiscussions: boolean;
236
296
  studentsCanReply: boolean;
237
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
238
- datasources: {
239
- db: {
240
- url: string;
241
- };
242
- };
243
- }>;
297
+ } | null>;
244
298
  /** @returns Sections for a class. */
245
- export declare function findSectionsByClassId(classId: string): import(".prisma/client").Prisma.PrismaPromise<{
246
- name: string;
299
+ export declare function findSectionsByClassId(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
247
300
  id: string;
301
+ name: string;
248
302
  color: string | null;
249
303
  classId: string;
250
304
  order: number | null;
251
305
  }[]>;
252
306
  /** @returns User by ID (id, username only). */
253
- export declare function findUserById(userId: string): import(".prisma/client").Prisma.Prisma__UserClient<{
307
+ export declare function findUserById(userId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
308
+ result: {
309
+ userProfile: {
310
+ profilePicture: () => {
311
+ needs: {
312
+ profilePicture: true;
313
+ };
314
+ compute(profile: {
315
+ profilePicture: string | null;
316
+ }): string | null;
317
+ };
318
+ profilePictureThumbnail: () => {
319
+ needs: {
320
+ profilePictureThumbnail: true;
321
+ };
322
+ compute(profile: {
323
+ profilePictureThumbnail: string | null;
324
+ }): string | null;
325
+ };
326
+ };
327
+ };
328
+ model: {};
329
+ query: {};
330
+ client: {};
331
+ }, {}>, "User", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
254
332
  id: string;
255
333
  username: string;
256
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
257
- datasources: {
258
- db: {
259
- url: string;
334
+ } | null>;
335
+ /** @returns Session by class invite code. */
336
+ export declare function findSessionByClassCode(classCode: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
337
+ result: {
338
+ userProfile: {
339
+ profilePicture: () => {
340
+ needs: {
341
+ profilePicture: true;
342
+ };
343
+ compute(profile: {
344
+ profilePicture: string | null;
345
+ }): string | null;
346
+ };
347
+ profilePictureThumbnail: () => {
348
+ needs: {
349
+ profilePictureThumbnail: true;
350
+ };
351
+ compute(profile: {
352
+ profilePictureThumbnail: string | null;
353
+ }): string | null;
354
+ };
260
355
  };
261
356
  };
262
- }>;
263
- /** @returns Session by class invite code. */
264
- export declare function findSessionByClassCode(classCode: string): import(".prisma/client").Prisma.Prisma__SessionClient<{
357
+ model: {};
358
+ query: {};
359
+ client: {};
360
+ }, {}>, "Session", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
265
361
  type: import(".prisma/client").$Enums.SessionType;
266
362
  id: string;
267
- createdAt: Date | null;
268
363
  userId: string | null;
269
- expiresAt: Date | null;
364
+ createdAt: Date | null;
270
365
  classId: string | null;
271
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
272
- datasources: {
273
- db: {
274
- url: string;
366
+ expiresAt: Date | null;
367
+ } | null>;
368
+ /** @returns Session for a class. */
369
+ export declare function findSessionByClassId(classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
370
+ result: {
371
+ userProfile: {
372
+ profilePicture: () => {
373
+ needs: {
374
+ profilePicture: true;
375
+ };
376
+ compute(profile: {
377
+ profilePicture: string | null;
378
+ }): string | null;
379
+ };
380
+ profilePictureThumbnail: () => {
381
+ needs: {
382
+ profilePictureThumbnail: true;
383
+ };
384
+ compute(profile: {
385
+ profilePictureThumbnail: string | null;
386
+ }): string | null;
387
+ };
275
388
  };
276
389
  };
277
- }>;
278
- /** @returns Session for a class. */
279
- export declare function findSessionByClassId(classId: string): import(".prisma/client").Prisma.Prisma__SessionClient<{
390
+ model: {};
391
+ query: {};
392
+ client: {};
393
+ }, {}>, "Session", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
280
394
  type: import(".prisma/client").$Enums.SessionType;
281
395
  id: string;
282
- createdAt: Date | null;
283
396
  userId: string | null;
284
- expiresAt: Date | null;
397
+ createdAt: Date | null;
285
398
  classId: string | null;
286
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
287
- datasources: {
288
- db: {
289
- url: string;
290
- };
291
- };
292
- }>;
399
+ expiresAt: Date | null;
400
+ } | null>;
293
401
  /** @returns User's graded submissions for grade calculation. */
294
- export declare function findSubmissionsForGrades(userId: string, classId: string): import(".prisma/client").Prisma.PrismaPromise<({
402
+ export declare function findSubmissionsForGrades(userId: string, classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
295
403
  assignment: {
404
+ markScheme: {
405
+ structured: string;
406
+ } | null;
407
+ gradingBoundary: {
408
+ structured: string;
409
+ } | null;
296
410
  id: string;
297
411
  title: string;
298
412
  dueDate: Date;
@@ -300,12 +414,6 @@ export declare function findSubmissionsForGrades(userId: string, classId: string
300
414
  weight: number;
301
415
  markSchemeId: string | null;
302
416
  gradingBoundaryId: string | null;
303
- markScheme: {
304
- structured: string;
305
- } | null;
306
- gradingBoundary: {
307
- structured: string;
308
- } | null;
309
417
  };
310
418
  } & {
311
419
  id: string;
@@ -325,47 +433,67 @@ export declare function findSubmissionsForGrades(userId: string, classId: string
325
433
  returned: boolean | null;
326
434
  })[]>;
327
435
  /** @returns Events for a class. */
328
- export declare function findEventsByClassId(classId: string): import(".prisma/client").Prisma.PrismaPromise<{
436
+ export declare function findEventsByClassId(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
329
437
  name: string | null;
330
438
  startTime: Date;
331
439
  endTime: Date;
332
440
  }[]>;
333
441
  /** @returns Mark schemes for a class. */
334
- export declare function findMarkSchemesByClassId(classId: string): import(".prisma/client").Prisma.PrismaPromise<{
335
- name: string | null;
442
+ export declare function findMarkSchemesByClassId(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
336
443
  id: string;
337
- departmentId: string | null;
444
+ name: string | null;
338
445
  classId: string | null;
446
+ departmentId: string | null;
339
447
  structured: string;
340
448
  }[]>;
341
449
  /** @returns Grading boundaries for a class. */
342
- export declare function findGradingBoundariesByClassId(classId: string): import(".prisma/client").Prisma.PrismaPromise<{
343
- name: string | null;
450
+ export declare function findGradingBoundariesByClassId(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
344
451
  id: string;
345
- departmentId: string | null;
452
+ name: string | null;
346
453
  classId: string | null;
454
+ departmentId: string | null;
347
455
  structured: string;
348
456
  }[]>;
349
457
  /** @returns Class syllabus. */
350
- export declare function findClassSyllabus(classId: string): import(".prisma/client").Prisma.Prisma__ClassClient<{
351
- syllabus: string | null;
352
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
353
- datasources: {
354
- db: {
355
- url: string;
458
+ export declare function findClassSyllabus(classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
459
+ result: {
460
+ userProfile: {
461
+ profilePicture: () => {
462
+ needs: {
463
+ profilePicture: true;
464
+ };
465
+ compute(profile: {
466
+ profilePicture: string | null;
467
+ }): string | null;
468
+ };
469
+ profilePictureThumbnail: () => {
470
+ needs: {
471
+ profilePictureThumbnail: true;
472
+ };
473
+ compute(profile: {
474
+ profilePictureThumbnail: string | null;
475
+ }): string | null;
476
+ };
356
477
  };
357
478
  };
358
- }>;
479
+ model: {};
480
+ query: {};
481
+ client: {};
482
+ }, {}>, "Class", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
483
+ syllabus: string | null;
484
+ } | null>;
359
485
  /** @returns In-progress lab drafts for a teacher. */
360
- export declare function findLabDraftsByClass(classId: string, teacherId: string): import(".prisma/client").Prisma.PrismaPromise<{
486
+ export declare function findLabDraftsByClass(classId: string, teacherId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
361
487
  type: import(".prisma/client").$Enums.AssignmentType;
362
488
  id: string;
363
489
  createdAt: Date | null;
364
490
  classId: string;
365
- modifiedAt: Date | null;
366
491
  title: string;
367
- instructions: string;
368
492
  dueDate: Date;
493
+ maxGrade: number | null;
494
+ eventId: string | null;
495
+ instructions: string;
496
+ modifiedAt: Date | null;
369
497
  teacherId: string;
370
498
  acceptFiles: boolean;
371
499
  acceptExtendedResponse: boolean;
@@ -374,48 +502,46 @@ export declare function findLabDraftsByClass(classId: string, teacherId: string)
374
502
  aiPolicyLevel: number;
375
503
  sectionId: string | null;
376
504
  graded: boolean;
377
- maxGrade: number | null;
378
505
  weight: number;
379
506
  inProgress: boolean;
380
507
  template: boolean;
381
- eventId: string | null;
382
508
  markSchemeId: string | null;
383
509
  order: number | null;
384
510
  gradingBoundaryId: string | null;
385
511
  }[]>;
386
512
  /** @returns Assignments with attachments and submissions. */
387
- export declare function findAssignmentsWithFiles(classId: string): import(".prisma/client").Prisma.PrismaPromise<({
513
+ export declare function findAssignmentsWithFiles(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
388
514
  submissions: ({
389
- annotations: {
515
+ attachments: {
390
516
  path: string;
391
517
  type: string;
392
- name: string;
393
- id: string;
394
518
  user: {
395
519
  id: string;
396
520
  username: string;
397
521
  } | null;
522
+ id: string;
523
+ name: string;
398
524
  size: number | null;
399
525
  uploadedAt: Date | null;
400
526
  thumbnailId: string | null;
401
527
  }[];
402
- attachments: {
528
+ student: {
529
+ id: string;
530
+ username: string;
531
+ };
532
+ annotations: {
403
533
  path: string;
404
534
  type: string;
405
- name: string;
406
- id: string;
407
535
  user: {
408
536
  id: string;
409
537
  username: string;
410
538
  } | null;
539
+ id: string;
540
+ name: string;
411
541
  size: number | null;
412
542
  uploadedAt: Date | null;
413
543
  thumbnailId: string | null;
414
544
  }[];
415
- student: {
416
- id: string;
417
- username: string;
418
- };
419
545
  } & {
420
546
  id: string;
421
547
  createdAt: Date;
@@ -440,12 +566,12 @@ export declare function findAssignmentsWithFiles(classId: string): import(".pris
440
566
  attachments: {
441
567
  path: string;
442
568
  type: string;
443
- name: string;
444
- id: string;
445
569
  user: {
446
570
  id: string;
447
571
  username: string;
448
572
  } | null;
573
+ id: string;
574
+ name: string;
449
575
  size: number | null;
450
576
  uploadedAt: Date | null;
451
577
  thumbnailId: string | null;
@@ -455,10 +581,12 @@ export declare function findAssignmentsWithFiles(classId: string): import(".pris
455
581
  id: string;
456
582
  createdAt: Date | null;
457
583
  classId: string;
458
- modifiedAt: Date | null;
459
584
  title: string;
460
- instructions: string;
461
585
  dueDate: Date;
586
+ maxGrade: number | null;
587
+ eventId: string | null;
588
+ instructions: string;
589
+ modifiedAt: Date | null;
462
590
  teacherId: string;
463
591
  acceptFiles: boolean;
464
592
  acceptExtendedResponse: boolean;
@@ -467,11 +595,9 @@ export declare function findAssignmentsWithFiles(classId: string): import(".pris
467
595
  aiPolicyLevel: number;
468
596
  sectionId: string | null;
469
597
  graded: boolean;
470
- maxGrade: number | null;
471
598
  weight: number;
472
599
  inProgress: boolean;
473
600
  template: boolean;
474
- eventId: string | null;
475
601
  markSchemeId: string | null;
476
602
  order: number | null;
477
603
  gradingBoundaryId: string | null;
@@ -480,16 +606,29 @@ export declare function findFullExportableClass(classId: string): Promise<{
480
606
  classFiles: any;
481
607
  assignments: {
482
608
  type: import(".prisma/client").$Enums.AssignmentType;
483
- id: string;
484
- createdAt: Date | null;
609
+ markScheme: {
610
+ id: string;
611
+ structured: string;
612
+ } | null;
613
+ gradingBoundary: {
614
+ id: string;
615
+ structured: string;
616
+ } | null;
485
617
  section: {
486
- name: string;
487
618
  id: string;
619
+ name: string;
488
620
  } | null;
621
+ id: string;
622
+ createdAt: Date | null;
489
623
  classId: string;
624
+ worksheets: {
625
+ id: string;
626
+ }[];
490
627
  title: string;
491
- instructions: string;
492
628
  dueDate: Date;
629
+ maxGrade: number | null;
630
+ eventId: string | null;
631
+ instructions: string;
493
632
  teacherId: string;
494
633
  acceptFiles: boolean;
495
634
  acceptExtendedResponse: boolean;
@@ -498,45 +637,32 @@ export declare function findFullExportableClass(classId: string): Promise<{
498
637
  aiPolicyLevel: number;
499
638
  sectionId: string | null;
500
639
  graded: boolean;
501
- maxGrade: number | null;
502
640
  weight: number;
503
641
  inProgress: boolean;
504
- eventId: string | null;
505
642
  markSchemeId: string | null;
506
643
  order: number | null;
507
644
  gradingBoundaryId: string | null;
508
- markScheme: {
509
- id: string;
510
- structured: string;
511
- } | null;
512
- gradingBoundary: {
513
- id: string;
514
- structured: string;
515
- } | null;
516
- worksheets: {
517
- id: string;
518
- }[];
519
645
  }[];
520
646
  sections: {
521
- name: string;
522
647
  id: string;
648
+ name: string;
523
649
  color: string | null;
524
650
  classId: string;
525
651
  order: number | null;
526
652
  }[];
527
653
  worksheets: {
528
- name: string;
529
654
  id: string;
655
+ name: string;
530
656
  classId: string;
531
657
  questions: {
532
658
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
533
659
  options: import("@prisma/client/runtime/library.js").JsonValue;
660
+ markScheme: import("@prisma/client/runtime/library.js").JsonValue;
534
661
  order: number | null;
535
- points: number;
536
662
  worksheetId: string;
537
- markScheme: import("@prisma/client/runtime/library.js").JsonValue;
538
663
  question: string;
539
664
  answer: string;
665
+ points: number;
540
666
  }[];
541
667
  }[];
542
668
  markSchemes: {
@@ -549,12 +675,12 @@ export declare function findFullExportableClass(classId: string): Promise<{
549
675
  classId: string | null;
550
676
  structured: string;
551
677
  }[];
552
- name: string;
678
+ section: string;
553
679
  id: string;
680
+ name: string;
554
681
  schoolId: string | null;
555
- subject: string;
556
682
  color: string | null;
557
- section: string;
683
+ subject: string;
558
684
  syllabus: string | null;
559
685
  departmentId: string | null;
560
686
  discussionsEnabled: boolean;