@studious-lms/server 1.2.47 → 1.2.49
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/index.js +22 -18
- package/dist/index.js.map +1 -1
- package/dist/middleware/security.d.ts.map +1 -1
- package/dist/middleware/security.js +4 -4
- package/dist/middleware/security.js.map +1 -1
- package/dist/routers/_app.d.ts +186 -0
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/agenda.d.ts +52 -0
- package/dist/routers/agenda.d.ts.map +1 -1
- package/dist/routers/agenda.js +4 -2
- package/dist/routers/agenda.js.map +1 -1
- package/dist/routers/announcement.d.ts +20 -0
- package/dist/routers/announcement.d.ts.map +1 -1
- package/dist/routers/announcement.js +9 -2
- package/dist/routers/announcement.js.map +1 -1
- package/dist/routers/assignment.d.ts +3 -0
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/assignment.js +5 -2
- package/dist/routers/assignment.js.map +1 -1
- package/dist/routers/class.d.ts +18 -0
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/class.js +56 -2
- package/dist/routers/class.js.map +1 -1
- package/dist/routers/newtonChat.d.ts.map +1 -1
- package/dist/routers/newtonChat.js +5 -6
- package/dist/routers/newtonChat.js.map +1 -1
- package/dist/seedDatabase.d.ts.map +1 -1
- package/dist/seedDatabase.js +34 -8
- package/dist/seedDatabase.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +24 -22
- package/src/middleware/security.ts +2 -2
- package/src/routers/agenda.ts +2 -0
- package/src/routers/announcement.ts +7 -0
- package/src/routers/assignment.ts +3 -0
- package/src/routers/class.ts +55 -0
- package/src/routers/newtonChat.ts +7 -9
- package/src/seedDatabase.ts +38 -6
package/dist/routers/class.d.ts
CHANGED
|
@@ -36,6 +36,15 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
36
36
|
title: string;
|
|
37
37
|
dueDate: Date;
|
|
38
38
|
}[];
|
|
39
|
+
members: {
|
|
40
|
+
id: string;
|
|
41
|
+
username: string;
|
|
42
|
+
profile: {
|
|
43
|
+
displayName: string | null;
|
|
44
|
+
profilePicture: string | null;
|
|
45
|
+
profilePictureThumbnail: string | null;
|
|
46
|
+
} | null;
|
|
47
|
+
}[];
|
|
39
48
|
color: string | null;
|
|
40
49
|
}[];
|
|
41
50
|
studentInClass: {
|
|
@@ -55,6 +64,15 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
55
64
|
title: string;
|
|
56
65
|
dueDate: Date;
|
|
57
66
|
}[];
|
|
67
|
+
members: {
|
|
68
|
+
id: string;
|
|
69
|
+
username: string;
|
|
70
|
+
profile: {
|
|
71
|
+
displayName: string | null;
|
|
72
|
+
profilePicture: string | null;
|
|
73
|
+
profilePictureThumbnail: string | null;
|
|
74
|
+
} | null;
|
|
75
|
+
}[];
|
|
58
76
|
color: string | null;
|
|
59
77
|
}[];
|
|
60
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"/","sources":["routers/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"class.d.ts","sourceRoot":"/","sources":["routers/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAguCtB,CAAC"}
|
package/dist/routers/class.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="767877f8-1e76-552f-92f2-c3b39f1302ec")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createTRPCRouter, protectedProcedure, protectedTeacherProcedure, protectedClassMemberProcedure } from "../trpc.js";
|
|
5
5
|
import { prisma } from "../lib/prisma.js";
|
|
@@ -32,6 +32,32 @@ export const classRouter = createTRPCRouter({
|
|
|
32
32
|
dueDate: true,
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
|
+
students: {
|
|
36
|
+
select: {
|
|
37
|
+
id: true,
|
|
38
|
+
username: true,
|
|
39
|
+
profile: {
|
|
40
|
+
select: {
|
|
41
|
+
displayName: true,
|
|
42
|
+
profilePicture: true,
|
|
43
|
+
profilePictureThumbnail: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
teachers: {
|
|
49
|
+
select: {
|
|
50
|
+
id: true,
|
|
51
|
+
username: true,
|
|
52
|
+
profile: {
|
|
53
|
+
select: {
|
|
54
|
+
displayName: true,
|
|
55
|
+
profilePicture: true,
|
|
56
|
+
profilePictureThumbnail: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
35
61
|
},
|
|
36
62
|
}),
|
|
37
63
|
prisma.class.findMany({
|
|
@@ -57,6 +83,32 @@ export const classRouter = createTRPCRouter({
|
|
|
57
83
|
dueDate: true,
|
|
58
84
|
},
|
|
59
85
|
},
|
|
86
|
+
students: {
|
|
87
|
+
select: {
|
|
88
|
+
id: true,
|
|
89
|
+
username: true,
|
|
90
|
+
profile: {
|
|
91
|
+
select: {
|
|
92
|
+
displayName: true,
|
|
93
|
+
profilePicture: true,
|
|
94
|
+
profilePictureThumbnail: true,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
teachers: {
|
|
100
|
+
select: {
|
|
101
|
+
id: true,
|
|
102
|
+
username: true,
|
|
103
|
+
profile: {
|
|
104
|
+
select: {
|
|
105
|
+
displayName: true,
|
|
106
|
+
profilePicture: true,
|
|
107
|
+
profilePictureThumbnail: true,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
60
112
|
},
|
|
61
113
|
}),
|
|
62
114
|
]);
|
|
@@ -68,6 +120,7 @@ export const classRouter = createTRPCRouter({
|
|
|
68
120
|
subject: cls.subject,
|
|
69
121
|
dueToday: cls.assignments,
|
|
70
122
|
assignments: cls.assignments,
|
|
123
|
+
members: [...cls.students, ...cls.teachers],
|
|
71
124
|
color: cls.color,
|
|
72
125
|
})),
|
|
73
126
|
studentInClass: studentClasses.map(cls => ({
|
|
@@ -77,6 +130,7 @@ export const classRouter = createTRPCRouter({
|
|
|
77
130
|
subject: cls.subject,
|
|
78
131
|
dueToday: cls.assignments,
|
|
79
132
|
assignments: cls.assignments,
|
|
133
|
+
members: [...cls.students, ...cls.teachers],
|
|
80
134
|
color: cls.color,
|
|
81
135
|
})),
|
|
82
136
|
};
|
|
@@ -1109,4 +1163,4 @@ export const classRouter = createTRPCRouter({
|
|
|
1109
1163
|
}),
|
|
1110
1164
|
});
|
|
1111
1165
|
//# sourceMappingURL=class.js.map
|
|
1112
|
-
//# debugId=
|
|
1166
|
+
//# debugId=767877f8-1e76-552f-92f2-c3b39f1302ec
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sources":["routers/class.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure, protectedTeacherProcedure, protectedClassMemberProcedure } from \"../trpc.js\";\nimport { prisma } from \"../lib/prisma.js\";\nimport { TRPCError } from \"@trpc/server\";\nimport { generateInviteCode } from \"../utils/generateInviteCode.js\";\n\nexport const classRouter = createTRPCRouter({\n getAll: protectedProcedure\n \n .query(async ({ ctx }) => {\n const [teacherClasses, studentClasses] = await Promise.all([\n prisma.class.findMany({\n where: {\n teachers: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n include: {\n assignments: {\n where: {\n dueDate: {\n lte: new Date(new Date().setHours(23, 59, 59, 999)),\n },\n template: false,\n },\n select: {\n id: true,\n title: true,\n type: true,\n dueDate: true,\n },\n },\n },\n }),\n prisma.class.findMany({\n where: {\n students: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n include: {\n assignments: {\n where: {\n dueDate: { \n lte: new Date(new Date().setHours(23, 59, 59, 999)),\n },\n template: false,\n },\n select: {\n id: true,\n title: true,\n type: true,\n dueDate: true,\n },\n },\n },\n }),\n ]);\n\n return {\n teacherInClass: teacherClasses.map(cls => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n color: cls.color,\n })),\n studentInClass: studentClasses.map(cls => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n color: cls.color,\n })),\n };\n }),\n get: protectedProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const isTeacher = await prisma.class.findFirst({\n where: {\n id: classId,\n teachers: {\n some: { id: ctx.user?.id },\n },\n },\n });\n\n const classData = await prisma.class.findUnique({\n where: {\n id: classId,\n },\n include: {\n teachers: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n }\n }\n },\n },\n students: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n announcements: {\n orderBy: {\n createdAt: 'desc',\n },\n select: {\n id: true,\n remarks: true,\n createdAt: true,\n modifiedAt: true,\n teacher: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n assignments: {\n ...(!isTeacher && {\n where: {OR: [\n {\n assignedTo: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n {\n assignedTo: {\n none: {},\n },\n },\n ],}\n }),\n select: {\n type: true,\n id: true,\n title: true,\n dueDate: true,\n createdAt: true,\n weight: true,\n order: true,\n graded: true,\n maxGrade: true,\n instructions: true,\n inProgress: true,\n template: false,\n section: {\n select: {\n id: true,\n name: true,\n },\n },\n markScheme: {\n select: {\n id: true,\n structured: true,\n },\n },\n gradingBoundary: {\n select: {\n id: true,\n structured: true,\n },\n },\n submissions: {\n ...(!isTeacher && {\n where: {\n studentId: ctx.user?.id,\n },\n }),\n select: {\n studentId: true,\n id: true,\n submitted: true,\n gradeReceived: true,\n rubricState: true,\n teacherComments: true,\n returned: true,\n submittedAt: true,\n },\n },\n },\n },\n },\n });\n\n\n if (!classData) {\n throw new Error('Class not found');\n }\n \n const formattedClassData = {\n ...classData,\n assignments: classData.assignments.map(assignment => ({\n ...assignment,\n late: assignment.dueDate < new Date(),\n submitted: assignment.submissions.find(submission => submission.studentId === ctx.user?.id)?.submitted,\n returned: assignment.submissions.find(submission => submission.studentId === ctx.user?.id)?.returned,\n })),\n }\n\n const sections = await prisma.section.findMany({\n where: {\n classId: classId,\n },\n });\n\n return {\n class: {\n ...formattedClassData,\n sections,\n },\n };\n }),\n update: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n name: z.string().optional(),\n section: z.string().optional(),\n subject: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, ...updateData } = input;\n \n const updatedClass = await prisma.class.update({\n where: {\n id: classId,\n },\n data: updateData,\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n }\n });\n\n return {\n updatedClass,\n }\n }),\n create: protectedProcedure\n .input(z.object({\n students: z.array(z.string()).optional(),\n teachers: z.array(z.string()).optional(),\n name: z.string(),\n section: z.string(),\n subject: z.string(),\n color: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { students, teachers, name, section, subject, color } = input;\n \n if (teachers && teachers.length > 0 && students && students.length > 0) {\n const newClass = await prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n teachers: {\n connect: teachers.map(teacher => ({ id: teacher })),\n },\n students: {\n connect: students.map(student => ({ id: student })),\n },\n },\n include: {\n teachers: true,\n students: true,\n },\n });\n return newClass;\n }\n\n const newClass = await prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n teachers: {\n connect: {\n id: ctx.user?.id,\n },\n },\n },\n });\n \n return newClass;\n }),\n delete: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n id: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n // Verify user is the teacher of this class\n const classToDelete = await prisma.class.findFirst({\n where: {\n id: input.id,\n },\n });\n\n if (!classToDelete) {\n throw new Error(\"Class not found or you don't have permission to delete it\");\n }\n\n await prisma.class.delete({\n where: {\n id: input.id,\n },\n });\n\n return {\n deletedClass: {\n id: input.id,\n }\n }\n }),\n addStudent: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n studentId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, studentId } = input;\n\n const student = await prisma.user.findUnique({\n where: {\n id: studentId,\n },\n });\n\n if (!student) {\n throw new Error(\"Student not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: {\n id: classId,\n },\n data: {\n students: {\n connect: {\n id: studentId,\n },\n },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n }\n });\n\n return {\n updatedClass,\n newStudent: student,\n }\n }),\n changeRole: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n type: z.enum(['teacher', 'student']),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, userId, type } = input;\n\n const user = await prisma.user.findUnique({\n where: { id: userId },\n select: {\n id: true,\n username: true,\n },\n });\n\n if (!user) {\n throw new Error(\"User not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n [type === 'teacher' ? 'teachers' : 'students']: {\n connect: { id: userId },\n },\n [type === 'teacher' ? 'students' : 'teachers']: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n user: {\n ...user,\n type,\n },\n };\n }),\n removeMember: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, userId } = input;\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n teachers: {\n disconnect: { id: userId },\n },\n students: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n removedUserId: userId,\n };\n }),\n leaveClass: protectedProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId } = input;\n const userId = ctx.user?.id;\n\n if (!userId) {\n throw new TRPCError({\n code: 'UNAUTHORIZED',\n message: 'User not authenticated',\n });\n }\n\n const classData = await prisma.class.findFirst({\n where: {\n id: classId,\n students: {\n some: { id: userId },\n },\n },\n });\n\n if (!classData) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Class not found or you are not a student in this class',\n });\n }\n\n await prisma.class.update({\n where: { id: classId },\n data: {\n students: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n success: true,\n leftClassId: classId,\n };\n }),\n join: protectedProcedure\n .input(z.object({\n classCode: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classCode } = input;\n\n // Case-insensitive search for invite code\n const session = await prisma.session.findFirst({\n where: {\n id: {\n equals: classCode,\n mode: 'insensitive',\n },\n },\n });\n\n if (!session || !session.classId) {\n throw new Error(\"Class not found\");\n }\n\n if (session.expiresAt && session.expiresAt < new Date()) {\n throw new Error(\"Session expired\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: session.classId },\n data: {\n students: {\n connect: { id: ctx.user?.id },\n },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n },\n });\n\n return {\n joinedClass: updatedClass,\n }\n }),\n getInviteCode: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const session = await prisma.session.findFirst({\n where: {\n classId,\n },\n });\n\n if ((session?.expiresAt && session.expiresAt < new Date()) || !session) {\n const newSession = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours from now\n }\n });\n return {\n code: newSession.id,\n }\n }\n\n return {\n code: session?.id,\n };\n }),\n createInviteCode: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId } = input;\n\n await prisma.session.deleteMany({\n where: {\n classId,\n },\n });\n\n // Create a new session for the invite code\n const session = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours from now\n }\n });\n\n return {\n code: session.id,\n };\n }),\n getGrades: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId, userId } = input;\n\n const isTeacher = await prisma.class.findFirst({\n where: {\n id: classId,\n teachers: {\n some: { id: ctx.user?.id }\n }\n }\n });\n // If student, only allow viewing their own grades\n if (ctx.user?.id !== userId && !isTeacher) {\n throw new TRPCError({\n code: 'UNAUTHORIZED',\n message: 'You can only view your own grades',\n });\n }\n\n const grades = await prisma.submission.findMany({\n where: {\n studentId: userId,\n assignment: {\n classId: classId,\n graded: true\n }\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n markSchemeId: true,\n markScheme: {\n select: {\n structured: true,\n }\n },\n gradingBoundaryId: true,\n gradingBoundary: {\n select: {\n structured: true,\n }\n },\n }\n },\n }\n });\n\n return {\n grades,\n };\n }),\n updateGrade: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n assignmentId: z.string(),\n submissionId: z.string(),\n gradeReceived: z.number().nullable(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, assignmentId, submissionId, gradeReceived } = input;\n\n // Update the grade\n const updatedSubmission = await prisma.submission.update({\n where: {\n id: submissionId,\n assignmentId: assignmentId,\n },\n data: {\n gradeReceived,\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n }\n }\n }\n });\n\n return updatedSubmission;\n }),\n getEvents: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const events = await prisma.event.findMany({\n where: {\n class: {\n id: classId,\n }\n },\n select: {\n name: true,\n startTime: true,\n endTime: true,\n }\n });\n\n return events;\n }),\n listMarkSchemes: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const markSchemes = await prisma.markScheme.findMany({\n where: {\n class: {\n id: classId,\n },\n },\n });\n\n return markSchemes;\n }),\n createMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const markScheme = await prisma.markScheme.create({\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return markScheme;\n }),\n updateMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n markSchemeId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, markSchemeId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const markScheme = await prisma.markScheme.update({\n where: { id: markSchemeId },\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return markScheme;\n }),\n deleteMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n markSchemeId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, markSchemeId } = input;\n\n const markScheme = await prisma.markScheme.delete({\n where: { id: markSchemeId },\n });\n\n return markScheme;\n }),\n listGradingBoundaries: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const gradingBoundaries = await prisma.gradingBoundary.findMany({\n where: {\n class: {\n id: classId,\n },\n },\n });\n\n return gradingBoundaries;\n }),\n createGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const gradingBoundary = await prisma.gradingBoundary.create({\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return gradingBoundary;\n }),\n updateGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n gradingBoundaryId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, gradingBoundaryId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const gradingBoundary = await prisma.gradingBoundary.update({\n where: { id: gradingBoundaryId },\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return gradingBoundary;\n }),\n deleteGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n gradingBoundaryId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, gradingBoundaryId } = input;\n\n const gradingBoundary = await prisma.gradingBoundary.delete({\n where: { id: gradingBoundaryId },\n });\n\n return gradingBoundary;\n }),\n getSyllabus: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({input}) => {\n const {classId} = input;\n\n const syllabus = (await prisma.class.findUnique({\n where: {\n id: classId,\n },\n }))?.syllabus;\n\n const markSchemes = await prisma.markScheme.findMany({\n where: {\n classId,\n }\n });\n\n const gradingBoundaries = await prisma.gradingBoundary.findMany({\n where: {\n classId,\n }\n });\n\n return {syllabus, gradingBoundaries, markSchemes};\n }),\n updateSyllabus: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n contents: z.string(),\n }))\n .mutation(async ({ input }) => {\n const { contents, classId } = input;\n\n if (!contents) throw new TRPCError({\n code: 'BAD_REQUEST',\n message: \"Missing key contents\",\n });\n\n const updated = await prisma.class.update({\n where: {\n id: classId\n },\n data: {\n syllabus: contents,\n }\n });\n\n return updated;\n }),\n // Lab Management Endpoints (Assignment-based)\n listLabDrafts: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const labDrafts = await prisma.assignment.findMany({\n where: {\n classId: classId,\n teacherId: ctx.user?.id,\n inProgress: true,\n },\n orderBy: {\n modifiedAt: 'desc',\n },\n });\n\n return labDrafts;\n }),\n createLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n title: z.string(),\n type: z.enum(['LAB', 'HOMEWORK', 'QUIZ', 'TEST', 'PROJECT', 'ESSAY', 'DISCUSSION', 'PRESENTATION', 'OTHER']),\n instructions: z.string(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n sectionId: z.string().optional(),\n markSchemeId: z.string().optional(),\n gradingBoundaryId: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, ...draftData } = input;\n\n const labDraft = await prisma.assignment.create({\n data: {\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n graded: draftData.graded ?? false,\n maxGrade: draftData.maxGrade ?? 0,\n weight: draftData.weight ?? 1,\n dueDate: draftData.dueDate || new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // Default 1 week from now\n title: draftData.title,\n instructions: draftData.instructions,\n type: draftData.type,\n ...(draftData.sectionId && { sectionId: draftData.sectionId }),\n ...(draftData.markSchemeId && { markSchemeId: draftData.markSchemeId }),\n ...(draftData.gradingBoundaryId && { gradingBoundaryId: draftData.gradingBoundaryId }),\n },\n });\n\n return labDraft;\n }),\n updateLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n title: z.string().optional(),\n instructions: z.string().optional(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n sectionId: z.string().optional(),\n markSchemeId: z.string().optional(),\n gradingBoundaryId: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId, ...updateData } = input;\n\n const labDraft = await prisma.assignment.update({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n data: {\n ...(updateData.title && { title: updateData.title }),\n ...(updateData.instructions && { instructions: updateData.instructions }),\n ...(updateData.dueDate && { dueDate: updateData.dueDate }),\n ...(updateData.maxGrade !== undefined && { maxGrade: updateData.maxGrade }),\n ...(updateData.weight !== undefined && { weight: updateData.weight }),\n ...(updateData.graded !== undefined && { graded: updateData.graded }),\n ...(updateData.sectionId !== undefined && { sectionId: updateData.sectionId }),\n ...(updateData.markSchemeId !== undefined && { markSchemeId: updateData.markSchemeId }),\n ...(updateData.gradingBoundaryId !== undefined && { gradingBoundaryId: updateData.gradingBoundaryId }),\n modifiedAt: new Date(),\n },\n });\n\n return labDraft;\n }),\n deleteLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId } = input;\n\n const labDraft = await prisma.assignment.delete({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n });\n\n return labDraft;\n }),\n publishLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId, ...publishData } = input;\n\n // Get the lab draft\n const labDraft = await prisma.assignment.findUnique({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n });\n\n if (!labDraft) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Lab draft not found',\n });\n }\n\n // Publish the draft by updating it to not be in progress\n const publishedAssignment = await prisma.assignment.update({\n where: { id: draftId },\n data: {\n inProgress: false,\n dueDate: publishData.dueDate || labDraft.dueDate,\n maxGrade: publishData.maxGrade || labDraft.maxGrade || 100,\n weight: publishData.weight || labDraft.weight || 1,\n graded: publishData.graded !== undefined ? publishData.graded : true,\n modifiedAt: new Date(),\n },\n });\n\n return publishedAssignment;\n }),\n getFiles: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n // Get all assignments with their files and submissions\n const assignments = await prisma.assignment.findMany({\n where: {\n classId: classId,\n },\n include: {\n attachments: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n submissions: {\n include: {\n attachments: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n annotations: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n student: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n teacher: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n orderBy: {\n createdAt: 'desc',\n },\n });\n\n // Organize files by assignment structure\n const organizedFiles = assignments.map(assignment => ({\n id: assignment.id,\n title: assignment.title,\n teacher: assignment.teacher,\n teacherAttachments: assignment.attachments,\n students: assignment.submissions.map(submission => ({\n id: submission.student.id,\n username: submission.student.username,\n attachments: submission.attachments,\n annotations: submission.annotations,\n })),\n }));\n\n return organizedFiles;\n }),\n});"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,YAAY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WAAW;YAC1C,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAClD,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE;gBACzB,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ;gBACrC,WAAW,EAAE,UAAU,CAAC,WAAW;gBACnC,WAAW,EAAE,UAAU,CAAC,WAAW;aACpC,CAAC,CAAC;SACJ,CAAC,CAAC,CAAC;QAEJ,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC;CACP,CAAC,CAAC","debug_id":"90bd2ed8-f6aa-5bb5-b0f5-4d2643587610"}
|
|
1
|
+
{"version":3,"file":"class.js","sources":["routers/class.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure, protectedTeacherProcedure, protectedClassMemberProcedure } from \"../trpc.js\";\nimport { prisma } from \"../lib/prisma.js\";\nimport { TRPCError } from \"@trpc/server\";\nimport { generateInviteCode } from \"../utils/generateInviteCode.js\";\n\nexport const classRouter = createTRPCRouter({\n getAll: protectedProcedure\n \n .query(async ({ ctx }) => {\n const [teacherClasses, studentClasses] = await Promise.all([\n prisma.class.findMany({\n where: {\n teachers: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n include: {\n assignments: {\n where: {\n dueDate: {\n lte: new Date(new Date().setHours(23, 59, 59, 999)),\n },\n template: false,\n },\n select: {\n\n id: true,\n title: true,\n type: true,\n dueDate: true,\n },\n },\n students: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n teachers: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n }),\n prisma.class.findMany({\n where: {\n students: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n include: {\n assignments: {\n where: {\n dueDate: { \n lte: new Date(new Date().setHours(23, 59, 59, 999)),\n },\n template: false,\n },\n select: {\n id: true,\n title: true,\n type: true,\n dueDate: true,\n },\n },\n students: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n teachers: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n }),\n ]);\n\n return {\n teacherInClass: teacherClasses.map(cls => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n members: [...cls.students, ...cls.teachers],\n color: cls.color,\n })),\n studentInClass: studentClasses.map(cls => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n members: [...cls.students, ...cls.teachers],\n color: cls.color,\n })),\n };\n }),\n get: protectedProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const isTeacher = await prisma.class.findFirst({\n where: {\n id: classId,\n teachers: {\n some: { id: ctx.user?.id },\n },\n },\n });\n\n const classData = await prisma.class.findUnique({\n where: {\n id: classId,\n },\n include: {\n teachers: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n }\n }\n },\n },\n students: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n announcements: {\n orderBy: {\n createdAt: 'desc',\n },\n select: {\n id: true,\n remarks: true,\n createdAt: true,\n modifiedAt: true,\n teacher: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n assignments: {\n ...(!isTeacher && {\n where: {OR: [\n {\n assignedTo: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n {\n assignedTo: {\n none: {},\n },\n },\n ],}\n }),\n select: {\n type: true,\n id: true,\n title: true,\n dueDate: true,\n createdAt: true,\n weight: true,\n order: true,\n graded: true,\n maxGrade: true,\n instructions: true,\n inProgress: true,\n template: false,\n section: {\n select: {\n id: true,\n name: true,\n },\n },\n markScheme: {\n select: {\n id: true,\n structured: true,\n },\n },\n gradingBoundary: {\n select: {\n id: true,\n structured: true,\n },\n },\n submissions: {\n ...(!isTeacher && {\n where: {\n studentId: ctx.user?.id,\n },\n }),\n select: {\n studentId: true,\n id: true,\n submitted: true,\n gradeReceived: true,\n rubricState: true,\n teacherComments: true,\n returned: true,\n submittedAt: true,\n },\n },\n },\n },\n },\n });\n\n\n if (!classData) {\n throw new Error('Class not found');\n }\n \n const formattedClassData = {\n ...classData,\n assignments: classData.assignments.map(assignment => ({\n ...assignment,\n late: assignment.dueDate < new Date(),\n submitted: assignment.submissions.find(submission => submission.studentId === ctx.user?.id)?.submitted,\n returned: assignment.submissions.find(submission => submission.studentId === ctx.user?.id)?.returned,\n })),\n }\n\n const sections = await prisma.section.findMany({\n where: {\n classId: classId,\n },\n });\n\n return {\n class: {\n ...formattedClassData,\n sections,\n },\n };\n }),\n update: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n name: z.string().optional(),\n section: z.string().optional(),\n subject: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, ...updateData } = input;\n \n const updatedClass = await prisma.class.update({\n where: {\n id: classId,\n },\n data: updateData,\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n }\n });\n\n return {\n updatedClass,\n }\n }),\n create: protectedProcedure\n .input(z.object({\n students: z.array(z.string()).optional(),\n teachers: z.array(z.string()).optional(),\n name: z.string(),\n section: z.string(),\n subject: z.string(),\n color: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { students, teachers, name, section, subject, color } = input;\n \n if (teachers && teachers.length > 0 && students && students.length > 0) {\n const newClass = await prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n teachers: {\n connect: teachers.map(teacher => ({ id: teacher })),\n },\n students: {\n connect: students.map(student => ({ id: student })),\n },\n },\n include: {\n teachers: true,\n students: true,\n },\n });\n return newClass;\n }\n\n const newClass = await prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n teachers: {\n connect: {\n id: ctx.user?.id,\n },\n },\n },\n });\n \n return newClass;\n }),\n delete: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n id: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n // Verify user is the teacher of this class\n const classToDelete = await prisma.class.findFirst({\n where: {\n id: input.id,\n },\n });\n\n if (!classToDelete) {\n throw new Error(\"Class not found or you don't have permission to delete it\");\n }\n\n await prisma.class.delete({\n where: {\n id: input.id,\n },\n });\n\n return {\n deletedClass: {\n id: input.id,\n }\n }\n }),\n addStudent: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n studentId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, studentId } = input;\n\n const student = await prisma.user.findUnique({\n where: {\n id: studentId,\n },\n });\n\n if (!student) {\n throw new Error(\"Student not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: {\n id: classId,\n },\n data: {\n students: {\n connect: {\n id: studentId,\n },\n },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n }\n });\n\n return {\n updatedClass,\n newStudent: student,\n }\n }),\n changeRole: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n type: z.enum(['teacher', 'student']),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, userId, type } = input;\n\n const user = await prisma.user.findUnique({\n where: { id: userId },\n select: {\n id: true,\n username: true,\n },\n });\n\n if (!user) {\n throw new Error(\"User not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n [type === 'teacher' ? 'teachers' : 'students']: {\n connect: { id: userId },\n },\n [type === 'teacher' ? 'students' : 'teachers']: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n user: {\n ...user,\n type,\n },\n };\n }),\n removeMember: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, userId } = input;\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n teachers: {\n disconnect: { id: userId },\n },\n students: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n removedUserId: userId,\n };\n }),\n leaveClass: protectedProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId } = input;\n const userId = ctx.user?.id;\n\n if (!userId) {\n throw new TRPCError({\n code: 'UNAUTHORIZED',\n message: 'User not authenticated',\n });\n }\n\n const classData = await prisma.class.findFirst({\n where: {\n id: classId,\n students: {\n some: { id: userId },\n },\n },\n });\n\n if (!classData) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Class not found or you are not a student in this class',\n });\n }\n\n await prisma.class.update({\n where: { id: classId },\n data: {\n students: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n success: true,\n leftClassId: classId,\n };\n }),\n join: protectedProcedure\n .input(z.object({\n classCode: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classCode } = input;\n\n // Case-insensitive search for invite code\n const session = await prisma.session.findFirst({\n where: {\n id: {\n equals: classCode,\n mode: 'insensitive',\n },\n },\n });\n\n if (!session || !session.classId) {\n throw new Error(\"Class not found\");\n }\n\n if (session.expiresAt && session.expiresAt < new Date()) {\n throw new Error(\"Session expired\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: session.classId },\n data: {\n students: {\n connect: { id: ctx.user?.id },\n },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n },\n });\n\n return {\n joinedClass: updatedClass,\n }\n }),\n getInviteCode: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const session = await prisma.session.findFirst({\n where: {\n classId,\n },\n });\n\n if ((session?.expiresAt && session.expiresAt < new Date()) || !session) {\n const newSession = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours from now\n }\n });\n return {\n code: newSession.id,\n }\n }\n\n return {\n code: session?.id,\n };\n }),\n createInviteCode: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId } = input;\n\n await prisma.session.deleteMany({\n where: {\n classId,\n },\n });\n\n // Create a new session for the invite code\n const session = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours from now\n }\n });\n\n return {\n code: session.id,\n };\n }),\n getGrades: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId, userId } = input;\n\n const isTeacher = await prisma.class.findFirst({\n where: {\n id: classId,\n teachers: {\n some: { id: ctx.user?.id }\n }\n }\n });\n // If student, only allow viewing their own grades\n if (ctx.user?.id !== userId && !isTeacher) {\n throw new TRPCError({\n code: 'UNAUTHORIZED',\n message: 'You can only view your own grades',\n });\n }\n\n const grades = await prisma.submission.findMany({\n where: {\n studentId: userId,\n assignment: {\n classId: classId,\n graded: true\n }\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n markSchemeId: true,\n markScheme: {\n select: {\n structured: true,\n }\n },\n gradingBoundaryId: true,\n gradingBoundary: {\n select: {\n structured: true,\n }\n },\n }\n },\n }\n });\n\n return {\n grades,\n };\n }),\n updateGrade: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n assignmentId: z.string(),\n submissionId: z.string(),\n gradeReceived: z.number().nullable(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, assignmentId, submissionId, gradeReceived } = input;\n\n // Update the grade\n const updatedSubmission = await prisma.submission.update({\n where: {\n id: submissionId,\n assignmentId: assignmentId,\n },\n data: {\n gradeReceived,\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n }\n }\n }\n });\n\n return updatedSubmission;\n }),\n getEvents: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const events = await prisma.event.findMany({\n where: {\n class: {\n id: classId,\n }\n },\n select: {\n name: true,\n startTime: true,\n endTime: true,\n }\n });\n\n return events;\n }),\n listMarkSchemes: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const markSchemes = await prisma.markScheme.findMany({\n where: {\n class: {\n id: classId,\n },\n },\n });\n\n return markSchemes;\n }),\n createMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const markScheme = await prisma.markScheme.create({\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return markScheme;\n }),\n updateMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n markSchemeId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, markSchemeId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const markScheme = await prisma.markScheme.update({\n where: { id: markSchemeId },\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return markScheme;\n }),\n deleteMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n markSchemeId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, markSchemeId } = input;\n\n const markScheme = await prisma.markScheme.delete({\n where: { id: markSchemeId },\n });\n\n return markScheme;\n }),\n listGradingBoundaries: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const gradingBoundaries = await prisma.gradingBoundary.findMany({\n where: {\n class: {\n id: classId,\n },\n },\n });\n\n return gradingBoundaries;\n }),\n createGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const gradingBoundary = await prisma.gradingBoundary.create({\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return gradingBoundary;\n }),\n updateGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n gradingBoundaryId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, gradingBoundaryId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const gradingBoundary = await prisma.gradingBoundary.update({\n where: { id: gradingBoundaryId },\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return gradingBoundary;\n }),\n deleteGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n gradingBoundaryId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, gradingBoundaryId } = input;\n\n const gradingBoundary = await prisma.gradingBoundary.delete({\n where: { id: gradingBoundaryId },\n });\n\n return gradingBoundary;\n }),\n getSyllabus: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({input}) => {\n const {classId} = input;\n\n const syllabus = (await prisma.class.findUnique({\n where: {\n id: classId,\n },\n }))?.syllabus;\n\n const markSchemes = await prisma.markScheme.findMany({\n where: {\n classId,\n }\n });\n\n const gradingBoundaries = await prisma.gradingBoundary.findMany({\n where: {\n classId,\n }\n });\n\n return {syllabus, gradingBoundaries, markSchemes};\n }),\n updateSyllabus: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n contents: z.string(),\n }))\n .mutation(async ({ input }) => {\n const { contents, classId } = input;\n\n if (!contents) throw new TRPCError({\n code: 'BAD_REQUEST',\n message: \"Missing key contents\",\n });\n\n const updated = await prisma.class.update({\n where: {\n id: classId\n },\n data: {\n syllabus: contents,\n }\n });\n\n return updated;\n }),\n // Lab Management Endpoints (Assignment-based)\n listLabDrafts: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const labDrafts = await prisma.assignment.findMany({\n where: {\n classId: classId,\n teacherId: ctx.user?.id,\n inProgress: true,\n },\n orderBy: {\n modifiedAt: 'desc',\n },\n });\n\n return labDrafts;\n }),\n createLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n title: z.string(),\n type: z.enum(['LAB', 'HOMEWORK', 'QUIZ', 'TEST', 'PROJECT', 'ESSAY', 'DISCUSSION', 'PRESENTATION', 'OTHER']),\n instructions: z.string(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n sectionId: z.string().optional(),\n markSchemeId: z.string().optional(),\n gradingBoundaryId: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, ...draftData } = input;\n\n const labDraft = await prisma.assignment.create({\n data: {\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n graded: draftData.graded ?? false,\n maxGrade: draftData.maxGrade ?? 0,\n weight: draftData.weight ?? 1,\n dueDate: draftData.dueDate || new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // Default 1 week from now\n title: draftData.title,\n instructions: draftData.instructions,\n type: draftData.type,\n ...(draftData.sectionId && { sectionId: draftData.sectionId }),\n ...(draftData.markSchemeId && { markSchemeId: draftData.markSchemeId }),\n ...(draftData.gradingBoundaryId && { gradingBoundaryId: draftData.gradingBoundaryId }),\n },\n });\n\n return labDraft;\n }),\n updateLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n title: z.string().optional(),\n instructions: z.string().optional(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n sectionId: z.string().optional(),\n markSchemeId: z.string().optional(),\n gradingBoundaryId: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId, ...updateData } = input;\n\n const labDraft = await prisma.assignment.update({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n data: {\n ...(updateData.title && { title: updateData.title }),\n ...(updateData.instructions && { instructions: updateData.instructions }),\n ...(updateData.dueDate && { dueDate: updateData.dueDate }),\n ...(updateData.maxGrade !== undefined && { maxGrade: updateData.maxGrade }),\n ...(updateData.weight !== undefined && { weight: updateData.weight }),\n ...(updateData.graded !== undefined && { graded: updateData.graded }),\n ...(updateData.sectionId !== undefined && { sectionId: updateData.sectionId }),\n ...(updateData.markSchemeId !== undefined && { markSchemeId: updateData.markSchemeId }),\n ...(updateData.gradingBoundaryId !== undefined && { gradingBoundaryId: updateData.gradingBoundaryId }),\n modifiedAt: new Date(),\n },\n });\n\n return labDraft;\n }),\n deleteLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId } = input;\n\n const labDraft = await prisma.assignment.delete({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n });\n\n return labDraft;\n }),\n publishLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId, ...publishData } = input;\n\n // Get the lab draft\n const labDraft = await prisma.assignment.findUnique({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n });\n\n if (!labDraft) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Lab draft not found',\n });\n }\n\n // Publish the draft by updating it to not be in progress\n const publishedAssignment = await prisma.assignment.update({\n where: { id: draftId },\n data: {\n inProgress: false,\n dueDate: publishData.dueDate || labDraft.dueDate,\n maxGrade: publishData.maxGrade || labDraft.maxGrade || 100,\n weight: publishData.weight || labDraft.weight || 1,\n graded: publishData.graded !== undefined ? publishData.graded : true,\n modifiedAt: new Date(),\n },\n });\n\n return publishedAssignment;\n }),\n getFiles: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n // Get all assignments with their files and submissions\n const assignments = await prisma.assignment.findMany({\n where: {\n classId: classId,\n },\n include: {\n attachments: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n submissions: {\n include: {\n attachments: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n annotations: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n student: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n teacher: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n orderBy: {\n createdAt: 'desc',\n },\n });\n\n // Organize files by assignment structure\n const organizedFiles = assignments.map(assignment => ({\n id: assignment.id,\n title: assignment.title,\n teacher: assignment.teacher,\n teacherAttachments: assignment.attachments,\n students: assignment.submissions.map(submission => ({\n id: submission.student.id,\n username: submission.student.username,\n attachments: submission.attachments,\n annotations: submission.annotations,\n })),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C3B,kBAAkB,EAAE,UAAU,CAAC,WAAW;YAC1C,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAClD,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE;gBACzB,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ;gBACrC,WAAW,EAAE,UAAU,CAAC,WAAW;gBACnC,WAAW,EAAE,UAAU,CAAC,WAAW;aACpC,CAAC,CAAC;SACJ,CAAC,CAAC,CAAC;QAEJ,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC;CACP,CAAC,CAAC","debug_id":"767877f8-1e76-552f-92f2-c3b39f1302ec"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"newtonChat.d.ts","sourceRoot":"/","sources":["routers/newtonChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"newtonChat.d.ts","sourceRoot":"/","sources":["routers/newtonChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6R3B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="ce05ab9c-6259-5565-ad40-a8e2dd1beb79")}catch(e){}}();
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { createTRPCRouter, protectedProcedure } from '../trpc.js';
|
|
5
5
|
import { prisma } from '../lib/prisma.js';
|
|
@@ -108,12 +108,11 @@ export const newtonChatRouter = createTRPCRouter({
|
|
|
108
108
|
title: 'Session with Newton Tutor',
|
|
109
109
|
},
|
|
110
110
|
});
|
|
111
|
+
generateAndSendNewtonIntroduction(newtonChat.id, newtonChat.conversationId, submission.id).catch(error => {
|
|
112
|
+
logger.error('Failed to generate AI introduction:', { error, newtonChatId: result.id });
|
|
113
|
+
});
|
|
111
114
|
return newtonChat;
|
|
112
115
|
});
|
|
113
|
-
// Generate AI introduction message in parallel (don't await - fire and forget)
|
|
114
|
-
generateAndSendNewtonIntroduction(result.id, result.conversationId, submission.id).catch(error => {
|
|
115
|
-
logger.error('Failed to generate AI introduction:', { error, newtonChatId: result.id });
|
|
116
|
-
});
|
|
117
116
|
return {
|
|
118
117
|
conversationId: result.conversationId,
|
|
119
118
|
newtonChatId: result.id,
|
|
@@ -259,4 +258,4 @@ export const newtonChatRouter = createTRPCRouter({
|
|
|
259
258
|
}),
|
|
260
259
|
});
|
|
261
260
|
//# sourceMappingURL=newtonChat.js.map
|
|
262
|
-
//# debugId=
|
|
261
|
+
//# debugId=ce05ab9c-6259-5565-ad40-a8e2dd1beb79
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"newtonChat.js","sources":["routers/newtonChat.ts"],"sourceRoot":"/","sourcesContent":["import { z } from 'zod';\nimport { createTRPCRouter, protectedProcedure } from '../trpc.js';\nimport { prisma } from '../lib/prisma.js';\nimport { pusher } from '../lib/pusher.js';\nimport { TRPCError } from '@trpc/server';\nimport { logger } from '../utils/logger.js';\nimport { isAIUser } from '../utils/aiUser.js';\nimport { generateAndSendNewtonIntroduction, generateAndSendNewtonResponse } from '../server/pipelines/aiNewtonChat.js';\n\nexport const newtonChatRouter = createTRPCRouter({\n getTutorConversation: protectedProcedure\n .input(\n z.object({\n assignmentId: z.string(),\n classId: z.string(),\n })\n )\n .query(async ({ input, ctx }) => {\n const userId = ctx.user!.id;\n const { assignmentId, classId } = input;\n\n // Verify user is a student in the class\n const classMembership = await prisma.class.findFirst({\n where: {\n id: classId,\n students: {\n some: {\n id: userId,\n },\n },\n },\n });\n\n if (!classMembership) {\n throw new TRPCError({\n code: 'FORBIDDEN',\n message: 'Not a student in this class',\n });\n }\n\n // Find or create submission for this student and assignment\n const submission = await prisma.submission.findFirst({\n where: {\n assignmentId,\n studentId: userId,\n },\n });\n\n if (!submission) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Submission not found. Please create a submission first.',\n });\n }\n\n // Find the latest NewtonChat for this submission, or create a new one\n const result = await prisma.$transaction(async (tx) => {\n // Get the latest NewtonChat for this submission\n const existingNewtonChat = await tx.newtonChat.findFirst({\n where: {\n submissionId: submission.id,\n },\n include: {\n conversation: {\n include: {\n members: {\n where: {\n userId,\n },\n },\n },\n },\n },\n orderBy: {\n createdAt: 'desc',\n },\n });\n\n // If exists and user is already a member, return it\n if (existingNewtonChat && existingNewtonChat.conversation.members.length > 0) {\n return existingNewtonChat;\n }\n\n // If exists but user is not a member, add them\n if (existingNewtonChat) {\n await tx.conversationMember.create({\n data: {\n userId,\n conversationId: existingNewtonChat.conversationId,\n role: 'MEMBER',\n },\n });\n\n return existingNewtonChat;\n }\n\n // Create new NewtonChat with associated conversation\n const conversation = await tx.conversation.create({\n data: {\n type: 'DM',\n name: 'Session with Newton Tutor',\n displayInChat: false, // Newton chats don't show in regular chat list\n },\n });\n\n // Add student to the conversation\n await tx.conversationMember.create({\n data: {\n userId,\n conversationId: conversation.id,\n role: 'MEMBER',\n },\n });\n\n // Create the NewtonChat\n const newtonChat = await tx.newtonChat.create({\n data: {\n submissionId: submission.id,\n conversationId: conversation.id,\n title: 'Session with Newton Tutor',\n },\n });\n\n return newtonChat;\n });\n\n // Generate AI introduction message in parallel (don't await - fire and forget)\n generateAndSendNewtonIntroduction(\n result.id,\n result.conversationId,\n submission.id\n ).catch(error => {\n logger.error('Failed to generate AI introduction:', { error, newtonChatId: result.id });\n });\n\n return {\n conversationId: result.conversationId,\n newtonChatId: result.id,\n };\n }),\n\n postToNewtonChat: protectedProcedure\n .input(\n z.object({\n newtonChatId: z.string(),\n content: z.string().min(1).max(4000),\n mentionedUserIds: z.array(z.string()).optional(),\n })\n )\n .mutation(async ({ input, ctx }) => {\n const userId = ctx.user!.id;\n const { newtonChatId, content, mentionedUserIds = [] } = input;\n\n // Get newton chat and verify user is a member\n const newtonChat = await prisma.newtonChat.findFirst({\n where: {\n id: newtonChatId,\n conversation: {\n members: {\n some: {\n userId,\n },\n },\n },\n },\n include: {\n conversation: {\n select: {\n id: true,\n },\n },\n submission: {\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n instructions: true,\n class: {\n select: {\n subject: true,\n },\n },\n },\n },\n },\n },\n },\n });\n\n if (!newtonChat) {\n throw new TRPCError({\n code: 'FORBIDDEN',\n message: 'Newton chat not found or access denied',\n });\n }\n\n // Verify mentioned users are members of the conversation\n if (mentionedUserIds.length > 0) {\n const mentionedMemberships = await prisma.conversationMember.findMany({\n where: {\n conversationId: newtonChat.conversationId,\n userId: { in: mentionedUserIds },\n },\n });\n\n if (mentionedMemberships.length !== mentionedUserIds.length) {\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: 'Some mentioned users are not members of this conversation',\n });\n }\n }\n\n // Create message and mentions\n const result = await prisma.$transaction(async (tx) => {\n const message = await tx.message.create({\n data: {\n content,\n senderId: userId,\n conversationId: newtonChat.conversationId,\n },\n include: {\n sender: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n },\n },\n },\n },\n },\n });\n\n // Create mentions\n if (mentionedUserIds.length > 0) {\n await tx.mention.createMany({\n data: mentionedUserIds.map((mentionedUserId) => ({\n messageId: message.id,\n userId: mentionedUserId,\n })),\n });\n }\n\n // Update newton chat timestamp\n await tx.newtonChat.update({\n where: { id: newtonChatId },\n data: { updatedAt: new Date() },\n });\n\n return message;\n });\n\n // Broadcast to Pusher channel (same format as regular chat)\n try {\n await pusher.trigger(`conversation-${newtonChat.conversationId}`, 'new-message', {\n id: result.id,\n content: result.content,\n senderId: result.senderId,\n conversationId: result.conversationId,\n createdAt: result.createdAt,\n sender: result.sender,\n mentionedUserIds,\n });\n } catch (error) {\n console.error('Failed to broadcast newton chat message:', error);\n // Don't fail the request if Pusher fails\n }\n\n // Generate AI response in parallel (don't await - fire and forget)\n if (!isAIUser(userId)) {\n // Run AI response generation in background\n generateAndSendNewtonResponse(\n newtonChatId,\n content,\n newtonChat.conversationId,\n newtonChat.submission\n ).catch(error => {\n logger.error('Failed to generate AI response:', { error });\n });\n }\n\n return {\n id: result.id,\n content: result.content,\n senderId: result.senderId,\n conversationId: result.conversationId,\n createdAt: result.createdAt,\n sender: result.sender,\n mentionedUserIds,\n };\n }),\n});\n\n\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iCAAiC,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAEvH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;IAC/C,oBAAoB,EAAE,kBAAkB;SACrC,KAAK,CACJ,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AC,0CAA0C,EAAE,KAAK,CAAC,CAAC;YACjE,yCAAyC;QAC3C,CAAC;QAED,mEAAmE;QACnE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,2CAA2C;YAC3C,6BAA6B,CAC3B,YAAY,EACZ,OAAO,EACP,UAAU,CAAC,cAAc,EACzB,UAAU,CAAC,UAAU,CACtB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,gBAAgB;SACjB,CAAC;IACJ,CAAC,CAAC;CACL,CAAC,CAAC","debug_id":"725aad78-0e5f-5b68-a668-413b3e62886e"}
|
|
1
|
+
{"version":3,"file":"newtonChat.js","sources":["routers/newtonChat.ts"],"sourceRoot":"/","sourcesContent":["import { z } from 'zod';\nimport { createTRPCRouter, protectedProcedure } from '../trpc.js';\nimport { prisma } from '../lib/prisma.js';\nimport { pusher } from '../lib/pusher.js';\nimport { TRPCError } from '@trpc/server';\nimport { logger } from '../utils/logger.js';\nimport { isAIUser } from '../utils/aiUser.js';\nimport { generateAndSendNewtonIntroduction, generateAndSendNewtonResponse } from '../server/pipelines/aiNewtonChat.js';\n\nexport const newtonChatRouter = createTRPCRouter({\n getTutorConversation: protectedProcedure\n .input(\n z.object({\n assignmentId: z.string(),\n classId: z.string(),\n })\n )\n .query(async ({ input, ctx }) => {\n const userId = ctx.user!.id;\n const { assignmentId, classId } = input;\n\n // Verify user is a student in the class\n const classMembership = await prisma.class.findFirst({\n where: {\n id: classId,\n students: {\n some: {\n id: userId,\n },\n },\n },\n });\n\n if (!classMembership) {\n throw new TRPCError({\n code: 'FORBIDDEN',\n message: 'Not a student in this class',\n });\n }\n\n // Find or create submission for this student and assignment\n const submission = await prisma.submission.findFirst({\n where: {\n assignmentId,\n studentId: userId,\n },\n });\n\n if (!submission) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Submission not found. Please create a submission first.',\n });\n }\n\n // Find the latest NewtonChat for this submission, or create a new one\n const result = await prisma.$transaction(async (tx) => {\n // Get the latest NewtonChat for this submission\n const existingNewtonChat = await tx.newtonChat.findFirst({\n where: {\n submissionId: submission.id,\n },\n include: {\n conversation: {\n include: {\n members: {\n where: {\n userId,\n },\n },\n },\n },\n },\n orderBy: {\n createdAt: 'desc',\n },\n });\n\n // If exists and user is already a member, return it\n if (existingNewtonChat && existingNewtonChat.conversation.members.length > 0) {\n return existingNewtonChat;\n }\n\n // If exists but user is not a member, add them\n if (existingNewtonChat) {\n await tx.conversationMember.create({\n data: {\n userId,\n conversationId: existingNewtonChat.conversationId,\n role: 'MEMBER',\n },\n });\n\n return existingNewtonChat;\n }\n\n // Create new NewtonChat with associated conversation\n const conversation = await tx.conversation.create({\n data: {\n type: 'DM',\n name: 'Session with Newton Tutor',\n displayInChat: false, // Newton chats don't show in regular chat list\n },\n });\n\n // Add student to the conversation\n await tx.conversationMember.create({\n data: {\n userId,\n conversationId: conversation.id,\n role: 'MEMBER',\n },\n });\n\n // Create the NewtonChat\n const newtonChat = await tx.newtonChat.create({\n data: {\n submissionId: submission.id,\n conversationId: conversation.id,\n title: 'Session with Newton Tutor',\n },\n });\n generateAndSendNewtonIntroduction(\n newtonChat.id,\n newtonChat.conversationId,\n submission.id\n ).catch(error => {\n logger.error('Failed to generate AI introduction:', { error, newtonChatId: result.id });\n });\n\n return newtonChat;\n });\n\n return {\n conversationId: result.conversationId,\n newtonChatId: result.id,\n };\n }),\n\n postToNewtonChat: protectedProcedure\n .input(\n z.object({\n newtonChatId: z.string(),\n content: z.string().min(1).max(4000),\n mentionedUserIds: z.array(z.string()).optional(),\n })\n )\n .mutation(async ({ input, ctx }) => {\n const userId = ctx.user!.id;\n const { newtonChatId, content, mentionedUserIds = [] } = input;\n\n // Get newton chat and verify user is a member\n const newtonChat = await prisma.newtonChat.findFirst({\n where: {\n id: newtonChatId,\n conversation: {\n members: {\n some: {\n userId,\n },\n },\n },\n },\n include: {\n conversation: {\n select: {\n id: true,\n },\n },\n submission: {\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n instructions: true,\n class: {\n select: {\n subject: true,\n },\n },\n },\n },\n },\n },\n },\n });\n\n if (!newtonChat) {\n throw new TRPCError({\n code: 'FORBIDDEN',\n message: 'Newton chat not found or access denied',\n });\n }\n\n // Verify mentioned users are members of the conversation\n if (mentionedUserIds.length > 0) {\n const mentionedMemberships = await prisma.conversationMember.findMany({\n where: {\n conversationId: newtonChat.conversationId,\n userId: { in: mentionedUserIds },\n },\n });\n\n if (mentionedMemberships.length !== mentionedUserIds.length) {\n throw new TRPCError({\n code: 'BAD_REQUEST',\n message: 'Some mentioned users are not members of this conversation',\n });\n }\n }\n\n // Create message and mentions\n const result = await prisma.$transaction(async (tx) => {\n const message = await tx.message.create({\n data: {\n content,\n senderId: userId,\n conversationId: newtonChat.conversationId,\n },\n include: {\n sender: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n },\n },\n },\n },\n },\n });\n\n // Create mentions\n if (mentionedUserIds.length > 0) {\n await tx.mention.createMany({\n data: mentionedUserIds.map((mentionedUserId) => ({\n messageId: message.id,\n userId: mentionedUserId,\n })),\n });\n }\n\n // Update newton chat timestamp\n await tx.newtonChat.update({\n where: { id: newtonChatId },\n data: { updatedAt: new Date() },\n });\n\n return message;\n });\n\n // Broadcast to Pusher channel (same format as regular chat)\n try {\n await pusher.trigger(`conversation-${newtonChat.conversationId}`, 'new-message', {\n id: result.id,\n content: result.content,\n senderId: result.senderId,\n conversationId: result.conversationId,\n createdAt: result.createdAt,\n sender: result.sender,\n mentionedUserIds,\n });\n } catch (error) {\n console.error('Failed to broadcast newton chat message:', error);\n // Don't fail the request if Pusher fails\n }\n\n // Generate AI response in parallel (don't await - fire and forget)\n if (!isAIUser(userId)) {\n // Run AI response generation in background\n generateAndSendNewtonResponse(\n newtonChatId,\n content,\n newtonChat.conversationId,\n newtonChat.submission\n ).catch(error => {\n logger.error('Failed to generate AI response:', { error });\n });\n }\n\n return {\n id: result.id,\n content: result.content,\n senderId: result.senderId,\n conversationId: result.conversationId,\n createdAt: result.createdAt,\n sender: result.sender,\n mentionedUserIds,\n };\n }),\n});\n\n\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iCAAiC,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAEvH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;IAC/C,oBAAoB,EAAE,kBAAkB;SACrC,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH;SACA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,IAAK,CAAC,EAAE,CAA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,EAAE;gBACd,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,gBAAgB;SACjB,CAAC;IACJ,CAAC,CAAC;CACL,CAAC,CAAC","debug_id":"ce05ab9c-6259-5565-ad40-a8e2dd1beb79"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedDatabase.d.ts","sourceRoot":"/","sources":["seedDatabase.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,
|
|
1
|
+
{"version":3,"file":"seedDatabase.d.ts","sourceRoot":"/","sources":["seedDatabase.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,kBA0DlC;AAOD,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;GAOjF;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;GAQnF;AAED,eAAO,MAAM,YAAY,qBA6+CxB,CAAC"}
|