@studious-lms/server 1.25.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +3 -1
- package/.github/workflows/npm-publish.yml +1 -0
- package/AGENTS.md +84 -0
- package/dist/models/cloudStorage.d.ts +11 -0
- package/dist/models/cloudStorage.d.ts.map +1 -1
- package/dist/models/cloudStorage.js +18 -2
- package/dist/models/cloudStorage.js.map +1 -1
- package/dist/models/conversation.d.ts +1 -0
- package/dist/models/conversation.d.ts.map +1 -1
- package/dist/models/labChat.d.ts +40 -0
- package/dist/models/labChat.d.ts.map +1 -1
- package/dist/models/labChat.js +32 -2
- package/dist/models/labChat.js.map +1 -1
- package/dist/models/marketplace.d.ts +35 -0
- package/dist/models/marketplace.d.ts.map +1 -1
- package/dist/models/marketplace.js +9 -2
- package/dist/models/marketplace.js.map +1 -1
- package/dist/models/message.d.ts +3 -0
- package/dist/models/message.d.ts.map +1 -1
- package/dist/models/module.d.ts +228 -0
- package/dist/models/module.d.ts.map +1 -0
- package/dist/models/module.js +69 -0
- package/dist/models/module.js.map +1 -0
- package/dist/pipelines/aiLabChat.d.ts +2 -0
- package/dist/pipelines/aiLabChat.d.ts.map +1 -1
- package/dist/pipelines/aiLabChat.js +60 -16
- package/dist/pipelines/aiLabChat.js.map +1 -1
- package/dist/pipelines/aiLabChatContract.d.ts +170 -2
- package/dist/pipelines/aiLabChatContract.d.ts.map +1 -1
- package/dist/pipelines/aiLabChatContract.js +30 -2
- package/dist/pipelines/aiLabChatContract.js.map +1 -1
- package/dist/pipelines/aiNewtonChat.d.ts.map +1 -1
- package/dist/pipelines/aiNewtonChat.js +30 -5
- package/dist/pipelines/aiNewtonChat.js.map +1 -1
- package/dist/pipelines/gradeWorksheet.d.ts.map +1 -1
- package/dist/pipelines/gradeWorksheet.js +4 -2
- package/dist/pipelines/gradeWorksheet.js.map +1 -1
- package/dist/pipelines/labChatPrompt.d.ts +1 -1
- package/dist/pipelines/labChatPrompt.d.ts.map +1 -1
- package/dist/pipelines/labChatPrompt.js +13 -14
- package/dist/pipelines/labChatPrompt.js.map +1 -1
- package/dist/routers/_app.d.ts +1185 -215
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +4 -2
- package/dist/routers/_app.js.map +1 -1
- package/dist/routers/admin.d.ts +0 -1
- package/dist/routers/admin.d.ts.map +1 -1
- package/dist/routers/conversation.d.ts +1 -0
- package/dist/routers/conversation.d.ts.map +1 -1
- package/dist/routers/labChat.d.ts +10 -0
- package/dist/routers/labChat.d.ts.map +1 -1
- package/dist/routers/labChat.js +6 -3
- package/dist/routers/labChat.js.map +1 -1
- package/dist/routers/marketplace.d.ts +41 -0
- package/dist/routers/marketplace.d.ts.map +1 -1
- package/dist/routers/marketplace.js +13 -3
- package/dist/routers/marketplace.js.map +1 -1
- package/dist/routers/message.d.ts +37 -4
- package/dist/routers/message.d.ts.map +1 -1
- package/dist/routers/message.js +24 -7
- package/dist/routers/message.js.map +1 -1
- package/dist/routers/module.d.ts +345 -0
- package/dist/routers/module.d.ts.map +1 -0
- package/dist/routers/module.js +82 -0
- package/dist/routers/module.js.map +1 -0
- package/dist/routers/parent.d.ts +18 -0
- package/dist/routers/parent.d.ts.map +1 -1
- package/dist/routers/parent.js +10 -3
- package/dist/routers/parent.js.map +1 -1
- package/dist/routers/studentProgress.d.ts +44 -0
- package/dist/routers/studentProgress.d.ts.map +1 -1
- package/dist/routers/studentProgress.js +12 -3
- package/dist/routers/studentProgress.js.map +1 -1
- package/dist/routes/aiStream.js +32 -2
- package/dist/routes/aiStream.js.map +1 -1
- package/dist/seedDatabase.d.ts.map +1 -1
- package/dist/seedDatabase.js +107 -3
- package/dist/seedDatabase.js.map +1 -1
- package/dist/services/adminUser.d.ts +0 -1
- package/dist/services/adminUser.d.ts.map +1 -1
- package/dist/services/adminUser.js +7 -4
- package/dist/services/adminUser.js.map +1 -1
- package/dist/services/aiChatStream.d.ts +15 -0
- package/dist/services/aiChatStream.d.ts.map +1 -1
- package/dist/services/aiChatStream.js +144 -74
- package/dist/services/aiChatStream.js.map +1 -1
- package/dist/services/aiGeneration.d.ts +4 -0
- package/dist/services/aiGeneration.d.ts.map +1 -0
- package/dist/services/aiGeneration.js +88 -0
- package/dist/services/aiGeneration.js.map +1 -0
- package/dist/services/aiProposalTools.d.ts +4 -1
- package/dist/services/aiProposalTools.d.ts.map +1 -1
- package/dist/services/aiProposalTools.js +128 -3
- package/dist/services/aiProposalTools.js.map +1 -1
- package/dist/services/aiProposals.d.ts +70 -0
- package/dist/services/aiProposals.d.ts.map +1 -0
- package/dist/services/aiProposals.js +363 -0
- package/dist/services/aiProposals.js.map +1 -0
- package/dist/services/assignment.d.ts.map +1 -1
- package/dist/services/assignment.js +8 -3
- package/dist/services/assignment.js.map +1 -1
- package/dist/services/conversation.d.ts +1 -0
- package/dist/services/conversation.d.ts.map +1 -1
- package/dist/services/labChat.d.ts +10 -0
- package/dist/services/labChat.d.ts.map +1 -1
- package/dist/services/labChat.js +52 -3
- package/dist/services/labChat.js.map +1 -1
- package/dist/services/marketplace.d.ts +36 -0
- package/dist/services/marketplace.d.ts.map +1 -1
- package/dist/services/marketplace.js +30 -3
- package/dist/services/marketplace.js.map +1 -1
- package/dist/services/message.d.ts +24 -8
- package/dist/services/message.d.ts.map +1 -1
- package/dist/services/message.js +170 -117
- package/dist/services/message.js.map +1 -1
- package/dist/services/module.d.ts +288 -0
- package/dist/services/module.d.ts.map +1 -0
- package/dist/services/module.js +518 -0
- package/dist/services/module.js.map +1 -0
- package/dist/services/parentPortal.d.ts +14 -0
- package/dist/services/parentPortal.d.ts.map +1 -1
- package/dist/services/parentPortal.js +72 -2
- package/dist/services/parentPortal.js.map +1 -1
- package/dist/services/school.d.ts.map +1 -1
- package/dist/services/school.js +17 -5
- package/dist/services/school.js.map +1 -1
- package/dist/services/studentProgress.d.ts +50 -0
- package/dist/services/studentProgress.d.ts.map +1 -1
- package/dist/services/studentProgress.js +107 -2
- package/dist/services/studentProgress.js.map +1 -1
- package/dist/utils/inference.d.ts +10 -0
- package/dist/utils/inference.d.ts.map +1 -1
- package/dist/utils/inference.js +77 -2
- package/dist/utils/inference.js.map +1 -1
- package/dist/workers/processors/createRunJobWorker.js +17 -16
- package/dist/workers/processors/createRunJobWorker.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260708013000_add_modules/migration.sql +100 -0
- package/prisma/migrations/20260811130000_add_ai_message_feedback/migration.sql +7 -0
- package/prisma/schema.prisma +101 -0
- package/src/models/cloudStorage.ts +19 -0
- package/src/models/labChat.ts +34 -0
- package/src/models/marketplace.ts +16 -0
- package/src/models/module.ts +77 -0
- package/src/pipelines/aiLabChat.ts +79 -18
- package/src/pipelines/aiLabChatContract.ts +35 -0
- package/src/pipelines/aiNewtonChat.ts +34 -2
- package/src/pipelines/gradeWorksheet.ts +6 -0
- package/src/pipelines/labChatPrompt.ts +11 -12
- package/src/routers/_app.ts +2 -0
- package/src/routers/labChat.ts +5 -0
- package/src/routers/marketplace.ts +16 -0
- package/src/routers/message.ts +34 -5
- package/src/routers/module.ts +118 -0
- package/src/routers/parent.ts +11 -0
- package/src/routers/studentProgress.ts +15 -0
- package/src/routes/aiStream.ts +32 -0
- package/src/seedDatabase.ts +107 -2
- package/src/services/adminUser.ts +5 -2
- package/src/services/aiChatStream.ts +83 -7
- package/src/services/aiGeneration.ts +92 -0
- package/src/services/aiProposalTools.ts +166 -1
- package/src/services/aiProposals.ts +428 -0
- package/src/services/assignment.ts +12 -1
- package/src/services/labChat.ts +65 -0
- package/src/services/marketplace.ts +39 -0
- package/src/services/message.ts +205 -142
- package/src/services/module.ts +683 -0
- package/src/services/parentPortal.ts +85 -0
- package/src/services/school.ts +15 -3
- package/src/services/studentProgress.ts +135 -0
- package/src/utils/inference.ts +85 -0
- package/src/workers/processors/createRunJobWorker.ts +17 -17
- package/tests/unit/services/adminUser.test.ts +75 -0
- package/tests/unit/utils/adminPanelAccess.test.ts +26 -0
|
@@ -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 getMessageUploadUrls,\n confirmMessageUpload,\n markAsRead,\n markMentionsAsRead,\n
|
|
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 getUnreadCount,\n regenerateAIResponse,\n setAIMessageFeedback,\n} from \"../services/message.js\";\nimport { resolveAiProposal } from \"../services/aiProposals.js\";\nimport { cancelAiGeneration } from \"../services/aiGeneration.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 cancelAiGeneration: protectedProcedure\n .input(z.object({ messageId: z.string() }))\n .mutation(({ ctx, input }) =>\n cancelAiGeneration(ctx.user!.id, input.messageId)\n ),\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 resolveAiProposal: protectedProcedure\n .input(\n z.object({\n messageId: z.string(),\n proposalId: z.string(),\n action: z.enum([\"approve\", \"dismiss\"]),\n })\n )\n .mutation(({ ctx, input }) =>\n resolveAiProposal(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 regenerateAIResponse: protectedProcedure\n .input(z.object({ messageId: z.string() }))\n .mutation(({ ctx, input }) =>\n regenerateAIResponse(ctx.user!.id, input.messageId)\n ),\n\n setAIFeedback: protectedProcedure\n .input(\n z.object({\n messageId: z.string(),\n feedback: z.enum([\"UP\", \"DOWN\"]).nullable(),\n })\n )\n .mutation(({ ctx, input }) =>\n setAIMessageFeedback(ctx.user!.id, {\n messageId: input.messageId,\n feedback: input.feedback,\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,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAAC;IAC5C,IAAI,EAAE,kBAAkB;SACrB,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KAC9C,CAAC,CACH;SACA,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CACxB,YAAY,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE;QACzB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,KAAK,EAAE,KAAK,CAAC,KAAK;KACnB,CAAC,CACH;IAEH,IAAI,EAAE,kBAAkB;SACrB,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,cAAc,EAAE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import("@trpc/server").TRPCBuiltRouter<{
|
|
3
|
+
ctx: import("../trpc.js").Context;
|
|
4
|
+
meta: object;
|
|
5
|
+
errorShape: {
|
|
6
|
+
data: {
|
|
7
|
+
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
+
prismaError: import("../utils/prismaErrorHandler.js").PrismaErrorInfo | null;
|
|
9
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
10
|
+
httpStatus: number;
|
|
11
|
+
path?: string;
|
|
12
|
+
stack?: string;
|
|
13
|
+
};
|
|
14
|
+
message: string;
|
|
15
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
16
|
+
};
|
|
17
|
+
transformer: false;
|
|
18
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
19
|
+
/** Teacher view: every module (published or not) with its items. */
|
|
20
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
21
|
+
input: {
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
classId: string;
|
|
24
|
+
};
|
|
25
|
+
output: ({
|
|
26
|
+
items: {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string | null;
|
|
29
|
+
position: number;
|
|
30
|
+
moduleId: string;
|
|
31
|
+
indent: number;
|
|
32
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
33
|
+
itemId: string | null;
|
|
34
|
+
externalUrl: string | null;
|
|
35
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
36
|
+
requiredScore: number | null;
|
|
37
|
+
}[];
|
|
38
|
+
prerequisites: {
|
|
39
|
+
prerequisiteId: string;
|
|
40
|
+
}[];
|
|
41
|
+
} & {
|
|
42
|
+
id: string;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
classId: string;
|
|
46
|
+
title: string;
|
|
47
|
+
position: number;
|
|
48
|
+
published: boolean;
|
|
49
|
+
unlockAt: Date | null;
|
|
50
|
+
requireSequential: boolean;
|
|
51
|
+
})[];
|
|
52
|
+
meta: object;
|
|
53
|
+
}>;
|
|
54
|
+
/** Student view: published modules with lock state and progress. */
|
|
55
|
+
getStudentState: import("@trpc/server").TRPCQueryProcedure<{
|
|
56
|
+
input: {
|
|
57
|
+
[x: string]: unknown;
|
|
58
|
+
classId: string;
|
|
59
|
+
};
|
|
60
|
+
output: {
|
|
61
|
+
modules: {
|
|
62
|
+
items: {
|
|
63
|
+
completed: boolean;
|
|
64
|
+
accessible: boolean;
|
|
65
|
+
worksheetAssignmentId: string | null;
|
|
66
|
+
id: string;
|
|
67
|
+
title: string | null;
|
|
68
|
+
position: number;
|
|
69
|
+
moduleId: string;
|
|
70
|
+
indent: number;
|
|
71
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
72
|
+
itemId: string | null;
|
|
73
|
+
externalUrl: string | null;
|
|
74
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
75
|
+
requiredScore: number | null;
|
|
76
|
+
}[];
|
|
77
|
+
locked: boolean;
|
|
78
|
+
lockedByPrerequisite: boolean;
|
|
79
|
+
lockedByDate: boolean;
|
|
80
|
+
completed: boolean;
|
|
81
|
+
requiredCount: number;
|
|
82
|
+
completedRequiredCount: number;
|
|
83
|
+
percentComplete: number;
|
|
84
|
+
prerequisites: {
|
|
85
|
+
prerequisiteId: string;
|
|
86
|
+
}[];
|
|
87
|
+
id: string;
|
|
88
|
+
createdAt: Date;
|
|
89
|
+
updatedAt: Date;
|
|
90
|
+
classId: string;
|
|
91
|
+
title: string;
|
|
92
|
+
position: number;
|
|
93
|
+
published: boolean;
|
|
94
|
+
unlockAt: Date | null;
|
|
95
|
+
requireSequential: boolean;
|
|
96
|
+
}[];
|
|
97
|
+
continueItemId: null;
|
|
98
|
+
continueModuleId: null;
|
|
99
|
+
};
|
|
100
|
+
meta: object;
|
|
101
|
+
}>;
|
|
102
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
103
|
+
input: {
|
|
104
|
+
[x: string]: unknown;
|
|
105
|
+
classId: string;
|
|
106
|
+
title: string;
|
|
107
|
+
unlockAt?: Date | null | undefined;
|
|
108
|
+
requireSequential?: boolean | undefined;
|
|
109
|
+
};
|
|
110
|
+
output: {
|
|
111
|
+
items: {
|
|
112
|
+
id: string;
|
|
113
|
+
title: string | null;
|
|
114
|
+
position: number;
|
|
115
|
+
moduleId: string;
|
|
116
|
+
indent: number;
|
|
117
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
118
|
+
itemId: string | null;
|
|
119
|
+
externalUrl: string | null;
|
|
120
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
121
|
+
requiredScore: number | null;
|
|
122
|
+
}[];
|
|
123
|
+
prerequisites: {
|
|
124
|
+
prerequisiteId: string;
|
|
125
|
+
}[];
|
|
126
|
+
} & {
|
|
127
|
+
id: string;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
updatedAt: Date;
|
|
130
|
+
classId: string;
|
|
131
|
+
title: string;
|
|
132
|
+
position: number;
|
|
133
|
+
published: boolean;
|
|
134
|
+
unlockAt: Date | null;
|
|
135
|
+
requireSequential: boolean;
|
|
136
|
+
};
|
|
137
|
+
meta: object;
|
|
138
|
+
}>;
|
|
139
|
+
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
140
|
+
input: {
|
|
141
|
+
[x: string]: unknown;
|
|
142
|
+
classId: string;
|
|
143
|
+
id: string;
|
|
144
|
+
title?: string | undefined;
|
|
145
|
+
published?: boolean | undefined;
|
|
146
|
+
unlockAt?: Date | null | undefined;
|
|
147
|
+
requireSequential?: boolean | undefined;
|
|
148
|
+
prerequisiteIds?: string[] | undefined;
|
|
149
|
+
};
|
|
150
|
+
output: {
|
|
151
|
+
items: {
|
|
152
|
+
id: string;
|
|
153
|
+
title: string | null;
|
|
154
|
+
position: number;
|
|
155
|
+
moduleId: string;
|
|
156
|
+
indent: number;
|
|
157
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
158
|
+
itemId: string | null;
|
|
159
|
+
externalUrl: string | null;
|
|
160
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
161
|
+
requiredScore: number | null;
|
|
162
|
+
}[];
|
|
163
|
+
prerequisites: {
|
|
164
|
+
prerequisiteId: string;
|
|
165
|
+
}[];
|
|
166
|
+
} & {
|
|
167
|
+
id: string;
|
|
168
|
+
createdAt: Date;
|
|
169
|
+
updatedAt: Date;
|
|
170
|
+
classId: string;
|
|
171
|
+
title: string;
|
|
172
|
+
position: number;
|
|
173
|
+
published: boolean;
|
|
174
|
+
unlockAt: Date | null;
|
|
175
|
+
requireSequential: boolean;
|
|
176
|
+
};
|
|
177
|
+
meta: object;
|
|
178
|
+
}>;
|
|
179
|
+
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
180
|
+
input: {
|
|
181
|
+
[x: string]: unknown;
|
|
182
|
+
classId: string;
|
|
183
|
+
id: string;
|
|
184
|
+
};
|
|
185
|
+
output: {
|
|
186
|
+
id: string;
|
|
187
|
+
};
|
|
188
|
+
meta: object;
|
|
189
|
+
}>;
|
|
190
|
+
reorder: import("@trpc/server").TRPCMutationProcedure<{
|
|
191
|
+
input: {
|
|
192
|
+
[x: string]: unknown;
|
|
193
|
+
classId: string;
|
|
194
|
+
orderedIds: string[];
|
|
195
|
+
};
|
|
196
|
+
output: ({
|
|
197
|
+
items: {
|
|
198
|
+
id: string;
|
|
199
|
+
title: string | null;
|
|
200
|
+
position: number;
|
|
201
|
+
moduleId: string;
|
|
202
|
+
indent: number;
|
|
203
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
204
|
+
itemId: string | null;
|
|
205
|
+
externalUrl: string | null;
|
|
206
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
207
|
+
requiredScore: number | null;
|
|
208
|
+
}[];
|
|
209
|
+
prerequisites: {
|
|
210
|
+
prerequisiteId: string;
|
|
211
|
+
}[];
|
|
212
|
+
} & {
|
|
213
|
+
id: string;
|
|
214
|
+
createdAt: Date;
|
|
215
|
+
updatedAt: Date;
|
|
216
|
+
classId: string;
|
|
217
|
+
title: string;
|
|
218
|
+
position: number;
|
|
219
|
+
published: boolean;
|
|
220
|
+
unlockAt: Date | null;
|
|
221
|
+
requireSequential: boolean;
|
|
222
|
+
})[];
|
|
223
|
+
meta: object;
|
|
224
|
+
}>;
|
|
225
|
+
createItem: import("@trpc/server").TRPCMutationProcedure<{
|
|
226
|
+
input: {
|
|
227
|
+
[x: string]: unknown;
|
|
228
|
+
classId: string;
|
|
229
|
+
moduleId: string;
|
|
230
|
+
itemType: "FILE" | "ASSIGNMENT" | "WORKSHEET" | "ANNOUNCEMENT" | "DISCUSSION" | "EXTERNAL_URL" | "SUB_HEADER";
|
|
231
|
+
title?: string | undefined;
|
|
232
|
+
indent?: number | undefined;
|
|
233
|
+
itemId?: string | undefined;
|
|
234
|
+
externalUrl?: string | undefined;
|
|
235
|
+
requirementType?: "VIEW" | "SUBMIT" | "SCORE_AT_LEAST" | undefined;
|
|
236
|
+
requiredScore?: number | undefined;
|
|
237
|
+
};
|
|
238
|
+
output: {
|
|
239
|
+
id: string;
|
|
240
|
+
title: string | null;
|
|
241
|
+
position: number;
|
|
242
|
+
moduleId: string;
|
|
243
|
+
indent: number;
|
|
244
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
245
|
+
itemId: string | null;
|
|
246
|
+
externalUrl: string | null;
|
|
247
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
248
|
+
requiredScore: number | null;
|
|
249
|
+
};
|
|
250
|
+
meta: object;
|
|
251
|
+
}>;
|
|
252
|
+
updateItem: import("@trpc/server").TRPCMutationProcedure<{
|
|
253
|
+
input: {
|
|
254
|
+
[x: string]: unknown;
|
|
255
|
+
classId: string;
|
|
256
|
+
id: string;
|
|
257
|
+
title?: string | null | undefined;
|
|
258
|
+
indent?: number | undefined;
|
|
259
|
+
externalUrl?: string | undefined;
|
|
260
|
+
requirementType?: "VIEW" | "SUBMIT" | "SCORE_AT_LEAST" | null | undefined;
|
|
261
|
+
requiredScore?: number | null | undefined;
|
|
262
|
+
};
|
|
263
|
+
output: {
|
|
264
|
+
id: string;
|
|
265
|
+
title: string | null;
|
|
266
|
+
position: number;
|
|
267
|
+
moduleId: string;
|
|
268
|
+
indent: number;
|
|
269
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
270
|
+
itemId: string | null;
|
|
271
|
+
externalUrl: string | null;
|
|
272
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
273
|
+
requiredScore: number | null;
|
|
274
|
+
};
|
|
275
|
+
meta: object;
|
|
276
|
+
}>;
|
|
277
|
+
deleteItem: import("@trpc/server").TRPCMutationProcedure<{
|
|
278
|
+
input: {
|
|
279
|
+
[x: string]: unknown;
|
|
280
|
+
classId: string;
|
|
281
|
+
id: string;
|
|
282
|
+
};
|
|
283
|
+
output: {
|
|
284
|
+
id: string;
|
|
285
|
+
};
|
|
286
|
+
meta: object;
|
|
287
|
+
}>;
|
|
288
|
+
reorderItems: import("@trpc/server").TRPCMutationProcedure<{
|
|
289
|
+
input: {
|
|
290
|
+
[x: string]: unknown;
|
|
291
|
+
classId: string;
|
|
292
|
+
items: {
|
|
293
|
+
id: string;
|
|
294
|
+
moduleId: string;
|
|
295
|
+
}[];
|
|
296
|
+
};
|
|
297
|
+
output: ({
|
|
298
|
+
items: {
|
|
299
|
+
id: string;
|
|
300
|
+
title: string | null;
|
|
301
|
+
position: number;
|
|
302
|
+
moduleId: string;
|
|
303
|
+
indent: number;
|
|
304
|
+
itemType: import(".prisma/client").$Enums.CourseModuleItemType;
|
|
305
|
+
itemId: string | null;
|
|
306
|
+
externalUrl: string | null;
|
|
307
|
+
requirementType: import(".prisma/client").$Enums.ModuleItemRequirementType | null;
|
|
308
|
+
requiredScore: number | null;
|
|
309
|
+
}[];
|
|
310
|
+
prerequisites: {
|
|
311
|
+
prerequisiteId: string;
|
|
312
|
+
}[];
|
|
313
|
+
} & {
|
|
314
|
+
id: string;
|
|
315
|
+
createdAt: Date;
|
|
316
|
+
updatedAt: Date;
|
|
317
|
+
classId: string;
|
|
318
|
+
title: string;
|
|
319
|
+
position: number;
|
|
320
|
+
published: boolean;
|
|
321
|
+
unlockAt: Date | null;
|
|
322
|
+
requireSequential: boolean;
|
|
323
|
+
})[];
|
|
324
|
+
meta: object;
|
|
325
|
+
}>;
|
|
326
|
+
/** Record that a student viewed an item (completes VIEW requirements). */
|
|
327
|
+
markItemViewed: import("@trpc/server").TRPCMutationProcedure<{
|
|
328
|
+
input: {
|
|
329
|
+
[x: string]: unknown;
|
|
330
|
+
classId: string;
|
|
331
|
+
itemId: string;
|
|
332
|
+
};
|
|
333
|
+
output: {
|
|
334
|
+
status: import(".prisma/client").$Enums.ModuleItemProgressStatus;
|
|
335
|
+
id: string;
|
|
336
|
+
createdAt: Date;
|
|
337
|
+
updatedAt: Date;
|
|
338
|
+
moduleItemId: string;
|
|
339
|
+
studentId: string;
|
|
340
|
+
completedAt: Date | null;
|
|
341
|
+
};
|
|
342
|
+
meta: object;
|
|
343
|
+
}>;
|
|
344
|
+
}>>;
|
|
345
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"/","sources":["routers/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;IACvB,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKpE,oEAAoE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmFpE,0EAA0E;;;;;;;;;;;;;;;;;;GAI1E,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
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]="bce497d9-7c87-5479-9ba0-f2235b734365")}catch(e){}}();
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { CourseModuleItemType as ModuleItemType, ModuleItemRequirementType } from "@prisma/client";
|
|
5
|
+
import { createTRPCRouter, protectedClassMemberProcedure, protectedTeacherProcedure, } from "../trpc.js";
|
|
6
|
+
import { listModulesRecord, createModuleRecord, updateModuleRecord, deleteModuleRecord, reorderModulesRecord, createModuleItemRecord, updateModuleItemRecord, deleteModuleItemRecord, reorderModuleItemsRecord, getStudentModulesState, markItemViewedRecord, } from "../services/module.js";
|
|
7
|
+
const itemTypeSchema = z.nativeEnum(ModuleItemType);
|
|
8
|
+
const requirementTypeSchema = z.nativeEnum(ModuleItemRequirementType);
|
|
9
|
+
export const moduleRouter = createTRPCRouter({
|
|
10
|
+
/** Teacher view: every module (published or not) with its items. */
|
|
11
|
+
list: protectedTeacherProcedure
|
|
12
|
+
.input(z.object({ classId: z.string() }))
|
|
13
|
+
.query(({ ctx, input }) => listModulesRecord(ctx.user.id, input.classId)),
|
|
14
|
+
/** Student view: published modules with lock state and progress. */
|
|
15
|
+
getStudentState: protectedClassMemberProcedure
|
|
16
|
+
.input(z.object({ classId: z.string() }))
|
|
17
|
+
.query(({ ctx, input }) => getStudentModulesState(input.classId, ctx.user.id)),
|
|
18
|
+
create: protectedTeacherProcedure
|
|
19
|
+
.input(z.object({
|
|
20
|
+
classId: z.string(),
|
|
21
|
+
title: z.string().min(1),
|
|
22
|
+
unlockAt: z.coerce.date().nullish(),
|
|
23
|
+
requireSequential: z.boolean().optional(),
|
|
24
|
+
}))
|
|
25
|
+
.mutation(({ ctx, input }) => createModuleRecord(ctx.user.id, input)),
|
|
26
|
+
update: protectedTeacherProcedure
|
|
27
|
+
.input(z.object({
|
|
28
|
+
classId: z.string(),
|
|
29
|
+
id: z.string(),
|
|
30
|
+
title: z.string().min(1).optional(),
|
|
31
|
+
unlockAt: z.coerce.date().nullable().optional(),
|
|
32
|
+
requireSequential: z.boolean().optional(),
|
|
33
|
+
published: z.boolean().optional(),
|
|
34
|
+
prerequisiteIds: z.array(z.string()).optional(),
|
|
35
|
+
}))
|
|
36
|
+
.mutation(({ ctx, input }) => updateModuleRecord(ctx.user.id, input)),
|
|
37
|
+
delete: protectedTeacherProcedure
|
|
38
|
+
.input(z.object({ classId: z.string(), id: z.string() }))
|
|
39
|
+
.mutation(({ ctx, input }) => deleteModuleRecord(ctx.user.id, input)),
|
|
40
|
+
reorder: protectedTeacherProcedure
|
|
41
|
+
.input(z.object({ classId: z.string(), orderedIds: z.array(z.string()) }))
|
|
42
|
+
.mutation(({ ctx, input }) => reorderModulesRecord(ctx.user.id, input)),
|
|
43
|
+
createItem: protectedTeacherProcedure
|
|
44
|
+
.input(z.object({
|
|
45
|
+
classId: z.string(),
|
|
46
|
+
moduleId: z.string(),
|
|
47
|
+
itemType: itemTypeSchema,
|
|
48
|
+
itemId: z.string().optional(),
|
|
49
|
+
externalUrl: z.string().url().optional(),
|
|
50
|
+
title: z.string().optional(),
|
|
51
|
+
indent: z.number().int().min(0).max(4).optional(),
|
|
52
|
+
requirementType: requirementTypeSchema.optional(),
|
|
53
|
+
requiredScore: z.number().min(0).optional(),
|
|
54
|
+
}))
|
|
55
|
+
.mutation(({ ctx, input }) => createModuleItemRecord(ctx.user.id, input)),
|
|
56
|
+
updateItem: protectedTeacherProcedure
|
|
57
|
+
.input(z.object({
|
|
58
|
+
classId: z.string(),
|
|
59
|
+
id: z.string(),
|
|
60
|
+
title: z.string().nullable().optional(),
|
|
61
|
+
externalUrl: z.string().url().optional(),
|
|
62
|
+
indent: z.number().int().min(0).max(4).optional(),
|
|
63
|
+
requirementType: requirementTypeSchema.nullable().optional(),
|
|
64
|
+
requiredScore: z.number().min(0).nullable().optional(),
|
|
65
|
+
}))
|
|
66
|
+
.mutation(({ ctx, input }) => updateModuleItemRecord(ctx.user.id, input)),
|
|
67
|
+
deleteItem: protectedTeacherProcedure
|
|
68
|
+
.input(z.object({ classId: z.string(), id: z.string() }))
|
|
69
|
+
.mutation(({ ctx, input }) => deleteModuleItemRecord(ctx.user.id, input)),
|
|
70
|
+
reorderItems: protectedTeacherProcedure
|
|
71
|
+
.input(z.object({
|
|
72
|
+
classId: z.string(),
|
|
73
|
+
items: z.array(z.object({ id: z.string(), moduleId: z.string() })),
|
|
74
|
+
}))
|
|
75
|
+
.mutation(({ ctx, input }) => reorderModuleItemsRecord(ctx.user.id, input)),
|
|
76
|
+
/** Record that a student viewed an item (completes VIEW requirements). */
|
|
77
|
+
markItemViewed: protectedClassMemberProcedure
|
|
78
|
+
.input(z.object({ classId: z.string(), itemId: z.string() }))
|
|
79
|
+
.mutation(({ ctx, input }) => markItemViewedRecord(ctx.user.id, input)),
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=module.js.map
|
|
82
|
+
//# debugId=bce497d9-7c87-5479-9ba0-f2235b734365
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sources":["routers/module.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { CourseModuleItemType as ModuleItemType, ModuleItemRequirementType } from \"@prisma/client\";\nimport {\n createTRPCRouter,\n protectedClassMemberProcedure,\n protectedTeacherProcedure,\n} from \"../trpc.js\";\nimport {\n listModulesRecord,\n createModuleRecord,\n updateModuleRecord,\n deleteModuleRecord,\n reorderModulesRecord,\n createModuleItemRecord,\n updateModuleItemRecord,\n deleteModuleItemRecord,\n reorderModuleItemsRecord,\n getStudentModulesState,\n markItemViewedRecord,\n} from \"../services/module.js\";\n\nconst itemTypeSchema = z.nativeEnum(ModuleItemType);\nconst requirementTypeSchema = z.nativeEnum(ModuleItemRequirementType);\n\nexport const moduleRouter = createTRPCRouter({\n /** Teacher view: every module (published or not) with its items. */\n list: protectedTeacherProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ ctx, input }) => listModulesRecord(ctx.user!.id, input.classId)),\n\n /** Student view: published modules with lock state and progress. */\n getStudentState: protectedClassMemberProcedure\n .input(z.object({ classId: z.string() }))\n .query(({ ctx, input }) =>\n getStudentModulesState(input.classId, ctx.user!.id)\n ),\n\n create: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n title: z.string().min(1),\n unlockAt: z.coerce.date().nullish(),\n requireSequential: z.boolean().optional(),\n })\n )\n .mutation(({ ctx, input }) => createModuleRecord(ctx.user!.id, input)),\n\n update: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n id: z.string(),\n title: z.string().min(1).optional(),\n unlockAt: z.coerce.date().nullable().optional(),\n requireSequential: z.boolean().optional(),\n published: z.boolean().optional(),\n prerequisiteIds: z.array(z.string()).optional(),\n })\n )\n .mutation(({ ctx, input }) => updateModuleRecord(ctx.user!.id, input)),\n\n delete: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), id: z.string() }))\n .mutation(({ ctx, input }) => deleteModuleRecord(ctx.user!.id, input)),\n\n reorder: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), orderedIds: z.array(z.string()) }))\n .mutation(({ ctx, input }) => reorderModulesRecord(ctx.user!.id, input)),\n\n createItem: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n moduleId: z.string(),\n itemType: itemTypeSchema,\n itemId: z.string().optional(),\n externalUrl: z.string().url().optional(),\n title: z.string().optional(),\n indent: z.number().int().min(0).max(4).optional(),\n requirementType: requirementTypeSchema.optional(),\n requiredScore: z.number().min(0).optional(),\n })\n )\n .mutation(({ ctx, input }) => createModuleItemRecord(ctx.user!.id, input)),\n\n updateItem: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n id: z.string(),\n title: z.string().nullable().optional(),\n externalUrl: z.string().url().optional(),\n indent: z.number().int().min(0).max(4).optional(),\n requirementType: requirementTypeSchema.nullable().optional(),\n requiredScore: z.number().min(0).nullable().optional(),\n })\n )\n .mutation(({ ctx, input }) => updateModuleItemRecord(ctx.user!.id, input)),\n\n deleteItem: protectedTeacherProcedure\n .input(z.object({ classId: z.string(), id: z.string() }))\n .mutation(({ ctx, input }) => deleteModuleItemRecord(ctx.user!.id, input)),\n\n reorderItems: protectedTeacherProcedure\n .input(\n z.object({\n classId: z.string(),\n items: z.array(z.object({ id: z.string(), moduleId: z.string() })),\n })\n )\n .mutation(({ ctx, input }) => reorderModuleItemsRecord(ctx.user!.id, input)),\n\n /** Record that a student viewed an item (completes VIEW requirements). */\n markItemViewed: protectedClassMemberProcedure\n .input(z.object({ classId: z.string(), itemId: z.string() }))\n .mutation(({ ctx, input }) => markItemViewedRecord(ctx.user!.id, input)),\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,IAAI,cAAc,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,cAAc,GAAG,CAAC,CAAC,UAAU,C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E,KAAK,CAAC,CAAC;IAE9E,0EAA0E;IAC1E,cAAc,EAAE,6BAA6B;SAC1C,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SAC5D,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;CAC3E,CAAC,CAAC","debug_id":"bce497d9-7c87-5479-9ba0-f2235b734365"}
|
package/dist/routers/parent.d.ts
CHANGED
|
@@ -34,6 +34,24 @@ export declare const parentRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
34
34
|
};
|
|
35
35
|
meta: object;
|
|
36
36
|
}>;
|
|
37
|
+
addToStudent: import("@trpc/server").TRPCMutationProcedure<{
|
|
38
|
+
input: {
|
|
39
|
+
schoolId: string;
|
|
40
|
+
studentUserId: string;
|
|
41
|
+
parentIdentifier: string;
|
|
42
|
+
};
|
|
43
|
+
output: {
|
|
44
|
+
link: {
|
|
45
|
+
id: string;
|
|
46
|
+
createdAt: Date;
|
|
47
|
+
updatedAt: Date;
|
|
48
|
+
schoolId: string;
|
|
49
|
+
parentUserId: string;
|
|
50
|
+
studentUserId: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
meta: object;
|
|
54
|
+
}>;
|
|
37
55
|
unlinkStudent: import("@trpc/server").TRPCMutationProcedure<{
|
|
38
56
|
input: {
|
|
39
57
|
schoolId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parent.d.ts","sourceRoot":"/","sources":["routers/parent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"parent.d.ts","sourceRoot":"/","sources":["routers/parent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEvB,CAAC"}
|
package/dist/routers/parent.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]="aeadeb18-2d8e-5854-87f1-691c46766cc8")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createTRPCRouter, protectedProcedure } from "../trpc.js";
|
|
5
|
-
import { getChildAttendance, getChildGrades, linkParentToStudent, listMyChildren, listParentLinks, unlinkParentFromStudent, } from "../services/parentPortal.js";
|
|
5
|
+
import { addParentToStudent, getChildAttendance, getChildGrades, linkParentToStudent, listMyChildren, listParentLinks, unlinkParentFromStudent, } from "../services/parentPortal.js";
|
|
6
6
|
export const parentRouter = createTRPCRouter({
|
|
7
7
|
linkStudent: protectedProcedure
|
|
8
8
|
.input(z.object({
|
|
@@ -11,6 +11,13 @@ export const parentRouter = createTRPCRouter({
|
|
|
11
11
|
studentUserId: z.string(),
|
|
12
12
|
}))
|
|
13
13
|
.mutation(({ ctx, input }) => linkParentToStudent(ctx.user.id, input)),
|
|
14
|
+
addToStudent: protectedProcedure
|
|
15
|
+
.input(z.object({
|
|
16
|
+
schoolId: z.string(),
|
|
17
|
+
studentUserId: z.string(),
|
|
18
|
+
parentIdentifier: z.string().min(1),
|
|
19
|
+
}))
|
|
20
|
+
.mutation(({ ctx, input }) => addParentToStudent(ctx.user.id, input)),
|
|
14
21
|
unlinkStudent: protectedProcedure
|
|
15
22
|
.input(z.object({
|
|
16
23
|
schoolId: z.string(),
|
|
@@ -46,4 +53,4 @@ export const parentRouter = createTRPCRouter({
|
|
|
46
53
|
.query(({ ctx, input }) => getChildGrades(ctx.user.id, input)),
|
|
47
54
|
});
|
|
48
55
|
//# sourceMappingURL=parent.js.map
|
|
49
|
-
//# debugId=
|
|
56
|
+
//# debugId=aeadeb18-2d8e-5854-87f1-691c46766cc8
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parent.js","sources":["routers/parent.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport {\n getChildAttendance,\n getChildGrades,\n linkParentToStudent,\n listMyChildren,\n listParentLinks,\n unlinkParentFromStudent,\n} from \"../services/parentPortal.js\";\n\nexport const parentRouter = createTRPCRouter({\n linkStudent: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n parentUserId: z.string(),\n studentUserId: z.string(),\n })\n )\n .mutation(({ ctx, input }) => linkParentToStudent(ctx.user!.id, input)),\n\n unlinkStudent: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n parentUserId: z.string(),\n studentUserId: z.string(),\n })\n )\n .mutation(({ ctx, input }) => unlinkParentFromStudent(ctx.user!.id, input)),\n\n listLinks: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n parentUserId: z.string().optional(),\n studentUserId: z.string().optional(),\n })\n )\n .query(({ ctx, input }) => listParentLinks(ctx.user!.id, input)),\n\n listMyChildren: protectedProcedure\n .input(z.object({ schoolId: z.string() }))\n .query(({ ctx, input }) => listMyChildren(ctx.user!.id, input.schoolId)),\n\n getChildAttendance: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n studentUserId: z.string(),\n classId: z.string().optional(),\n from: z.date().optional(),\n to: z.date().optional(),\n })\n )\n .query(({ ctx, input }) => getChildAttendance(ctx.user!.id, input)),\n\n getChildGrades: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n studentUserId: z.string(),\n classId: z.string().optional(),\n })\n )\n .query(({ ctx, input }) => getChildGrades(ctx.user!.id, input)),\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,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;IAC3C,WAAW,EAAE,kBAAkB;SAC5B,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;KAC1B,CAAC,CACH;SACA,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAEzE,aAAa,EAAE,kBAAkB;SAC9B,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;KAC1B,CAAC,CACH;SACA,QAAQ,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BAAkB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAErE,cAAc,EAAE,kBAAkB;SAC/B,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC,CACH;SACA,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;CAClE,CAAC,CAAC","debug_id":"
|
|
1
|
+
{"version":3,"file":"parent.js","sources":["routers/parent.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport {\n addParentToStudent,\n getChildAttendance,\n getChildGrades,\n linkParentToStudent,\n listMyChildren,\n listParentLinks,\n unlinkParentFromStudent,\n} from \"../services/parentPortal.js\";\n\nexport const parentRouter = createTRPCRouter({\n linkStudent: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n parentUserId: z.string(),\n studentUserId: z.string(),\n })\n )\n .mutation(({ ctx, input }) => linkParentToStudent(ctx.user!.id, input)),\n\n addToStudent: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n studentUserId: z.string(),\n parentIdentifier: z.string().min(1),\n })\n )\n .mutation(({ ctx, input }) => addParentToStudent(ctx.user!.id, input)),\n\n unlinkStudent: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n parentUserId: z.string(),\n studentUserId: z.string(),\n })\n )\n .mutation(({ ctx, input }) => unlinkParentFromStudent(ctx.user!.id, input)),\n\n listLinks: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n parentUserId: z.string().optional(),\n studentUserId: z.string().optional(),\n })\n )\n .query(({ ctx, input }) => listParentLinks(ctx.user!.id, input)),\n\n listMyChildren: protectedProcedure\n .input(z.object({ schoolId: z.string() }))\n .query(({ ctx, input }) => listMyChildren(ctx.user!.id, input.schoolId)),\n\n getChildAttendance: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n studentUserId: z.string(),\n classId: z.string().optional(),\n from: z.date().optional(),\n to: z.date().optional(),\n })\n )\n .query(({ ctx, input }) => getChildAttendance(ctx.user!.id, input)),\n\n getChildGrades: protectedProcedure\n .input(\n z.object({\n schoolId: z.string(),\n studentUserId: z.string(),\n classId: z.string().optional(),\n })\n )\n .query(({ ctx, input }) => getChildGrades(ctx.user!.id, input)),\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,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC;IAC3C,WAAW,EAAE,kBAAkB;SAC5B,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;KAC1B,CAAC,CACH;SACA,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAEzE,YAAY,EAAE,kBAAkB;SAC7B,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,aAAa,EAAE,CAAC,CAAC,M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,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAE1E,kBAAkB,EAAE,kBAAkB;SACnC,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;QACzB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;KACxB,CAAC,CACH;SACA,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAErE,cAAc,EAAE,kBAAkB;SAC/B,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC,CACH;SACA,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;CAClE,CAAC,CAAC","debug_id":"aeadeb18-2d8e-5854-87f1-691c46766cc8"}
|
|
@@ -185,6 +185,50 @@ export declare const studentProgressRouter: import("@trpc/server").TRPCBuiltRout
|
|
|
185
185
|
};
|
|
186
186
|
meta: object;
|
|
187
187
|
}>;
|
|
188
|
+
generateFollowUpAssignment: import("@trpc/server").TRPCMutationProcedure<{
|
|
189
|
+
input: {
|
|
190
|
+
[x: string]: unknown;
|
|
191
|
+
classId: string;
|
|
192
|
+
submissionId: string;
|
|
193
|
+
prompt: string;
|
|
194
|
+
studentId: string;
|
|
195
|
+
dueDate?: string | undefined;
|
|
196
|
+
};
|
|
197
|
+
output: {
|
|
198
|
+
assignment: {
|
|
199
|
+
type: import(".prisma/client").$Enums.AssignmentType;
|
|
200
|
+
class: {
|
|
201
|
+
id: string;
|
|
202
|
+
name: string;
|
|
203
|
+
};
|
|
204
|
+
section: {
|
|
205
|
+
id: string;
|
|
206
|
+
name: string;
|
|
207
|
+
} | null;
|
|
208
|
+
id: string;
|
|
209
|
+
title: string;
|
|
210
|
+
dueDate: Date;
|
|
211
|
+
maxGrade: number | null;
|
|
212
|
+
attachments: {
|
|
213
|
+
type: string;
|
|
214
|
+
id: string;
|
|
215
|
+
name: string;
|
|
216
|
+
}[];
|
|
217
|
+
instructions: string;
|
|
218
|
+
graded: boolean;
|
|
219
|
+
weight: number;
|
|
220
|
+
teacher: {
|
|
221
|
+
id: string;
|
|
222
|
+
username: string;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
draft: {
|
|
226
|
+
title: string;
|
|
227
|
+
instructions: string;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
meta: object;
|
|
231
|
+
}>;
|
|
188
232
|
chat: import("@trpc/server").TRPCMutationProcedure<{
|
|
189
233
|
input: {
|
|
190
234
|
[x: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studentProgress.d.ts","sourceRoot":"/","sources":["routers/studentProgress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"studentProgress.d.ts","sourceRoot":"/","sources":["routers/studentProgress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFhC,CAAC"}
|