@studious-lms/server 1.4.2 → 1.4.3
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/.coderabbit.yaml +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -28
- package/dist/index.js.map +1 -1
- package/dist/lib/fileUpload.d.ts +10 -2
- package/dist/lib/fileUpload.d.ts.map +1 -1
- package/dist/lib/fileUpload.js +38 -6
- package/dist/lib/fileUpload.js.map +1 -1
- package/dist/middleware/auth.d.ts.map +1 -1
- package/dist/middleware/auth.js +18 -5
- package/dist/middleware/auth.js.map +1 -1
- package/dist/models/auth.d.ts +19 -14
- package/dist/models/auth.d.ts.map +1 -1
- package/dist/models/auth.js +53 -30
- package/dist/models/auth.js.map +1 -1
- package/dist/models/class.d.ts +3 -1
- package/dist/models/class.d.ts.map +1 -1
- package/dist/models/class.js +16 -4
- package/dist/models/class.js.map +1 -1
- package/dist/models/notification.d.ts +11 -10
- package/dist/models/notification.d.ts.map +1 -1
- package/dist/models/notification.js +13 -9
- package/dist/models/notification.js.map +1 -1
- package/dist/models/worksheet.d.ts +378 -7
- package/dist/models/worksheet.d.ts.map +1 -1
- package/dist/models/worksheet.js +168 -2
- package/dist/models/worksheet.js.map +1 -1
- package/dist/pipelines/aiLabChat.d.ts.map +1 -1
- package/dist/pipelines/aiLabChat.js +11 -3
- package/dist/pipelines/aiLabChat.js.map +1 -1
- package/dist/pipelines/aiLabChatContract.d.ts +3 -3
- package/dist/pipelines/aiNewtonChat.d.ts.map +1 -1
- package/dist/pipelines/aiNewtonChat.js +25 -14
- package/dist/pipelines/aiNewtonChat.js.map +1 -1
- package/dist/pipelines/gradeWorksheet.d.ts.map +1 -1
- package/dist/pipelines/gradeWorksheet.js +10 -3
- package/dist/pipelines/gradeWorksheet.js.map +1 -1
- package/dist/routers/_app.d.ts +124 -18
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/class.d.ts +2 -1
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/class.js +3 -3
- package/dist/routers/class.js.map +1 -1
- package/dist/routers/labChat.d.ts +6 -0
- package/dist/routers/labChat.d.ts.map +1 -1
- package/dist/routers/labChat.js +5 -3
- package/dist/routers/labChat.js.map +1 -1
- package/dist/routers/message.d.ts +31 -0
- package/dist/routers/message.d.ts.map +1 -1
- package/dist/routers/message.js +27 -4
- package/dist/routers/message.js.map +1 -1
- package/dist/routers/newtonChat.d.ts +6 -0
- package/dist/routers/newtonChat.d.ts.map +1 -1
- package/dist/routers/newtonChat.js +5 -4
- package/dist/routers/newtonChat.js.map +1 -1
- package/dist/routers/notifications.d.ts +9 -2
- package/dist/routers/notifications.d.ts.map +1 -1
- package/dist/routers/notifications.js +4 -4
- package/dist/routers/notifications.js.map +1 -1
- package/dist/routers/worksheet.d.ts +8 -6
- package/dist/routers/worksheet.d.ts.map +1 -1
- package/dist/routers/worksheet.js +18 -16
- package/dist/routers/worksheet.js.map +1 -1
- package/dist/services/auth.d.ts +1 -1
- package/dist/services/auth.d.ts.map +1 -1
- package/dist/services/auth.js +19 -12
- package/dist/services/auth.js.map +1 -1
- package/dist/services/class.d.ts +1 -1
- package/dist/services/class.d.ts.map +1 -1
- package/dist/services/class.js +6 -3
- package/dist/services/class.js.map +1 -1
- package/dist/services/file.d.ts.map +1 -1
- package/dist/services/file.js +7 -2
- package/dist/services/file.js.map +1 -1
- package/dist/services/labChat.d.ts +6 -0
- package/dist/services/labChat.d.ts.map +1 -1
- package/dist/services/labChat.js +30 -18
- package/dist/services/labChat.js.map +1 -1
- package/dist/services/message.d.ts +30 -0
- package/dist/services/message.d.ts.map +1 -1
- package/dist/services/message.js +97 -21
- package/dist/services/message.js.map +1 -1
- package/dist/services/newtonChat.d.ts +6 -1
- package/dist/services/newtonChat.d.ts.map +1 -1
- package/dist/services/newtonChat.js +36 -18
- package/dist/services/newtonChat.js.map +1 -1
- package/dist/services/notification.d.ts +12 -5
- package/dist/services/notification.d.ts.map +1 -1
- package/dist/services/notification.js +24 -9
- package/dist/services/notification.js.map +1 -1
- package/dist/services/studentProgress.d.ts.map +1 -1
- package/dist/services/studentProgress.js +6 -3
- package/dist/services/studentProgress.js.map +1 -1
- package/dist/services/worksheet.d.ts +15 -15
- package/dist/services/worksheet.d.ts.map +1 -1
- package/dist/services/worksheet.js +138 -54
- package/dist/services/worksheet.js.map +1 -1
- package/dist/trpc.d.ts.map +1 -1
- package/dist/trpc.js +11 -17
- package/dist/trpc.js.map +1 -1
- package/dist/utils/inference.d.ts +9 -1
- package/dist/utils/inference.d.ts.map +1 -1
- package/dist/utils/inference.js +138 -50
- package/dist/utils/inference.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260415103500_add_session_type/migration.sql +33 -0
- package/prisma/migrations/20260415133000_add_ai_usage_logs/migration.sql +19 -0
- package/prisma/schema.prisma +27 -1
- package/scripts/test-pre-push.ts +6 -2
- package/src/index.ts +80 -28
- package/src/lib/fileUpload.ts +55 -5
- package/src/middleware/auth.ts +19 -4
- package/src/models/auth.ts +59 -29
- package/src/models/class.ts +15 -4
- package/src/models/notification.ts +13 -7
- package/src/models/worksheet.ts +202 -0
- package/src/pipelines/aiLabChat.ts +9 -1
- package/src/pipelines/aiNewtonChat.ts +24 -14
- package/src/pipelines/gradeWorksheet.ts +8 -0
- package/src/routers/class.ts +2 -2
- package/src/routers/labChat.ts +3 -1
- package/src/routers/message.ts +38 -1
- package/src/routers/newtonChat.ts +4 -2
- package/src/routers/notifications.ts +2 -2
- package/src/routers/worksheet.ts +31 -19
- package/src/services/auth.ts +26 -12
- package/src/services/class.ts +4 -1
- package/src/services/file.ts +6 -0
- package/src/services/labChat.ts +42 -18
- package/src/services/message.ts +163 -18
- package/src/services/newtonChat.ts +49 -18
- package/src/services/notification.ts +27 -8
- package/src/services/studentProgress.ts +4 -1
- package/src/services/worksheet.ts +191 -51
- package/src/trpc.ts +12 -18
- package/src/utils/inference.ts +209 -55
- package/tests/globalSetup.ts +13 -4
- package/tests/routers/auth.test.ts +120 -17
- package/tests/routers/class.test.ts +7 -1
- package/tests/routers/message.test.ts +236 -9
- package/tests/routers/newtonChat.test.ts +81 -0
- package/tests/routers/notification.test.ts +12 -0
- package/tests/routers/worksheet.test.ts +194 -0
- package/tests/setup.ts +22 -5
- package/tests/utils/inference.test.ts +218 -0
package/dist/routers/labChat.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]="f18914ac-2f4a-550b-965e-60912d8a1440")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createTRPCRouter, protectedProcedure } from "../trpc.js";
|
|
5
5
|
import { createLabChat, getLabChat, listLabChats, postToLabChat, deleteLabChat, rerunLastResponse, } from "../services/labChat.js";
|
|
@@ -24,13 +24,15 @@ export const labChatRouter = createTRPCRouter({
|
|
|
24
24
|
postToLabChat: protectedProcedure
|
|
25
25
|
.input(z.object({
|
|
26
26
|
labChatId: z.string(),
|
|
27
|
-
content: z.string().
|
|
27
|
+
content: z.string().max(4000),
|
|
28
28
|
mentionedUserIds: z.array(z.string()).optional(),
|
|
29
|
+
fileIds: z.array(z.string()).max(10).optional(),
|
|
29
30
|
}))
|
|
30
31
|
.mutation(({ ctx, input }) => postToLabChat(ctx.user.id, {
|
|
31
32
|
labChatId: input.labChatId,
|
|
32
33
|
content: input.content,
|
|
33
34
|
mentionedUserIds: input.mentionedUserIds,
|
|
35
|
+
fileIds: input.fileIds,
|
|
34
36
|
})),
|
|
35
37
|
delete: protectedProcedure
|
|
36
38
|
.input(z.object({ labChatId: z.string() }))
|
|
@@ -40,4 +42,4 @@ export const labChatRouter = createTRPCRouter({
|
|
|
40
42
|
.mutation(({ ctx, input }) => rerunLastResponse(ctx.user.id, input.labChatId)),
|
|
41
43
|
});
|
|
42
44
|
//# sourceMappingURL=labChat.js.map
|
|
43
|
-
//# debugId=
|
|
45
|
+
//# debugId=f18914ac-2f4a-550b-965e-60912d8a1440
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labChat.js","sources":["routers/labChat.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport {\n createLabChat,\n getLabChat,\n listLabChats,\n postToLabChat,\n deleteLabChat,\n rerunLastResponse,\n} from \"../services/labChat.js\";\n\nexport const labChatRouter = createTRPCRouter({\n create: protectedProcedure\n .input(\n z.object({\n classId: z.string(),\n title: z.string().min(1).max(200),\n context: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n createLabChat(ctx.user!.id, {\n classId: input.classId,\n title: input.title,\n context: input.context,\n })\n ),\n\n get: protectedProcedure\n .input(z.object({ labChatId: z.string() }))\n .query(({ ctx, input }) => getLabChat(ctx.user!.id, input.labChatId)),\n\n list: protectedProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ ctx, input }) => listLabChats(ctx.user!.id, input.classId)),\n\n postToLabChat: protectedProcedure\n .input(\n z.object({\n labChatId: z.string(),\n content: z.string().
|
|
1
|
+
{"version":3,"file":"labChat.js","sources":["routers/labChat.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport {\n createLabChat,\n getLabChat,\n listLabChats,\n postToLabChat,\n deleteLabChat,\n rerunLastResponse,\n} from \"../services/labChat.js\";\n\nexport const labChatRouter = createTRPCRouter({\n create: protectedProcedure\n .input(\n z.object({\n classId: z.string(),\n title: z.string().min(1).max(200),\n context: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n createLabChat(ctx.user!.id, {\n classId: input.classId,\n title: input.title,\n context: input.context,\n })\n ),\n\n get: protectedProcedure\n .input(z.object({ labChatId: z.string() }))\n .query(({ ctx, input }) => getLabChat(ctx.user!.id, input.labChatId)),\n\n list: protectedProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ ctx, input }) => listLabChats(ctx.user!.id, input.classId)),\n\n postToLabChat: protectedProcedure\n .input(\n z.object({\n labChatId: z.string(),\n content: z.string().max(4000),\n mentionedUserIds: z.array(z.string()).optional(),\n fileIds: z.array(z.string()).max(10).optional(),\n })\n )\n .mutation(({ ctx, input }) =>\n postToLabChat(ctx.user!.id, {\n labChatId: input.labChatId,\n content: input.content,\n mentionedUserIds: input.mentionedUserIds,\n fileIds: input.fileIds,\n })\n ),\n\n delete: protectedProcedure\n .input(z.object({ labChatId: z.string() }))\n .mutation(({ ctx, input }) =>\n deleteLabChat(ctx.user!.id, input.labChatId)\n ),\n\n rerunLastResponse: protectedProcedure\n .input(z.object({ labChatId: z.string() }))\n .mutation(({ ctx, input }) =>\n rerunLastResponse(ctx.user!.id, input.labChatId)\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,EACL,aAAa,EACb,UAAU,EACV,YAAY,EACZ,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;IAC5C,MAAM,EAAE,kBAAkB;SACvB,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,G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AE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAChD,CAAC,CACH;SACA,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC3B,aAAa,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE;QAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC,CACH;IAEH,MAAM,EAAE,kBAAkB;SACvB,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SAC1C,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC3B,aAAa,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,CAC7C;IAEH,iBAAiB,EAAE,kBAAkB;SAClC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SAC1C,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC3B,iBAAiB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,CACjD;CACJ,CAAC,CAAC","debug_id":"f18914ac-2f4a-550b-965e-60912d8a1440"}
|
|
@@ -63,6 +63,7 @@ export declare const messageRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
63
63
|
conversationId: string;
|
|
64
64
|
content: string;
|
|
65
65
|
mentionedUserIds?: string[] | undefined;
|
|
66
|
+
fileIds?: string[] | undefined;
|
|
66
67
|
};
|
|
67
68
|
output: {
|
|
68
69
|
id: string;
|
|
@@ -78,10 +79,40 @@ export declare const messageRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
78
79
|
profilePicture: string | null;
|
|
79
80
|
} | null;
|
|
80
81
|
};
|
|
82
|
+
attachments: {
|
|
83
|
+
type: string;
|
|
84
|
+
name: string;
|
|
85
|
+
id: string;
|
|
86
|
+
}[];
|
|
81
87
|
mentionedUserIds: string[];
|
|
82
88
|
};
|
|
83
89
|
meta: object;
|
|
84
90
|
}>;
|
|
91
|
+
getUploadUrls: import("@trpc/server").TRPCMutationProcedure<{
|
|
92
|
+
input: {
|
|
93
|
+
conversationId: string;
|
|
94
|
+
files: {
|
|
95
|
+
type: string;
|
|
96
|
+
name: string;
|
|
97
|
+
size: number;
|
|
98
|
+
}[];
|
|
99
|
+
};
|
|
100
|
+
output: import("../lib/fileUpload.js").DirectUploadFile[];
|
|
101
|
+
meta: object;
|
|
102
|
+
}>;
|
|
103
|
+
confirmUpload: import("@trpc/server").TRPCMutationProcedure<{
|
|
104
|
+
input: {
|
|
105
|
+
conversationId: string;
|
|
106
|
+
fileId: string;
|
|
107
|
+
uploadSuccess: boolean;
|
|
108
|
+
errorMessage?: string | undefined;
|
|
109
|
+
};
|
|
110
|
+
output: {
|
|
111
|
+
success: boolean;
|
|
112
|
+
message: string;
|
|
113
|
+
};
|
|
114
|
+
meta: object;
|
|
115
|
+
}>;
|
|
85
116
|
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
86
117
|
input: {
|
|
87
118
|
messageId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"/","sources":["routers/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"/","sources":["routers/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHxB,CAAC"}
|
package/dist/routers/message.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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]="5b5e332c-7fdd-563b-9413-4a6e93a91642")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createTRPCRouter, protectedProcedure } from "../trpc.js";
|
|
5
|
-
import { listMessages, sendMessage, updateMessage, deleteMessage, markAsRead, markMentionsAsRead, markSuggestionCreated, getUnreadCount, } from "../services/message.js";
|
|
5
|
+
import { listMessages, sendMessage, updateMessage, deleteMessage, getMessageUploadUrls, confirmMessageUpload, markAsRead, markMentionsAsRead, markSuggestionCreated, getUnreadCount, } from "../services/message.js";
|
|
6
6
|
export const messageRouter = createTRPCRouter({
|
|
7
7
|
list: protectedProcedure
|
|
8
8
|
.input(z.object({
|
|
@@ -18,14 +18,37 @@ export const messageRouter = createTRPCRouter({
|
|
|
18
18
|
send: protectedProcedure
|
|
19
19
|
.input(z.object({
|
|
20
20
|
conversationId: z.string(),
|
|
21
|
-
content: z.string().
|
|
21
|
+
content: z.string().max(4000),
|
|
22
22
|
mentionedUserIds: z.array(z.string()).optional(),
|
|
23
|
+
fileIds: z.array(z.string()).max(10).optional(),
|
|
23
24
|
}))
|
|
24
25
|
.mutation(({ ctx, input }) => sendMessage(ctx.user.id, {
|
|
25
26
|
conversationId: input.conversationId,
|
|
26
27
|
content: input.content,
|
|
27
28
|
mentionedUserIds: input.mentionedUserIds,
|
|
29
|
+
fileIds: input.fileIds,
|
|
28
30
|
})),
|
|
31
|
+
getUploadUrls: protectedProcedure
|
|
32
|
+
.input(z.object({
|
|
33
|
+
conversationId: z.string(),
|
|
34
|
+
files: z
|
|
35
|
+
.array(z.object({
|
|
36
|
+
name: z.string().min(1),
|
|
37
|
+
type: z.string().min(1),
|
|
38
|
+
size: z.number().int().nonnegative(),
|
|
39
|
+
}))
|
|
40
|
+
.min(1)
|
|
41
|
+
.max(10),
|
|
42
|
+
}))
|
|
43
|
+
.mutation(({ ctx, input }) => getMessageUploadUrls(ctx.user.id, input)),
|
|
44
|
+
confirmUpload: protectedProcedure
|
|
45
|
+
.input(z.object({
|
|
46
|
+
conversationId: z.string(),
|
|
47
|
+
fileId: z.string(),
|
|
48
|
+
uploadSuccess: z.boolean(),
|
|
49
|
+
errorMessage: z.string().optional(),
|
|
50
|
+
}))
|
|
51
|
+
.mutation(({ ctx, input }) => confirmMessageUpload(ctx.user.id, input)),
|
|
29
52
|
update: protectedProcedure
|
|
30
53
|
.input(z.object({
|
|
31
54
|
messageId: z.string(),
|
|
@@ -58,4 +81,4 @@ export const messageRouter = createTRPCRouter({
|
|
|
58
81
|
.query(({ ctx, input }) => getUnreadCount(ctx.user.id, input.conversationId)),
|
|
59
82
|
});
|
|
60
83
|
//# sourceMappingURL=message.js.map
|
|
61
|
-
//# debugId=
|
|
84
|
+
//# debugId=5b5e332c-7fdd-563b-9413-4a6e93a91642
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sources":["routers/message.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport {\n listMessages,\n sendMessage,\n updateMessage,\n deleteMessage,\n markAsRead,\n markMentionsAsRead,\n markSuggestionCreated,\n getUnreadCount,\n} from \"../services/message.js\";\n\nexport const messageRouter = createTRPCRouter({\n list: protectedProcedure\n .input(\n z.object({\n conversationId: z.string(),\n cursor: z.string().optional(),\n limit: z.number().min(1).max(100).default(50),\n })\n )\n .query(({ ctx, input }) =>\n listMessages(ctx.user!.id, {\n conversationId: input.conversationId,\n cursor: input.cursor,\n limit: input.limit,\n })\n ),\n\n send: protectedProcedure\n .input(\n z.object({\n conversationId: z.string(),\n content: z.string().
|
|
1
|
+
{"version":3,"file":"message.js","sources":["routers/message.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport {\n listMessages,\n sendMessage,\n updateMessage,\n deleteMessage,\n getMessageUploadUrls,\n confirmMessageUpload,\n markAsRead,\n markMentionsAsRead,\n markSuggestionCreated,\n getUnreadCount,\n} from \"../services/message.js\";\n\nexport const messageRouter = createTRPCRouter({\n list: protectedProcedure\n .input(\n z.object({\n conversationId: z.string(),\n cursor: z.string().optional(),\n limit: z.number().min(1).max(100).default(50),\n })\n )\n .query(({ ctx, input }) =>\n listMessages(ctx.user!.id, {\n conversationId: input.conversationId,\n cursor: input.cursor,\n limit: input.limit,\n })\n ),\n\n send: protectedProcedure\n .input(\n z.object({\n conversationId: z.string(),\n content: z.string().max(4000),\n mentionedUserIds: z.array(z.string()).optional(),\n fileIds: z.array(z.string()).max(10).optional(),\n })\n )\n .mutation(({ ctx, input }) =>\n sendMessage(ctx.user!.id, {\n conversationId: input.conversationId,\n content: input.content,\n mentionedUserIds: input.mentionedUserIds,\n fileIds: input.fileIds,\n })\n ),\n\n getUploadUrls: protectedProcedure\n .input(\n z.object({\n conversationId: z.string(),\n files: z\n .array(\n z.object({\n name: z.string().min(1),\n type: z.string().min(1),\n size: z.number().int().nonnegative(),\n })\n )\n .min(1)\n .max(10),\n })\n )\n .mutation(({ ctx, input }) =>\n getMessageUploadUrls(ctx.user!.id, input)\n ),\n\n confirmUpload: protectedProcedure\n .input(\n z.object({\n conversationId: z.string(),\n fileId: z.string(),\n uploadSuccess: z.boolean(),\n errorMessage: z.string().optional(),\n })\n )\n .mutation(({ ctx, input }) =>\n confirmMessageUpload(ctx.user!.id, input)\n ),\n\n update: protectedProcedure\n .input(\n z.object({\n messageId: z.string(),\n content: z.string().min(1).max(4000),\n mentionedUserIds: z.array(z.string()).optional(),\n })\n )\n .mutation(({ ctx, input }) =>\n updateMessage(ctx.user!.id, {\n messageId: input.messageId,\n content: input.content,\n mentionedUserIds: input.mentionedUserIds,\n })\n ),\n\n delete: protectedProcedure\n .input(z.object({ messageId: z.string() }))\n .mutation(({ ctx, input }) => deleteMessage(ctx.user!.id, input.messageId)),\n\n markAsRead: protectedProcedure\n .input(z.object({ conversationId: z.string() }))\n .mutation(({ ctx, input }) =>\n markAsRead(ctx.user!.id, input.conversationId)\n ),\n\n markMentionsAsRead: protectedProcedure\n .input(z.object({ conversationId: z.string() }))\n .mutation(({ ctx, input }) =>\n markMentionsAsRead(ctx.user!.id, input.conversationId)\n ),\n\n markSuggestionCreated: protectedProcedure\n .input(\n z.object({\n messageId: z.string(),\n type: z.enum([\"assignment\", \"worksheet\", \"section\"]),\n index: z.number().int().min(0),\n })\n )\n .mutation(({ ctx, input }) =>\n markSuggestionCreated(ctx.user!.id, input)\n ),\n\n getUnreadCount: protectedProcedure\n .input(z.object({ conversationId: z.string() }))\n .query(({ ctx, input }) =>\n getUnreadCount(ctx.user!.id, input.conversationId)\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,EACL,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EA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AC;SAC/C,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC3B,kBAAkB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,CACvD;IAEH,qBAAqB,EAAE,kBAAkB;SACtC,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC/B,CAAC,CACH;SACA,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC3B,qBAAqB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAC3C;IAEH,cAAc,EAAE,kBAAkB;SAC/B,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SAC/C,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CACxB,cAAc,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,CACnD;CACJ,CAAC,CAAC","debug_id":"5b5e332c-7fdd-563b-9413-4a6e93a91642"}
|
|
@@ -32,6 +32,7 @@ export declare const newtonChatRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
32
32
|
content: string;
|
|
33
33
|
newtonChatId: string;
|
|
34
34
|
mentionedUserIds?: string[] | undefined;
|
|
35
|
+
fileIds?: string[] | undefined;
|
|
35
36
|
};
|
|
36
37
|
output: {
|
|
37
38
|
id: string;
|
|
@@ -47,6 +48,11 @@ export declare const newtonChatRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
47
48
|
profilePicture: string | null;
|
|
48
49
|
} | null;
|
|
49
50
|
};
|
|
51
|
+
attachments: {
|
|
52
|
+
type: string;
|
|
53
|
+
name: string;
|
|
54
|
+
id: string;
|
|
55
|
+
}[];
|
|
50
56
|
mentionedUserIds: string[];
|
|
51
57
|
};
|
|
52
58
|
meta: object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"newtonChat.d.ts","sourceRoot":"/","sources":["routers/newtonChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,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;AAOxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8B3B,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]="0a29065f-084e-52fc-8a96-7b5347eaab81")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createTRPCRouter, protectedProcedure } from "../trpc.js";
|
|
5
5
|
import { getTutorConversation, postToNewtonChat, } from "../services/newtonChat.js";
|
|
@@ -13,10 +13,11 @@ export const newtonChatRouter = createTRPCRouter({
|
|
|
13
13
|
postToNewtonChat: protectedProcedure
|
|
14
14
|
.input(z.object({
|
|
15
15
|
newtonChatId: z.string(),
|
|
16
|
-
content: z.string().
|
|
16
|
+
content: z.string().max(4000),
|
|
17
17
|
mentionedUserIds: z.array(z.string()).optional(),
|
|
18
|
+
fileIds: z.array(z.string()).max(10).optional(),
|
|
18
19
|
}))
|
|
19
|
-
.mutation(({ ctx, input }) => postToNewtonChat(ctx.user.id, input.newtonChatId, input.content, input.mentionedUserIds ?? [])),
|
|
20
|
+
.mutation(({ ctx, input }) => postToNewtonChat(ctx.user.id, input.newtonChatId, input.content, input.mentionedUserIds ?? [], input.fileIds ?? [])),
|
|
20
21
|
});
|
|
21
22
|
//# sourceMappingURL=newtonChat.js.map
|
|
22
|
-
//# debugId=
|
|
23
|
+
//# debugId=0a29065f-084e-52fc-8a96-7b5347eaab81
|
|
@@ -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 {\n getTutorConversation,\n postToNewtonChat,\n} from \"../services/newtonChat.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(({ ctx, input }) =>\n getTutorConversation(ctx.user!.id, input.assignmentId, input.classId)\n ),\n\n postToNewtonChat: protectedProcedure\n .input(\n z.object({\n newtonChatId: z.string(),\n content: z.string().
|
|
1
|
+
{"version":3,"file":"newtonChat.js","sources":["routers/newtonChat.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport {\n getTutorConversation,\n postToNewtonChat,\n} from \"../services/newtonChat.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(({ ctx, input }) =>\n getTutorConversation(ctx.user!.id, input.assignmentId, input.classId)\n ),\n\n postToNewtonChat: protectedProcedure\n .input(\n z.object({\n newtonChatId: z.string(),\n content: z.string().max(4000),\n mentionedUserIds: z.array(z.string()).optional(),\n fileIds: z.array(z.string()).max(10).optional(),\n })\n )\n .mutation(({ ctx, input }) =>\n postToNewtonChat(\n ctx.user!.id,\n input.newtonChatId,\n input.content,\n input.mentionedUserIds ?? [],\n input.fileIds ?? []\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,EACL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,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,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CACxB,oBAAoB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CACtE;IAEH,gBAAgB,EAAE,kBAAkB;SACjC,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;QAC7B,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;QAChD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAChD,CAAC,CACH;SACA,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC3B,gBAAgB,CACd,GAAG,CAAC,IAAK,CAAC,EAAE,EACZ,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,gBAAgB,IAAI,EAAE,EAC5B,KAAK,CAAC,OAAO,IAAI,EAAE,CACpB,CACF;CACJ,CAAC,CAAC","debug_id":"0a29065f-084e-52fc-8a96-7b5347eaab81"}
|
|
@@ -40,7 +40,7 @@ export declare const notificationRouter: import("@trpc/server").TRPCBuiltRouter<
|
|
|
40
40
|
input: {
|
|
41
41
|
id: string;
|
|
42
42
|
};
|
|
43
|
-
output:
|
|
43
|
+
output: {
|
|
44
44
|
sender: {
|
|
45
45
|
username: string;
|
|
46
46
|
} | null;
|
|
@@ -55,7 +55,7 @@ export declare const notificationRouter: import("@trpc/server").TRPCBuiltRouter<
|
|
|
55
55
|
senderId: string | null;
|
|
56
56
|
receiverId: string;
|
|
57
57
|
read: boolean;
|
|
58
|
-
}
|
|
58
|
+
};
|
|
59
59
|
meta: object;
|
|
60
60
|
}>;
|
|
61
61
|
sendTo: import("@trpc/server").TRPCMutationProcedure<{
|
|
@@ -89,6 +89,13 @@ export declare const notificationRouter: import("@trpc/server").TRPCBuiltRouter<
|
|
|
89
89
|
id: string;
|
|
90
90
|
};
|
|
91
91
|
output: {
|
|
92
|
+
sender: {
|
|
93
|
+
username: string;
|
|
94
|
+
} | null;
|
|
95
|
+
receiver: {
|
|
96
|
+
username: string;
|
|
97
|
+
};
|
|
98
|
+
} & {
|
|
92
99
|
id: string;
|
|
93
100
|
createdAt: Date;
|
|
94
101
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"/","sources":["routers/notifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"/","sources":["routers/notifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgC7B,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]="326a74b5-821e-501b-8db6-78f578a43fc3")}catch(e){}}();
|
|
3
3
|
import { createTRPCRouter, protectedProcedure } from "../trpc.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { listNotifications, getNotification, sendNotification, sendToMultiple, markAsRead, } from "../services/notification.js";
|
|
@@ -7,7 +7,7 @@ export const notificationRouter = createTRPCRouter({
|
|
|
7
7
|
list: protectedProcedure.query(({ ctx }) => listNotifications(ctx.user.id)),
|
|
8
8
|
get: protectedProcedure
|
|
9
9
|
.input(z.object({ id: z.string() }))
|
|
10
|
-
.query(({ input }) => getNotification(input.id)),
|
|
10
|
+
.query(({ ctx, input }) => getNotification(ctx.user.id, input.id)),
|
|
11
11
|
sendTo: protectedProcedure
|
|
12
12
|
.input(z.object({
|
|
13
13
|
receiverId: z.string(),
|
|
@@ -24,7 +24,7 @@ export const notificationRouter = createTRPCRouter({
|
|
|
24
24
|
.mutation(({ input }) => sendToMultiple(input)),
|
|
25
25
|
markAsRead: protectedProcedure
|
|
26
26
|
.input(z.object({ id: z.string() }))
|
|
27
|
-
.mutation(({ input }) => markAsRead(input.id)),
|
|
27
|
+
.mutation(({ ctx, input }) => markAsRead(ctx.user.id, input.id)),
|
|
28
28
|
});
|
|
29
29
|
//# sourceMappingURL=notifications.js.map
|
|
30
|
-
//# debugId=
|
|
30
|
+
//# debugId=326a74b5-821e-501b-8db6-78f578a43fc3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sources":["routers/notifications.ts"],"sourceRoot":"/","sourcesContent":["import { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport { z } from \"zod\";\nimport {\n listNotifications,\n getNotification,\n sendNotification,\n sendToMultiple,\n markAsRead,\n} from \"../services/notification.js\";\n\nexport const notificationRouter = createTRPCRouter({\n list: protectedProcedure.query(({ ctx }) =>\n listNotifications(ctx.user!.id)\n ),\n\n get: protectedProcedure\n .input(z.object({ id: z.string() }))\n .query(({ input }) => getNotification(input.id)),\n\n sendTo: protectedProcedure\n .input(\n z.object({\n receiverId: z.string(),\n title: z.string(),\n content: z.string(),\n })\n )\n .mutation(({ input }) => sendNotification(input)),\n\n sendToMultiple: protectedProcedure\n .input(\n z.object({\n receiverIds: z.array(z.string()),\n title: z.string(),\n content: z.string(),\n })\n )\n .mutation(({ input }) => sendToMultiple(input)),\n\n markAsRead: protectedProcedure\n .input(z.object({ id: z.string() }))\n .mutation(({ input }) => markAsRead(input.id)),\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;IACjD,IAAI,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CACzC,iBAAiB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,CAAC,CAChC;IAED,GAAG,EAAE,kBAAkB;SACpB,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACnC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"notifications.js","sources":["routers/notifications.ts"],"sourceRoot":"/","sourcesContent":["import { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport { z } from \"zod\";\nimport {\n listNotifications,\n getNotification,\n sendNotification,\n sendToMultiple,\n markAsRead,\n} from \"../services/notification.js\";\n\nexport const notificationRouter = createTRPCRouter({\n list: protectedProcedure.query(({ ctx }) =>\n listNotifications(ctx.user!.id)\n ),\n\n get: protectedProcedure\n .input(z.object({ id: z.string() }))\n .query(({ ctx, input }) => getNotification(ctx.user!.id, input.id)),\n\n sendTo: protectedProcedure\n .input(\n z.object({\n receiverId: z.string(),\n title: z.string(),\n content: z.string(),\n })\n )\n .mutation(({ input }) => sendNotification(input)),\n\n sendToMultiple: protectedProcedure\n .input(\n z.object({\n receiverIds: z.array(z.string()),\n title: z.string(),\n content: z.string(),\n })\n )\n .mutation(({ input }) => sendToMultiple(input)),\n\n markAsRead: protectedProcedure\n .input(z.object({ id: z.string() }))\n .mutation(({ ctx, input }) => markAsRead(ctx.user!.id, input.id)),\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CA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AAc,CAAC,KAAK,CAAC,CAAC;IAEjD,UAAU,EAAE,kBAAkB;SAC3B,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACnC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;CACpE,CAAC,CAAC","debug_id":"326a74b5-821e-501b-8db6-78f578a43fc3"}
|
|
@@ -31,8 +31,8 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
31
31
|
syllabus: string | null;
|
|
32
32
|
} | null;
|
|
33
33
|
questions: {
|
|
34
|
-
options: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
35
34
|
type: import(".prisma/client").$Enums.WorksheetQuestionType;
|
|
35
|
+
options: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
36
36
|
id: string;
|
|
37
37
|
createdAt: Date;
|
|
38
38
|
order: number | null;
|
|
@@ -63,6 +63,7 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
63
63
|
}>;
|
|
64
64
|
listWorksheets: import("@trpc/server").TRPCQueryProcedure<{
|
|
65
65
|
input: {
|
|
66
|
+
[x: string]: unknown;
|
|
66
67
|
classId: string;
|
|
67
68
|
};
|
|
68
69
|
output: {
|
|
@@ -107,8 +108,9 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
107
108
|
}>;
|
|
108
109
|
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
109
110
|
input: {
|
|
110
|
-
|
|
111
|
+
[x: string]: unknown;
|
|
111
112
|
classId: string;
|
|
113
|
+
name: string;
|
|
112
114
|
};
|
|
113
115
|
output: {
|
|
114
116
|
name: string;
|
|
@@ -130,8 +132,8 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
130
132
|
markScheme?: any;
|
|
131
133
|
};
|
|
132
134
|
output: {
|
|
133
|
-
options: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
134
135
|
type: import(".prisma/client").$Enums.WorksheetQuestionType;
|
|
136
|
+
options: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
135
137
|
id: string;
|
|
136
138
|
createdAt: Date;
|
|
137
139
|
order: number | null;
|
|
@@ -160,16 +162,16 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
160
162
|
input: {
|
|
161
163
|
questionId: string;
|
|
162
164
|
worksheetId: string;
|
|
163
|
-
options?: any;
|
|
164
165
|
type?: "ESSAY" | "MULTIPLE_CHOICE" | "TRUE_FALSE" | "SHORT_ANSWER" | "LONG_ANSWER" | "MATH_EXPRESSION" | undefined;
|
|
166
|
+
options?: any;
|
|
165
167
|
points?: number | undefined;
|
|
166
168
|
markScheme?: any;
|
|
167
169
|
question?: string | undefined;
|
|
168
170
|
answer?: string | undefined;
|
|
169
171
|
};
|
|
170
172
|
output: {
|
|
171
|
-
options: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
172
173
|
type: import(".prisma/client").$Enums.WorksheetQuestionType;
|
|
174
|
+
options: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
173
175
|
id: string;
|
|
174
176
|
createdAt: Date;
|
|
175
177
|
order: number | null;
|
|
@@ -188,8 +190,8 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
188
190
|
worksheetId: string;
|
|
189
191
|
};
|
|
190
192
|
output: {
|
|
191
|
-
options: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
192
193
|
type: import(".prisma/client").$Enums.WorksheetQuestionType;
|
|
194
|
+
options: import("@prisma/client/runtime/library.js").JsonValue | null;
|
|
193
195
|
id: string;
|
|
194
196
|
createdAt: Date;
|
|
195
197
|
order: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet.d.ts","sourceRoot":"/","sources":["routers/worksheet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worksheet.d.ts","sourceRoot":"/","sources":["routers/worksheet.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4O1B,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
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]="0b0beac6-a26f-5bc1-becc-4071188968a9")}catch(e){}}();
|
|
3
3
|
import { TRPCError } from "@trpc/server";
|
|
4
|
-
import { createTRPCRouter, protectedClassMemberProcedure, protectedProcedure, } from "../trpc.js";
|
|
4
|
+
import { createTRPCRouter, protectedClassMemberProcedure, protectedProcedure, protectedTeacherProcedure, } from "../trpc.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { getWorksheet, worksheetExists, listWorksheets, updateWorksheetRecord, deleteWorksheetRecord, createWorksheetRecord, addQuestionToWorksheet, reorderWorksheetQuestions, updateWorksheetQuestionRecord, deleteWorksheetQuestionRecord, getWorksheetSubmission, answerWorksheetQuestion, cancelGrading, regradeQuestion, gradeAnswer, addCommentToResponse, } from "../services/worksheet.js";
|
|
7
7
|
export const worksheetRouter = createTRPCRouter({
|
|
8
8
|
getWorksheet: protectedProcedure
|
|
9
9
|
.input(z.object({ worksheetId: z.string() }))
|
|
10
|
-
.query(({ input }) => getWorksheet(input.worksheetId)),
|
|
10
|
+
.query(({ ctx, input }) => getWorksheet(input.worksheetId, ctx.user.id)),
|
|
11
11
|
exists: protectedClassMemberProcedure
|
|
12
12
|
.input(z.object({ id: z.string() }))
|
|
13
13
|
.query(async ({ ctx, input }) => {
|
|
@@ -19,16 +19,18 @@ export const worksheetRouter = createTRPCRouter({
|
|
|
19
19
|
}
|
|
20
20
|
return worksheetExists(input.id);
|
|
21
21
|
}),
|
|
22
|
-
listWorksheets:
|
|
22
|
+
listWorksheets: protectedClassMemberProcedure
|
|
23
23
|
.input(z.object({ classId: z.string() }))
|
|
24
24
|
.query(({ input }) => listWorksheets(input.classId)),
|
|
25
25
|
updateWorksheet: protectedProcedure
|
|
26
26
|
.input(z.object({ worksheetId: z.string(), name: z.string().optional() }))
|
|
27
|
-
.mutation(({ input }) => updateWorksheetRecord(input.worksheetId,
|
|
27
|
+
.mutation(({ ctx, input }) => updateWorksheetRecord(input.worksheetId, ctx.user.id, {
|
|
28
|
+
name: input.name,
|
|
29
|
+
})),
|
|
28
30
|
deleteWorksheet: protectedProcedure
|
|
29
31
|
.input(z.object({ worksheetId: z.string() }))
|
|
30
|
-
.mutation(({ input }) => deleteWorksheetRecord(input.worksheetId)),
|
|
31
|
-
create:
|
|
32
|
+
.mutation(({ ctx, input }) => deleteWorksheetRecord(input.worksheetId, ctx.user.id)),
|
|
33
|
+
create: protectedTeacherProcedure
|
|
32
34
|
.input(z.object({ classId: z.string(), name: z.string() }))
|
|
33
35
|
.mutation(({ input }) => createWorksheetRecord(input.classId, input.name)),
|
|
34
36
|
addQuestion: protectedProcedure
|
|
@@ -48,7 +50,7 @@ export const worksheetRouter = createTRPCRouter({
|
|
|
48
50
|
"ESSAY",
|
|
49
51
|
]),
|
|
50
52
|
}))
|
|
51
|
-
.mutation(({ input }) => addQuestionToWorksheet(input.worksheetId, {
|
|
53
|
+
.mutation(({ ctx, input }) => addQuestionToWorksheet(input.worksheetId, ctx.user.id, {
|
|
52
54
|
question: input.question,
|
|
53
55
|
answer: input.answer,
|
|
54
56
|
points: input.points,
|
|
@@ -63,7 +65,7 @@ export const worksheetRouter = createTRPCRouter({
|
|
|
63
65
|
position: z.enum(["before", "after"]),
|
|
64
66
|
targetId: z.string(),
|
|
65
67
|
}))
|
|
66
|
-
.mutation(({ input }) => reorderWorksheetQuestions(input.worksheetId, input.movedId, input.position, input.targetId)),
|
|
68
|
+
.mutation(({ ctx, input }) => reorderWorksheetQuestions(input.worksheetId, ctx.user.id, input.movedId, input.position, input.targetId)),
|
|
67
69
|
updateQuestion: protectedProcedure
|
|
68
70
|
.input(z.object({
|
|
69
71
|
worksheetId: z.string(),
|
|
@@ -84,7 +86,7 @@ export const worksheetRouter = createTRPCRouter({
|
|
|
84
86
|
])
|
|
85
87
|
.optional(),
|
|
86
88
|
}))
|
|
87
|
-
.mutation(({ input }) => updateWorksheetQuestionRecord(input.worksheetId, input.questionId, {
|
|
89
|
+
.mutation(({ ctx, input }) => updateWorksheetQuestionRecord(input.worksheetId, input.questionId, ctx.user.id, {
|
|
88
90
|
question: input.question,
|
|
89
91
|
answer: input.answer,
|
|
90
92
|
points: input.points,
|
|
@@ -97,13 +99,13 @@ export const worksheetRouter = createTRPCRouter({
|
|
|
97
99
|
worksheetId: z.string(),
|
|
98
100
|
questionId: z.string(),
|
|
99
101
|
}))
|
|
100
|
-
.mutation(({ input }) => deleteWorksheetQuestionRecord(input.worksheetId, input.questionId)),
|
|
102
|
+
.mutation(({ ctx, input }) => deleteWorksheetQuestionRecord(input.worksheetId, input.questionId, ctx.user.id)),
|
|
101
103
|
getWorksheetSubmission: protectedProcedure
|
|
102
104
|
.input(z.object({
|
|
103
105
|
worksheetId: z.string(),
|
|
104
106
|
submissionId: z.string(),
|
|
105
107
|
}))
|
|
106
|
-
.query(({ input }) => getWorksheetSubmission(input.worksheetId, input.submissionId)),
|
|
108
|
+
.query(({ ctx, input }) => getWorksheetSubmission(input.worksheetId, input.submissionId, ctx.user.id)),
|
|
107
109
|
answerQuestion: protectedProcedure
|
|
108
110
|
.input(z.object({
|
|
109
111
|
worksheetResponseId: z.string(),
|
|
@@ -116,13 +118,13 @@ export const worksheetRouter = createTRPCRouter({
|
|
|
116
118
|
worksheetResponseId: z.string(),
|
|
117
119
|
progressId: z.string(),
|
|
118
120
|
}))
|
|
119
|
-
.mutation(({ input }) => cancelGrading(input.worksheetResponseId, input.progressId)),
|
|
121
|
+
.mutation(({ ctx, input }) => cancelGrading(input.worksheetResponseId, input.progressId, ctx.user.id)),
|
|
120
122
|
regradeQuestion: protectedProcedure
|
|
121
123
|
.input(z.object({
|
|
122
124
|
worksheetResponseId: z.string(),
|
|
123
125
|
progressId: z.string(),
|
|
124
126
|
}))
|
|
125
|
-
.mutation(({ input }) => regradeQuestion(input.worksheetResponseId, input.progressId)),
|
|
127
|
+
.mutation(({ ctx, input }) => regradeQuestion(input.worksheetResponseId, input.progressId, ctx.user.id)),
|
|
126
128
|
gradeAnswer: protectedProcedure
|
|
127
129
|
.input(z.object({
|
|
128
130
|
questionId: z.string(),
|
|
@@ -134,7 +136,7 @@ export const worksheetRouter = createTRPCRouter({
|
|
|
134
136
|
markschemeState: z.any().optional(),
|
|
135
137
|
points: z.number().optional(),
|
|
136
138
|
}))
|
|
137
|
-
.mutation(({ input }) => gradeAnswer(input.questionId, input.studentWorksheetResponseId, {
|
|
139
|
+
.mutation(({ ctx, input }) => gradeAnswer(input.questionId, input.studentWorksheetResponseId, ctx.user.id, {
|
|
138
140
|
responseId: input.responseId,
|
|
139
141
|
response: input.response,
|
|
140
142
|
isCorrect: input.isCorrect,
|
|
@@ -150,4 +152,4 @@ export const worksheetRouter = createTRPCRouter({
|
|
|
150
152
|
.mutation(({ ctx, input }) => addCommentToResponse(input.responseId, input.comment, ctx.user.id)),
|
|
151
153
|
});
|
|
152
154
|
//# sourceMappingURL=worksheet.js.map
|
|
153
|
-
//# debugId=
|
|
155
|
+
//# debugId=0b0beac6-a26f-5bc1-becc-4071188968a9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet.js","sources":["routers/worksheet.ts"],"sourceRoot":"/","sourcesContent":["import { TRPCError } from \"@trpc/server\";\nimport {\n createTRPCRouter,\n protectedClassMemberProcedure,\n protectedProcedure,\n} from \"../trpc.js\";\nimport { z } from \"zod\";\nimport {\n getWorksheet,\n worksheetExists,\n listWorksheets,\n updateWorksheetRecord,\n deleteWorksheetRecord,\n createWorksheetRecord,\n addQuestionToWorksheet,\n reorderWorksheetQuestions,\n updateWorksheetQuestionRecord,\n deleteWorksheetQuestionRecord,\n getWorksheetSubmission,\n answerWorksheetQuestion,\n cancelGrading,\n regradeQuestion,\n gradeAnswer,\n addCommentToResponse,\n} from \"../services/worksheet.js\";\n\nexport const worksheetRouter = createTRPCRouter({\n getWorksheet: protectedProcedure\n .input(z.object({ worksheetId: z.string() }))\n .query(({ input }) => getWorksheet(input.worksheetId)),\n\n exists: protectedClassMemberProcedure\n .input(z.object({ id: z.string() }))\n .query(async ({ ctx, input }) => {\n if (!ctx.user) {\n throw new TRPCError({\n code: \"UNAUTHORIZED\",\n message: \"User must be authenticated\",\n });\n }\n return worksheetExists(input.id);\n }),\n\n listWorksheets: protectedProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ input }) => listWorksheets(input.classId)),\n\n updateWorksheet: protectedProcedure\n .input(z.object({ worksheetId: z.string(), name: z.string().optional() }))\n .mutation(({ input }) =>\n updateWorksheetRecord(input.worksheetId, { name: input.name })\n ),\n\n deleteWorksheet: protectedProcedure\n .input(z.object({ worksheetId: z.string() }))\n .mutation(({ input }) => deleteWorksheetRecord(input.worksheetId)),\n\n create: protectedProcedure\n .input(z.object({ classId: z.string(), name: z.string() }))\n .mutation(({ input }) =>\n createWorksheetRecord(input.classId, input.name)\n ),\n\n addQuestion: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n question: z.string(),\n answer: z.string(),\n points: z.number().optional(),\n options: z.any().optional(),\n markScheme: z.any().optional(),\n type: z.enum([\n \"MULTIPLE_CHOICE\",\n \"TRUE_FALSE\",\n \"SHORT_ANSWER\",\n \"LONG_ANSWER\",\n \"MATH_EXPRESSION\",\n \"ESSAY\",\n ]),\n })\n )\n .mutation(({ input }) =>\n addQuestionToWorksheet(input.worksheetId, {\n question: input.question,\n answer: input.answer,\n points: input.points,\n options: input.options,\n markScheme: input.markScheme,\n type: input.type,\n })\n ),\n\n reorderQuestions: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n movedId: z.string(),\n position: z.enum([\"before\", \"after\"]),\n targetId: z.string(),\n })\n )\n .mutation(({ input }) =>\n reorderWorksheetQuestions(\n input.worksheetId,\n input.movedId,\n input.position,\n input.targetId\n )\n ),\n\n updateQuestion: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n questionId: z.string(),\n question: z.string().optional(),\n answer: z.string().optional(),\n points: z.number().optional(),\n options: z.any().optional(),\n markScheme: z.any().optional(),\n type: z\n .enum([\n \"MULTIPLE_CHOICE\",\n \"TRUE_FALSE\",\n \"SHORT_ANSWER\",\n \"LONG_ANSWER\",\n \"MATH_EXPRESSION\",\n \"ESSAY\",\n ])\n .optional(),\n })\n )\n .mutation(({ input }) =>\n updateWorksheetQuestionRecord(\n input.worksheetId,\n input.questionId,\n {\n question: input.question,\n answer: input.answer,\n points: input.points,\n options: input.options,\n markScheme: input.markScheme,\n type: input.type,\n }\n )\n ),\n\n deleteQuestion: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n questionId: z.string(),\n })\n )\n .mutation(({ input }) =>\n deleteWorksheetQuestionRecord(input.worksheetId, input.questionId)\n ),\n\n getWorksheetSubmission: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n submissionId: z.string(),\n })\n )\n .query(({ input }) =>\n getWorksheetSubmission(input.worksheetId, input.submissionId)\n ),\n\n answerQuestion: protectedProcedure\n .input(\n z.object({\n worksheetResponseId: z.string(),\n questionId: z.string(),\n response: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n answerWorksheetQuestion(\n input.worksheetResponseId,\n input.questionId,\n input.response,\n ctx.user!.id\n )\n ),\n\n cancelGrading: protectedProcedure\n .input(\n z.object({\n worksheetResponseId: z.string(),\n progressId: z.string(),\n })\n )\n .mutation(({ input }) =>\n cancelGrading(input.worksheetResponseId, input.progressId)\n ),\n\n regradeQuestion: protectedProcedure\n .input(\n z.object({\n worksheetResponseId: z.string(),\n progressId: z.string(),\n })\n )\n .mutation(({ input }) =>\n regradeQuestion(input.worksheetResponseId, input.progressId)\n ),\n\n gradeAnswer: protectedProcedure\n .input(\n z.object({\n questionId: z.string(),\n responseId: z.string().optional(),\n studentWorksheetResponseId: z.string(),\n response: z.string().optional(),\n isCorrect: z.boolean(),\n feedback: z.string().optional(),\n markschemeState: z.any().optional(),\n points: z.number().optional(),\n })\n )\n .mutation(({ input }) =>\n gradeAnswer(\n input.questionId,\n input.studentWorksheetResponseId,\n {\n responseId: input.responseId,\n response: input.response,\n isCorrect: input.isCorrect,\n feedback: input.feedback,\n markschemeState: input.markschemeState,\n points: input.points,\n }\n )\n ),\n\n addComment: protectedProcedure\n .input(\n z.object({\n responseId: z.string(),\n comment: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n addCommentToResponse(\n input.responseId,\n input.comment,\n ctx.user!.id\n )\n ),\n});\n"],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AC,OAAO,EACb,GAAG,CAAC,IAAK,CAAC,EAAE,CACb,CACF;CACJ,CAAC,CAAC","debug_id":"bb1aa1a6-e249-5dff-bc42-ce1e6f79f915"}
|
|
1
|
+
{"version":3,"file":"worksheet.js","sources":["routers/worksheet.ts"],"sourceRoot":"/","sourcesContent":["import { TRPCError } from \"@trpc/server\";\nimport {\n createTRPCRouter,\n protectedClassMemberProcedure,\n protectedProcedure,\n protectedTeacherProcedure,\n} from \"../trpc.js\";\nimport { z } from \"zod\";\nimport {\n getWorksheet,\n worksheetExists,\n listWorksheets,\n updateWorksheetRecord,\n deleteWorksheetRecord,\n createWorksheetRecord,\n addQuestionToWorksheet,\n reorderWorksheetQuestions,\n updateWorksheetQuestionRecord,\n deleteWorksheetQuestionRecord,\n getWorksheetSubmission,\n answerWorksheetQuestion,\n cancelGrading,\n regradeQuestion,\n gradeAnswer,\n addCommentToResponse,\n} from \"../services/worksheet.js\";\n\nexport const worksheetRouter = createTRPCRouter({\n getWorksheet: protectedProcedure\n .input(z.object({ worksheetId: z.string() }))\n .query(({ ctx, input }) => getWorksheet(input.worksheetId, ctx.user!.id)),\n\n exists: protectedClassMemberProcedure\n .input(z.object({ id: z.string() }))\n .query(async ({ ctx, input }) => {\n if (!ctx.user) {\n throw new TRPCError({\n code: \"UNAUTHORIZED\",\n message: \"User must be authenticated\",\n });\n }\n return worksheetExists(input.id);\n }),\n\n listWorksheets: protectedClassMemberProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ input }) => listWorksheets(input.classId)),\n\n updateWorksheet: protectedProcedure\n .input(z.object({ worksheetId: z.string(), name: z.string().optional() }))\n .mutation(({ ctx, input }) =>\n updateWorksheetRecord(input.worksheetId, ctx.user!.id, {\n name: input.name,\n })\n ),\n\n deleteWorksheet: protectedProcedure\n .input(z.object({ worksheetId: z.string() }))\n .mutation(({ ctx, input }) =>\n deleteWorksheetRecord(input.worksheetId, ctx.user!.id)\n ),\n\n create: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), name: z.string() }))\n .mutation(({ input }) =>\n createWorksheetRecord(input.classId, input.name)\n ),\n\n addQuestion: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n question: z.string(),\n answer: z.string(),\n points: z.number().optional(),\n options: z.any().optional(),\n markScheme: z.any().optional(),\n type: z.enum([\n \"MULTIPLE_CHOICE\",\n \"TRUE_FALSE\",\n \"SHORT_ANSWER\",\n \"LONG_ANSWER\",\n \"MATH_EXPRESSION\",\n \"ESSAY\",\n ]),\n })\n )\n .mutation(({ ctx, input }) =>\n addQuestionToWorksheet(input.worksheetId, ctx.user!.id, {\n question: input.question,\n answer: input.answer,\n points: input.points,\n options: input.options,\n markScheme: input.markScheme,\n type: input.type,\n })\n ),\n\n reorderQuestions: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n movedId: z.string(),\n position: z.enum([\"before\", \"after\"]),\n targetId: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n reorderWorksheetQuestions(\n input.worksheetId,\n ctx.user!.id,\n input.movedId,\n input.position,\n input.targetId\n )\n ),\n\n updateQuestion: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n questionId: z.string(),\n question: z.string().optional(),\n answer: z.string().optional(),\n points: z.number().optional(),\n options: z.any().optional(),\n markScheme: z.any().optional(),\n type: z\n .enum([\n \"MULTIPLE_CHOICE\",\n \"TRUE_FALSE\",\n \"SHORT_ANSWER\",\n \"LONG_ANSWER\",\n \"MATH_EXPRESSION\",\n \"ESSAY\",\n ])\n .optional(),\n })\n )\n .mutation(({ ctx, input }) =>\n updateWorksheetQuestionRecord(\n input.worksheetId,\n input.questionId,\n ctx.user!.id,\n {\n question: input.question,\n answer: input.answer,\n points: input.points,\n options: input.options,\n markScheme: input.markScheme,\n type: input.type,\n }\n )\n ),\n\n deleteQuestion: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n questionId: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n deleteWorksheetQuestionRecord(\n input.worksheetId,\n input.questionId,\n ctx.user!.id\n )\n ),\n\n getWorksheetSubmission: protectedProcedure\n .input(\n z.object({\n worksheetId: z.string(),\n submissionId: z.string(),\n })\n )\n .query(({ ctx, input }) =>\n getWorksheetSubmission(input.worksheetId, input.submissionId, ctx.user!.id)\n ),\n\n answerQuestion: protectedProcedure\n .input(\n z.object({\n worksheetResponseId: z.string(),\n questionId: z.string(),\n response: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n answerWorksheetQuestion(\n input.worksheetResponseId,\n input.questionId,\n input.response,\n ctx.user!.id\n )\n ),\n\n cancelGrading: protectedProcedure\n .input(\n z.object({\n worksheetResponseId: z.string(),\n progressId: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n cancelGrading(input.worksheetResponseId, input.progressId, ctx.user!.id)\n ),\n\n regradeQuestion: protectedProcedure\n .input(\n z.object({\n worksheetResponseId: z.string(),\n progressId: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n regradeQuestion(input.worksheetResponseId, input.progressId, ctx.user!.id)\n ),\n\n gradeAnswer: protectedProcedure\n .input(\n z.object({\n questionId: z.string(),\n responseId: z.string().optional(),\n studentWorksheetResponseId: z.string(),\n response: z.string().optional(),\n isCorrect: z.boolean(),\n feedback: z.string().optional(),\n markschemeState: z.any().optional(),\n points: z.number().optional(),\n })\n )\n .mutation(({ ctx, input }) =>\n gradeAnswer(\n input.questionId,\n input.studentWorksheetResponseId,\n ctx.user!.id,\n {\n responseId: input.responseId,\n response: input.response,\n isCorrect: input.isCorrect,\n feedback: input.feedback,\n markschemeState: input.markschemeState,\n points: input.points,\n }\n )\n ),\n\n addComment: protectedProcedure\n .input(\n z.object({\n responseId: z.string(),\n comment: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n addCommentToResponse(\n input.responseId,\n input.comment,\n ctx.user!.id\n )\n ),\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,gBA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K,CAAC,QAAQ;QACxB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,CACF,CACF;IAEH,UAAU,EAAE,kBAAkB;SAC3B,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH;SACA,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC3B,oBAAoB,CAClB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,OAAO,EACb,GAAG,CAAC,IAAK,CAAC,EAAE,CACb,CACF;CACJ,CAAC,CAAC","debug_id":"0b0beac6-a26f-5bc1-becc-4071188968a9"}
|
package/dist/services/auth.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function register(input: {
|
|
|
9
9
|
username: string;
|
|
10
10
|
};
|
|
11
11
|
}>;
|
|
12
|
-
/** Authenticate user by username/password, create session
|
|
12
|
+
/** Authenticate user by username/password, create session. */
|
|
13
13
|
export declare function login(input: {
|
|
14
14
|
username: string;
|
|
15
15
|
password: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"/","sources":["services/auth.ts"],"names":[],"mappings":"AA6BA,qFAAqF;AACrF,wBAAsB,QAAQ,CAAC,KAAK,EAAE;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;;;;;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"/","sources":["services/auth.ts"],"names":[],"mappings":"AA6BA,qFAAqF;AACrF,wBAAsB,QAAQ,CAAC,KAAK,EAAE;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;;;;;GAqEA;AAED,8DAA8D;AAC9D,wBAAsB,KAAK,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;GAoCxE;AAED,iEAAiE;AACjE,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM;;GAG1C;AAED,0EAA0E;AAC1E,wBAAsB,KAAK,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;GASzC;AAED,gFAAgF;AAChF,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,MAAM;;GAiC1D;AAED,8EAA8E;AAC9E,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM;;GA+BzC;AAED,kFAAkF;AAClF,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM;;GA+BvD;AAED,mFAAmF;AACnF,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;GAuBlE"}
|