@studious-lms/server 1.7.0 → 1.9.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 (212) hide show
  1. package/dist/middleware/security.d.ts.map +1 -1
  2. package/dist/middleware/security.js +3 -3
  3. package/dist/middleware/security.js.map +1 -1
  4. package/dist/models/access.d.ts +21 -66
  5. package/dist/models/access.d.ts.map +1 -1
  6. package/dist/models/access.js +10 -26
  7. package/dist/models/access.js.map +1 -1
  8. package/dist/models/agenda.d.ts +4 -2
  9. package/dist/models/agenda.d.ts.map +1 -1
  10. package/dist/models/announcement.d.ts +4 -3
  11. package/dist/models/announcement.d.ts.map +1 -1
  12. package/dist/models/announcement.js +2 -3
  13. package/dist/models/announcement.js.map +1 -1
  14. package/dist/models/assignment.d.ts +40 -33
  15. package/dist/models/assignment.d.ts.map +1 -1
  16. package/dist/models/auth.d.ts +2 -4
  17. package/dist/models/auth.d.ts.map +1 -1
  18. package/dist/models/auth.js +2 -3
  19. package/dist/models/auth.js.map +1 -1
  20. package/dist/models/class.d.ts +34 -6
  21. package/dist/models/class.d.ts.map +1 -1
  22. package/dist/models/class.js +15 -2
  23. package/dist/models/class.js.map +1 -1
  24. package/dist/models/cloudStorage.d.ts +153 -0
  25. package/dist/models/cloudStorage.d.ts.map +1 -0
  26. package/dist/models/cloudStorage.js +295 -0
  27. package/dist/models/cloudStorage.js.map +1 -0
  28. package/dist/models/comment.d.ts +0 -24
  29. package/dist/models/comment.d.ts.map +1 -1
  30. package/dist/models/comment.js +2 -6
  31. package/dist/models/comment.js.map +1 -1
  32. package/dist/models/conversation.d.ts +22 -22
  33. package/dist/models/department.d.ts +154 -0
  34. package/dist/models/department.d.ts.map +1 -0
  35. package/dist/models/department.js +135 -0
  36. package/dist/models/department.js.map +1 -0
  37. package/dist/models/event.d.ts +10 -4
  38. package/dist/models/event.d.ts.map +1 -1
  39. package/dist/models/event.js +2 -5
  40. package/dist/models/event.js.map +1 -1
  41. package/dist/models/file.d.ts +52 -36
  42. package/dist/models/file.d.ts.map +1 -1
  43. package/dist/models/file.js +4 -42
  44. package/dist/models/file.js.map +1 -1
  45. package/dist/models/folder.d.ts +47 -0
  46. package/dist/models/folder.d.ts.map +1 -1
  47. package/dist/models/labChat.d.ts +11 -9
  48. package/dist/models/labChat.d.ts.map +1 -1
  49. package/dist/models/message.d.ts +46 -12
  50. package/dist/models/message.d.ts.map +1 -1
  51. package/dist/models/message.js +19 -10
  52. package/dist/models/message.js.map +1 -1
  53. package/dist/models/newtonChat.d.ts +2 -1
  54. package/dist/models/newtonChat.d.ts.map +1 -1
  55. package/dist/models/school.d.ts +45 -12
  56. package/dist/models/school.d.ts.map +1 -1
  57. package/dist/models/school.js +19 -2
  58. package/dist/models/school.js.map +1 -1
  59. package/dist/models/section.d.ts +2 -1
  60. package/dist/models/section.d.ts.map +1 -1
  61. package/dist/models/tag.d.ts +117 -0
  62. package/dist/models/tag.d.ts.map +1 -0
  63. package/dist/models/tag.js +113 -0
  64. package/dist/models/tag.js.map +1 -0
  65. package/dist/models/worksheet.d.ts +3 -0
  66. package/dist/models/worksheet.d.ts.map +1 -1
  67. package/dist/pipelines/aiLabChatContract.d.ts +8 -8
  68. package/dist/routers/_app.d.ts +6704 -5222
  69. package/dist/routers/_app.d.ts.map +1 -1
  70. package/dist/routers/_app.js +8 -2
  71. package/dist/routers/_app.js.map +1 -1
  72. package/dist/routers/agenda.d.ts +4 -2
  73. package/dist/routers/agenda.d.ts.map +1 -1
  74. package/dist/routers/announcement.d.ts.map +1 -1
  75. package/dist/routers/announcement.js +3 -5
  76. package/dist/routers/announcement.js.map +1 -1
  77. package/dist/routers/assignment.d.ts +49 -40
  78. package/dist/routers/assignment.d.ts.map +1 -1
  79. package/dist/routers/assignment.js +2 -3
  80. package/dist/routers/assignment.js.map +1 -1
  81. package/dist/routers/class.d.ts +92 -19
  82. package/dist/routers/class.d.ts.map +1 -1
  83. package/dist/routers/class.js +5 -2
  84. package/dist/routers/class.js.map +1 -1
  85. package/dist/routers/conversation.d.ts +5 -5
  86. package/dist/routers/department.d.ts +293 -0
  87. package/dist/routers/department.d.ts.map +1 -0
  88. package/dist/routers/department.js +93 -0
  89. package/dist/routers/department.js.map +1 -0
  90. package/dist/routers/event.d.ts +4 -3
  91. package/dist/routers/event.d.ts.map +1 -1
  92. package/dist/routers/file.d.ts +10 -8
  93. package/dist/routers/file.d.ts.map +1 -1
  94. package/dist/routers/file.js +26 -17
  95. package/dist/routers/file.js.map +1 -1
  96. package/dist/routers/folder.d.ts +163 -186
  97. package/dist/routers/folder.d.ts.map +1 -1
  98. package/dist/routers/folder.js +102 -88
  99. package/dist/routers/folder.js.map +1 -1
  100. package/dist/routers/labChat.d.ts +13 -4
  101. package/dist/routers/labChat.d.ts.map +1 -1
  102. package/dist/routers/message.d.ts +20 -2
  103. package/dist/routers/message.d.ts.map +1 -1
  104. package/dist/routers/newtonChat.d.ts +10 -1
  105. package/dist/routers/newtonChat.d.ts.map +1 -1
  106. package/dist/routers/permissions.d.ts +120 -0
  107. package/dist/routers/permissions.d.ts.map +1 -0
  108. package/dist/routers/permissions.js +50 -0
  109. package/dist/routers/permissions.js.map +1 -0
  110. package/dist/routers/school.d.ts +160 -17
  111. package/dist/routers/school.d.ts.map +1 -1
  112. package/dist/routers/school.js +46 -3
  113. package/dist/routers/school.js.map +1 -1
  114. package/dist/routers/tag.d.ts +119 -0
  115. package/dist/routers/tag.d.ts.map +1 -0
  116. package/dist/routers/tag.js +52 -0
  117. package/dist/routers/tag.js.map +1 -0
  118. package/dist/routers/worksheet.d.ts +1 -0
  119. package/dist/routers/worksheet.d.ts.map +1 -1
  120. package/dist/seedDatabase.d.ts +0 -1
  121. package/dist/seedDatabase.d.ts.map +1 -1
  122. package/dist/services/agenda.d.ts +4 -2
  123. package/dist/services/agenda.d.ts.map +1 -1
  124. package/dist/services/assignment.d.ts +49 -40
  125. package/dist/services/assignment.d.ts.map +1 -1
  126. package/dist/services/class.d.ts +92 -19
  127. package/dist/services/class.d.ts.map +1 -1
  128. package/dist/services/class.js +92 -5
  129. package/dist/services/class.js.map +1 -1
  130. package/dist/services/conversation.d.ts +5 -5
  131. package/dist/services/department.d.ts +200 -0
  132. package/dist/services/department.d.ts.map +1 -0
  133. package/dist/services/department.js +368 -0
  134. package/dist/services/department.js.map +1 -0
  135. package/dist/services/event.d.ts +4 -3
  136. package/dist/services/event.d.ts.map +1 -1
  137. package/dist/services/file.d.ts +105 -3
  138. package/dist/services/file.d.ts.map +1 -1
  139. package/dist/services/file.js +167 -41
  140. package/dist/services/file.js.map +1 -1
  141. package/dist/services/folder.d.ts +220 -149
  142. package/dist/services/folder.d.ts.map +1 -1
  143. package/dist/services/folder.js +326 -196
  144. package/dist/services/folder.js.map +1 -1
  145. package/dist/services/labChat.d.ts +13 -4
  146. package/dist/services/labChat.d.ts.map +1 -1
  147. package/dist/services/labChat.js +4 -3
  148. package/dist/services/labChat.js.map +1 -1
  149. package/dist/services/message.d.ts +20 -2
  150. package/dist/services/message.d.ts.map +1 -1
  151. package/dist/services/message.js +7 -23
  152. package/dist/services/message.js.map +1 -1
  153. package/dist/services/newtonChat.d.ts +9 -0
  154. package/dist/services/newtonChat.d.ts.map +1 -1
  155. package/dist/services/newtonChat.js +4 -3
  156. package/dist/services/newtonChat.js.map +1 -1
  157. package/dist/services/permissions.d.ts +188 -0
  158. package/dist/services/permissions.d.ts.map +1 -0
  159. package/dist/services/permissions.js +661 -0
  160. package/dist/services/permissions.js.map +1 -0
  161. package/dist/services/school.d.ts +142 -15
  162. package/dist/services/school.d.ts.map +1 -1
  163. package/dist/services/school.js +308 -54
  164. package/dist/services/school.js.map +1 -1
  165. package/dist/services/tag.d.ts +71 -0
  166. package/dist/services/tag.d.ts.map +1 -0
  167. package/dist/services/tag.js +178 -0
  168. package/dist/services/tag.js.map +1 -0
  169. package/dist/services/worksheet.d.ts +1 -0
  170. package/dist/services/worksheet.d.ts.map +1 -1
  171. package/dist/utils/aiUser.d.ts.map +1 -1
  172. package/dist/utils/aiUser.js +2 -3
  173. package/dist/utils/aiUser.js.map +1 -1
  174. package/package.json +1 -1
  175. package/prisma/migrations/20260509220000_institution_overhaul/migration.sql +184 -0
  176. package/prisma/migrations/20260510170000_add_folder_permissions/migration.sql +93 -0
  177. package/prisma/schema.prisma +193 -35
  178. package/src/middleware/security.ts +1 -1
  179. package/src/models/access.ts +8 -24
  180. package/src/models/announcement.ts +0 -1
  181. package/src/models/auth.ts +0 -1
  182. package/src/models/class.ts +13 -0
  183. package/src/models/cloudStorage.ts +327 -0
  184. package/src/models/comment.ts +0 -4
  185. package/src/models/department.ts +159 -0
  186. package/src/models/event.ts +0 -3
  187. package/src/models/file.ts +2 -40
  188. package/src/models/message.ts +19 -5
  189. package/src/models/school.ts +26 -0
  190. package/src/models/tag.ts +140 -0
  191. package/src/routers/_app.ts +6 -0
  192. package/src/routers/announcement.ts +1 -3
  193. package/src/routers/assignment.ts +0 -1
  194. package/src/routers/class.ts +3 -0
  195. package/src/routers/department.ts +174 -0
  196. package/src/routers/file.ts +29 -26
  197. package/src/routers/folder.ts +127 -118
  198. package/src/routers/permissions.ts +71 -0
  199. package/src/routers/school.ts +83 -0
  200. package/src/routers/tag.ts +78 -0
  201. package/src/services/class.ts +109 -4
  202. package/src/services/department.ts +478 -0
  203. package/src/services/file.ts +172 -43
  204. package/src/services/folder.ts +399 -237
  205. package/src/services/labChat.ts +2 -1
  206. package/src/services/message.ts +5 -21
  207. package/src/services/newtonChat.ts +2 -1
  208. package/src/services/permissions.ts +778 -0
  209. package/src/services/school.ts +369 -57
  210. package/src/services/tag.ts +229 -0
  211. package/src/utils/aiUser.ts +0 -1
  212. package/tests/unit/services/permissions.test.ts +463 -0
@@ -3,15 +3,13 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
3
3
  assignment: ({
4
4
  class: {
5
5
  school: ({
6
- users: {
7
- id: string;
8
- }[];
9
6
  memberships: {
10
7
  userId: string;
11
8
  }[];
12
9
  } & {
13
10
  name: string;
14
11
  id: string;
12
+ description: string | null;
15
13
  logoId: string | null;
16
14
  subdomain: string | null;
17
15
  createdAt: Date;
@@ -23,7 +21,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
23
21
  email: string;
24
22
  password: string;
25
23
  verified: boolean;
26
- role: import(".prisma/client").$Enums.UserRole;
27
24
  schoolId: string | null;
28
25
  }[];
29
26
  students: {
@@ -32,7 +29,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
32
29
  email: string;
33
30
  password: string;
34
31
  verified: boolean;
35
- role: import(".prisma/client").$Enums.UserRole;
36
32
  schoolId: string | null;
37
33
  }[];
38
34
  } & {
@@ -43,13 +39,14 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
43
39
  color: string | null;
44
40
  section: string;
45
41
  syllabus: string | null;
42
+ departmentId: string | null;
46
43
  };
47
44
  } & {
48
45
  type: import(".prisma/client").$Enums.AssignmentType;
49
46
  id: string;
50
47
  createdAt: Date | null;
51
- modifiedAt: Date | null;
52
48
  classId: string;
49
+ modifiedAt: Date | null;
53
50
  title: string;
54
51
  instructions: string;
55
52
  dueDate: Date;
@@ -74,15 +71,13 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
74
71
  assignment: {
75
72
  class: {
76
73
  school: ({
77
- users: {
78
- id: string;
79
- }[];
80
74
  memberships: {
81
75
  userId: string;
82
76
  }[];
83
77
  } & {
84
78
  name: string;
85
79
  id: string;
80
+ description: string | null;
86
81
  logoId: string | null;
87
82
  subdomain: string | null;
88
83
  createdAt: Date;
@@ -94,7 +89,14 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
94
89
  email: string;
95
90
  password: string;
96
91
  verified: boolean;
97
- role: import(".prisma/client").$Enums.UserRole;
92
+ schoolId: string | null;
93
+ }[];
94
+ students: {
95
+ id: string;
96
+ username: string;
97
+ email: string;
98
+ password: string;
99
+ verified: boolean;
98
100
  schoolId: string | null;
99
101
  }[];
100
102
  } & {
@@ -105,13 +107,14 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
105
107
  color: string | null;
106
108
  section: string;
107
109
  syllabus: string | null;
110
+ departmentId: string | null;
108
111
  };
109
112
  } & {
110
113
  type: import(".prisma/client").$Enums.AssignmentType;
111
114
  id: string;
112
115
  createdAt: Date | null;
113
- modifiedAt: Date | null;
114
116
  classId: string;
117
+ modifiedAt: Date | null;
115
118
  title: string;
116
119
  instructions: string;
117
120
  dueDate: Date;
@@ -138,7 +141,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
138
141
  email: string;
139
142
  password: string;
140
143
  verified: boolean;
141
- role: import(".prisma/client").$Enums.UserRole;
142
144
  schoolId: string | null;
143
145
  };
144
146
  } & {
@@ -162,15 +164,13 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
162
164
  assignment: {
163
165
  class: {
164
166
  school: ({
165
- users: {
166
- id: string;
167
- }[];
168
167
  memberships: {
169
168
  userId: string;
170
169
  }[];
171
170
  } & {
172
171
  name: string;
173
172
  id: string;
173
+ description: string | null;
174
174
  logoId: string | null;
175
175
  subdomain: string | null;
176
176
  createdAt: Date;
@@ -182,7 +182,14 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
182
182
  email: string;
183
183
  password: string;
184
184
  verified: boolean;
185
- role: import(".prisma/client").$Enums.UserRole;
185
+ schoolId: string | null;
186
+ }[];
187
+ students: {
188
+ id: string;
189
+ username: string;
190
+ email: string;
191
+ password: string;
192
+ verified: boolean;
186
193
  schoolId: string | null;
187
194
  }[];
188
195
  } & {
@@ -193,13 +200,14 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
193
200
  color: string | null;
194
201
  section: string;
195
202
  syllabus: string | null;
203
+ departmentId: string | null;
196
204
  };
197
205
  } & {
198
206
  type: import(".prisma/client").$Enums.AssignmentType;
199
207
  id: string;
200
208
  createdAt: Date | null;
201
- modifiedAt: Date | null;
202
209
  classId: string;
210
+ modifiedAt: Date | null;
203
211
  title: string;
204
212
  instructions: string;
205
213
  dueDate: Date;
@@ -226,7 +234,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
226
234
  email: string;
227
235
  password: string;
228
236
  verified: boolean;
229
- role: import(".prisma/client").$Enums.UserRole;
230
237
  schoolId: string | null;
231
238
  };
232
239
  } & {
@@ -249,15 +256,13 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
249
256
  folder: ({
250
257
  class: ({
251
258
  school: ({
252
- users: {
253
- id: string;
254
- }[];
255
259
  memberships: {
256
260
  userId: string;
257
261
  }[];
258
262
  } & {
259
263
  name: string;
260
264
  id: string;
265
+ description: string | null;
261
266
  logoId: string | null;
262
267
  subdomain: string | null;
263
268
  createdAt: Date;
@@ -269,7 +274,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
269
274
  email: string;
270
275
  password: string;
271
276
  verified: boolean;
272
- role: import(".prisma/client").$Enums.UserRole;
273
277
  schoolId: string | null;
274
278
  }[];
275
279
  students: {
@@ -278,7 +282,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
278
282
  email: string;
279
283
  password: string;
280
284
  verified: boolean;
281
- role: import(".prisma/client").$Enums.UserRole;
282
285
  schoolId: string | null;
283
286
  }[];
284
287
  } & {
@@ -289,26 +292,28 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
289
292
  color: string | null;
290
293
  section: string;
291
294
  syllabus: string | null;
295
+ departmentId: string | null;
292
296
  }) | null;
293
297
  } & {
294
298
  name: string;
295
299
  id: string;
296
300
  color: string | null;
297
301
  classId: string | null;
302
+ schoolStorageId: string | null;
303
+ personalOwnerId: string | null;
304
+ scope: import(".prisma/client").$Enums.FolderScope;
298
305
  parentFolderId: string | null;
299
306
  }) | null;
300
307
  announcement: ({
301
308
  class: {
302
309
  school: ({
303
- users: {
304
- id: string;
305
- }[];
306
310
  memberships: {
307
311
  userId: string;
308
312
  }[];
309
313
  } & {
310
314
  name: string;
311
315
  id: string;
316
+ description: string | null;
312
317
  logoId: string | null;
313
318
  subdomain: string | null;
314
319
  createdAt: Date;
@@ -320,7 +325,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
320
325
  email: string;
321
326
  password: string;
322
327
  verified: boolean;
323
- role: import(".prisma/client").$Enums.UserRole;
324
328
  schoolId: string | null;
325
329
  }[];
326
330
  students: {
@@ -329,7 +333,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
329
333
  email: string;
330
334
  password: string;
331
335
  verified: boolean;
332
- role: import(".prisma/client").$Enums.UserRole;
333
336
  schoolId: string | null;
334
337
  }[];
335
338
  } & {
@@ -340,12 +343,13 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
340
343
  color: string | null;
341
344
  section: string;
342
345
  syllabus: string | null;
346
+ departmentId: string | null;
343
347
  };
344
348
  } & {
345
349
  id: string;
346
350
  createdAt: Date;
347
- modifiedAt: Date | null;
348
351
  classId: string;
352
+ modifiedAt: Date | null;
349
353
  teacherId: string;
350
354
  remarks: string;
351
355
  }) | null;
@@ -355,6 +359,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
355
359
  name: string;
356
360
  id: string;
357
361
  userId: string | null;
362
+ folderId: string | null;
358
363
  size: number | null;
359
364
  uploadedAt: Date | null;
360
365
  uploadStatus: import(".prisma/client").$Enums.UploadStatus;
@@ -371,7 +376,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
371
376
  submissionId: string | null;
372
377
  annotationId: string | null;
373
378
  classDraftId: string | null;
374
- folderId: string | null;
375
379
  conversationId: string | null;
376
380
  messageId: string | null;
377
381
  announcementId: string | null;
@@ -394,12 +398,16 @@ export declare function findFileWithFolder(fileId: string): import(".prisma/clie
394
398
  color: string | null;
395
399
  section: string;
396
400
  syllabus: string | null;
401
+ departmentId: string | null;
397
402
  } | null;
398
403
  } & {
399
404
  name: string;
400
405
  id: string;
401
406
  color: string | null;
402
407
  classId: string | null;
408
+ schoolStorageId: string | null;
409
+ personalOwnerId: string | null;
410
+ scope: import(".prisma/client").$Enums.FolderScope;
403
411
  parentFolderId: string | null;
404
412
  }) | null;
405
413
  } & {
@@ -408,6 +416,7 @@ export declare function findFileWithFolder(fileId: string): import(".prisma/clie
408
416
  name: string;
409
417
  id: string;
410
418
  userId: string | null;
419
+ folderId: string | null;
411
420
  size: number | null;
412
421
  uploadedAt: Date | null;
413
422
  uploadStatus: import(".prisma/client").$Enums.UploadStatus;
@@ -424,7 +433,6 @@ export declare function findFileWithFolder(fileId: string): import(".prisma/clie
424
433
  submissionId: string | null;
425
434
  annotationId: string | null;
426
435
  classDraftId: string | null;
427
- folderId: string | null;
428
436
  conversationId: string | null;
429
437
  messageId: string | null;
430
438
  announcementId: string | null;
@@ -444,6 +452,7 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
444
452
  name: string;
445
453
  id: string;
446
454
  userId: string | null;
455
+ folderId: string | null;
447
456
  size: number | null;
448
457
  uploadedAt: Date | null;
449
458
  uploadStatus: import(".prisma/client").$Enums.UploadStatus;
@@ -460,7 +469,6 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
460
469
  submissionId: string | null;
461
470
  annotationId: string | null;
462
471
  classDraftId: string | null;
463
- folderId: string | null;
464
472
  conversationId: string | null;
465
473
  messageId: string | null;
466
474
  announcementId: string | null;
@@ -475,12 +483,16 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
475
483
  color: string | null;
476
484
  section: string;
477
485
  syllabus: string | null;
486
+ departmentId: string | null;
478
487
  } | null;
479
488
  } & {
480
489
  name: string;
481
490
  id: string;
482
491
  color: string | null;
483
492
  classId: string | null;
493
+ schoolStorageId: string | null;
494
+ personalOwnerId: string | null;
495
+ scope: import(".prisma/client").$Enums.FolderScope;
484
496
  parentFolderId: string | null;
485
497
  }) | null;
486
498
  } & {
@@ -489,6 +501,7 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
489
501
  name: string;
490
502
  id: string;
491
503
  userId: string | null;
504
+ folderId: string | null;
492
505
  size: number | null;
493
506
  uploadedAt: Date | null;
494
507
  uploadStatus: import(".prisma/client").$Enums.UploadStatus;
@@ -505,7 +518,6 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
505
518
  submissionId: string | null;
506
519
  annotationId: string | null;
507
520
  classDraftId: string | null;
508
- folderId: string | null;
509
521
  conversationId: string | null;
510
522
  messageId: string | null;
511
523
  announcementId: string | null;
@@ -527,12 +539,16 @@ export declare function findFolderById(folderId: string): import(".prisma/client
527
539
  color: string | null;
528
540
  section: string;
529
541
  syllabus: string | null;
542
+ departmentId: string | null;
530
543
  } | null;
531
544
  } & {
532
545
  name: string;
533
546
  id: string;
534
547
  color: string | null;
535
548
  classId: string | null;
549
+ schoolStorageId: string | null;
550
+ personalOwnerId: string | null;
551
+ scope: import(".prisma/client").$Enums.FolderScope;
536
552
  parentFolderId: string | null;
537
553
  }) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
538
554
  datasources: {
@@ -553,6 +569,7 @@ export declare function updateFileFolder(fileId: string, folderId: string): impo
553
569
  name: string;
554
570
  id: string;
555
571
  userId: string | null;
572
+ folderId: string | null;
556
573
  size: number | null;
557
574
  uploadedAt: Date | null;
558
575
  uploadStatus: import(".prisma/client").$Enums.UploadStatus;
@@ -569,7 +586,6 @@ export declare function updateFileFolder(fileId: string, folderId: string): impo
569
586
  submissionId: string | null;
570
587
  annotationId: string | null;
571
588
  classDraftId: string | null;
572
- folderId: string | null;
573
589
  conversationId: string | null;
574
590
  messageId: string | null;
575
591
  announcementId: string | null;
@@ -593,6 +609,7 @@ export declare function updateFileName(fileId: string, name: string): import(".p
593
609
  name: string;
594
610
  id: string;
595
611
  userId: string | null;
612
+ folderId: string | null;
596
613
  size: number | null;
597
614
  uploadedAt: Date | null;
598
615
  uploadStatus: import(".prisma/client").$Enums.UploadStatus;
@@ -609,7 +626,6 @@ export declare function updateFileName(fileId: string, name: string): import(".p
609
626
  submissionId: string | null;
610
627
  annotationId: string | null;
611
628
  classDraftId: string | null;
612
- folderId: string | null;
613
629
  conversationId: string | null;
614
630
  messageId: string | null;
615
631
  announcementId: string | null;
@@ -628,6 +644,7 @@ export declare function deleteFileById(fileId: string): import(".prisma/client")
628
644
  name: string;
629
645
  id: string;
630
646
  userId: string | null;
647
+ folderId: string | null;
631
648
  size: number | null;
632
649
  uploadedAt: Date | null;
633
650
  uploadStatus: import(".prisma/client").$Enums.UploadStatus;
@@ -644,7 +661,6 @@ export declare function deleteFileById(fileId: string): import(".prisma/client")
644
661
  submissionId: string | null;
645
662
  annotationId: string | null;
646
663
  classDraftId: string | null;
647
- folderId: string | null;
648
664
  conversationId: string | null;
649
665
  messageId: string | null;
650
666
  announcementId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"/","sources":["models/file.ts"],"names":[],"mappings":"AAyBA,0GAA0G;AAC1G,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqF1C;AAED,2CAA2C;AAC3C,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOhD;AAED,+CAA+C;AAC/C,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C/C,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQ5D;AAED,wCAAwC;AACxC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;GAK9C;AAED,6BAA6B;AAC7B,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQhE;AAED,qBAAqB;AACrB,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQ1D;AAED,4BAA4B;AAC5B,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAI5C"}
@@ -2,17 +2,13 @@
2
2
  * File model – file lookup by ID, folder, assignment, submission. Permission checks.
3
3
  */
4
4
 
5
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5fff69ed-bff2-579c-a03e-467530b4ea27")}catch(e){}}();
5
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d3a26ae1-962d-534f-8e7b-4f9095d9b91d")}catch(e){}}();
6
6
  import { prisma } from "../lib/prisma.js";
7
7
  const classFileAccessInclude = {
8
8
  students: true,
9
9
  teachers: true,
10
10
  school: {
11
11
  include: {
12
- users: {
13
- where: { role: "ADMIN" },
14
- select: { id: true },
15
- },
16
12
  memberships: {
17
13
  where: {
18
14
  role: "ADMIN",
@@ -41,24 +37,7 @@ export function findFileById(fileId) {
41
37
  assignment: {
42
38
  include: {
43
39
  class: {
44
- include: {
45
- teachers: true,
46
- school: {
47
- include: {
48
- users: {
49
- where: { role: "ADMIN" },
50
- select: { id: true },
51
- },
52
- memberships: {
53
- where: {
54
- role: "ADMIN",
55
- status: "ACTIVE",
56
- },
57
- select: { userId: true },
58
- },
59
- },
60
- },
61
- },
40
+ include: classFileAccessInclude,
62
41
  },
63
42
  },
64
43
  },
@@ -70,24 +49,7 @@ export function findFileById(fileId) {
70
49
  assignment: {
71
50
  include: {
72
51
  class: {
73
- include: {
74
- teachers: true,
75
- school: {
76
- include: {
77
- users: {
78
- where: { role: "ADMIN" },
79
- select: { id: true },
80
- },
81
- memberships: {
82
- where: {
83
- role: "ADMIN",
84
- status: "ACTIVE",
85
- },
86
- select: { userId: true },
87
- },
88
- },
89
- },
90
- },
52
+ include: classFileAccessInclude,
91
53
  },
92
54
  },
93
55
  },
@@ -163,4 +125,4 @@ export function deleteFileById(fileId) {
163
125
  });
164
126
  }
165
127
  //# sourceMappingURL=file.js.map
166
- //# debugId=5fff69ed-bff2-579c-a03e-467530b4ea27
128
+ //# debugId=d3a26ae1-962d-534f-8e7b-4f9095d9b91d
@@ -1 +1 @@
1
- {"version":3,"file":"file.js","sources":["models/file.ts"],"sourceRoot":"/","sourcesContent":["/**\n * File model – file lookup by ID, folder, assignment, submission. Permission checks.\n */\nimport { prisma } from \"../lib/prisma.js\";\n\nconst classFileAccessInclude = {\n students: true,\n teachers: true,\n school: {\n include: {\n users: {\n where: { role: \"ADMIN\" as const },\n select: { id: true },\n },\n memberships: {\n where: {\n role: \"ADMIN\" as const,\n status: \"ACTIVE\" as const,\n },\n select: { userId: true },\n },\n },\n },\n} as const;\n\n/** @returns File with assignment, submission, annotations, folder, announcement for permission checks. */\nexport function findFileById(fileId: string) {\n return prisma.file.findUnique({\n where: { id: fileId },\n include: {\n assignment: {\n include: {\n class: {\n include: classFileAccessInclude,\n },\n },\n },\n submission: {\n include: {\n student: true,\n assignment: {\n include: {\n class: {\n include: {\n teachers: true,\n school: {\n include: {\n users: {\n where: { role: \"ADMIN\" as const },\n select: { id: true },\n },\n memberships: {\n where: {\n role: \"ADMIN\" as const,\n status: \"ACTIVE\" as const,\n },\n select: { userId: true },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n annotations: {\n include: {\n student: true,\n assignment: {\n include: {\n class: {\n include: {\n teachers: true,\n school: {\n include: {\n users: {\n where: { role: \"ADMIN\" as const },\n select: { id: true },\n },\n memberships: {\n where: {\n role: \"ADMIN\" as const,\n status: \"ACTIVE\" as const,\n },\n select: { userId: true },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n folder: {\n include: {\n class: {\n include: classFileAccessInclude,\n },\n },\n },\n announcement: {\n include: {\n class: {\n include: classFileAccessInclude,\n },\n },\n },\n },\n });\n}\n\n/** @returns File with folder and class. */\nexport function findFileWithFolder(fileId: string) {\n return prisma.file.findUnique({\n where: { id: fileId },\n include: {\n folder: { include: { class: true } },\n },\n });\n}\n\n/** @returns File with folder and thumbnail. */\nexport function findFileWithFolderAndThumbnail(fileId: string) {\n return prisma.file.findUnique({\n where: { id: fileId },\n include: {\n folder: { include: { class: true } },\n thumbnail: true,\n },\n });\n}\n\n/** @returns Folder by ID with class. */\nexport function findFolderById(folderId: string) {\n return prisma.folder.findUnique({\n where: { id: folderId },\n include: { class: true },\n });\n}\n\n/** Move file to a folder. */\nexport function updateFileFolder(fileId: string, folderId: string) {\n return prisma.file.update({\n where: { id: fileId },\n data: { folderId },\n include: {\n user: { select: { id: true, username: true } },\n },\n });\n}\n\n/** Rename a file. */\nexport function updateFileName(fileId: string, name: string) {\n return prisma.file.update({\n where: { id: fileId },\n data: { name },\n include: {\n user: { select: { id: true, username: true } },\n },\n });\n}\n\n/** Delete a file record. */\nexport function deleteFileById(fileId: string) {\n return prisma.file.delete({\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","debug_id":"5fff69ed-bff2-579c-a03e-467530b4ea27"}
1
+ {"version":3,"file":"file.js","sources":["models/file.ts"],"sourceRoot":"/","sourcesContent":["/**\n * File model – file lookup by ID, folder, assignment, submission. Permission checks.\n */\nimport { prisma } from \"../lib/prisma.js\";\n\nconst classFileAccessInclude = {\n students: true,\n teachers: true,\n school: {\n include: {\n memberships: {\n where: {\n role: \"ADMIN\" as const,\n status: \"ACTIVE\" as const,\n },\n select: { userId: true },\n },\n },\n },\n} as const;\n\n/** @returns File with assignment, submission, annotations, folder, announcement for permission checks. */\nexport function findFileById(fileId: string) {\n return prisma.file.findUnique({\n where: { id: fileId },\n include: {\n assignment: {\n include: {\n class: {\n include: classFileAccessInclude,\n },\n },\n },\n submission: {\n include: {\n student: true,\n assignment: {\n include: {\n class: {\n include: classFileAccessInclude,\n },\n },\n },\n },\n },\n annotations: {\n include: {\n student: true,\n assignment: {\n include: {\n class: {\n include: classFileAccessInclude,\n },\n },\n },\n },\n },\n folder: {\n include: {\n class: {\n include: classFileAccessInclude,\n },\n },\n },\n announcement: {\n include: {\n class: {\n include: classFileAccessInclude,\n },\n },\n },\n },\n });\n}\n\n/** @returns File with folder and class. */\nexport function findFileWithFolder(fileId: string) {\n return prisma.file.findUnique({\n where: { id: fileId },\n include: {\n folder: { include: { class: true } },\n },\n });\n}\n\n/** @returns File with folder and thumbnail. */\nexport function findFileWithFolderAndThumbnail(fileId: string) {\n return prisma.file.findUnique({\n where: { id: fileId },\n include: {\n folder: { include: { class: true } },\n thumbnail: true,\n },\n });\n}\n\n/** @returns Folder by ID with class. */\nexport function findFolderById(folderId: string) {\n return prisma.folder.findUnique({\n where: { id: folderId },\n include: { class: true },\n });\n}\n\n/** Move file to a folder. */\nexport function updateFileFolder(fileId: string, folderId: string) {\n return prisma.file.update({\n where: { id: fileId },\n data: { folderId },\n include: {\n user: { select: { id: true, username: true } },\n },\n });\n}\n\n/** Rename a file. */\nexport function updateFileName(fileId: string, name: string) {\n return prisma.file.update({\n where: { id: fileId },\n data: { name },\n include: {\n user: { select: { id: true, username: true } },\n },\n });\n}\n\n/** Delete a file record. */\nexport function deleteFileById(fileId: string) {\n return prisma.file.delete({\n where: { id: fileId },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,sBAAsB,GAAG;IAC7B,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE;QACN,OAAO,EAAE;YACP,WAAW,EAAE;gBACX,KAAK,EAAE;oBACL,IAAI,EAAE,OAAgB;oBACtB,MAAM,EAAE,QAAiB;iBAC1B;gBACD,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;aACzB;SACF;KACF;CACO,CAAC;AAEX,0GAA0G;AAC1G,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC5B,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACrB,OAAO,EAAE;YACP,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL,OAAO,EAAE,sBAAsB;qBAChC;iBACF;aACF;YACD,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,OAAO,EAAE,IAAI;oBACb,UAAU,EAAE;wBACV,OAAO,EAAE;4BACP,KAAK,EAAE;gCACL,OAAO,EAAE,sBAAsB;6BAChC;yBACF;qBACF;iBACF;aACF;YACD,WAAW,EAAE;gBACX,OAAO,EAAE;oBACP,OAAO,EAAE,IAAI;oBACb,UAAU,EAAE;wBACV,OAAO,EAAE;4BACP,KAAK,EAAE;gCACL,OAAO,EAAE,sBAAsB;6BAChC;yBACF;qBACF;iBACF;aACF;YACD,MAAM,EAAE;gBACN,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL,OAAO,EAAE,sBAAsB;qBAChC;iBACF;aACF;YACD,YAAY,EAAE;gBACZ,OAAO,EAA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