@studious-lms/server 1.12.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 (338) 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 -188
  32. package/dist/models/class.d.ts.map +1 -1
  33. package/dist/models/class.js +9 -3
  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 +269 -110
  38. package/dist/models/comment.d.ts.map +1 -1
  39. package/dist/models/comment.js +3 -2
  40. package/dist/models/comment.js.map +1 -1
  41. package/dist/models/conversation.d.ts +206 -63
  42. package/dist/models/conversation.d.ts.map +1 -1
  43. package/dist/models/conversation.js +13 -2
  44. package/dist/models/conversation.js.map +1 -1
  45. package/dist/models/department.d.ts +196 -70
  46. package/dist/models/department.d.ts.map +1 -1
  47. package/dist/models/event.d.ts +287 -125
  48. package/dist/models/event.d.ts.map +1 -1
  49. package/dist/models/file.d.ts +389 -263
  50. package/dist/models/file.d.ts.map +1 -1
  51. package/dist/models/folder.d.ts +433 -181
  52. package/dist/models/folder.d.ts.map +1 -1
  53. package/dist/models/labChat.d.ts +209 -83
  54. package/dist/models/labChat.d.ts.map +1 -1
  55. package/dist/models/marketing.d.ts +80 -26
  56. package/dist/models/marketing.d.ts.map +1 -1
  57. package/dist/models/message.d.ts +95 -41
  58. package/dist/models/message.d.ts.map +1 -1
  59. package/dist/models/newtonChat.d.ts +83 -29
  60. package/dist/models/newtonChat.d.ts.map +1 -1
  61. package/dist/models/notification.d.ts +61 -25
  62. package/dist/models/notification.d.ts.map +1 -1
  63. package/dist/models/school.d.ts +349 -133
  64. package/dist/models/school.d.ts.map +1 -1
  65. package/dist/models/section.d.ts +216 -72
  66. package/dist/models/section.d.ts.map +1 -1
  67. package/dist/models/tag.d.ts +156 -48
  68. package/dist/models/tag.d.ts.map +1 -1
  69. package/dist/models/user.d.ts +82 -28
  70. package/dist/models/user.d.ts.map +1 -1
  71. package/dist/models/worksheet.d.ts +1023 -410
  72. package/dist/models/worksheet.d.ts.map +1 -1
  73. package/dist/models/worksheet.js +19 -7
  74. package/dist/models/worksheet.js.map +1 -1
  75. package/dist/pipelines/aiLabChat.d.ts +0 -8
  76. package/dist/pipelines/aiLabChat.d.ts.map +1 -1
  77. package/dist/pipelines/aiLabChat.js +50 -67
  78. package/dist/pipelines/aiLabChat.js.map +1 -1
  79. package/dist/pipelines/aiLabChatContract.d.ts +393 -388
  80. package/dist/pipelines/aiLabChatContract.d.ts.map +1 -1
  81. package/dist/pipelines/aiLabChatContract.js +63 -69
  82. package/dist/pipelines/aiLabChatContract.js.map +1 -1
  83. package/dist/pipelines/aiNewtonChat.d.ts.map +1 -1
  84. package/dist/pipelines/aiNewtonChat.js +41 -41
  85. package/dist/pipelines/aiNewtonChat.js.map +1 -1
  86. package/dist/pipelines/gradeWorksheet.d.ts +8 -8
  87. package/dist/pipelines/gradeWorksheet.d.ts.map +1 -1
  88. package/dist/pipelines/gradeWorksheet.js +59 -14
  89. package/dist/pipelines/gradeWorksheet.js.map +1 -1
  90. package/dist/pipelines/labChatPrompt.d.ts +10 -8
  91. package/dist/pipelines/labChatPrompt.d.ts.map +1 -1
  92. package/dist/pipelines/labChatPrompt.js +47 -67
  93. package/dist/pipelines/labChatPrompt.js.map +1 -1
  94. package/dist/pipelines/pdfToWorksheet.d.ts +2 -2
  95. package/dist/routers/_app.d.ts +2268 -1898
  96. package/dist/routers/_app.d.ts.map +1 -1
  97. package/dist/routers/_app.js +4 -2
  98. package/dist/routers/_app.js.map +1 -1
  99. package/dist/routers/admin.d.ts +13 -13
  100. package/dist/routers/agenda.d.ts +18 -18
  101. package/dist/routers/announcement.d.ts +32 -28
  102. package/dist/routers/announcement.d.ts.map +1 -1
  103. package/dist/routers/announcement.js +6 -5
  104. package/dist/routers/announcement.js.map +1 -1
  105. package/dist/routers/assignment.d.ts +335 -327
  106. package/dist/routers/assignment.d.ts.map +1 -1
  107. package/dist/routers/assignment.js +4 -4
  108. package/dist/routers/assignment.js.map +1 -1
  109. package/dist/routers/attendance.d.ts +10 -10
  110. package/dist/routers/auth.d.ts +2 -2
  111. package/dist/routers/class.d.ts +170 -147
  112. package/dist/routers/class.d.ts.map +1 -1
  113. package/dist/routers/comment.d.ts +40 -16
  114. package/dist/routers/comment.d.ts.map +1 -1
  115. package/dist/routers/comment.js +6 -3
  116. package/dist/routers/comment.js.map +1 -1
  117. package/dist/routers/conversation.d.ts +17 -17
  118. package/dist/routers/department.d.ts +34 -34
  119. package/dist/routers/discussion.d.ts +65 -53
  120. package/dist/routers/discussion.d.ts.map +1 -1
  121. package/dist/routers/discussion.js +6 -2
  122. package/dist/routers/discussion.js.map +1 -1
  123. package/dist/routers/embedding.d.ts +69 -0
  124. package/dist/routers/embedding.d.ts.map +1 -0
  125. package/dist/routers/embedding.js +143 -0
  126. package/dist/routers/embedding.js.map +1 -0
  127. package/dist/routers/event.d.ts +39 -39
  128. package/dist/routers/file.d.ts +12 -12
  129. package/dist/routers/folder.d.ts +38 -38
  130. package/dist/routers/labChat.d.ts +19 -19
  131. package/dist/routers/marketing.d.ts +2 -2
  132. package/dist/routers/message.d.ts +13 -13
  133. package/dist/routers/newtonChat.d.ts +4 -4
  134. package/dist/routers/notifications.d.ts +9 -9
  135. package/dist/routers/permissions.d.ts +14 -14
  136. package/dist/routers/school.d.ts +55 -55
  137. package/dist/routers/search.d.ts +22 -1
  138. package/dist/routers/search.d.ts.map +1 -1
  139. package/dist/routers/search.js +9 -3
  140. package/dist/routers/search.js.map +1 -1
  141. package/dist/routers/section.d.ts +4 -4
  142. package/dist/routers/studentProgress.d.ts +1 -1
  143. package/dist/routers/tag.d.ts +7 -7
  144. package/dist/routers/user.d.ts +10 -10
  145. package/dist/routers/worksheet.d.ts +97 -56
  146. package/dist/routers/worksheet.d.ts.map +1 -1
  147. package/dist/routers/worksheet.js +28 -2
  148. package/dist/routers/worksheet.js.map +1 -1
  149. package/dist/routes/aiStream.d.ts +2 -0
  150. package/dist/routes/aiStream.d.ts.map +1 -0
  151. package/dist/routes/aiStream.js +696 -0
  152. package/dist/routes/aiStream.js.map +1 -0
  153. package/dist/seedDatabase.d.ts +2 -2
  154. package/dist/seedDatabase.js +6 -6
  155. package/dist/seedDatabase.js.map +1 -1
  156. package/dist/services/adminInstitution.d.ts +8 -8
  157. package/dist/services/adminRunJob.d.ts +4 -4
  158. package/dist/services/agenda.d.ts +18 -18
  159. package/dist/services/aiChatStream.d.ts +68 -0
  160. package/dist/services/aiChatStream.d.ts.map +1 -0
  161. package/dist/services/aiChatStream.js +157 -0
  162. package/dist/services/aiChatStream.js.map +1 -0
  163. package/dist/services/aiModifierTools.d.ts +32 -0
  164. package/dist/services/aiModifierTools.d.ts.map +1 -0
  165. package/dist/services/aiModifierTools.js +165 -0
  166. package/dist/services/aiModifierTools.js.map +1 -0
  167. package/dist/services/aiProposalTools.d.ts +32 -0
  168. package/dist/services/aiProposalTools.d.ts.map +1 -0
  169. package/dist/services/aiProposalTools.js +207 -0
  170. package/dist/services/aiProposalTools.js.map +1 -0
  171. package/dist/services/aiStream.d.ts +22 -0
  172. package/dist/services/aiStream.d.ts.map +1 -0
  173. package/dist/services/aiStream.js +142 -0
  174. package/dist/services/aiStream.js.map +1 -0
  175. package/dist/services/aiTools.d.ts +16 -0
  176. package/dist/services/aiTools.d.ts.map +1 -0
  177. package/dist/services/aiTools.js +271 -0
  178. package/dist/services/aiTools.js.map +1 -0
  179. package/dist/services/announcement.d.ts +12 -12
  180. package/dist/services/announcement.d.ts.map +1 -1
  181. package/dist/services/announcement.js +7 -2
  182. package/dist/services/announcement.js.map +1 -1
  183. package/dist/services/assignment.d.ts +293 -293
  184. package/dist/services/assignment.d.ts.map +1 -1
  185. package/dist/services/assignment.js +36 -15
  186. package/dist/services/assignment.js.map +1 -1
  187. package/dist/services/attendance.d.ts +10 -10
  188. package/dist/services/auth.d.ts +2 -2
  189. package/dist/services/class.d.ts +161 -138
  190. package/dist/services/class.d.ts.map +1 -1
  191. package/dist/services/class.js +25 -4
  192. package/dist/services/class.js.map +1 -1
  193. package/dist/services/comment.d.ts +34 -16
  194. package/dist/services/comment.d.ts.map +1 -1
  195. package/dist/services/comment.js +23 -2
  196. package/dist/services/comment.js.map +1 -1
  197. package/dist/services/conversation.d.ts +17 -17
  198. package/dist/services/conversation.d.ts.map +1 -1
  199. package/dist/services/conversation.js +9 -7
  200. package/dist/services/conversation.js.map +1 -1
  201. package/dist/services/department.d.ts +33 -33
  202. package/dist/services/discussion.d.ts +58 -58
  203. package/dist/services/discussion.d.ts.map +1 -1
  204. package/dist/services/discussion.js +8 -8
  205. package/dist/services/discussion.js.map +1 -1
  206. package/dist/services/discussionSummary.d.ts +21 -0
  207. package/dist/services/discussionSummary.d.ts.map +1 -0
  208. package/dist/services/discussionSummary.js +179 -0
  209. package/dist/services/discussionSummary.js.map +1 -0
  210. package/dist/services/embedding.d.ts +67 -0
  211. package/dist/services/embedding.d.ts.map +1 -0
  212. package/dist/services/embedding.js +226 -0
  213. package/dist/services/embedding.js.map +1 -0
  214. package/dist/services/event.d.ts +37 -37
  215. package/dist/services/file.d.ts +24 -24
  216. package/dist/services/folder.d.ts +36 -36
  217. package/dist/services/labChat.d.ts +19 -19
  218. package/dist/services/marketing.d.ts +2 -2
  219. package/dist/services/message.d.ts +11 -11
  220. package/dist/services/message.d.ts.map +1 -1
  221. package/dist/services/message.js +2 -2
  222. package/dist/services/message.js.map +1 -1
  223. package/dist/services/newtonChat.d.ts +4 -4
  224. package/dist/services/notification.d.ts +9 -9
  225. package/dist/services/notification.d.ts.map +1 -1
  226. package/dist/services/permissions.d.ts +14 -14
  227. package/dist/services/school.d.ts +50 -50
  228. package/dist/services/search.d.ts +12 -0
  229. package/dist/services/search.d.ts.map +1 -1
  230. package/dist/services/search.js +120 -2
  231. package/dist/services/search.js.map +1 -1
  232. package/dist/services/section.d.ts +3 -3
  233. package/dist/services/tag.d.ts +4 -4
  234. package/dist/services/user.d.ts +4 -4
  235. package/dist/services/user.d.ts.map +1 -1
  236. package/dist/services/user.js +10 -15
  237. package/dist/services/user.js.map +1 -1
  238. package/dist/services/worksheet.d.ts +62 -47
  239. package/dist/services/worksheet.d.ts.map +1 -1
  240. package/dist/services/worksheet.js +11 -4
  241. package/dist/services/worksheet.js.map +1 -1
  242. package/dist/utils/streamBroadcast.d.ts +11 -0
  243. package/dist/utils/streamBroadcast.d.ts.map +1 -0
  244. package/dist/utils/streamBroadcast.js +32 -0
  245. package/dist/utils/streamBroadcast.js.map +1 -0
  246. package/dist/workers/connection.d.ts +15 -0
  247. package/dist/workers/connection.d.ts.map +1 -1
  248. package/dist/workers/connection.js +20 -2
  249. package/dist/workers/connection.js.map +1 -1
  250. package/dist/workers/index.js +4 -2
  251. package/dist/workers/index.js.map +1 -1
  252. package/dist/workers/processors/createRunJobWorker.d.ts.map +1 -1
  253. package/dist/workers/processors/createRunJobWorker.js +31 -8
  254. package/dist/workers/processors/createRunJobWorker.js.map +1 -1
  255. package/dist/workers/processors/embedContent.d.ts +8 -0
  256. package/dist/workers/processors/embedContent.d.ts.map +1 -0
  257. package/dist/workers/processors/embedContent.js +76 -0
  258. package/dist/workers/processors/embedContent.js.map +1 -0
  259. package/dist/workers/queues.d.ts +6 -0
  260. package/dist/workers/queues.d.ts.map +1 -1
  261. package/dist/workers/queues.js +5 -3
  262. package/dist/workers/queues.js.map +1 -1
  263. package/package.json +5 -1
  264. package/prisma/migrations/20260609215135_init/migration.sql +1412 -0
  265. package/prisma/migrations/20260610130000_add_worksheet_tags/migration.sql +13 -0
  266. package/prisma/schema.prisma +39 -7
  267. package/src/index.ts +4 -0
  268. package/src/lib/config/cors.ts +32 -9
  269. package/src/lib/config/env.ts +6 -0
  270. package/src/lib/googleCloudStorage.ts +21 -0
  271. package/src/lib/prisma.ts +40 -1
  272. package/src/models/class.ts +10 -3
  273. package/src/models/comment.ts +1 -0
  274. package/src/models/conversation.ts +12 -0
  275. package/src/models/worksheet.ts +16 -7
  276. package/src/pipelines/aiLabChat.ts +54 -79
  277. package/src/pipelines/aiLabChatContract.ts +69 -69
  278. package/src/pipelines/aiNewtonChat.ts +46 -43
  279. package/src/pipelines/gradeWorksheet.ts +66 -15
  280. package/src/pipelines/labChatPrompt.ts +63 -88
  281. package/src/routers/_app.ts +2 -0
  282. package/src/routers/announcement.ts +4 -3
  283. package/src/routers/assignment.ts +2 -2
  284. package/src/routers/comment.ts +5 -0
  285. package/src/routers/discussion.ts +7 -0
  286. package/src/routers/embedding.ts +159 -0
  287. package/src/routers/search.ts +10 -1
  288. package/src/routers/worksheet.ts +29 -0
  289. package/src/routes/aiStream.ts +789 -0
  290. package/src/seedDatabase.ts +4 -4
  291. package/src/services/aiChatStream.ts +219 -0
  292. package/src/services/aiModifierTools.ts +188 -0
  293. package/src/services/aiProposalTools.ts +272 -0
  294. package/src/services/aiStream.ts +175 -0
  295. package/src/services/aiTools.ts +290 -0
  296. package/src/services/announcement.ts +7 -0
  297. package/src/services/assignment.ts +36 -14
  298. package/src/services/class.ts +30 -2
  299. package/src/services/comment.ts +22 -0
  300. package/src/services/conversation.ts +9 -4
  301. package/src/services/discussion.ts +9 -8
  302. package/src/services/discussionSummary.ts +226 -0
  303. package/src/services/embedding.ts +285 -0
  304. package/src/services/message.ts +2 -2
  305. package/src/services/search.ts +138 -0
  306. package/src/services/user.ts +9 -17
  307. package/src/services/worksheet.ts +10 -2
  308. package/src/utils/streamBroadcast.ts +48 -0
  309. package/src/workers/connection.ts +19 -0
  310. package/src/workers/index.ts +2 -0
  311. package/src/workers/processors/createRunJobWorker.ts +32 -6
  312. package/src/workers/processors/embedContent.ts +90 -0
  313. package/src/workers/queues.ts +5 -1
  314. package/tests/integration/routers/conversation.test.ts +9 -7
  315. package/tests/unit/pipelines/aiLabChatContract.test.ts +38 -21
  316. package/tests/unit/pipelines/labChatPrompt.test.ts +23 -36
  317. package/prisma/migrations/20250807062924_init/migration.sql +0 -436
  318. package/prisma/migrations/20250919063704_init2/migration.sql +0 -24
  319. package/prisma/migrations/20250920143543_add_profile_fields/migration.sql +0 -15
  320. package/prisma/migrations/20250922165147_add_chat_models/migration.sql +0 -68
  321. package/prisma/migrations/20250922165314_add_chat_roles/migration.sql +0 -5
  322. package/prisma/migrations/20250922171242_refactor_notification_system/migration.sql +0 -20
  323. package/prisma/migrations/20250922172208_add_mentions_system/migration.sql +0 -21
  324. package/prisma/migrations/20250925072732_add_lab_chat_system/migration.sql +0 -25
  325. package/prisma/migrations/20251020151505_add_upload_tracking_fields/migration.sql +0 -57
  326. package/prisma/migrations/20251109122857_annuoncements_comments/migration.sql +0 -30
  327. package/prisma/migrations/20251109135555_reactions_announcements_comments/migration.sql +0 -35
  328. package/prisma/migrations/20260410124000_add_submission_recommendation_state/migration.sql +0 -14
  329. package/prisma/migrations/20260415103500_add_session_type/migration.sql +0 -33
  330. package/prisma/migrations/20260415133000_add_ai_usage_logs/migration.sql +0 -19
  331. package/prisma/migrations/20260417083000_add_conversation_member_hidden_at/migration.sql +0 -2
  332. package/prisma/migrations/20260502230500_assignment_submission_comments/migration.sql +0 -60
  333. package/prisma/migrations/20260504071500_school_memberships/migration.sql +0 -81
  334. package/prisma/migrations/20260506162500_consolidate_run_job_and_unify_job_status/migration.sql +0 -166
  335. package/prisma/migrations/20260509220000_institution_overhaul/migration.sql +0 -184
  336. package/prisma/migrations/20260510170000_add_folder_permissions/migration.sql +0 -93
  337. package/prisma/migrations/20260510183000_add_discussions/migration.sql +0 -151
  338. /package/.github/workflows/{npm.yml → npm-publish.yml} +0 -0
@@ -2,60 +2,114 @@
2
2
  * School model - school membership, invites, and admin lookups.
3
3
  */
4
4
  import { SchoolMembershipRole } from "@prisma/client";
5
- export declare function findSchoolMembership(schoolId: string, userId: string): import(".prisma/client").Prisma.Prisma__SchoolMembershipClient<{
5
+ export declare function findSchoolMembership(schoolId: string, userId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
6
+ result: {
7
+ userProfile: {
8
+ profilePicture: () => {
9
+ needs: {
10
+ profilePicture: true;
11
+ };
12
+ compute(profile: {
13
+ profilePicture: string | null;
14
+ }): string | null;
15
+ };
16
+ profilePictureThumbnail: () => {
17
+ needs: {
18
+ profilePictureThumbnail: true;
19
+ };
20
+ compute(profile: {
21
+ profilePictureThumbnail: string | null;
22
+ }): string | null;
23
+ };
24
+ };
25
+ };
26
+ model: {};
27
+ query: {};
28
+ client: {};
29
+ }, {}>, "SchoolMembership", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
6
30
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
7
31
  id: string;
32
+ userId: string;
8
33
  createdAt: Date;
9
34
  updatedAt: Date;
10
35
  schoolId: string;
11
- userId: string;
12
36
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
13
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
14
- datasources: {
15
- db: {
16
- url: string;
37
+ } | null>;
38
+ export declare function findActiveSchoolMembership(schoolId: string, userId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
39
+ result: {
40
+ userProfile: {
41
+ profilePicture: () => {
42
+ needs: {
43
+ profilePicture: true;
44
+ };
45
+ compute(profile: {
46
+ profilePicture: string | null;
47
+ }): string | null;
48
+ };
49
+ profilePictureThumbnail: () => {
50
+ needs: {
51
+ profilePictureThumbnail: true;
52
+ };
53
+ compute(profile: {
54
+ profilePictureThumbnail: string | null;
55
+ }): string | null;
56
+ };
17
57
  };
18
58
  };
19
- }>;
20
- export declare function findActiveSchoolMembership(schoolId: string, userId: string): import(".prisma/client").Prisma.Prisma__SchoolMembershipClient<{
59
+ model: {};
60
+ query: {};
61
+ client: {};
62
+ }, {}>, "SchoolMembership", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
21
63
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
22
64
  id: string;
65
+ userId: string;
23
66
  createdAt: Date;
24
67
  updatedAt: Date;
25
68
  schoolId: string;
26
- userId: string;
27
69
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
28
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
29
- datasources: {
30
- db: {
31
- url: string;
70
+ } | null>;
71
+ export declare function findActiveSchoolAdminMembership(schoolId: string, userId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
72
+ result: {
73
+ userProfile: {
74
+ profilePicture: () => {
75
+ needs: {
76
+ profilePicture: true;
77
+ };
78
+ compute(profile: {
79
+ profilePicture: string | null;
80
+ }): string | null;
81
+ };
82
+ profilePictureThumbnail: () => {
83
+ needs: {
84
+ profilePictureThumbnail: true;
85
+ };
86
+ compute(profile: {
87
+ profilePictureThumbnail: string | null;
88
+ }): string | null;
89
+ };
32
90
  };
33
91
  };
34
- }>;
35
- export declare function findActiveSchoolAdminMembership(schoolId: string, userId: string): import(".prisma/client").Prisma.Prisma__SchoolMembershipClient<{
92
+ model: {};
93
+ query: {};
94
+ client: {};
95
+ }, {}>, "SchoolMembership", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
36
96
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
37
97
  id: string;
98
+ userId: string;
38
99
  createdAt: Date;
39
100
  updatedAt: Date;
40
101
  schoolId: string;
41
- userId: string;
42
102
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
43
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
44
- datasources: {
45
- db: {
46
- url: string;
47
- };
48
- };
49
- }>;
50
- export declare function listUserSchoolMemberships(userId: string): import(".prisma/client").Prisma.PrismaPromise<({
103
+ } | null>;
104
+ export declare function listUserSchoolMemberships(userId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
51
105
  school: {
52
- name: string;
53
106
  id: string;
107
+ createdAt: Date;
108
+ updatedAt: Date;
109
+ name: string;
54
110
  description: string | null;
55
111
  logoId: string | null;
56
112
  subdomain: string | null;
57
- createdAt: Date;
58
- updatedAt: Date;
59
113
  logo: {
60
114
  path: string;
61
115
  type: string;
@@ -65,10 +119,10 @@ export declare function listUserSchoolMemberships(userId: string): import(".pris
65
119
  } & {
66
120
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
67
121
  id: string;
122
+ userId: string;
68
123
  createdAt: Date;
69
124
  updatedAt: Date;
70
125
  schoolId: string;
71
- userId: string;
72
126
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
73
127
  })[]>;
74
128
  export declare function createSchoolWithAdmin(data: {
@@ -76,79 +130,157 @@ export declare function createSchoolWithAdmin(data: {
76
130
  subdomain?: string;
77
131
  logoId?: string;
78
132
  userId: string;
79
- }): import(".prisma/client").Prisma.Prisma__SchoolClient<{
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
+ }, {}>, "School", "create", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
80
158
  memberships: {
81
159
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
82
160
  id: string;
161
+ userId: string;
83
162
  createdAt: Date;
84
163
  updatedAt: Date;
85
164
  schoolId: string;
86
- userId: string;
87
165
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
88
166
  }[];
89
167
  } & {
90
- name: string;
91
168
  id: string;
169
+ createdAt: Date;
170
+ updatedAt: Date;
171
+ name: string;
92
172
  description: string | null;
93
173
  logoId: string | null;
94
174
  subdomain: string | null;
95
- createdAt: Date;
96
- updatedAt: Date;
97
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
98
- datasources: {
99
- db: {
100
- url: string;
175
+ }>;
176
+ export declare function getSchoolById(schoolId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
177
+ result: {
178
+ userProfile: {
179
+ profilePicture: () => {
180
+ needs: {
181
+ profilePicture: true;
182
+ };
183
+ compute(profile: {
184
+ profilePicture: string | null;
185
+ }): string | null;
186
+ };
187
+ profilePictureThumbnail: () => {
188
+ needs: {
189
+ profilePictureThumbnail: true;
190
+ };
191
+ compute(profile: {
192
+ profilePictureThumbnail: string | null;
193
+ }): string | null;
194
+ };
101
195
  };
102
196
  };
103
- }>;
104
- export declare function getSchoolById(schoolId: string): import(".prisma/client").Prisma.Prisma__SchoolClient<{
105
- name: string;
197
+ model: {};
198
+ query: {};
199
+ client: {};
200
+ }, {}>, "School", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
106
201
  id: string;
202
+ createdAt: Date;
203
+ updatedAt: Date;
204
+ name: string;
107
205
  description: string | null;
108
206
  logoId: string | null;
109
207
  subdomain: string | null;
110
- createdAt: Date;
111
- updatedAt: Date;
112
208
  logo: {
113
209
  path: string;
114
210
  type: string;
115
- name: string;
116
211
  id: string;
212
+ name: string;
117
213
  } | null;
118
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
119
- datasources: {
120
- db: {
121
- url: string;
122
- };
123
- };
124
- }>;
214
+ } | null>;
125
215
  export declare function updateSchoolRecord(schoolId: string, data: {
126
216
  name?: string;
127
217
  description?: string | null;
128
218
  subdomain?: string | null;
129
219
  logoId?: string | null;
130
- }): import(".prisma/client").Prisma.Prisma__SchoolClient<{
131
- name: string;
220
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
221
+ result: {
222
+ userProfile: {
223
+ profilePicture: () => {
224
+ needs: {
225
+ profilePicture: true;
226
+ };
227
+ compute(profile: {
228
+ profilePicture: string | null;
229
+ }): string | null;
230
+ };
231
+ profilePictureThumbnail: () => {
232
+ needs: {
233
+ profilePictureThumbnail: true;
234
+ };
235
+ compute(profile: {
236
+ profilePictureThumbnail: string | null;
237
+ }): string | null;
238
+ };
239
+ };
240
+ };
241
+ model: {};
242
+ query: {};
243
+ client: {};
244
+ }, {}>, "School", "update", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
132
245
  id: string;
246
+ name: string;
133
247
  description: string | null;
134
248
  logoId: string | null;
135
249
  subdomain: string | null;
136
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
137
- datasources: {
138
- db: {
139
- url: string;
250
+ }>;
251
+ export declare function getSchoolOverview(schoolId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
252
+ result: {
253
+ userProfile: {
254
+ profilePicture: () => {
255
+ needs: {
256
+ profilePicture: true;
257
+ };
258
+ compute(profile: {
259
+ profilePicture: string | null;
260
+ }): string | null;
261
+ };
262
+ profilePictureThumbnail: () => {
263
+ needs: {
264
+ profilePictureThumbnail: true;
265
+ };
266
+ compute(profile: {
267
+ profilePictureThumbnail: string | null;
268
+ }): string | null;
269
+ };
140
270
  };
141
271
  };
142
- }>;
143
- export declare function getSchoolOverview(schoolId: string): import(".prisma/client").Prisma.Prisma__SchoolClient<{
144
- name: string;
272
+ model: {};
273
+ query: {};
274
+ client: {};
275
+ }, {}>, "School", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
145
276
  id: string;
146
- subdomain: string | null;
277
+ name: string;
147
278
  _count: {
148
279
  memberships: number;
149
280
  invites: number;
150
281
  classes: number;
151
282
  };
283
+ subdomain: string | null;
152
284
  memberships: {
153
285
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
154
286
  }[];
@@ -156,117 +288,147 @@ export declare function getSchoolOverview(schoolId: string): import(".prisma/cli
156
288
  id: string;
157
289
  createdAt: Date;
158
290
  email: string;
159
- role: import(".prisma/client").$Enums.SchoolMembershipRole;
160
291
  expiresAt: Date;
292
+ role: import(".prisma/client").$Enums.SchoolMembershipRole;
161
293
  }[];
162
294
  classes: {
163
- name: string;
164
- id: string;
165
- subject: string;
166
- color: string | null;
167
295
  section: string;
296
+ id: string;
297
+ name: string;
168
298
  _count: {
169
299
  teachers: number;
170
300
  students: number;
171
301
  };
302
+ color: string | null;
303
+ subject: string;
172
304
  }[];
173
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
174
- datasources: {
175
- db: {
176
- url: string;
177
- };
178
- };
179
- }>;
180
- export declare function listSchoolClasses(schoolId: string): import(".prisma/client").Prisma.PrismaPromise<({
181
- _count: {
182
- assignments: number;
183
- teachers: number;
184
- students: number;
185
- };
305
+ } | null>;
306
+ export declare function listSchoolClasses(schoolId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
186
307
  teachers: {
187
308
  id: string;
188
309
  username: string;
189
310
  profile: {
190
- displayName: string | null;
191
311
  profilePicture: string | null;
312
+ displayName: string | null;
192
313
  profilePictureThumbnail: string | null;
193
314
  } | null;
194
315
  }[];
195
316
  students: {
196
317
  id: string;
197
318
  }[];
319
+ _count: {
320
+ teachers: number;
321
+ students: number;
322
+ assignments: number;
323
+ };
198
324
  } & {
199
- name: string;
325
+ section: string;
200
326
  id: string;
327
+ name: string;
201
328
  schoolId: string | null;
202
- subject: string;
203
329
  color: string | null;
204
- section: string;
330
+ subject: string;
205
331
  syllabus: string | null;
206
332
  departmentId: string | null;
207
333
  discussionsEnabled: boolean;
208
334
  studentsCanCreateDiscussions: boolean;
209
335
  studentsCanReply: boolean;
210
336
  })[]>;
211
- export declare function listSchoolMembers(schoolId: string): import(".prisma/client").Prisma.PrismaPromise<{
337
+ export declare function listSchoolMembers(schoolId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
212
338
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
213
- id: string;
214
- createdAt: Date;
215
- updatedAt: Date;
216
339
  user: {
217
340
  id: string;
218
341
  username: string;
219
342
  email: string;
220
343
  profile: {
221
- displayName: string | null;
222
344
  profilePicture: string | null;
345
+ displayName: string | null;
223
346
  profilePictureThumbnail: string | null;
224
347
  } | null;
225
348
  };
349
+ id: string;
350
+ createdAt: Date;
351
+ updatedAt: Date;
226
352
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
227
353
  }[]>;
228
- export declare function countActiveAdmins(schoolId: string): import(".prisma/client").Prisma.PrismaPromise<number>;
354
+ export declare function countActiveAdmins(schoolId: string): import("@prisma/client/runtime/library.js").PrismaPromise<number>;
229
355
  export declare function upsertSchoolMembership(data: {
230
356
  schoolId: string;
231
357
  userId: string;
232
358
  role: SchoolMembershipRole;
233
- }): import(".prisma/client").Prisma.Prisma__SchoolMembershipClient<{
359
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
360
+ result: {
361
+ userProfile: {
362
+ profilePicture: () => {
363
+ needs: {
364
+ profilePicture: true;
365
+ };
366
+ compute(profile: {
367
+ profilePicture: string | null;
368
+ }): string | null;
369
+ };
370
+ profilePictureThumbnail: () => {
371
+ needs: {
372
+ profilePictureThumbnail: true;
373
+ };
374
+ compute(profile: {
375
+ profilePictureThumbnail: string | null;
376
+ }): string | null;
377
+ };
378
+ };
379
+ };
380
+ model: {};
381
+ query: {};
382
+ client: {};
383
+ }, {}>, "SchoolMembership", "upsert", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
234
384
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
235
385
  id: string;
386
+ userId: string;
236
387
  createdAt: Date;
237
388
  updatedAt: Date;
238
389
  schoolId: string;
239
- userId: string;
240
390
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
241
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
242
- datasources: {
243
- db: {
244
- url: string;
391
+ }>;
392
+ export declare function updateSchoolMembershipRole(schoolId: string, userId: string, role: SchoolMembershipRole): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
393
+ result: {
394
+ userProfile: {
395
+ profilePicture: () => {
396
+ needs: {
397
+ profilePicture: true;
398
+ };
399
+ compute(profile: {
400
+ profilePicture: string | null;
401
+ }): string | null;
402
+ };
403
+ profilePictureThumbnail: () => {
404
+ needs: {
405
+ profilePictureThumbnail: true;
406
+ };
407
+ compute(profile: {
408
+ profilePictureThumbnail: string | null;
409
+ }): string | null;
410
+ };
245
411
  };
246
412
  };
247
- }>;
248
- export declare function updateSchoolMembershipRole(schoolId: string, userId: string, role: SchoolMembershipRole): import(".prisma/client").Prisma.Prisma__SchoolMembershipClient<{
413
+ model: {};
414
+ query: {};
415
+ client: {};
416
+ }, {}>, "SchoolMembership", "update", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
249
417
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
250
418
  id: string;
419
+ userId: string;
251
420
  createdAt: Date;
252
421
  updatedAt: Date;
253
422
  schoolId: string;
254
- userId: string;
255
423
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
256
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
257
- datasources: {
258
- db: {
259
- url: string;
260
- };
261
- };
262
424
  }>;
263
425
  export declare function removeSchoolMembershipPreservingContent(schoolId: string, userId: string): Promise<{
264
426
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
265
427
  id: string;
428
+ userId: string;
266
429
  createdAt: Date;
267
430
  updatedAt: Date;
268
431
  schoolId: string;
269
- userId: string;
270
432
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
271
433
  }>;
272
434
  export declare function createSchoolInvite(data: {
@@ -276,10 +438,34 @@ export declare function createSchoolInvite(data: {
276
438
  role: SchoolMembershipRole;
277
439
  token: string;
278
440
  expiresAt: Date;
279
- }): import(".prisma/client").Prisma.Prisma__SchoolInviteClient<{
441
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
442
+ result: {
443
+ userProfile: {
444
+ profilePicture: () => {
445
+ needs: {
446
+ profilePicture: true;
447
+ };
448
+ compute(profile: {
449
+ profilePicture: string | null;
450
+ }): string | null;
451
+ };
452
+ profilePictureThumbnail: () => {
453
+ needs: {
454
+ profilePictureThumbnail: true;
455
+ };
456
+ compute(profile: {
457
+ profilePictureThumbnail: string | null;
458
+ }): string | null;
459
+ };
460
+ };
461
+ };
462
+ model: {};
463
+ query: {};
464
+ client: {};
465
+ }, {}>, "SchoolInvite", "create", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
280
466
  school: {
281
- name: string;
282
467
  id: string;
468
+ name: string;
283
469
  };
284
470
  } & {
285
471
  status: import(".prisma/client").$Enums.SchoolInviteStatus;
@@ -288,26 +474,20 @@ export declare function createSchoolInvite(data: {
288
474
  updatedAt: Date;
289
475
  email: string;
290
476
  schoolId: string;
477
+ expiresAt: Date;
291
478
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
292
479
  token: string;
293
- expiresAt: Date;
294
480
  acceptedAt: Date | null;
295
481
  revokedAt: Date | null;
296
482
  invitedById: string;
297
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
298
- datasources: {
299
- db: {
300
- url: string;
301
- };
302
- };
303
483
  }>;
304
- export declare function listSchoolInvites(schoolId: string): import(".prisma/client").Prisma.PrismaPromise<{
484
+ export declare function listSchoolInvites(schoolId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
305
485
  status: import(".prisma/client").$Enums.SchoolInviteStatus;
306
486
  id: string;
307
487
  createdAt: Date;
308
488
  email: string;
309
- role: import(".prisma/client").$Enums.SchoolMembershipRole;
310
489
  expiresAt: Date;
490
+ role: import(".prisma/client").$Enums.SchoolMembershipRole;
311
491
  acceptedAt: Date | null;
312
492
  revokedAt: Date | null;
313
493
  invitedBy: {
@@ -318,30 +498,72 @@ export declare function listSchoolInvites(schoolId: string): import(".prisma/cli
318
498
  } | null;
319
499
  };
320
500
  }[]>;
321
- export declare function revokeSchoolInvite(inviteId: string, schoolId: string): import(".prisma/client").Prisma.Prisma__SchoolInviteClient<{
501
+ export declare function revokeSchoolInvite(inviteId: string, schoolId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
502
+ result: {
503
+ userProfile: {
504
+ profilePicture: () => {
505
+ needs: {
506
+ profilePicture: true;
507
+ };
508
+ compute(profile: {
509
+ profilePicture: string | null;
510
+ }): string | null;
511
+ };
512
+ profilePictureThumbnail: () => {
513
+ needs: {
514
+ profilePictureThumbnail: true;
515
+ };
516
+ compute(profile: {
517
+ profilePictureThumbnail: string | null;
518
+ }): string | null;
519
+ };
520
+ };
521
+ };
522
+ model: {};
523
+ query: {};
524
+ client: {};
525
+ }, {}>, "SchoolInvite", "update", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
322
526
  status: import(".prisma/client").$Enums.SchoolInviteStatus;
323
527
  id: string;
324
528
  createdAt: Date;
325
529
  updatedAt: Date;
326
530
  email: string;
327
531
  schoolId: string;
532
+ expiresAt: Date;
328
533
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
329
534
  token: string;
330
- expiresAt: Date;
331
535
  acceptedAt: Date | null;
332
536
  revokedAt: Date | null;
333
537
  invitedById: string;
334
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
335
- datasources: {
336
- db: {
337
- url: string;
538
+ }>;
539
+ export declare function findPendingInviteByToken(token: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
540
+ result: {
541
+ userProfile: {
542
+ profilePicture: () => {
543
+ needs: {
544
+ profilePicture: true;
545
+ };
546
+ compute(profile: {
547
+ profilePicture: string | null;
548
+ }): string | null;
549
+ };
550
+ profilePictureThumbnail: () => {
551
+ needs: {
552
+ profilePictureThumbnail: true;
553
+ };
554
+ compute(profile: {
555
+ profilePictureThumbnail: string | null;
556
+ }): string | null;
557
+ };
338
558
  };
339
559
  };
340
- }>;
341
- export declare function findPendingInviteByToken(token: string): import(".prisma/client").Prisma.Prisma__SchoolInviteClient<({
560
+ model: {};
561
+ query: {};
562
+ client: {};
563
+ }, {}>, "SchoolInvite", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<({
342
564
  school: {
343
- name: string;
344
565
  id: string;
566
+ name: string;
345
567
  };
346
568
  } & {
347
569
  status: import(".prisma/client").$Enums.SchoolInviteStatus;
@@ -350,26 +572,20 @@ export declare function findPendingInviteByToken(token: string): import(".prisma
350
572
  updatedAt: Date;
351
573
  email: string;
352
574
  schoolId: string;
575
+ expiresAt: Date;
353
576
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
354
577
  token: string;
355
- expiresAt: Date;
356
578
  acceptedAt: Date | null;
357
579
  revokedAt: Date | null;
358
580
  invitedById: string;
359
- }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
360
- datasources: {
361
- db: {
362
- url: string;
363
- };
364
- };
365
- }>;
581
+ }) | null>;
366
582
  export declare function acceptSchoolInvite(inviteId: string, userId: string): Promise<{
367
583
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
368
584
  id: string;
585
+ userId: string;
369
586
  createdAt: Date;
370
587
  updatedAt: Date;
371
588
  schoolId: string;
372
- userId: string;
373
589
  role: import(".prisma/client").$Enums.SchoolMembershipRole;
374
590
  }>;
375
591
  //# sourceMappingURL=school.d.ts.map