@studious-lms/server 1.6.0 → 1.8.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.
- package/dist/models/access.d.ts +21 -66
- package/dist/models/access.d.ts.map +1 -1
- package/dist/models/access.js +10 -26
- package/dist/models/access.js.map +1 -1
- package/dist/models/agenda.d.ts +2 -0
- package/dist/models/agenda.d.ts.map +1 -1
- package/dist/models/announcement.d.ts +2 -1
- package/dist/models/announcement.d.ts.map +1 -1
- package/dist/models/announcement.js +2 -3
- package/dist/models/announcement.js.map +1 -1
- package/dist/models/assignment.d.ts +7 -0
- package/dist/models/assignment.d.ts.map +1 -1
- package/dist/models/auth.d.ts +2 -4
- package/dist/models/auth.d.ts.map +1 -1
- package/dist/models/auth.js +2 -3
- package/dist/models/auth.js.map +1 -1
- package/dist/models/class.d.ts +32 -4
- package/dist/models/class.d.ts.map +1 -1
- package/dist/models/class.js +15 -2
- package/dist/models/class.js.map +1 -1
- package/dist/models/cloudStorage.d.ts +140 -0
- package/dist/models/cloudStorage.d.ts.map +1 -0
- package/dist/models/cloudStorage.js +175 -0
- package/dist/models/cloudStorage.js.map +1 -0
- package/dist/models/comment.d.ts +0 -24
- package/dist/models/comment.d.ts.map +1 -1
- package/dist/models/comment.js +2 -6
- package/dist/models/comment.js.map +1 -1
- package/dist/models/conversation.d.ts +38 -22
- package/dist/models/conversation.d.ts.map +1 -1
- package/dist/models/conversation.js +50 -2
- package/dist/models/conversation.js.map +1 -1
- package/dist/models/department.d.ts +154 -0
- package/dist/models/department.d.ts.map +1 -0
- package/dist/models/department.js +135 -0
- package/dist/models/department.js.map +1 -0
- package/dist/models/event.d.ts +7 -1
- package/dist/models/event.d.ts.map +1 -1
- package/dist/models/event.js +2 -5
- package/dist/models/event.js.map +1 -1
- package/dist/models/file.d.ts +25 -10
- package/dist/models/file.d.ts.map +1 -1
- package/dist/models/file.js +2 -5
- package/dist/models/file.js.map +1 -1
- package/dist/models/folder.d.ts +47 -0
- package/dist/models/folder.d.ts.map +1 -1
- package/dist/models/labChat.d.ts +5 -3
- package/dist/models/labChat.d.ts.map +1 -1
- package/dist/models/message.d.ts +46 -12
- package/dist/models/message.d.ts.map +1 -1
- package/dist/models/message.js +19 -10
- package/dist/models/message.js.map +1 -1
- package/dist/models/newtonChat.d.ts +2 -1
- package/dist/models/newtonChat.d.ts.map +1 -1
- package/dist/models/school.d.ts +45 -12
- package/dist/models/school.d.ts.map +1 -1
- package/dist/models/school.js +19 -2
- package/dist/models/school.js.map +1 -1
- package/dist/models/section.d.ts +1 -0
- package/dist/models/section.d.ts.map +1 -1
- package/dist/models/tag.d.ts +117 -0
- package/dist/models/tag.d.ts.map +1 -0
- package/dist/models/tag.js +113 -0
- package/dist/models/tag.js.map +1 -0
- package/dist/models/worksheet.d.ts +3 -0
- package/dist/models/worksheet.d.ts.map +1 -1
- package/dist/pipelines/aiLabChatContract.d.ts +8 -8
- package/dist/routers/_app.d.ts +3556 -2298
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +6 -2
- package/dist/routers/_app.js.map +1 -1
- package/dist/routers/agenda.d.ts +2 -0
- package/dist/routers/agenda.d.ts.map +1 -1
- package/dist/routers/announcement.d.ts.map +1 -1
- package/dist/routers/announcement.js +3 -5
- package/dist/routers/announcement.js.map +1 -1
- package/dist/routers/assignment.d.ts +18 -9
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/assignment.js +2 -3
- package/dist/routers/assignment.js.map +1 -1
- package/dist/routers/class.d.ts +87 -14
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/class.js +5 -2
- package/dist/routers/class.js.map +1 -1
- package/dist/routers/conversation.d.ts +20 -5
- package/dist/routers/conversation.d.ts.map +1 -1
- package/dist/routers/conversation.js +6 -3
- package/dist/routers/conversation.js.map +1 -1
- package/dist/routers/department.d.ts +293 -0
- package/dist/routers/department.d.ts.map +1 -0
- package/dist/routers/department.js +93 -0
- package/dist/routers/department.js.map +1 -0
- package/dist/routers/event.d.ts +2 -1
- package/dist/routers/event.d.ts.map +1 -1
- package/dist/routers/file.d.ts +8 -6
- package/dist/routers/file.d.ts.map +1 -1
- package/dist/routers/file.js +26 -17
- package/dist/routers/file.js.map +1 -1
- package/dist/routers/folder.d.ts +139 -186
- package/dist/routers/folder.d.ts.map +1 -1
- package/dist/routers/folder.js +82 -90
- package/dist/routers/folder.js.map +1 -1
- package/dist/routers/labChat.d.ts +11 -2
- package/dist/routers/labChat.d.ts.map +1 -1
- package/dist/routers/message.d.ts +20 -2
- package/dist/routers/message.d.ts.map +1 -1
- package/dist/routers/newtonChat.d.ts +9 -0
- package/dist/routers/newtonChat.d.ts.map +1 -1
- package/dist/routers/school.d.ts +160 -17
- package/dist/routers/school.d.ts.map +1 -1
- package/dist/routers/school.js +46 -3
- package/dist/routers/school.js.map +1 -1
- package/dist/routers/tag.d.ts +119 -0
- package/dist/routers/tag.d.ts.map +1 -0
- package/dist/routers/tag.js +52 -0
- package/dist/routers/tag.js.map +1 -0
- package/dist/routers/worksheet.d.ts +1 -0
- package/dist/routers/worksheet.d.ts.map +1 -1
- package/dist/seedDatabase.d.ts +0 -1
- package/dist/seedDatabase.d.ts.map +1 -1
- package/dist/services/agenda.d.ts +2 -0
- package/dist/services/agenda.d.ts.map +1 -1
- package/dist/services/assignment.d.ts +18 -9
- package/dist/services/assignment.d.ts.map +1 -1
- package/dist/services/assignment.js +4 -4
- package/dist/services/assignment.js.map +1 -1
- package/dist/services/class.d.ts +87 -14
- package/dist/services/class.d.ts.map +1 -1
- package/dist/services/class.js +91 -4
- package/dist/services/class.js.map +1 -1
- package/dist/services/conversation.d.ts +21 -5
- package/dist/services/conversation.d.ts.map +1 -1
- package/dist/services/conversation.js +22 -3
- package/dist/services/conversation.js.map +1 -1
- package/dist/services/department.d.ts +200 -0
- package/dist/services/department.d.ts.map +1 -0
- package/dist/services/department.js +368 -0
- package/dist/services/department.js.map +1 -0
- package/dist/services/event.d.ts +2 -1
- package/dist/services/event.d.ts.map +1 -1
- package/dist/services/file.d.ts +85 -0
- package/dist/services/file.d.ts.map +1 -1
- package/dist/services/file.js +92 -2
- package/dist/services/file.js.map +1 -1
- package/dist/services/folder.d.ts +125 -149
- package/dist/services/folder.d.ts.map +1 -1
- package/dist/services/folder.js +258 -199
- package/dist/services/folder.js.map +1 -1
- package/dist/services/labChat.d.ts +11 -2
- package/dist/services/labChat.d.ts.map +1 -1
- package/dist/services/labChat.js +8 -7
- package/dist/services/labChat.js.map +1 -1
- package/dist/services/message.d.ts +20 -2
- package/dist/services/message.d.ts.map +1 -1
- package/dist/services/message.js +7 -23
- package/dist/services/message.js.map +1 -1
- package/dist/services/newtonChat.d.ts +9 -0
- package/dist/services/newtonChat.d.ts.map +1 -1
- package/dist/services/newtonChat.js +7 -6
- package/dist/services/newtonChat.js.map +1 -1
- package/dist/services/school.d.ts +142 -15
- package/dist/services/school.d.ts.map +1 -1
- package/dist/services/school.js +308 -54
- package/dist/services/school.js.map +1 -1
- package/dist/services/tag.d.ts +71 -0
- package/dist/services/tag.d.ts.map +1 -0
- package/dist/services/tag.js +178 -0
- package/dist/services/tag.js.map +1 -0
- package/dist/services/worksheet.d.ts +1 -0
- package/dist/services/worksheet.d.ts.map +1 -1
- package/dist/utils/aiUser.d.ts.map +1 -1
- package/dist/utils/aiUser.js +2 -3
- package/dist/utils/aiUser.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260509220000_institution_overhaul/migration.sql +184 -0
- package/prisma/schema.prisma +119 -35
- package/src/models/access.ts +8 -24
- package/src/models/announcement.ts +0 -1
- package/src/models/auth.ts +0 -1
- package/src/models/class.ts +13 -0
- package/src/models/cloudStorage.ts +194 -0
- package/src/models/comment.ts +0 -4
- package/src/models/conversation.ts +54 -0
- package/src/models/department.ts +159 -0
- package/src/models/event.ts +0 -3
- package/src/models/file.ts +0 -3
- package/src/models/message.ts +19 -5
- package/src/models/school.ts +26 -0
- package/src/models/tag.ts +140 -0
- package/src/routers/_app.ts +4 -0
- package/src/routers/announcement.ts +1 -3
- package/src/routers/assignment.ts +0 -1
- package/src/routers/class.ts +3 -0
- package/src/routers/conversation.ts +7 -0
- package/src/routers/department.ts +174 -0
- package/src/routers/file.ts +29 -26
- package/src/routers/folder.ts +100 -121
- package/src/routers/school.ts +83 -0
- package/src/routers/tag.ts +78 -0
- package/src/services/assignment.ts +2 -3
- package/src/services/class.ts +108 -3
- package/src/services/conversation.ts +30 -0
- package/src/services/department.ts +478 -0
- package/src/services/file.ts +100 -0
- package/src/services/folder.ts +313 -240
- package/src/services/labChat.ts +7 -6
- package/src/services/message.ts +5 -21
- package/src/services/newtonChat.ts +5 -5
- package/src/services/school.ts +369 -57
- package/src/services/tag.ts +229 -0
- package/src/utils/aiUser.ts +0 -1
- package/tests/integration/routers/conversation.test.ts +121 -2
package/dist/models/event.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare function findEventById(id: string): import(".prisma/client").Pris
|
|
|
6
6
|
email: string;
|
|
7
7
|
password: string;
|
|
8
8
|
verified: boolean;
|
|
9
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
10
9
|
schoolId: string | null;
|
|
11
10
|
} | null;
|
|
12
11
|
class: ({
|
|
@@ -20,6 +19,7 @@ export declare function findEventById(id: string): import(".prisma/client").Pris
|
|
|
20
19
|
} & {
|
|
21
20
|
name: string;
|
|
22
21
|
id: string;
|
|
22
|
+
description: string | null;
|
|
23
23
|
logoId: string | null;
|
|
24
24
|
subdomain: string | null;
|
|
25
25
|
createdAt: Date;
|
|
@@ -36,6 +36,7 @@ export declare function findEventById(id: string): import(".prisma/client").Pris
|
|
|
36
36
|
color: string | null;
|
|
37
37
|
section: string;
|
|
38
38
|
syllabus: string | null;
|
|
39
|
+
departmentId: string | null;
|
|
39
40
|
}) | null;
|
|
40
41
|
assignmentsAttached: {
|
|
41
42
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
@@ -86,6 +87,7 @@ export declare function findClassWithTeachers(classId: string, teacherId: string
|
|
|
86
87
|
color: string | null;
|
|
87
88
|
section: string;
|
|
88
89
|
syllabus: string | null;
|
|
90
|
+
departmentId: string | null;
|
|
89
91
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
90
92
|
datasources: {
|
|
91
93
|
db: {
|
|
@@ -181,6 +183,7 @@ export declare function findEventWithClass(eventId: string): import(".prisma/cli
|
|
|
181
183
|
} & {
|
|
182
184
|
name: string;
|
|
183
185
|
id: string;
|
|
186
|
+
description: string | null;
|
|
184
187
|
logoId: string | null;
|
|
185
188
|
subdomain: string | null;
|
|
186
189
|
createdAt: Date;
|
|
@@ -197,6 +200,7 @@ export declare function findEventWithClass(eventId: string): import(".prisma/cli
|
|
|
197
200
|
color: string | null;
|
|
198
201
|
section: string;
|
|
199
202
|
syllabus: string | null;
|
|
203
|
+
departmentId: string | null;
|
|
200
204
|
}) | null;
|
|
201
205
|
} & {
|
|
202
206
|
name: string | null;
|
|
@@ -228,6 +232,7 @@ export declare function findAssignmentWithClass(assignmentId: string): import(".
|
|
|
228
232
|
} & {
|
|
229
233
|
name: string;
|
|
230
234
|
id: string;
|
|
235
|
+
description: string | null;
|
|
231
236
|
logoId: string | null;
|
|
232
237
|
subdomain: string | null;
|
|
233
238
|
createdAt: Date;
|
|
@@ -244,6 +249,7 @@ export declare function findAssignmentWithClass(assignmentId: string): import(".
|
|
|
244
249
|
color: string | null;
|
|
245
250
|
section: string;
|
|
246
251
|
syllabus: string | null;
|
|
252
|
+
departmentId: string | null;
|
|
247
253
|
};
|
|
248
254
|
} & {
|
|
249
255
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"/","sources":["models/event.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"/","sources":["models/event.ts"],"names":[],"mappings":"AA+DA,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;GAyB3D;AAED,qCAAqC;AACrC,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOhB;AAED,wCAAwC;AACxC,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM7D;AAED,sDAAsD;AACtD,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;KAqB/D"}
|
package/dist/models/event.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Event model – calendar events, assignment attachment/detachment.
|
|
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]="
|
|
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]="40b50512-03a6-535f-a397-55717298eee6")}catch(e){}}();
|
|
6
6
|
import { prisma } from "../lib/prisma.js";
|
|
7
7
|
import { classTeacherOrSchoolAdminWhere } from "./access.js";
|
|
8
8
|
const eventGetInclude = {
|
|
@@ -12,7 +12,6 @@ const eventGetInclude = {
|
|
|
12
12
|
school: {
|
|
13
13
|
include: {
|
|
14
14
|
users: {
|
|
15
|
-
where: { role: "ADMIN" },
|
|
16
15
|
select: { id: true },
|
|
17
16
|
},
|
|
18
17
|
memberships: {
|
|
@@ -107,7 +106,6 @@ export function findEventWithClass(eventId) {
|
|
|
107
106
|
school: {
|
|
108
107
|
include: {
|
|
109
108
|
users: {
|
|
110
|
-
where: { role: "ADMIN" },
|
|
111
109
|
select: { id: true },
|
|
112
110
|
},
|
|
113
111
|
memberships: {
|
|
@@ -135,7 +133,6 @@ export function findAssignmentWithClass(assignmentId) {
|
|
|
135
133
|
school: {
|
|
136
134
|
include: {
|
|
137
135
|
users: {
|
|
138
|
-
where: { role: "ADMIN" },
|
|
139
136
|
select: { id: true },
|
|
140
137
|
},
|
|
141
138
|
memberships: {
|
|
@@ -192,4 +189,4 @@ export function findAvailableAssignmentsForClass(classId) {
|
|
|
192
189
|
});
|
|
193
190
|
}
|
|
194
191
|
//# sourceMappingURL=event.js.map
|
|
195
|
-
//# debugId=
|
|
192
|
+
//# debugId=40b50512-03a6-535f-a397-55717298eee6
|
package/dist/models/event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sources":["models/event.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Event model – calendar events, assignment attachment/detachment.\n */\nimport { prisma } from \"../lib/prisma.js\";\nimport { classTeacherOrSchoolAdminWhere } from \"./access.js\";\n\nconst eventGetInclude = {\n class: {\n include: {\n teachers: { select: { id: 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 user: true,\n assignmentsAttached: {\n select: {\n id: true,\n title: true,\n instructions: true,\n dueDate: true,\n type: true,\n graded: true,\n maxGrade: true,\n weight: true,\n attachments: { select: { id: true, name: true, type: true } },\n section: { select: { id: true, name: true } },\n teacher: { select: { id: true, username: true } },\n },\n },\n};\n\nconst eventCreateSelect = {\n id: true,\n name: true,\n location: true,\n remarks: true,\n startTime: true,\n endTime: true,\n color: true,\n classId: true,\n userId: true,\n class: { select: { id: true, name: true } },\n};\n\nconst assignmentUpdateInclude = {\n attachments: { select: { id: true, name: true, type: true } },\n section: { select: { id: true, name: true } },\n teacher: { select: { id: true, username: true } },\n};\n\n/** @returns Event by ID with class, user, attached assignments. */\nexport function findEventById(id: string) {\n return prisma.event.findUnique({\n where: { id },\n include: eventGetInclude,\n });\n}\n\n/** @returns Class if user is a teacher or school admin. */\nexport function findClassWithTeachers(classId: string, teacherId: string) {\n return prisma.class.findFirst({\n where: {\n id: classId,\n ...classTeacherOrSchoolAdminWhere(teacherId),\n },\n });\n}\n\n/** Create a calendar event. */\nexport function createEvent(data: {\n name?: string;\n location?: string;\n remarks?: string;\n startTime: Date;\n endTime: Date;\n userId: string;\n color?: string;\n classId?: string;\n}) {\n return prisma.event.create({\n data,\n select: eventCreateSelect,\n });\n}\n\n/** Update an event. */\nexport function updateEvent(\n id: string,\n data: {\n name?: string;\n location?: string;\n remarks?: string;\n startTime?: Date;\n endTime?: Date;\n color?: string;\n classId?: string;\n }\n) {\n return prisma.event.update({\n where: { id },\n data,\n });\n}\n\n/** Delete an event. */\nexport function deleteEventById(id: string) {\n return prisma.event.delete({\n where: { id },\n });\n}\n\n/** @returns Event with class and teachers. */\nexport function findEventWithClass(eventId: string) {\n return prisma.event.findUnique({\n where: { id: eventId },\n include: {\n class: {\n include: {\n teachers: { select: { id: 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/** @returns Assignment with class and teachers. */\nexport function findAssignmentWithClass(assignmentId: string) {\n return prisma.assignment.findUnique({\n where: { id: assignmentId },\n include: {\n class: {\n include: {\n teachers: { select: { id: 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/** Attach assignment to an event. */\nexport function attachAssignmentToEvent(\n assignmentId: string,\n eventId: string\n) {\n return prisma.assignment.update({\n where: { id: assignmentId },\n data: { eventAttached: { connect: { id: eventId } } },\n include: assignmentUpdateInclude,\n });\n}\n\n/** Detach assignment from its event. */\nexport function detachAssignmentFromEvent(assignmentId: string) {\n return prisma.assignment.update({\n where: { id: assignmentId },\n data: { eventAttached: { disconnect: true } },\n include: assignmentUpdateInclude,\n });\n}\n\n/** @returns Assignments not attached to any event. */\nexport function findAvailableAssignmentsForClass(classId: string) {\n return prisma.assignment.findMany({\n where: {\n classId,\n eventId: null,\n },\n select: {\n id: true,\n title: true,\n instructions: true,\n dueDate: true,\n type: true,\n graded: true,\n maxGrade: true,\n weight: true,\n section: { select: { id: true, name: true } },\n attachments: { select: { id: true, name: true, type: true } },\n teacher: { select: { id: true, username: true } },\n },\n orderBy: { createdAt: \"desc\" },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,eAAe,GAAG;IACtB,KAAK,EAAE;QACL,OAAO,EAAE;YACP,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;YAClC,MAAM,EAAE;gBACN,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL,KAAK,EAAE,EAAE,IAAI,EAAE,OAAgB,EAAE;wBACjC,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE;qBACrB;oBACD,WAAW,EAAE;wBACX,KAAK,EAAE;4BACL,IAAI,EAAE,OAAgB;4BACtB,MAAM,EAAE,QAAiB;yBAC1B;wBACD,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;qBACzB;iBACF;aACF;SACF;KACF;IACD,IAAI,EAAE,IAAI;IACV,mBAAmB,EAAE;QACnB,MAAM,EAAE;YACN,EAAE,EAAE,IAAI;YACR,KAAK,EAA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,CAAC,CAAC;AACL,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,yBAAyB,CAAC,YAAoB;IAC5D,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;QAC9B,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE;QAC3B,IAAI,EAAE,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE;QAC7C,OAAO,EAAE,uBAAuB;KACjC,CAAC,CAAC;AACL,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,gCAAgC,CAAC,OAAe;IAC9D,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;QAChC,KAAK,EAAE;YACL,OAAO;YACP,OAAO,EAAE,IAAI;SACd;QACD,MAAM,EAAE;YACN,EAAE,EAAE,IAAI;YACR,KAAK,EAAE,IAAI;YACX,YAAY,EAAE,IAAI;YAClB,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;YAC7C,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;YAC7D,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SAClD;QACD,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;KAC/B,CAAC,CAAC;AACL,CAAC","debug_id":"cf3ed911-c40a-5919-97ae-6a9c13344647"}
|
|
1
|
+
{"version":3,"file":"event.js","sources":["models/event.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Event model – calendar events, assignment attachment/detachment.\n */\nimport { prisma } from \"../lib/prisma.js\";\nimport { classTeacherOrSchoolAdminWhere } from \"./access.js\";\n\nconst eventGetInclude = {\n class: {\n include: {\n teachers: { select: { id: true } },\n school: {\n include: {\n users: {\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 user: true,\n assignmentsAttached: {\n select: {\n id: true,\n title: true,\n instructions: true,\n dueDate: true,\n type: true,\n graded: true,\n maxGrade: true,\n weight: true,\n attachments: { select: { id: true, name: true, type: true } },\n section: { select: { id: true, name: true } },\n teacher: { select: { id: true, username: true } },\n },\n },\n};\n\nconst eventCreateSelect = {\n id: true,\n name: true,\n location: true,\n remarks: true,\n startTime: true,\n endTime: true,\n color: true,\n classId: true,\n userId: true,\n class: { select: { id: true, name: true } },\n};\n\nconst assignmentUpdateInclude = {\n attachments: { select: { id: true, name: true, type: true } },\n section: { select: { id: true, name: true } },\n teacher: { select: { id: true, username: true } },\n};\n\n/** @returns Event by ID with class, user, attached assignments. */\nexport function findEventById(id: string) {\n return prisma.event.findUnique({\n where: { id },\n include: eventGetInclude,\n });\n}\n\n/** @returns Class if user is a teacher or school admin. */\nexport function findClassWithTeachers(classId: string, teacherId: string) {\n return prisma.class.findFirst({\n where: {\n id: classId,\n ...classTeacherOrSchoolAdminWhere(teacherId),\n },\n });\n}\n\n/** Create a calendar event. */\nexport function createEvent(data: {\n name?: string;\n location?: string;\n remarks?: string;\n startTime: Date;\n endTime: Date;\n userId: string;\n color?: string;\n classId?: string;\n}) {\n return prisma.event.create({\n data,\n select: eventCreateSelect,\n });\n}\n\n/** Update an event. */\nexport function updateEvent(\n id: string,\n data: {\n name?: string;\n location?: string;\n remarks?: string;\n startTime?: Date;\n endTime?: Date;\n color?: string;\n classId?: string;\n }\n) {\n return prisma.event.update({\n where: { id },\n data,\n });\n}\n\n/** Delete an event. */\nexport function deleteEventById(id: string) {\n return prisma.event.delete({\n where: { id },\n });\n}\n\n/** @returns Event with class and teachers. */\nexport function findEventWithClass(eventId: string) {\n return prisma.event.findUnique({\n where: { id: eventId },\n include: {\n class: {\n include: {\n teachers: { select: { id: true } },\n school: {\n include: {\n users: {\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/** @returns Assignment with class and teachers. */\nexport function findAssignmentWithClass(assignmentId: string) {\n return prisma.assignment.findUnique({\n where: { id: assignmentId },\n include: {\n class: {\n include: {\n teachers: { select: { id: true } },\n school: {\n include: {\n users: {\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/** Attach assignment to an event. */\nexport function attachAssignmentToEvent(\n assignmentId: string,\n eventId: string\n) {\n return prisma.assignment.update({\n where: { id: assignmentId },\n data: { eventAttached: { connect: { id: eventId } } },\n include: assignmentUpdateInclude,\n });\n}\n\n/** Detach assignment from its event. */\nexport function detachAssignmentFromEvent(assignmentId: string) {\n return prisma.assignment.update({\n where: { id: assignmentId },\n data: { eventAttached: { disconnect: true } },\n include: assignmentUpdateInclude,\n });\n}\n\n/** @returns Assignments not attached to any event. */\nexport function findAvailableAssignmentsForClass(classId: string) {\n return prisma.assignment.findMany({\n where: {\n classId,\n eventId: null,\n },\n select: {\n id: true,\n title: true,\n instructions: true,\n dueDate: true,\n type: true,\n graded: true,\n maxGrade: true,\n weight: true,\n section: { select: { id: true, name: true } },\n attachments: { select: { id: true, name: true, type: true } },\n teacher: { select: { id: true, username: true } },\n },\n orderBy: { createdAt: \"desc\" },\n });\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,eAAe,GAAG;IACtB,KAAK,EAAE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AE,IAAI,EAAE,EAAE;YAC7D,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SAClD;QACD,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;KAC/B,CAAC,CAAC;AACL,CAAC","debug_id":"40b50512-03a6-535f-a397-55717298eee6"}
|
package/dist/models/file.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
12
12
|
} & {
|
|
13
13
|
name: string;
|
|
14
14
|
id: string;
|
|
15
|
+
description: string | null;
|
|
15
16
|
logoId: string | null;
|
|
16
17
|
subdomain: string | null;
|
|
17
18
|
createdAt: Date;
|
|
@@ -23,7 +24,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
23
24
|
email: string;
|
|
24
25
|
password: string;
|
|
25
26
|
verified: boolean;
|
|
26
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
27
27
|
schoolId: string | null;
|
|
28
28
|
}[];
|
|
29
29
|
students: {
|
|
@@ -32,7 +32,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
32
32
|
email: string;
|
|
33
33
|
password: string;
|
|
34
34
|
verified: boolean;
|
|
35
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
36
35
|
schoolId: string | null;
|
|
37
36
|
}[];
|
|
38
37
|
} & {
|
|
@@ -43,6 +42,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
43
42
|
color: string | null;
|
|
44
43
|
section: string;
|
|
45
44
|
syllabus: string | null;
|
|
45
|
+
departmentId: string | null;
|
|
46
46
|
};
|
|
47
47
|
} & {
|
|
48
48
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
@@ -83,6 +83,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
83
83
|
} & {
|
|
84
84
|
name: string;
|
|
85
85
|
id: string;
|
|
86
|
+
description: string | null;
|
|
86
87
|
logoId: string | null;
|
|
87
88
|
subdomain: string | null;
|
|
88
89
|
createdAt: Date;
|
|
@@ -94,7 +95,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
94
95
|
email: string;
|
|
95
96
|
password: string;
|
|
96
97
|
verified: boolean;
|
|
97
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
98
98
|
schoolId: string | null;
|
|
99
99
|
}[];
|
|
100
100
|
} & {
|
|
@@ -105,6 +105,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
105
105
|
color: string | null;
|
|
106
106
|
section: string;
|
|
107
107
|
syllabus: string | null;
|
|
108
|
+
departmentId: string | null;
|
|
108
109
|
};
|
|
109
110
|
} & {
|
|
110
111
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
@@ -138,7 +139,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
138
139
|
email: string;
|
|
139
140
|
password: string;
|
|
140
141
|
verified: boolean;
|
|
141
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
142
142
|
schoolId: string | null;
|
|
143
143
|
};
|
|
144
144
|
} & {
|
|
@@ -171,6 +171,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
171
171
|
} & {
|
|
172
172
|
name: string;
|
|
173
173
|
id: string;
|
|
174
|
+
description: string | null;
|
|
174
175
|
logoId: string | null;
|
|
175
176
|
subdomain: string | null;
|
|
176
177
|
createdAt: Date;
|
|
@@ -182,7 +183,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
182
183
|
email: string;
|
|
183
184
|
password: string;
|
|
184
185
|
verified: boolean;
|
|
185
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
186
186
|
schoolId: string | null;
|
|
187
187
|
}[];
|
|
188
188
|
} & {
|
|
@@ -193,6 +193,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
193
193
|
color: string | null;
|
|
194
194
|
section: string;
|
|
195
195
|
syllabus: string | null;
|
|
196
|
+
departmentId: string | null;
|
|
196
197
|
};
|
|
197
198
|
} & {
|
|
198
199
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
@@ -226,7 +227,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
226
227
|
email: string;
|
|
227
228
|
password: string;
|
|
228
229
|
verified: boolean;
|
|
229
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
230
230
|
schoolId: string | null;
|
|
231
231
|
};
|
|
232
232
|
} & {
|
|
@@ -258,6 +258,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
258
258
|
} & {
|
|
259
259
|
name: string;
|
|
260
260
|
id: string;
|
|
261
|
+
description: string | null;
|
|
261
262
|
logoId: string | null;
|
|
262
263
|
subdomain: string | null;
|
|
263
264
|
createdAt: Date;
|
|
@@ -269,7 +270,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
269
270
|
email: string;
|
|
270
271
|
password: string;
|
|
271
272
|
verified: boolean;
|
|
272
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
273
273
|
schoolId: string | null;
|
|
274
274
|
}[];
|
|
275
275
|
students: {
|
|
@@ -278,7 +278,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
278
278
|
email: string;
|
|
279
279
|
password: string;
|
|
280
280
|
verified: boolean;
|
|
281
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
282
281
|
schoolId: string | null;
|
|
283
282
|
}[];
|
|
284
283
|
} & {
|
|
@@ -289,12 +288,16 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
289
288
|
color: string | null;
|
|
290
289
|
section: string;
|
|
291
290
|
syllabus: string | null;
|
|
291
|
+
departmentId: string | null;
|
|
292
292
|
}) | null;
|
|
293
293
|
} & {
|
|
294
294
|
name: string;
|
|
295
295
|
id: string;
|
|
296
296
|
color: string | null;
|
|
297
297
|
classId: string | null;
|
|
298
|
+
schoolStorageId: string | null;
|
|
299
|
+
personalOwnerId: string | null;
|
|
300
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
298
301
|
parentFolderId: string | null;
|
|
299
302
|
}) | null;
|
|
300
303
|
announcement: ({
|
|
@@ -309,6 +312,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
309
312
|
} & {
|
|
310
313
|
name: string;
|
|
311
314
|
id: string;
|
|
315
|
+
description: string | null;
|
|
312
316
|
logoId: string | null;
|
|
313
317
|
subdomain: string | null;
|
|
314
318
|
createdAt: Date;
|
|
@@ -320,7 +324,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
320
324
|
email: string;
|
|
321
325
|
password: string;
|
|
322
326
|
verified: boolean;
|
|
323
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
324
327
|
schoolId: string | null;
|
|
325
328
|
}[];
|
|
326
329
|
students: {
|
|
@@ -329,7 +332,6 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
329
332
|
email: string;
|
|
330
333
|
password: string;
|
|
331
334
|
verified: boolean;
|
|
332
|
-
role: import(".prisma/client").$Enums.UserRole;
|
|
333
335
|
schoolId: string | null;
|
|
334
336
|
}[];
|
|
335
337
|
} & {
|
|
@@ -340,6 +342,7 @@ export declare function findFileById(fileId: string): import(".prisma/client").P
|
|
|
340
342
|
color: string | null;
|
|
341
343
|
section: string;
|
|
342
344
|
syllabus: string | null;
|
|
345
|
+
departmentId: string | null;
|
|
343
346
|
};
|
|
344
347
|
} & {
|
|
345
348
|
id: string;
|
|
@@ -394,12 +397,16 @@ export declare function findFileWithFolder(fileId: string): import(".prisma/clie
|
|
|
394
397
|
color: string | null;
|
|
395
398
|
section: string;
|
|
396
399
|
syllabus: string | null;
|
|
400
|
+
departmentId: string | null;
|
|
397
401
|
} | null;
|
|
398
402
|
} & {
|
|
399
403
|
name: string;
|
|
400
404
|
id: string;
|
|
401
405
|
color: string | null;
|
|
402
406
|
classId: string | null;
|
|
407
|
+
schoolStorageId: string | null;
|
|
408
|
+
personalOwnerId: string | null;
|
|
409
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
403
410
|
parentFolderId: string | null;
|
|
404
411
|
}) | null;
|
|
405
412
|
} & {
|
|
@@ -475,12 +482,16 @@ export declare function findFileWithFolderAndThumbnail(fileId: string): import("
|
|
|
475
482
|
color: string | null;
|
|
476
483
|
section: string;
|
|
477
484
|
syllabus: string | null;
|
|
485
|
+
departmentId: string | null;
|
|
478
486
|
} | null;
|
|
479
487
|
} & {
|
|
480
488
|
name: string;
|
|
481
489
|
id: string;
|
|
482
490
|
color: string | null;
|
|
483
491
|
classId: string | null;
|
|
492
|
+
schoolStorageId: string | null;
|
|
493
|
+
personalOwnerId: string | null;
|
|
494
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
484
495
|
parentFolderId: string | null;
|
|
485
496
|
}) | null;
|
|
486
497
|
} & {
|
|
@@ -527,12 +538,16 @@ export declare function findFolderById(folderId: string): import(".prisma/client
|
|
|
527
538
|
color: string | null;
|
|
528
539
|
section: string;
|
|
529
540
|
syllabus: string | null;
|
|
541
|
+
departmentId: string | null;
|
|
530
542
|
} | null;
|
|
531
543
|
} & {
|
|
532
544
|
name: string;
|
|
533
545
|
id: string;
|
|
534
546
|
color: string | null;
|
|
535
547
|
classId: string | null;
|
|
548
|
+
schoolStorageId: string | null;
|
|
549
|
+
personalOwnerId: string | null;
|
|
550
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
536
551
|
parentFolderId: string | null;
|
|
537
552
|
}) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
538
553
|
datasources: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"/","sources":["models/file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"/","sources":["models/file.ts"],"names":[],"mappings":"AAwBA,0GAA0G;AAC1G,wBAAgB,YAAY,CAAC,MAAM,EAAE,M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;;;;;;;;;;;GAI5C"}
|
package/dist/models/file.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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]="
|
|
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]="fab4a93e-e5c9-5485-b331-b3e1d8dd0d22")}catch(e){}}();
|
|
6
6
|
import { prisma } from "../lib/prisma.js";
|
|
7
7
|
const classFileAccessInclude = {
|
|
8
8
|
students: true,
|
|
@@ -10,7 +10,6 @@ const classFileAccessInclude = {
|
|
|
10
10
|
school: {
|
|
11
11
|
include: {
|
|
12
12
|
users: {
|
|
13
|
-
where: { role: "ADMIN" },
|
|
14
13
|
select: { id: true },
|
|
15
14
|
},
|
|
16
15
|
memberships: {
|
|
@@ -46,7 +45,6 @@ export function findFileById(fileId) {
|
|
|
46
45
|
school: {
|
|
47
46
|
include: {
|
|
48
47
|
users: {
|
|
49
|
-
where: { role: "ADMIN" },
|
|
50
48
|
select: { id: true },
|
|
51
49
|
},
|
|
52
50
|
memberships: {
|
|
@@ -75,7 +73,6 @@ export function findFileById(fileId) {
|
|
|
75
73
|
school: {
|
|
76
74
|
include: {
|
|
77
75
|
users: {
|
|
78
|
-
where: { role: "ADMIN" },
|
|
79
76
|
select: { id: true },
|
|
80
77
|
},
|
|
81
78
|
memberships: {
|
|
@@ -163,4 +160,4 @@ export function deleteFileById(fileId) {
|
|
|
163
160
|
});
|
|
164
161
|
}
|
|
165
162
|
//# sourceMappingURL=file.js.map
|
|
166
|
-
//# debugId=
|
|
163
|
+
//# debugId=fab4a93e-e5c9-5485-b331-b3e1d8dd0d22
|
package/dist/models/file.js.map
CHANGED
|
@@ -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
|
|
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 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 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 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({\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,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE;aACrB;YACD,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,E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,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,IAAY;IACzD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACxB,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACrB,IAAI,EAAE,EAAE,IAAI,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;SAC/C;KACF,CAAC,CAAC;AACL,CAAC;AAED,4BAA4B;AAC5B,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACxB,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;KACtB,CAAC,CAAC;AACL,CAAC","debug_id":"fab4a93e-e5c9-5485-b331-b3e1d8dd0d22"}
|
package/dist/models/folder.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function findClassWithTeacher(classId: string, teacherId: string)
|
|
|
7
7
|
color: string | null;
|
|
8
8
|
section: string;
|
|
9
9
|
syllabus: string | null;
|
|
10
|
+
departmentId: string | null;
|
|
10
11
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
11
12
|
datasources: {
|
|
12
13
|
db: {
|
|
@@ -20,6 +21,9 @@ export declare function findFolderById(folderId: string): import(".prisma/client
|
|
|
20
21
|
id: string;
|
|
21
22
|
color: string | null;
|
|
22
23
|
classId: string | null;
|
|
24
|
+
schoolStorageId: string | null;
|
|
25
|
+
personalOwnerId: string | null;
|
|
26
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
23
27
|
parentFolderId: string | null;
|
|
24
28
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
25
29
|
datasources: {
|
|
@@ -38,12 +42,16 @@ export declare function findFolderByIdWithClass(folderId: string): import(".pris
|
|
|
38
42
|
color: string | null;
|
|
39
43
|
section: string;
|
|
40
44
|
syllabus: string | null;
|
|
45
|
+
departmentId: string | null;
|
|
41
46
|
} | null;
|
|
42
47
|
} & {
|
|
43
48
|
name: string;
|
|
44
49
|
id: string;
|
|
45
50
|
color: string | null;
|
|
46
51
|
classId: string | null;
|
|
52
|
+
schoolStorageId: string | null;
|
|
53
|
+
personalOwnerId: string | null;
|
|
54
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
47
55
|
parentFolderId: string | null;
|
|
48
56
|
}) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
49
57
|
datasources: {
|
|
@@ -58,6 +66,9 @@ export declare function findRootFolderByClassId(classId: string): import(".prism
|
|
|
58
66
|
id: string;
|
|
59
67
|
color: string | null;
|
|
60
68
|
classId: string | null;
|
|
69
|
+
schoolStorageId: string | null;
|
|
70
|
+
personalOwnerId: string | null;
|
|
71
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
61
72
|
parentFolderId: string | null;
|
|
62
73
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
63
74
|
datasources: {
|
|
@@ -72,6 +83,9 @@ export declare function findOrCreateRootFolder(classId: string): Promise<{
|
|
|
72
83
|
id: string;
|
|
73
84
|
color: string | null;
|
|
74
85
|
classId: string | null;
|
|
86
|
+
schoolStorageId: string | null;
|
|
87
|
+
personalOwnerId: string | null;
|
|
88
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
75
89
|
parentFolderId: string | null;
|
|
76
90
|
}>;
|
|
77
91
|
/** Create a folder. */
|
|
@@ -106,6 +120,9 @@ export declare function createFolder(data: {
|
|
|
106
120
|
id: string;
|
|
107
121
|
color: string | null;
|
|
108
122
|
classId: string | null;
|
|
123
|
+
schoolStorageId: string | null;
|
|
124
|
+
personalOwnerId: string | null;
|
|
125
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
109
126
|
parentFolderId: string | null;
|
|
110
127
|
}, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
111
128
|
datasources: {
|
|
@@ -145,6 +162,9 @@ export declare function findFolderWithContents(folderId: string): import(".prism
|
|
|
145
162
|
id: string;
|
|
146
163
|
color: string | null;
|
|
147
164
|
classId: string | null;
|
|
165
|
+
schoolStorageId: string | null;
|
|
166
|
+
personalOwnerId: string | null;
|
|
167
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
148
168
|
parentFolderId: string | null;
|
|
149
169
|
}) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
150
170
|
datasources: {
|
|
@@ -180,6 +200,9 @@ export declare function findChildFolders(parentFolderId: string): import(".prism
|
|
|
180
200
|
id: string;
|
|
181
201
|
color: string | null;
|
|
182
202
|
classId: string | null;
|
|
203
|
+
schoolStorageId: string | null;
|
|
204
|
+
personalOwnerId: string | null;
|
|
205
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
183
206
|
parentFolderId: string | null;
|
|
184
207
|
})[]>;
|
|
185
208
|
/** @returns Root folder with contents for a class. */
|
|
@@ -215,6 +238,9 @@ export declare function findRootFolderWithContents(classId: string): import(".pr
|
|
|
215
238
|
id: string;
|
|
216
239
|
color: string | null;
|
|
217
240
|
classId: string | null;
|
|
241
|
+
schoolStorageId: string | null;
|
|
242
|
+
personalOwnerId: string | null;
|
|
243
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
218
244
|
parentFolderId: string | null;
|
|
219
245
|
}) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
220
246
|
datasources: {
|
|
@@ -234,6 +260,9 @@ export declare function findFolderWithCount(folderId: string, classId: string):
|
|
|
234
260
|
id: string;
|
|
235
261
|
color: string | null;
|
|
236
262
|
classId: string | null;
|
|
263
|
+
schoolStorageId: string | null;
|
|
264
|
+
personalOwnerId: string | null;
|
|
265
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
237
266
|
parentFolderId: string | null;
|
|
238
267
|
}) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
239
268
|
datasources: {
|
|
@@ -253,6 +282,9 @@ export declare function findFolderByIdWithCount(folderId: string): import(".pris
|
|
|
253
282
|
id: string;
|
|
254
283
|
color: string | null;
|
|
255
284
|
classId: string | null;
|
|
285
|
+
schoolStorageId: string | null;
|
|
286
|
+
personalOwnerId: string | null;
|
|
287
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
256
288
|
parentFolderId: string | null;
|
|
257
289
|
}) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
258
290
|
datasources: {
|
|
@@ -267,6 +299,9 @@ export declare function deleteFolderById(folderId: string): import(".prisma/clie
|
|
|
267
299
|
id: string;
|
|
268
300
|
color: string | null;
|
|
269
301
|
classId: string | null;
|
|
302
|
+
schoolStorageId: string | null;
|
|
303
|
+
personalOwnerId: string | null;
|
|
304
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
270
305
|
parentFolderId: string | null;
|
|
271
306
|
}, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
272
307
|
datasources: {
|
|
@@ -302,6 +337,9 @@ export declare function updateFolderParent(folderId: string, parentFolderId: str
|
|
|
302
337
|
id: string;
|
|
303
338
|
color: string | null;
|
|
304
339
|
classId: string | null;
|
|
340
|
+
schoolStorageId: string | null;
|
|
341
|
+
personalOwnerId: string | null;
|
|
342
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
305
343
|
parentFolderId: string | null;
|
|
306
344
|
}, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
307
345
|
datasources: {
|
|
@@ -340,6 +378,9 @@ export declare function updateFolder(folderId: string, data: {
|
|
|
340
378
|
id: string;
|
|
341
379
|
color: string | null;
|
|
342
380
|
classId: string | null;
|
|
381
|
+
schoolStorageId: string | null;
|
|
382
|
+
personalOwnerId: string | null;
|
|
383
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
343
384
|
parentFolderId: string | null;
|
|
344
385
|
}, never, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
345
386
|
datasources: {
|
|
@@ -354,6 +395,9 @@ export declare function findFolderByIdForTraversal(id: string): import(".prisma/
|
|
|
354
395
|
id: string;
|
|
355
396
|
color: string | null;
|
|
356
397
|
classId: string | null;
|
|
398
|
+
schoolStorageId: string | null;
|
|
399
|
+
personalOwnerId: string | null;
|
|
400
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
357
401
|
parentFolderId: string | null;
|
|
358
402
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
359
403
|
datasources: {
|
|
@@ -368,6 +412,9 @@ export declare function findFolderParents(folderId: string): import(".prisma/cli
|
|
|
368
412
|
id: string;
|
|
369
413
|
color: string | null;
|
|
370
414
|
classId: string | null;
|
|
415
|
+
schoolStorageId: string | null;
|
|
416
|
+
personalOwnerId: string | null;
|
|
417
|
+
scope: import(".prisma/client").$Enums.FolderScope;
|
|
371
418
|
parentFolderId: string | null;
|
|
372
419
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
373
420
|
datasources: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder.d.ts","sourceRoot":"/","sources":["models/folder.ts"],"names":[],"mappings":"AAsBA,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"folder.d.ts","sourceRoot":"/","sources":["models/folder.ts"],"names":[],"mappings":"AAsBA,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;GAOtE;AAED,6BAA6B;AAC7B,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;GAI9C;AAED,kCAAkC;AAClC,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;GAKvD;AAED,wCAAwC;AACxC,wBAAgB,uBAAuB,CAAC,OAAO,EAA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