@studious-lms/server 1.13.0 → 1.15.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 (375) 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/instrument.js +3 -3
  8. package/dist/instrument.js.map +1 -1
  9. package/dist/lib/config/cors.d.ts.map +1 -1
  10. package/dist/lib/config/cors.js +31 -11
  11. package/dist/lib/config/cors.js.map +1 -1
  12. package/dist/lib/config/env.d.ts +17 -0
  13. package/dist/lib/config/env.d.ts.map +1 -1
  14. package/dist/lib/config/env.js +8 -2
  15. package/dist/lib/config/env.js.map +1 -1
  16. package/dist/lib/googleCloudStorage.d.ts +10 -0
  17. package/dist/lib/googleCloudStorage.d.ts.map +1 -1
  18. package/dist/lib/googleCloudStorage.js +22 -2
  19. package/dist/lib/googleCloudStorage.js.map +1 -1
  20. package/dist/lib/inferDocumentFormat.d.ts +10 -0
  21. package/dist/lib/inferDocumentFormat.d.ts.map +1 -0
  22. package/dist/lib/inferDocumentFormat.js +48 -0
  23. package/dist/lib/inferDocumentFormat.js.map +1 -0
  24. package/dist/lib/legal.d.ts +3 -0
  25. package/dist/lib/legal.d.ts.map +1 -0
  26. package/dist/lib/legal.js +6 -0
  27. package/dist/lib/legal.js.map +1 -0
  28. package/dist/lib/prisma.d.ts +104 -5
  29. package/dist/lib/prisma.d.ts.map +1 -1
  30. package/dist/lib/prisma.js +33 -2
  31. package/dist/lib/prisma.js.map +1 -1
  32. package/dist/models/agenda.d.ts +20 -20
  33. package/dist/models/announcement.d.ts +211 -101
  34. package/dist/models/announcement.d.ts.map +1 -1
  35. package/dist/models/assignment.d.ts +560 -362
  36. package/dist/models/assignment.d.ts.map +1 -1
  37. package/dist/models/attendance.d.ts +197 -71
  38. package/dist/models/attendance.d.ts.map +1 -1
  39. package/dist/models/auth.d.ts +356 -114
  40. package/dist/models/auth.d.ts.map +1 -1
  41. package/dist/models/auth.js +4 -2
  42. package/dist/models/auth.js.map +1 -1
  43. package/dist/models/class.d.ts +327 -201
  44. package/dist/models/class.d.ts.map +1 -1
  45. package/dist/models/class.js +2 -2
  46. package/dist/models/class.js.map +1 -1
  47. package/dist/models/cloudStorage.d.ts +146 -56
  48. package/dist/models/cloudStorage.d.ts.map +1 -1
  49. package/dist/models/comment.d.ts +262 -110
  50. package/dist/models/comment.d.ts.map +1 -1
  51. package/dist/models/conversation.d.ts +206 -80
  52. package/dist/models/conversation.d.ts.map +1 -1
  53. package/dist/models/department.d.ts +196 -70
  54. package/dist/models/department.d.ts.map +1 -1
  55. package/dist/models/event.d.ts +305 -141
  56. package/dist/models/event.d.ts.map +1 -1
  57. package/dist/models/file.d.ts +422 -272
  58. package/dist/models/file.d.ts.map +1 -1
  59. package/dist/models/folder.d.ts +433 -181
  60. package/dist/models/folder.d.ts.map +1 -1
  61. package/dist/models/labChat.d.ts +205 -79
  62. package/dist/models/labChat.d.ts.map +1 -1
  63. package/dist/models/marketing.d.ts +79 -38
  64. package/dist/models/marketing.d.ts.map +1 -1
  65. package/dist/models/marketing.js +12 -4
  66. package/dist/models/marketing.js.map +1 -1
  67. package/dist/models/message.d.ts +97 -43
  68. package/dist/models/message.d.ts.map +1 -1
  69. package/dist/models/newtonChat.d.ts +84 -30
  70. package/dist/models/newtonChat.d.ts.map +1 -1
  71. package/dist/models/notification.d.ts +57 -21
  72. package/dist/models/notification.d.ts.map +1 -1
  73. package/dist/models/school.d.ts +349 -133
  74. package/dist/models/school.d.ts.map +1 -1
  75. package/dist/models/section.d.ts +216 -72
  76. package/dist/models/section.d.ts.map +1 -1
  77. package/dist/models/tag.d.ts +156 -48
  78. package/dist/models/tag.d.ts.map +1 -1
  79. package/dist/models/user.d.ts +82 -28
  80. package/dist/models/user.d.ts.map +1 -1
  81. package/dist/models/worksheet.d.ts +1032 -423
  82. package/dist/models/worksheet.d.ts.map +1 -1
  83. package/dist/models/worksheet.js +8 -2
  84. package/dist/models/worksheet.js.map +1 -1
  85. package/dist/pipelines/aiLabChat.d.ts +7 -9
  86. package/dist/pipelines/aiLabChat.d.ts.map +1 -1
  87. package/dist/pipelines/aiLabChat.js +194 -125
  88. package/dist/pipelines/aiLabChat.js.map +1 -1
  89. package/dist/pipelines/aiLabChatContract.d.ts +233 -389
  90. package/dist/pipelines/aiLabChatContract.d.ts.map +1 -1
  91. package/dist/pipelines/aiLabChatContract.js +54 -70
  92. package/dist/pipelines/aiLabChatContract.js.map +1 -1
  93. package/dist/pipelines/aiNewtonChat.d.ts.map +1 -1
  94. package/dist/pipelines/aiNewtonChat.js +41 -41
  95. package/dist/pipelines/aiNewtonChat.js.map +1 -1
  96. package/dist/pipelines/gradeWorksheet.d.ts +8 -8
  97. package/dist/pipelines/labChatPrompt.d.ts +18 -11
  98. package/dist/pipelines/labChatPrompt.d.ts.map +1 -1
  99. package/dist/pipelines/labChatPrompt.js +93 -75
  100. package/dist/pipelines/labChatPrompt.js.map +1 -1
  101. package/dist/pipelines/pdfToWorksheet.d.ts +1 -1
  102. package/dist/routers/_app.d.ts +2601 -2151
  103. package/dist/routers/_app.d.ts.map +1 -1
  104. package/dist/routers/_app.js +4 -2
  105. package/dist/routers/_app.js.map +1 -1
  106. package/dist/routers/admin.d.ts +13 -13
  107. package/dist/routers/agenda.d.ts +18 -18
  108. package/dist/routers/announcement.d.ts +60 -60
  109. package/dist/routers/assignment.d.ts +393 -383
  110. package/dist/routers/assignment.d.ts.map +1 -1
  111. package/dist/routers/attendance.d.ts +10 -10
  112. package/dist/routers/auth.d.ts +4 -2
  113. package/dist/routers/auth.d.ts.map +1 -1
  114. package/dist/routers/auth.js +15 -2
  115. package/dist/routers/auth.js.map +1 -1
  116. package/dist/routers/class.d.ts +157 -153
  117. package/dist/routers/class.d.ts.map +1 -1
  118. package/dist/routers/comment.d.ts +18 -18
  119. package/dist/routers/conversation.d.ts +11 -11
  120. package/dist/routers/department.d.ts +34 -34
  121. package/dist/routers/discussion.d.ts +68 -56
  122. package/dist/routers/discussion.d.ts.map +1 -1
  123. package/dist/routers/discussion.js +6 -2
  124. package/dist/routers/discussion.js.map +1 -1
  125. package/dist/routers/embedding.d.ts +73 -0
  126. package/dist/routers/embedding.d.ts.map +1 -0
  127. package/dist/routers/embedding.js +151 -0
  128. package/dist/routers/embedding.js.map +1 -0
  129. package/dist/routers/event.d.ts +57 -55
  130. package/dist/routers/event.d.ts.map +1 -1
  131. package/dist/routers/file.d.ts +14 -14
  132. package/dist/routers/folder.d.ts +38 -38
  133. package/dist/routers/labChat.d.ts +16 -16
  134. package/dist/routers/marketing.d.ts +1 -14
  135. package/dist/routers/marketing.d.ts.map +1 -1
  136. package/dist/routers/message.d.ts +13 -13
  137. package/dist/routers/newtonChat.d.ts +4 -4
  138. package/dist/routers/notifications.d.ts +5 -5
  139. package/dist/routers/permissions.d.ts +14 -14
  140. package/dist/routers/school.d.ts +59 -55
  141. package/dist/routers/school.d.ts.map +1 -1
  142. package/dist/routers/search.d.ts +22 -1
  143. package/dist/routers/search.d.ts.map +1 -1
  144. package/dist/routers/search.js +9 -3
  145. package/dist/routers/search.js.map +1 -1
  146. package/dist/routers/section.d.ts +4 -4
  147. package/dist/routers/studentProgress.d.ts +1 -1
  148. package/dist/routers/tag.d.ts +7 -7
  149. package/dist/routers/user.d.ts +99 -10
  150. package/dist/routers/user.d.ts.map +1 -1
  151. package/dist/routers/user.js +19 -2
  152. package/dist/routers/user.js.map +1 -1
  153. package/dist/routers/worksheet.d.ts +93 -55
  154. package/dist/routers/worksheet.d.ts.map +1 -1
  155. package/dist/routers/worksheet.js +26 -2
  156. package/dist/routers/worksheet.js.map +1 -1
  157. package/dist/routes/aiStream.d.ts +2 -0
  158. package/dist/routes/aiStream.d.ts.map +1 -0
  159. package/dist/routes/aiStream.js +726 -0
  160. package/dist/routes/aiStream.js.map +1 -0
  161. package/dist/seedDatabase.d.ts +3 -1
  162. package/dist/seedDatabase.d.ts.map +1 -1
  163. package/dist/seedDatabase.js +6 -6
  164. package/dist/seedDatabase.js.map +1 -1
  165. package/dist/services/adminInstitution.d.ts +8 -8
  166. package/dist/services/adminRunJob.d.ts +4 -4
  167. package/dist/services/agenda.d.ts +18 -18
  168. package/dist/services/aiChatStream.d.ts +88 -0
  169. package/dist/services/aiChatStream.d.ts.map +1 -0
  170. package/dist/services/aiChatStream.js +254 -0
  171. package/dist/services/aiChatStream.js.map +1 -0
  172. package/dist/services/aiModifierTools.d.ts +16 -0
  173. package/dist/services/aiModifierTools.d.ts.map +1 -0
  174. package/dist/services/aiModifierTools.js +274 -0
  175. package/dist/services/aiModifierTools.js.map +1 -0
  176. package/dist/services/aiProposalTools.d.ts +32 -0
  177. package/dist/services/aiProposalTools.d.ts.map +1 -0
  178. package/dist/services/aiProposalTools.js +207 -0
  179. package/dist/services/aiProposalTools.js.map +1 -0
  180. package/dist/services/aiStream.d.ts +22 -0
  181. package/dist/services/aiStream.d.ts.map +1 -0
  182. package/dist/services/aiStream.js +142 -0
  183. package/dist/services/aiStream.js.map +1 -0
  184. package/dist/services/aiTools.d.ts +16 -0
  185. package/dist/services/aiTools.d.ts.map +1 -0
  186. package/dist/services/aiTools.js +271 -0
  187. package/dist/services/aiTools.js.map +1 -0
  188. package/dist/services/announcement.d.ts +42 -42
  189. package/dist/services/announcement.d.ts.map +1 -1
  190. package/dist/services/announcement.js +7 -2
  191. package/dist/services/announcement.js.map +1 -1
  192. package/dist/services/assignment.d.ts +355 -345
  193. package/dist/services/assignment.d.ts.map +1 -1
  194. package/dist/services/assignment.js +30 -9
  195. package/dist/services/assignment.js.map +1 -1
  196. package/dist/services/attendance.d.ts +10 -10
  197. package/dist/services/auth.d.ts +4 -2
  198. package/dist/services/auth.d.ts.map +1 -1
  199. package/dist/services/auth.js +13 -4
  200. package/dist/services/auth.js.map +1 -1
  201. package/dist/services/class.d.ts +146 -142
  202. package/dist/services/class.d.ts.map +1 -1
  203. package/dist/services/class.js +24 -4
  204. package/dist/services/class.js.map +1 -1
  205. package/dist/services/comment.d.ts +18 -18
  206. package/dist/services/conversation.d.ts +11 -11
  207. package/dist/services/department.d.ts +33 -33
  208. package/dist/services/discussion.d.ts +58 -58
  209. package/dist/services/discussion.d.ts.map +1 -1
  210. package/dist/services/discussion.js +15 -8
  211. package/dist/services/discussion.js.map +1 -1
  212. package/dist/services/discussionSummary.d.ts +21 -0
  213. package/dist/services/discussionSummary.d.ts.map +1 -0
  214. package/dist/services/discussionSummary.js +179 -0
  215. package/dist/services/discussionSummary.js.map +1 -0
  216. package/dist/services/embedding.d.ts +85 -0
  217. package/dist/services/embedding.d.ts.map +1 -0
  218. package/dist/services/embedding.js +372 -0
  219. package/dist/services/embedding.js.map +1 -0
  220. package/dist/services/event.d.ts +55 -53
  221. package/dist/services/event.d.ts.map +1 -1
  222. package/dist/services/file.d.ts +28 -28
  223. package/dist/services/folder.d.ts +36 -36
  224. package/dist/services/folder.d.ts.map +1 -1
  225. package/dist/services/folder.js +32 -2
  226. package/dist/services/folder.js.map +1 -1
  227. package/dist/services/labChat.d.ts +16 -16
  228. package/dist/services/marketing.d.ts +2 -15
  229. package/dist/services/marketing.d.ts.map +1 -1
  230. package/dist/services/marketing.js +5 -5
  231. package/dist/services/marketing.js.map +1 -1
  232. package/dist/services/message.d.ts +11 -11
  233. package/dist/services/message.d.ts.map +1 -1
  234. package/dist/services/message.js +2 -2
  235. package/dist/services/message.js.map +1 -1
  236. package/dist/services/newtonChat.d.ts +4 -4
  237. package/dist/services/notification.d.ts +5 -5
  238. package/dist/services/notification.d.ts.map +1 -1
  239. package/dist/services/openaiDocumentGen.d.ts +37 -0
  240. package/dist/services/openaiDocumentGen.d.ts.map +1 -0
  241. package/dist/services/openaiDocumentGen.js +262 -0
  242. package/dist/services/openaiDocumentGen.js.map +1 -0
  243. package/dist/services/permissions.d.ts +14 -14
  244. package/dist/services/school.d.ts +54 -50
  245. package/dist/services/school.d.ts.map +1 -1
  246. package/dist/services/search.d.ts +13 -1
  247. package/dist/services/search.d.ts.map +1 -1
  248. package/dist/services/search.js +145 -2
  249. package/dist/services/search.js.map +1 -1
  250. package/dist/services/section.d.ts +3 -3
  251. package/dist/services/tag.d.ts +4 -4
  252. package/dist/services/user.d.ts +4 -4
  253. package/dist/services/user.d.ts.map +1 -1
  254. package/dist/services/user.js +10 -15
  255. package/dist/services/user.js.map +1 -1
  256. package/dist/services/userPrivacy.d.ts +86 -0
  257. package/dist/services/userPrivacy.d.ts.map +1 -0
  258. package/dist/services/userPrivacy.js +184 -0
  259. package/dist/services/userPrivacy.js.map +1 -0
  260. package/dist/services/worksheet.d.ts +86 -57
  261. package/dist/services/worksheet.d.ts.map +1 -1
  262. package/dist/services/worksheet.js +57 -5
  263. package/dist/services/worksheet.js.map +1 -1
  264. package/dist/utils/email.d.ts.map +1 -1
  265. package/dist/utils/email.js +7 -3
  266. package/dist/utils/email.js.map +1 -1
  267. package/dist/utils/streamBroadcast.d.ts +11 -0
  268. package/dist/utils/streamBroadcast.d.ts.map +1 -0
  269. package/dist/utils/streamBroadcast.js +32 -0
  270. package/dist/utils/streamBroadcast.js.map +1 -0
  271. package/dist/workers/connection.d.ts +15 -0
  272. package/dist/workers/connection.d.ts.map +1 -1
  273. package/dist/workers/connection.js +20 -2
  274. package/dist/workers/connection.js.map +1 -1
  275. package/dist/workers/index.js +4 -2
  276. package/dist/workers/index.js.map +1 -1
  277. package/dist/workers/processors/createRunJobWorker.d.ts.map +1 -1
  278. package/dist/workers/processors/createRunJobWorker.js +31 -8
  279. package/dist/workers/processors/createRunJobWorker.js.map +1 -1
  280. package/dist/workers/processors/embedContent.d.ts +8 -0
  281. package/dist/workers/processors/embedContent.d.ts.map +1 -0
  282. package/dist/workers/processors/embedContent.js +67 -0
  283. package/dist/workers/processors/embedContent.js.map +1 -0
  284. package/dist/workers/queues.d.ts +6 -0
  285. package/dist/workers/queues.d.ts.map +1 -1
  286. package/dist/workers/queues.js +5 -3
  287. package/dist/workers/queues.js.map +1 -1
  288. package/package.json +5 -1
  289. package/prisma/migrations/20260609215135_init/migration.sql +1412 -0
  290. package/prisma/migrations/20260610130000_add_worksheet_tags/migration.sql +13 -0
  291. package/prisma/migrations/20260610140000_expand_embedding_source_types/migration.sql +4 -0
  292. package/prisma/migrations/20260611120000_add_user_terms_acceptance/migration.sql +3 -0
  293. package/prisma/schema.prisma +44 -7
  294. package/src/index.ts +4 -0
  295. package/src/instrument.ts +1 -1
  296. package/src/lib/config/cors.ts +32 -9
  297. package/src/lib/config/env.ts +6 -0
  298. package/src/lib/googleCloudStorage.ts +21 -0
  299. package/src/lib/inferDocumentFormat.ts +58 -0
  300. package/src/lib/legal.ts +2 -0
  301. package/src/lib/prisma.ts +40 -1
  302. package/src/models/auth.ts +4 -0
  303. package/src/models/class.ts +3 -2
  304. package/src/models/marketing.ts +10 -2
  305. package/src/models/worksheet.ts +5 -2
  306. package/src/pipelines/aiLabChat.ts +245 -146
  307. package/src/pipelines/aiLabChatContract.ts +59 -69
  308. package/src/pipelines/aiNewtonChat.ts +46 -43
  309. package/src/pipelines/labChatPrompt.ts +115 -90
  310. package/src/routers/_app.ts +2 -0
  311. package/src/routers/auth.ts +13 -0
  312. package/src/routers/discussion.ts +7 -0
  313. package/src/routers/embedding.ts +164 -0
  314. package/src/routers/search.ts +10 -1
  315. package/src/routers/user.ts +26 -0
  316. package/src/routers/worksheet.ts +27 -0
  317. package/src/routes/aiStream.ts +827 -0
  318. package/src/seedDatabase.ts +4 -4
  319. package/src/services/aiChatStream.ts +341 -0
  320. package/src/services/aiModifierTools.ts +341 -0
  321. package/src/services/aiProposalTools.ts +274 -0
  322. package/src/services/aiStream.ts +175 -0
  323. package/src/services/aiTools.ts +290 -0
  324. package/src/services/announcement.ts +7 -0
  325. package/src/services/assignment.ts +31 -7
  326. package/src/services/auth.ts +14 -2
  327. package/src/services/class.ts +27 -2
  328. package/src/services/discussion.ts +22 -8
  329. package/src/services/discussionSummary.ts +226 -0
  330. package/src/services/embedding.ts +446 -0
  331. package/src/services/folder.ts +31 -0
  332. package/src/services/marketing.ts +3 -3
  333. package/src/services/message.ts +2 -2
  334. package/src/services/openaiDocumentGen.ts +319 -0
  335. package/src/services/search.ts +163 -1
  336. package/src/services/user.ts +9 -17
  337. package/src/services/userPrivacy.ts +196 -0
  338. package/src/services/worksheet.ts +77 -3
  339. package/src/utils/email.ts +5 -1
  340. package/src/utils/streamBroadcast.ts +48 -0
  341. package/src/workers/connection.ts +19 -0
  342. package/src/workers/index.ts +2 -0
  343. package/src/workers/processors/createRunJobWorker.ts +32 -6
  344. package/src/workers/processors/embedContent.ts +86 -0
  345. package/src/workers/queues.ts +5 -1
  346. package/tests/helpers/registerInput.ts +20 -0
  347. package/tests/integration/globalSetup.ts +10 -18
  348. package/tests/integration/routers/auth.test.ts +13 -18
  349. package/tests/unit/lib/inferDocumentFormat.test.ts +33 -0
  350. package/tests/unit/pipelines/aiLabChatContract.test.ts +38 -21
  351. package/tests/unit/pipelines/labChatPrompt.test.ts +23 -36
  352. package/tests/unit/services/aiChatStream.test.ts +92 -0
  353. package/tests/unit/services/openaiDocumentGen.test.ts +65 -0
  354. package/prisma/migrations/20250807062924_init/migration.sql +0 -436
  355. package/prisma/migrations/20250919063704_init2/migration.sql +0 -24
  356. package/prisma/migrations/20250920143543_add_profile_fields/migration.sql +0 -15
  357. package/prisma/migrations/20250922165147_add_chat_models/migration.sql +0 -68
  358. package/prisma/migrations/20250922165314_add_chat_roles/migration.sql +0 -5
  359. package/prisma/migrations/20250922171242_refactor_notification_system/migration.sql +0 -20
  360. package/prisma/migrations/20250922172208_add_mentions_system/migration.sql +0 -21
  361. package/prisma/migrations/20250925072732_add_lab_chat_system/migration.sql +0 -25
  362. package/prisma/migrations/20251020151505_add_upload_tracking_fields/migration.sql +0 -57
  363. package/prisma/migrations/20251109122857_annuoncements_comments/migration.sql +0 -30
  364. package/prisma/migrations/20251109135555_reactions_announcements_comments/migration.sql +0 -35
  365. package/prisma/migrations/20260410124000_add_submission_recommendation_state/migration.sql +0 -14
  366. package/prisma/migrations/20260415103500_add_session_type/migration.sql +0 -33
  367. package/prisma/migrations/20260415133000_add_ai_usage_logs/migration.sql +0 -19
  368. package/prisma/migrations/20260417083000_add_conversation_member_hidden_at/migration.sql +0 -2
  369. package/prisma/migrations/20260502230500_assignment_submission_comments/migration.sql +0 -60
  370. package/prisma/migrations/20260504071500_school_memberships/migration.sql +0 -81
  371. package/prisma/migrations/20260506162500_consolidate_run_job_and_unify_job_status/migration.sql +0 -166
  372. package/prisma/migrations/20260509220000_institution_overhaul/migration.sql +0 -184
  373. package/prisma/migrations/20260510170000_add_folder_permissions/migration.sql +0 -93
  374. package/prisma/migrations/20260510183000_add_discussions/migration.sql +0 -151
  375. /package/.github/workflows/{npm.yml → npm-publish.yml} +0 -0
@@ -4,86 +4,178 @@
4
4
  */
5
5
  import { SessionType } from "@prisma/client";
6
6
  /** @returns User by username (includes password for login). */
7
- export declare function findUserByUsername(username: string): import(".prisma/client").Prisma.Prisma__UserClient<{
7
+ export declare function findUserByUsername(username: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
8
+ result: {
9
+ userProfile: {
10
+ profilePicture: () => {
11
+ needs: {
12
+ profilePicture: true;
13
+ };
14
+ compute(profile: {
15
+ profilePicture: string | null;
16
+ }): string | null;
17
+ };
18
+ profilePictureThumbnail: () => {
19
+ needs: {
20
+ profilePictureThumbnail: true;
21
+ };
22
+ compute(profile: {
23
+ profilePictureThumbnail: string | null;
24
+ }): string | null;
25
+ };
26
+ };
27
+ };
28
+ model: {};
29
+ query: {};
30
+ client: {};
31
+ }, {}>, "User", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
8
32
  id: string;
9
33
  username: string;
10
34
  email: string;
11
35
  password: string;
12
36
  verified: boolean;
13
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
14
- datasources: {
15
- db: {
16
- url: string;
37
+ } | null>;
38
+ /** @returns User by username or email. */
39
+ export declare function findUserByUsernameOrEmail(username: string, email: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
40
+ result: {
41
+ userProfile: {
42
+ profilePicture: () => {
43
+ needs: {
44
+ profilePicture: true;
45
+ };
46
+ compute(profile: {
47
+ profilePicture: string | null;
48
+ }): string | null;
49
+ };
50
+ profilePictureThumbnail: () => {
51
+ needs: {
52
+ profilePictureThumbnail: true;
53
+ };
54
+ compute(profile: {
55
+ profilePictureThumbnail: string | null;
56
+ }): string | null;
57
+ };
17
58
  };
18
59
  };
19
- }>;
20
- /** @returns User by username or email. */
21
- export declare function findUserByUsernameOrEmail(username: string, email: string): import(".prisma/client").Prisma.Prisma__UserClient<{
60
+ model: {};
61
+ query: {};
62
+ client: {};
63
+ }, {}>, "User", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
22
64
  id: string;
23
65
  username: string;
24
66
  email: string;
25
67
  verified: boolean;
26
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
27
- datasources: {
28
- db: {
29
- url: string;
68
+ } | null>;
69
+ /** @returns User by email with profile. */
70
+ export declare function findUserByEmail(email: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
71
+ result: {
72
+ userProfile: {
73
+ profilePicture: () => {
74
+ needs: {
75
+ profilePicture: true;
76
+ };
77
+ compute(profile: {
78
+ profilePicture: string | null;
79
+ }): string | null;
80
+ };
81
+ profilePictureThumbnail: () => {
82
+ needs: {
83
+ profilePictureThumbnail: true;
84
+ };
85
+ compute(profile: {
86
+ profilePictureThumbnail: string | null;
87
+ }): string | null;
88
+ };
30
89
  };
31
90
  };
32
- }>;
33
- /** @returns User by email with profile. */
34
- export declare function findUserByEmail(email: string): import(".prisma/client").Prisma.Prisma__UserClient<{
91
+ model: {};
92
+ query: {};
93
+ client: {};
94
+ }, {}>, "User", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
35
95
  id: string;
36
96
  email: string;
37
97
  profile: {
38
- location: string | null;
98
+ profilePicture: string | null;
39
99
  displayName: string | null;
40
100
  bio: string | null;
101
+ location: string | null;
41
102
  website: string | null;
42
- profilePicture: string | null;
43
103
  } | null;
44
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
45
- datasources: {
46
- db: {
47
- url: string;
104
+ } | null>;
105
+ /** @returns User by ID with profile. */
106
+ export declare function findUserById(id: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
107
+ result: {
108
+ userProfile: {
109
+ profilePicture: () => {
110
+ needs: {
111
+ profilePicture: true;
112
+ };
113
+ compute(profile: {
114
+ profilePicture: string | null;
115
+ }): string | null;
116
+ };
117
+ profilePictureThumbnail: () => {
118
+ needs: {
119
+ profilePictureThumbnail: true;
120
+ };
121
+ compute(profile: {
122
+ profilePictureThumbnail: string | null;
123
+ }): string | null;
124
+ };
48
125
  };
49
126
  };
50
- }>;
51
- /** @returns User by ID with profile. */
52
- export declare function findUserById(id: string): import(".prisma/client").Prisma.Prisma__UserClient<{
127
+ model: {};
128
+ query: {};
129
+ client: {};
130
+ }, {}>, "User", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
53
131
  id: string;
54
132
  username: string;
55
133
  email: string;
56
134
  profile: {
57
- location: string | null;
135
+ profilePicture: string | null;
58
136
  displayName: string | null;
59
137
  bio: string | null;
138
+ location: string | null;
60
139
  website: string | null;
61
- profilePicture: string | null;
62
140
  profilePictureThumbnail: string | null;
63
141
  } | null;
64
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
65
- datasources: {
66
- db: {
67
- url: string;
68
- };
69
- };
70
- }>;
142
+ } | null>;
71
143
  /** Create a user with empty profile. */
72
144
  export declare function createUser(data: {
73
145
  username: string;
74
146
  email: string;
75
147
  password: string;
76
148
  verified?: boolean;
77
- }): import(".prisma/client").Prisma.Prisma__UserClient<{
149
+ termsAcceptedAt?: Date;
150
+ termsVersion?: string;
151
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
152
+ result: {
153
+ userProfile: {
154
+ profilePicture: () => {
155
+ needs: {
156
+ profilePicture: true;
157
+ };
158
+ compute(profile: {
159
+ profilePicture: string | null;
160
+ }): string | null;
161
+ };
162
+ profilePictureThumbnail: () => {
163
+ needs: {
164
+ profilePictureThumbnail: true;
165
+ };
166
+ compute(profile: {
167
+ profilePictureThumbnail: string | null;
168
+ }): string | null;
169
+ };
170
+ };
171
+ };
172
+ model: {};
173
+ query: {};
174
+ client: {};
175
+ }, {}>, "User", "create", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
78
176
  id: string;
79
177
  username: string;
80
178
  email: string;
81
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
82
- datasources: {
83
- db: {
84
- url: string;
85
- };
86
- };
87
179
  }>;
88
180
  /** Create a session. */
89
181
  export declare function createSession(data: {
@@ -92,156 +184,306 @@ export declare function createSession(data: {
92
184
  expiresAt: Date;
93
185
  userId?: string;
94
186
  classId?: string;
95
- }): import(".prisma/client").Prisma.Prisma__SessionClient<{
187
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
188
+ result: {
189
+ userProfile: {
190
+ profilePicture: () => {
191
+ needs: {
192
+ profilePicture: true;
193
+ };
194
+ compute(profile: {
195
+ profilePicture: string | null;
196
+ }): string | null;
197
+ };
198
+ profilePictureThumbnail: () => {
199
+ needs: {
200
+ profilePictureThumbnail: true;
201
+ };
202
+ compute(profile: {
203
+ profilePictureThumbnail: string | null;
204
+ }): string | null;
205
+ };
206
+ };
207
+ };
208
+ model: {};
209
+ query: {};
210
+ client: {};
211
+ }, {}>, "Session", "create", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
96
212
  type: import(".prisma/client").$Enums.SessionType;
97
213
  id: string;
98
- createdAt: Date | null;
99
214
  userId: string | null;
100
- expiresAt: Date | null;
215
+ createdAt: Date | null;
101
216
  classId: string | null;
102
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
103
- datasources: {
104
- db: {
105
- url: string;
106
- };
107
- };
217
+ expiresAt: Date | null;
108
218
  }>;
109
219
  /** Delete all sessions for user. Invalidates Redis cache. */
110
- export declare function deleteSessionsByUserId(userId: string): Promise<import(".prisma/client").Prisma.BatchPayload>;
220
+ export declare function deleteSessionsByUserId(userId: string): Promise<import("@prisma/client/runtime/library.js").GetBatchResult>;
111
221
  /** Delete password reset sessions expiring before date. */
112
- export declare function deleteShortLivedSessionsByUserId(userId: string, expiresBefore: Date): import(".prisma/client").Prisma.PrismaPromise<import(".prisma/client").Prisma.BatchPayload>;
222
+ export declare function deleteShortLivedSessionsByUserId(userId: string, expiresBefore: Date): import("@prisma/client/runtime/library.js").PrismaPromise<import("@prisma/client/runtime/library.js").GetBatchResult>;
113
223
  /** Delete a user. */
114
- export declare function deleteUserById(id: string): import(".prisma/client").Prisma.Prisma__UserClient<{
224
+ export declare function deleteUserById(id: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
225
+ result: {
226
+ userProfile: {
227
+ profilePicture: () => {
228
+ needs: {
229
+ profilePicture: true;
230
+ };
231
+ compute(profile: {
232
+ profilePicture: string | null;
233
+ }): string | null;
234
+ };
235
+ profilePictureThumbnail: () => {
236
+ needs: {
237
+ profilePictureThumbnail: true;
238
+ };
239
+ compute(profile: {
240
+ profilePictureThumbnail: string | null;
241
+ }): string | null;
242
+ };
243
+ };
244
+ };
245
+ model: {};
246
+ query: {};
247
+ client: {};
248
+ }, {}>, "User", "delete", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
115
249
  id: string;
116
250
  username: string;
117
251
  email: string;
118
252
  password: string;
119
253
  verified: boolean;
254
+ termsAcceptedAt: Date | null;
255
+ termsVersion: string | null;
120
256
  schoolId: string | null;
121
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
122
- datasources: {
123
- db: {
124
- url: string;
125
- };
126
- };
127
257
  }>;
128
258
  /** @returns Session by ID and type. */
129
- export declare function findSessionByIdAndType(id: string, type: SessionType): import(".prisma/client").Prisma.Prisma__SessionClient<{
259
+ export declare function findSessionByIdAndType(id: string, type: SessionType): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
260
+ result: {
261
+ userProfile: {
262
+ profilePicture: () => {
263
+ needs: {
264
+ profilePicture: true;
265
+ };
266
+ compute(profile: {
267
+ profilePicture: string | null;
268
+ }): string | null;
269
+ };
270
+ profilePictureThumbnail: () => {
271
+ needs: {
272
+ profilePictureThumbnail: true;
273
+ };
274
+ compute(profile: {
275
+ profilePictureThumbnail: string | null;
276
+ }): string | null;
277
+ };
278
+ };
279
+ };
280
+ model: {};
281
+ query: {};
282
+ client: {};
283
+ }, {}>, "Session", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
130
284
  type: import(".prisma/client").$Enums.SessionType;
131
285
  id: string;
132
- createdAt: Date | null;
133
286
  userId: string | null;
134
- expiresAt: Date | null;
287
+ createdAt: Date | null;
135
288
  classId: string | null;
136
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
137
- datasources: {
138
- db: {
139
- url: string;
289
+ expiresAt: Date | null;
290
+ } | null>;
291
+ /** @returns Session with user by ID and type. */
292
+ export declare function findSessionByIdWithUserAndType(id: string, type: SessionType): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
293
+ result: {
294
+ userProfile: {
295
+ profilePicture: () => {
296
+ needs: {
297
+ profilePicture: true;
298
+ };
299
+ compute(profile: {
300
+ profilePicture: string | null;
301
+ }): string | null;
302
+ };
303
+ profilePictureThumbnail: () => {
304
+ needs: {
305
+ profilePictureThumbnail: true;
306
+ };
307
+ compute(profile: {
308
+ profilePictureThumbnail: string | null;
309
+ }): string | null;
310
+ };
140
311
  };
141
312
  };
142
- }>;
143
- /** @returns Session with user by ID and type. */
144
- export declare function findSessionByIdWithUserAndType(id: string, type: SessionType): import(".prisma/client").Prisma.Prisma__SessionClient<({
313
+ model: {};
314
+ query: {};
315
+ client: {};
316
+ }, {}>, "Session", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<({
145
317
  user: {
146
318
  id: string;
147
319
  } | null;
148
320
  } & {
149
321
  type: import(".prisma/client").$Enums.SessionType;
150
322
  id: string;
151
- createdAt: Date | null;
152
323
  userId: string | null;
153
- expiresAt: Date | null;
324
+ createdAt: Date | null;
154
325
  classId: string | null;
155
- }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
156
- datasources: {
157
- db: {
158
- url: string;
326
+ expiresAt: Date | null;
327
+ }) | null>;
328
+ /** Set user verified status. */
329
+ export declare function updateUserVerified(userId: string, verified: boolean): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
330
+ result: {
331
+ userProfile: {
332
+ profilePicture: () => {
333
+ needs: {
334
+ profilePicture: true;
335
+ };
336
+ compute(profile: {
337
+ profilePicture: string | null;
338
+ }): string | null;
339
+ };
340
+ profilePictureThumbnail: () => {
341
+ needs: {
342
+ profilePictureThumbnail: true;
343
+ };
344
+ compute(profile: {
345
+ profilePictureThumbnail: string | null;
346
+ }): string | null;
347
+ };
159
348
  };
160
349
  };
161
- }>;
162
- /** Set user verified status. */
163
- export declare function updateUserVerified(userId: string, verified: boolean): import(".prisma/client").Prisma.Prisma__UserClient<{
350
+ model: {};
351
+ query: {};
352
+ client: {};
353
+ }, {}>, "User", "update", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
164
354
  id: string;
165
355
  username: string;
166
356
  email: string;
167
357
  password: string;
168
358
  verified: boolean;
359
+ termsAcceptedAt: Date | null;
360
+ termsVersion: string | null;
169
361
  schoolId: string | null;
170
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
171
- datasources: {
172
- db: {
173
- url: string;
174
- };
175
- };
176
362
  }>;
177
363
  /** Update user password. */
178
- export declare function updateUserPassword(userId: string, password: string): import(".prisma/client").Prisma.Prisma__UserClient<{
364
+ export declare function updateUserPassword(userId: string, password: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
365
+ result: {
366
+ userProfile: {
367
+ profilePicture: () => {
368
+ needs: {
369
+ profilePicture: true;
370
+ };
371
+ compute(profile: {
372
+ profilePicture: string | null;
373
+ }): string | null;
374
+ };
375
+ profilePictureThumbnail: () => {
376
+ needs: {
377
+ profilePictureThumbnail: true;
378
+ };
379
+ compute(profile: {
380
+ profilePictureThumbnail: string | null;
381
+ }): string | null;
382
+ };
383
+ };
384
+ };
385
+ model: {};
386
+ query: {};
387
+ client: {};
388
+ }, {}>, "User", "update", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
179
389
  id: string;
180
390
  username: string;
181
391
  email: string;
182
392
  password: string;
183
393
  verified: boolean;
394
+ termsAcceptedAt: Date | null;
395
+ termsVersion: string | null;
184
396
  schoolId: string | null;
185
- }, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
186
- datasources: {
187
- db: {
188
- url: string;
189
- };
190
- };
191
397
  }>;
192
398
  /** Delete a session. */
193
399
  export declare function deleteSessionById(id: string): Promise<{
194
400
  type: import(".prisma/client").$Enums.SessionType;
195
401
  id: string;
196
- createdAt: Date | null;
197
402
  userId: string | null;
198
- expiresAt: Date | null;
403
+ createdAt: Date | null;
199
404
  classId: string | null;
405
+ expiresAt: Date | null;
200
406
  }>;
201
407
  /** @returns User from valid auth session token. Checks Redis first, then DB. Caches in Redis. */
202
408
  export declare function findUserBySessionToken(token: string): Promise<any>;
203
409
  /** @returns Class IDs where user is a teacher. */
204
- export declare function findTeacherClassesByUserId(userId: string): import(".prisma/client").Prisma.PrismaPromise<{
410
+ export declare function findTeacherClassesByUserId(userId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
205
411
  id: string;
206
412
  }[]>;
207
413
  /** @returns Class if user is student or teacher. */
208
- export declare function findClassWithMember(classId: string, userId: string): import(".prisma/client").Prisma.Prisma__ClassClient<{
209
- name: string;
414
+ export declare function findClassWithMember(classId: string, userId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
415
+ result: {
416
+ userProfile: {
417
+ profilePicture: () => {
418
+ needs: {
419
+ profilePicture: true;
420
+ };
421
+ compute(profile: {
422
+ profilePicture: string | null;
423
+ }): string | null;
424
+ };
425
+ profilePictureThumbnail: () => {
426
+ needs: {
427
+ profilePictureThumbnail: true;
428
+ };
429
+ compute(profile: {
430
+ profilePictureThumbnail: string | null;
431
+ }): string | null;
432
+ };
433
+ };
434
+ };
435
+ model: {};
436
+ query: {};
437
+ client: {};
438
+ }, {}>, "Class", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
439
+ section: string;
210
440
  id: string;
441
+ name: string;
211
442
  schoolId: string | null;
212
- subject: string;
213
443
  color: string | null;
214
- section: string;
444
+ subject: string;
215
445
  syllabus: string | null;
216
446
  departmentId: string | null;
217
447
  discussionsEnabled: boolean;
218
448
  studentsCanCreateDiscussions: boolean;
219
449
  studentsCanReply: boolean;
220
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
221
- datasources: {
222
- db: {
223
- url: string;
450
+ } | null>;
451
+ /** @returns Class if user is a teacher or school admin. */
452
+ export declare function findClassWithTeacher(classId: string, teacherId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
453
+ result: {
454
+ userProfile: {
455
+ profilePicture: () => {
456
+ needs: {
457
+ profilePicture: true;
458
+ };
459
+ compute(profile: {
460
+ profilePicture: string | null;
461
+ }): string | null;
462
+ };
463
+ profilePictureThumbnail: () => {
464
+ needs: {
465
+ profilePictureThumbnail: true;
466
+ };
467
+ compute(profile: {
468
+ profilePictureThumbnail: string | null;
469
+ }): string | null;
470
+ };
224
471
  };
225
472
  };
226
- }>;
227
- /** @returns Class if user is a teacher or school admin. */
228
- export declare function findClassWithTeacher(classId: string, teacherId: string): import(".prisma/client").Prisma.Prisma__ClassClient<{
229
- name: string;
473
+ model: {};
474
+ query: {};
475
+ client: {};
476
+ }, {}>, "Class", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
477
+ section: string;
230
478
  id: string;
479
+ name: string;
231
480
  schoolId: string | null;
232
- subject: string;
233
481
  color: string | null;
234
- section: string;
482
+ subject: string;
235
483
  syllabus: string | null;
236
484
  departmentId: string | null;
237
485
  discussionsEnabled: boolean;
238
486
  studentsCanCreateDiscussions: boolean;
239
487
  studentsCanReply: boolean;
240
- } | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
241
- datasources: {
242
- db: {
243
- url: string;
244
- };
245
- };
246
- }>;
488
+ } | null>;
247
489
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"/","sources":["models/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAuB7C,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;GAWl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,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKlE;AAED,wBAAwB;AACxB,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,MAAM;;;;;;;GAKjD;AAED,iGAAiG;AACjG,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,gBAqCzD;AAED,kDAAkD;AAClD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM;;KAKxD;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOlE;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOtE"}
@@ -3,7 +3,7 @@
3
3
  * findUserBySessionToken checks Redis first, then DB.
4
4
  */
5
5
 
6
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0a142abe-c24b-5549-932f-108cd325b0ee")}catch(e){}}();
6
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1f454e5f-571d-5200-843d-700eec8d74e3")}catch(e){}}();
7
7
  import { SessionType } from "@prisma/client";
8
8
  import { getRedis } from "../lib/redis.js";
9
9
  import { prisma } from "../lib/prisma.js";
@@ -94,6 +94,8 @@ export function createUser(data) {
94
94
  email: data.email,
95
95
  password: data.password,
96
96
  verified: data.verified ?? false,
97
+ termsAcceptedAt: data.termsAcceptedAt,
98
+ termsVersion: data.termsVersion,
97
99
  profile: { create: {} },
98
100
  },
99
101
  select: {
@@ -233,4 +235,4 @@ export function findClassWithTeacher(classId, teacherId) {
233
235
  });
234
236
  }
235
237
  //# sourceMappingURL=auth.js.map
236
- //# debugId=0a142abe-c24b-5549-932f-108cd325b0ee
238
+ //# debugId=1f454e5f-571d-5200-843d-700eec8d74e3