@studious-lms/server 1.21.0 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/models/agenda.d.ts +6 -0
- package/dist/models/agenda.d.ts.map +1 -1
- package/dist/models/announcement.d.ts +2 -0
- package/dist/models/announcement.d.ts.map +1 -1
- package/dist/models/assignment.d.ts +27 -0
- package/dist/models/assignment.d.ts.map +1 -1
- package/dist/models/auth.d.ts +4 -0
- package/dist/models/auth.d.ts.map +1 -1
- package/dist/models/class.d.ts +14 -0
- package/dist/models/class.d.ts.map +1 -1
- package/dist/models/event.d.ts +11 -0
- package/dist/models/event.d.ts.map +1 -1
- package/dist/models/file.d.ts +19 -0
- package/dist/models/file.d.ts.map +1 -1
- package/dist/models/folder.d.ts +4 -0
- package/dist/models/folder.d.ts.map +1 -1
- package/dist/models/gradebook.d.ts +180 -0
- package/dist/models/gradebook.d.ts.map +1 -0
- package/dist/models/gradebook.js +88 -0
- package/dist/models/gradebook.js.map +1 -0
- package/dist/models/labChat.d.ts +4 -0
- package/dist/models/labChat.d.ts.map +1 -1
- package/dist/models/newtonChat.d.ts +2 -0
- package/dist/models/newtonChat.d.ts.map +1 -1
- package/dist/models/school.d.ts +177 -0
- package/dist/models/school.d.ts.map +1 -1
- package/dist/models/school.js +75 -2
- package/dist/models/school.js.map +1 -1
- package/dist/models/section.d.ts +3 -0
- package/dist/models/section.d.ts.map +1 -1
- package/dist/models/worksheet.d.ts +6 -0
- package/dist/models/worksheet.d.ts.map +1 -1
- package/dist/routers/_app.d.ts +1475 -73
- 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 +164 -0
- package/dist/routers/admin.d.ts.map +1 -1
- package/dist/routers/admin.js +23 -4
- package/dist/routers/admin.js.map +1 -1
- package/dist/routers/agenda.d.ts +6 -0
- package/dist/routers/agenda.d.ts.map +1 -1
- package/dist/routers/assignment.d.ts +30 -3
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/class.d.ts +17 -0
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/event.d.ts +4 -0
- package/dist/routers/event.d.ts.map +1 -1
- package/dist/routers/file.d.ts +66 -0
- package/dist/routers/file.d.ts.map +1 -1
- package/dist/routers/file.js +111 -2
- package/dist/routers/file.js.map +1 -1
- package/dist/routers/gradebook.d.ts +299 -0
- package/dist/routers/gradebook.d.ts.map +1 -0
- package/dist/routers/gradebook.js +107 -0
- package/dist/routers/gradebook.js.map +1 -0
- package/dist/routers/school.d.ts +118 -0
- package/dist/routers/school.d.ts.map +1 -1
- package/dist/routers/school.js +32 -3
- package/dist/routers/school.js.map +1 -1
- package/dist/routers/section.d.ts +1 -1
- package/dist/routers/worksheet.d.ts +3 -1
- package/dist/routers/worksheet.d.ts.map +1 -1
- package/dist/services/adminInstitution.d.ts +51 -0
- package/dist/services/adminInstitution.d.ts.map +1 -1
- package/dist/services/adminInstitution.js +52 -2
- package/dist/services/adminInstitution.js.map +1 -1
- package/dist/services/adminMetrics.d.ts +17 -0
- package/dist/services/adminMetrics.d.ts.map +1 -0
- package/dist/services/adminMetrics.js +37 -0
- package/dist/services/adminMetrics.js.map +1 -0
- package/dist/services/adminRunJob.d.ts +9 -0
- package/dist/services/adminRunJob.d.ts.map +1 -1
- package/dist/services/adminRunJob.js +18 -2
- package/dist/services/adminRunJob.js.map +1 -1
- package/dist/services/adminUser.d.ts +67 -0
- package/dist/services/adminUser.d.ts.map +1 -0
- package/dist/services/adminUser.js +87 -0
- package/dist/services/adminUser.js.map +1 -0
- package/dist/services/agenda.d.ts +6 -0
- package/dist/services/agenda.d.ts.map +1 -1
- package/dist/services/assignment.d.ts +27 -0
- package/dist/services/assignment.d.ts.map +1 -1
- package/dist/services/class.d.ts +17 -0
- package/dist/services/class.d.ts.map +1 -1
- package/dist/services/event.d.ts +4 -0
- package/dist/services/event.d.ts.map +1 -1
- package/dist/services/gradeCalculation.d.ts +70 -0
- package/dist/services/gradeCalculation.d.ts.map +1 -0
- package/dist/services/gradeCalculation.js +148 -0
- package/dist/services/gradeCalculation.js.map +1 -0
- package/dist/services/gradebook.d.ts +197 -0
- package/dist/services/gradebook.d.ts.map +1 -0
- package/dist/services/gradebook.js +263 -0
- package/dist/services/gradebook.js.map +1 -0
- package/dist/services/school.d.ts +98 -0
- package/dist/services/school.d.ts.map +1 -1
- package/dist/services/school.js +116 -4
- package/dist/services/school.js.map +1 -1
- package/dist/services/worksheet.d.ts +2 -0
- package/dist/services/worksheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260708011629_add_gradebook_categories_columns_policies/migration.sql +78 -0
- package/prisma/migrations/20260723142314_make_file_annotation_submission_optional/migration.sql +2 -0
- package/prisma/schema.prisma +62 -2
- package/src/models/gradebook.ts +91 -0
- package/src/models/school.ts +89 -0
- package/src/routers/_app.ts +2 -0
- package/src/routers/admin.ts +28 -0
- package/src/routers/file.ts +128 -0
- package/src/routers/gradebook.ts +173 -0
- package/src/routers/school.ts +45 -0
- package/src/services/adminInstitution.ts +52 -0
- package/src/services/adminMetrics.ts +46 -0
- package/src/services/adminRunJob.ts +24 -0
- package/src/services/adminUser.ts +93 -0
- package/src/services/gradeCalculation.ts +253 -0
- package/src/services/gradebook.ts +383 -0
- package/src/services/school.ts +178 -1
- package/tests/unit/services/gradeCalculation.test.ts +206 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignment.d.ts","sourceRoot":"/","sources":["routers/assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAA2B,KAAK,gBAAgB,EAAgE,MAAM,sBAAsB,CAAC;AA2QpJ,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"assignment.d.ts","sourceRoot":"/","sources":["routers/assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAu6B3B,CAAC"}
|
package/dist/routers/class.d.ts
CHANGED
|
@@ -250,6 +250,8 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
250
250
|
discussionsEnabled: boolean;
|
|
251
251
|
studentsCanCreateDiscussions: boolean;
|
|
252
252
|
studentsCanReply: boolean;
|
|
253
|
+
treatMissingAsZero: boolean;
|
|
254
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
253
255
|
};
|
|
254
256
|
};
|
|
255
257
|
meta: object;
|
|
@@ -330,6 +332,8 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
330
332
|
discussionsEnabled: boolean;
|
|
331
333
|
studentsCanCreateDiscussions: boolean;
|
|
332
334
|
studentsCanReply: boolean;
|
|
335
|
+
treatMissingAsZero: boolean;
|
|
336
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
333
337
|
};
|
|
334
338
|
meta: object;
|
|
335
339
|
}>;
|
|
@@ -387,6 +391,8 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
387
391
|
discussionsEnabled: boolean;
|
|
388
392
|
studentsCanCreateDiscussions: boolean;
|
|
389
393
|
studentsCanReply: boolean;
|
|
394
|
+
treatMissingAsZero: boolean;
|
|
395
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
390
396
|
};
|
|
391
397
|
user: {
|
|
392
398
|
type: "student" | "teacher";
|
|
@@ -416,6 +422,8 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
416
422
|
discussionsEnabled: boolean;
|
|
417
423
|
studentsCanCreateDiscussions: boolean;
|
|
418
424
|
studentsCanReply: boolean;
|
|
425
|
+
treatMissingAsZero: boolean;
|
|
426
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
419
427
|
};
|
|
420
428
|
removedUserId: string;
|
|
421
429
|
};
|
|
@@ -718,6 +726,8 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
718
726
|
discussionsEnabled: boolean;
|
|
719
727
|
studentsCanCreateDiscussions: boolean;
|
|
720
728
|
studentsCanReply: boolean;
|
|
729
|
+
treatMissingAsZero: boolean;
|
|
730
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
721
731
|
};
|
|
722
732
|
meta: object;
|
|
723
733
|
}>;
|
|
@@ -751,6 +761,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
751
761
|
markSchemeId: string | null;
|
|
752
762
|
order: number | null;
|
|
753
763
|
gradingBoundaryId: string | null;
|
|
764
|
+
gradeCategoryId: string | null;
|
|
754
765
|
}[];
|
|
755
766
|
meta: object;
|
|
756
767
|
}>;
|
|
@@ -794,6 +805,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
794
805
|
markSchemeId: string | null;
|
|
795
806
|
order: number | null;
|
|
796
807
|
gradingBoundaryId: string | null;
|
|
808
|
+
gradeCategoryId: string | null;
|
|
797
809
|
};
|
|
798
810
|
meta: object;
|
|
799
811
|
}>;
|
|
@@ -837,6 +849,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
837
849
|
markSchemeId: string | null;
|
|
838
850
|
order: number | null;
|
|
839
851
|
gradingBoundaryId: string | null;
|
|
852
|
+
gradeCategoryId: string | null;
|
|
840
853
|
};
|
|
841
854
|
meta: object;
|
|
842
855
|
}>;
|
|
@@ -871,6 +884,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
871
884
|
markSchemeId: string | null;
|
|
872
885
|
order: number | null;
|
|
873
886
|
gradingBoundaryId: string | null;
|
|
887
|
+
gradeCategoryId: string | null;
|
|
874
888
|
};
|
|
875
889
|
meta: object;
|
|
876
890
|
}>;
|
|
@@ -909,6 +923,7 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
909
923
|
markSchemeId: string | null;
|
|
910
924
|
order: number | null;
|
|
911
925
|
gradingBoundaryId: string | null;
|
|
926
|
+
gradeCategoryId: string | null;
|
|
912
927
|
};
|
|
913
928
|
meta: object;
|
|
914
929
|
}>;
|
|
@@ -1060,6 +1075,8 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1060
1075
|
discussionsEnabled: boolean;
|
|
1061
1076
|
studentsCanCreateDiscussions: boolean;
|
|
1062
1077
|
studentsCanReply: boolean;
|
|
1078
|
+
treatMissingAsZero: boolean;
|
|
1079
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
1063
1080
|
};
|
|
1064
1081
|
meta: object;
|
|
1065
1082
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"/","sources":["routers/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2CxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"class.d.ts","sourceRoot":"/","sources":["routers/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2CxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
|
65
65
|
discussionsEnabled: boolean;
|
|
66
66
|
studentsCanCreateDiscussions: boolean;
|
|
67
67
|
studentsCanReply: boolean;
|
|
68
|
+
treatMissingAsZero: boolean;
|
|
69
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
68
70
|
}) | null;
|
|
69
71
|
assignmentsAttached: {
|
|
70
72
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
@@ -214,6 +216,7 @@ export declare const eventRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
214
216
|
markSchemeId: string | null;
|
|
215
217
|
order: number | null;
|
|
216
218
|
gradingBoundaryId: string | null;
|
|
219
|
+
gradeCategoryId: string | null;
|
|
217
220
|
};
|
|
218
221
|
};
|
|
219
222
|
meta: object;
|
|
@@ -263,6 +266,7 @@ export declare const eventRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
263
266
|
markSchemeId: string | null;
|
|
264
267
|
order: number | null;
|
|
265
268
|
gradingBoundaryId: string | null;
|
|
269
|
+
gradeCategoryId: string | null;
|
|
266
270
|
};
|
|
267
271
|
};
|
|
268
272
|
meta: object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"/","sources":["routers/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"/","sources":["routers/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDtB,CAAC"}
|
package/dist/routers/file.d.ts
CHANGED
|
@@ -126,5 +126,71 @@ export declare const fileRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
126
126
|
};
|
|
127
127
|
meta: object;
|
|
128
128
|
}>;
|
|
129
|
+
listAnnotations: import("@trpc/server").TRPCQueryProcedure<{
|
|
130
|
+
input: {
|
|
131
|
+
fileId: string;
|
|
132
|
+
};
|
|
133
|
+
output: {
|
|
134
|
+
annotations: ({
|
|
135
|
+
author: {
|
|
136
|
+
id: string;
|
|
137
|
+
username: string;
|
|
138
|
+
profile: {
|
|
139
|
+
displayName: string | null;
|
|
140
|
+
} | null;
|
|
141
|
+
};
|
|
142
|
+
} & {
|
|
143
|
+
type: import(".prisma/client").$Enums.FileAnnotationType;
|
|
144
|
+
id: string;
|
|
145
|
+
createdAt: Date;
|
|
146
|
+
updatedAt: Date;
|
|
147
|
+
color: string | null;
|
|
148
|
+
submissionId: string | null;
|
|
149
|
+
text: string | null;
|
|
150
|
+
authorId: string;
|
|
151
|
+
fileId: string;
|
|
152
|
+
page: number;
|
|
153
|
+
geometry: import("@prisma/client/runtime/library.js").JsonValue;
|
|
154
|
+
})[];
|
|
155
|
+
};
|
|
156
|
+
meta: object;
|
|
157
|
+
}>;
|
|
158
|
+
upsertAnnotation: import("@trpc/server").TRPCMutationProcedure<{
|
|
159
|
+
input: {
|
|
160
|
+
type: "HIGHLIGHT" | "INK" | "COMMENT" | "TEXT";
|
|
161
|
+
fileId: string;
|
|
162
|
+
page: number;
|
|
163
|
+
geometry: Record<string, unknown>;
|
|
164
|
+
id?: string | undefined;
|
|
165
|
+
color?: string | undefined;
|
|
166
|
+
text?: string | undefined;
|
|
167
|
+
};
|
|
168
|
+
output: {
|
|
169
|
+
annotation: {
|
|
170
|
+
type: import(".prisma/client").$Enums.FileAnnotationType;
|
|
171
|
+
id: string;
|
|
172
|
+
createdAt: Date;
|
|
173
|
+
updatedAt: Date;
|
|
174
|
+
color: string | null;
|
|
175
|
+
submissionId: string | null;
|
|
176
|
+
text: string | null;
|
|
177
|
+
authorId: string;
|
|
178
|
+
fileId: string;
|
|
179
|
+
page: number;
|
|
180
|
+
geometry: import("@prisma/client/runtime/library.js").JsonValue;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
meta: object;
|
|
184
|
+
}>;
|
|
185
|
+
deleteAnnotation: import("@trpc/server").TRPCMutationProcedure<{
|
|
186
|
+
input: {
|
|
187
|
+
id: string;
|
|
188
|
+
fileId: string;
|
|
189
|
+
};
|
|
190
|
+
output: {
|
|
191
|
+
success: boolean;
|
|
192
|
+
};
|
|
193
|
+
meta: object;
|
|
194
|
+
}>;
|
|
129
195
|
}>>;
|
|
130
196
|
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"/","sources":["routers/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"/","sources":["routers/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoCxB;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6IrB,CAAC"}
|
package/dist/routers/file.js
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
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]="e028d0f2-5361-5ae8-91b4-499cdb5c74ed")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import { TRPCError } from "@trpc/server";
|
|
4
5
|
import { createTRPCRouter, protectedProcedure } from "../trpc.js";
|
|
6
|
+
import { prisma } from "../lib/prisma.js";
|
|
5
7
|
import { deleteFileGeneric, getFileSignedUrl, moveFileScoped, renameFileScoped, } from "../services/file.js";
|
|
8
|
+
const upsertAnnotationSchema = z.object({
|
|
9
|
+
fileId: z.string(),
|
|
10
|
+
id: z.string().optional(),
|
|
11
|
+
page: z.number().int().min(1),
|
|
12
|
+
type: z.enum(["HIGHLIGHT", "INK", "COMMENT", "TEXT"]),
|
|
13
|
+
geometry: z.record(z.string(), z.unknown()),
|
|
14
|
+
text: z.string().optional(),
|
|
15
|
+
color: z.string().optional(),
|
|
16
|
+
});
|
|
17
|
+
/** @throws NOT_FOUND unless the file exists and is owned by the user. */
|
|
18
|
+
async function requireOwnedFile(userId, fileId) {
|
|
19
|
+
const file = await prisma.file.findFirst({
|
|
20
|
+
where: { id: fileId, userId },
|
|
21
|
+
select: { id: true },
|
|
22
|
+
});
|
|
23
|
+
if (!file) {
|
|
24
|
+
throw new TRPCError({
|
|
25
|
+
code: "NOT_FOUND",
|
|
26
|
+
message: "File not found or you don't own it",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
6
30
|
/**
|
|
7
31
|
* File router. Backed by the same unified scope-aware permission model as the
|
|
8
32
|
* folder router. The class files page and the cloud-storage page (personal /
|
|
@@ -36,6 +60,91 @@ export const fileRouter = createTRPCRouter({
|
|
|
36
60
|
delete: protectedProcedure
|
|
37
61
|
.input(z.object({ fileId: z.string() }))
|
|
38
62
|
.mutation(({ ctx, input }) => deleteFileGeneric(ctx.user.id, input.fileId)),
|
|
63
|
+
// PDF annotations on files the user owns (personal cloud storage). The
|
|
64
|
+
// submission review flow uses the annotation endpoints on the assignment
|
|
65
|
+
// router instead; these are owner-only and carry no submission context.
|
|
66
|
+
listAnnotations: protectedProcedure
|
|
67
|
+
.input(z.object({ fileId: z.string() }))
|
|
68
|
+
.query(async ({ ctx, input }) => {
|
|
69
|
+
await requireOwnedFile(ctx.user.id, input.fileId);
|
|
70
|
+
const annotations = await prisma.fileAnnotation.findMany({
|
|
71
|
+
where: { fileId: input.fileId, submissionId: null },
|
|
72
|
+
orderBy: { createdAt: "asc" },
|
|
73
|
+
include: {
|
|
74
|
+
author: {
|
|
75
|
+
select: {
|
|
76
|
+
id: true,
|
|
77
|
+
username: true,
|
|
78
|
+
profile: { select: { displayName: true } },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
return { annotations };
|
|
84
|
+
}),
|
|
85
|
+
upsertAnnotation: protectedProcedure
|
|
86
|
+
.input(upsertAnnotationSchema)
|
|
87
|
+
.mutation(async ({ ctx, input }) => {
|
|
88
|
+
const { fileId, id, page, type, geometry, text, color } = input;
|
|
89
|
+
await requireOwnedFile(ctx.user.id, fileId);
|
|
90
|
+
if (id) {
|
|
91
|
+
const existing = await prisma.fileAnnotation.findFirst({
|
|
92
|
+
where: { id, fileId, submissionId: null, authorId: ctx.user.id },
|
|
93
|
+
select: { id: true },
|
|
94
|
+
});
|
|
95
|
+
if (!existing) {
|
|
96
|
+
throw new TRPCError({
|
|
97
|
+
code: "NOT_FOUND",
|
|
98
|
+
message: "Annotation not found",
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const annotation = await prisma.fileAnnotation.update({
|
|
102
|
+
where: { id },
|
|
103
|
+
data: {
|
|
104
|
+
page,
|
|
105
|
+
type,
|
|
106
|
+
geometry: geometry,
|
|
107
|
+
text: text ?? null,
|
|
108
|
+
color: color ?? null,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
return { annotation };
|
|
112
|
+
}
|
|
113
|
+
const annotation = await prisma.fileAnnotation.create({
|
|
114
|
+
data: {
|
|
115
|
+
fileId,
|
|
116
|
+
authorId: ctx.user.id,
|
|
117
|
+
page,
|
|
118
|
+
type,
|
|
119
|
+
geometry: geometry,
|
|
120
|
+
text: text ?? null,
|
|
121
|
+
color: color ?? null,
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
return { annotation };
|
|
125
|
+
}),
|
|
126
|
+
deleteAnnotation: protectedProcedure
|
|
127
|
+
.input(z.object({ fileId: z.string(), id: z.string() }))
|
|
128
|
+
.mutation(async ({ ctx, input }) => {
|
|
129
|
+
await requireOwnedFile(ctx.user.id, input.fileId);
|
|
130
|
+
const annotation = await prisma.fileAnnotation.findFirst({
|
|
131
|
+
where: {
|
|
132
|
+
id: input.id,
|
|
133
|
+
fileId: input.fileId,
|
|
134
|
+
submissionId: null,
|
|
135
|
+
authorId: ctx.user.id,
|
|
136
|
+
},
|
|
137
|
+
select: { id: true },
|
|
138
|
+
});
|
|
139
|
+
if (!annotation) {
|
|
140
|
+
throw new TRPCError({
|
|
141
|
+
code: "NOT_FOUND",
|
|
142
|
+
message: "Annotation not found",
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
await prisma.fileAnnotation.delete({ where: { id: input.id } });
|
|
146
|
+
return { success: true };
|
|
147
|
+
}),
|
|
39
148
|
});
|
|
40
149
|
//# sourceMappingURL=file.js.map
|
|
41
|
-
//# debugId=
|
|
150
|
+
//# debugId=e028d0f2-5361-5ae8-91b4-499cdb5c74ed
|
package/dist/routers/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sources":["routers/file.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport {\n deleteFileGeneric,\n getFileSignedUrl,\n moveFileScoped,\n renameFileScoped,\n} from \"../services/file.js\";\n\n/**\n * File router. Backed by the same unified scope-aware permission model as the\n * folder router. The class files page and the cloud-storage page (personal /\n * institution) both run through the same endpoints.\n *\n * Permissions are derived from the file's parent folder scope, so callers\n * never need to send `classId` / `scope` — just the file id.\n */\nexport const fileRouter = createTRPCRouter({\n getSignedUrl: protectedProcedure\n .input(z.object({ fileId: z.string() }))\n .mutation(({ ctx, input }) =>\n getFileSignedUrl(ctx.user!.id, input.fileId)\n ),\n\n move: protectedProcedure\n .input(\n z.object({\n fileId: z.string(),\n targetFolderId: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n moveFileScoped(ctx.user!.id, {\n fileId: input.fileId,\n targetFolderId: input.targetFolderId,\n })\n ),\n\n rename: protectedProcedure\n .input(\n z.object({\n fileId: z.string(),\n newName: z.string().min(1),\n })\n )\n .mutation(({ ctx, input }) =>\n renameFileScoped(ctx.user!.id, {\n fileId: input.fileId,\n newName: input.newName,\n })\n ),\n\n delete: protectedProcedure\n .input(z.object({ fileId: z.string() }))\n .mutation(({ ctx, input }) =>\n deleteFileGeneric(ctx.user!.id, input.fileId)\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,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;IACzC,YAAY,EAAE,kBAAkB;SAC7B,KAAK,CAAC,CAAC,CAAC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AiB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,CAC9C;CACJ,CAAC,CAAC","debug_id":"978fd381-abcb-514c-84a7-291fb8f62f7a"}
|
|
1
|
+
{"version":3,"file":"file.js","sources":["routers/file.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { TRPCError } from \"@trpc/server\";\nimport { createTRPCRouter, protectedProcedure } from \"../trpc.js\";\nimport { prisma } from \"../lib/prisma.js\";\nimport {\n deleteFileGeneric,\n getFileSignedUrl,\n moveFileScoped,\n renameFileScoped,\n} from \"../services/file.js\";\n\nconst upsertAnnotationSchema = z.object({\n fileId: z.string(),\n id: z.string().optional(),\n page: z.number().int().min(1),\n type: z.enum([\"HIGHLIGHT\", \"INK\", \"COMMENT\", \"TEXT\"]),\n geometry: z.record(z.string(), z.unknown()),\n text: z.string().optional(),\n color: z.string().optional(),\n});\n\n/** @throws NOT_FOUND unless the file exists and is owned by the user. */\nasync function requireOwnedFile(userId: string, fileId: string) {\n const file = await prisma.file.findFirst({\n where: { id: fileId, userId },\n select: { id: true },\n });\n\n if (!file) {\n throw new TRPCError({\n code: \"NOT_FOUND\",\n message: \"File not found or you don't own it\",\n });\n }\n}\n\n/**\n * File router. Backed by the same unified scope-aware permission model as the\n * folder router. The class files page and the cloud-storage page (personal /\n * institution) both run through the same endpoints.\n *\n * Permissions are derived from the file's parent folder scope, so callers\n * never need to send `classId` / `scope` — just the file id.\n */\nexport const fileRouter = createTRPCRouter({\n getSignedUrl: protectedProcedure\n .input(z.object({ fileId: z.string() }))\n .mutation(({ ctx, input }) =>\n getFileSignedUrl(ctx.user!.id, input.fileId)\n ),\n\n move: protectedProcedure\n .input(\n z.object({\n fileId: z.string(),\n targetFolderId: z.string(),\n })\n )\n .mutation(({ ctx, input }) =>\n moveFileScoped(ctx.user!.id, {\n fileId: input.fileId,\n targetFolderId: input.targetFolderId,\n })\n ),\n\n rename: protectedProcedure\n .input(\n z.object({\n fileId: z.string(),\n newName: z.string().min(1),\n })\n )\n .mutation(({ ctx, input }) =>\n renameFileScoped(ctx.user!.id, {\n fileId: input.fileId,\n newName: input.newName,\n })\n ),\n\n delete: protectedProcedure\n .input(z.object({ fileId: z.string() }))\n .mutation(({ ctx, input }) =>\n deleteFileGeneric(ctx.user!.id, input.fileId)\n ),\n\n // PDF annotations on files the user owns (personal cloud storage). The\n // submission review flow uses the annotation endpoints on the assignment\n // router instead; these are owner-only and carry no submission context.\n listAnnotations: protectedProcedure\n .input(z.object({ fileId: z.string() }))\n .query(async ({ ctx, input }) => {\n await requireOwnedFile(ctx.user!.id, input.fileId);\n\n const annotations = await prisma.fileAnnotation.findMany({\n where: { fileId: input.fileId, submissionId: null },\n orderBy: { createdAt: \"asc\" },\n include: {\n author: {\n select: {\n id: true,\n username: true,\n profile: { select: { displayName: true } },\n },\n },\n },\n });\n\n return { annotations };\n }),\n\n upsertAnnotation: protectedProcedure\n .input(upsertAnnotationSchema)\n .mutation(async ({ ctx, input }) => {\n const { fileId, id, page, type, geometry, text, color } = input;\n\n await requireOwnedFile(ctx.user!.id, fileId);\n\n if (id) {\n const existing = await prisma.fileAnnotation.findFirst({\n where: { id, fileId, submissionId: null, authorId: ctx.user!.id },\n select: { id: true },\n });\n\n if (!existing) {\n throw new TRPCError({\n code: \"NOT_FOUND\",\n message: \"Annotation not found\",\n });\n }\n\n const annotation = await prisma.fileAnnotation.update({\n where: { id },\n data: {\n page,\n type,\n geometry: geometry as object,\n text: text ?? null,\n color: color ?? null,\n },\n });\n\n return { annotation };\n }\n\n const annotation = await prisma.fileAnnotation.create({\n data: {\n fileId,\n authorId: ctx.user!.id,\n page,\n type,\n geometry: geometry as object,\n text: text ?? null,\n color: color ?? null,\n },\n });\n\n return { annotation };\n }),\n\n deleteAnnotation: protectedProcedure\n .input(z.object({ fileId: z.string(), id: z.string() }))\n .mutation(async ({ ctx, input }) => {\n await requireOwnedFile(ctx.user!.id, input.fileId);\n\n const annotation = await prisma.fileAnnotation.findFirst({\n where: {\n id: input.id,\n fileId: input.fileId,\n submissionId: null,\n authorId: ctx.user!.id,\n },\n select: { id: true },\n });\n\n if (!annotation) {\n throw new TRPCError({\n code: \"NOT_FOUND\",\n message: \"Annotation not found\",\n });\n }\n\n await prisma.fileAnnotation.delete({ where: { id: input.id } });\n\n return { success: true };\n }),\n});\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEH,yEAAyE;AACzE,KAAK,UAAU,gBAAgB,CAAC,MAAc,EAAE,MAAc;IAC5D,MAAM,IAAI,GAAG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CAAC,CAAC;QAEhE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC,CAAC;CACL,CAAC,CAAC","debug_id":"e028d0f2-5361-5ae8-91b4-499cdb5c74ed"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const gradebookRouter: 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
|
+
listCategories: import("@trpc/server").TRPCQueryProcedure<{
|
|
20
|
+
input: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
classId: string;
|
|
23
|
+
};
|
|
24
|
+
output: {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
classId: string;
|
|
28
|
+
weight: number;
|
|
29
|
+
dropLowest: number;
|
|
30
|
+
position: number;
|
|
31
|
+
}[];
|
|
32
|
+
meta: object;
|
|
33
|
+
}>;
|
|
34
|
+
createCategory: import("@trpc/server").TRPCMutationProcedure<{
|
|
35
|
+
input: {
|
|
36
|
+
[x: string]: unknown;
|
|
37
|
+
classId: string;
|
|
38
|
+
name: string;
|
|
39
|
+
weight: number;
|
|
40
|
+
dropLowest?: number | undefined;
|
|
41
|
+
position?: number | undefined;
|
|
42
|
+
};
|
|
43
|
+
output: {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
classId: string;
|
|
47
|
+
weight: number;
|
|
48
|
+
dropLowest: number;
|
|
49
|
+
position: number;
|
|
50
|
+
};
|
|
51
|
+
meta: object;
|
|
52
|
+
}>;
|
|
53
|
+
updateCategory: import("@trpc/server").TRPCMutationProcedure<{
|
|
54
|
+
input: {
|
|
55
|
+
[x: string]: unknown;
|
|
56
|
+
classId: string;
|
|
57
|
+
categoryId: string;
|
|
58
|
+
name?: string | undefined;
|
|
59
|
+
weight?: number | undefined;
|
|
60
|
+
dropLowest?: number | undefined;
|
|
61
|
+
position?: number | undefined;
|
|
62
|
+
};
|
|
63
|
+
output: {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
classId: string;
|
|
67
|
+
weight: number;
|
|
68
|
+
dropLowest: number;
|
|
69
|
+
position: number;
|
|
70
|
+
};
|
|
71
|
+
meta: object;
|
|
72
|
+
}>;
|
|
73
|
+
deleteCategory: import("@trpc/server").TRPCMutationProcedure<{
|
|
74
|
+
input: {
|
|
75
|
+
[x: string]: unknown;
|
|
76
|
+
classId: string;
|
|
77
|
+
categoryId: string;
|
|
78
|
+
};
|
|
79
|
+
output: {
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
classId: string;
|
|
83
|
+
weight: number;
|
|
84
|
+
dropLowest: number;
|
|
85
|
+
position: number;
|
|
86
|
+
};
|
|
87
|
+
meta: object;
|
|
88
|
+
}>;
|
|
89
|
+
assignCategory: import("@trpc/server").TRPCMutationProcedure<{
|
|
90
|
+
input: {
|
|
91
|
+
[x: string]: unknown;
|
|
92
|
+
classId: string;
|
|
93
|
+
assignmentId: string;
|
|
94
|
+
gradeCategoryId: string | null;
|
|
95
|
+
};
|
|
96
|
+
output: {
|
|
97
|
+
type: import(".prisma/client").$Enums.AssignmentType;
|
|
98
|
+
id: string;
|
|
99
|
+
createdAt: Date | null;
|
|
100
|
+
classId: string;
|
|
101
|
+
title: string;
|
|
102
|
+
dueDate: Date;
|
|
103
|
+
maxGrade: number | null;
|
|
104
|
+
eventId: string | null;
|
|
105
|
+
instructions: string;
|
|
106
|
+
modifiedAt: Date | null;
|
|
107
|
+
teacherId: string;
|
|
108
|
+
acceptFiles: boolean;
|
|
109
|
+
acceptExtendedResponse: boolean;
|
|
110
|
+
acceptWorksheet: boolean;
|
|
111
|
+
gradeWithAI: boolean;
|
|
112
|
+
aiPolicyLevel: number;
|
|
113
|
+
sectionId: string | null;
|
|
114
|
+
graded: boolean;
|
|
115
|
+
weight: number;
|
|
116
|
+
inProgress: boolean;
|
|
117
|
+
template: boolean;
|
|
118
|
+
markSchemeId: string | null;
|
|
119
|
+
order: number | null;
|
|
120
|
+
gradingBoundaryId: string | null;
|
|
121
|
+
gradeCategoryId: string | null;
|
|
122
|
+
};
|
|
123
|
+
meta: object;
|
|
124
|
+
}>;
|
|
125
|
+
listColumns: import("@trpc/server").TRPCQueryProcedure<{
|
|
126
|
+
input: {
|
|
127
|
+
[x: string]: unknown;
|
|
128
|
+
classId: string;
|
|
129
|
+
};
|
|
130
|
+
output: ({
|
|
131
|
+
entries: {
|
|
132
|
+
id: string;
|
|
133
|
+
points: number;
|
|
134
|
+
studentId: string;
|
|
135
|
+
note: string | null;
|
|
136
|
+
}[];
|
|
137
|
+
} & {
|
|
138
|
+
id: string;
|
|
139
|
+
name: string;
|
|
140
|
+
classId: string;
|
|
141
|
+
gradeCategoryId: string | null;
|
|
142
|
+
position: number;
|
|
143
|
+
maxPoints: number;
|
|
144
|
+
})[];
|
|
145
|
+
meta: object;
|
|
146
|
+
}>;
|
|
147
|
+
createColumn: import("@trpc/server").TRPCMutationProcedure<{
|
|
148
|
+
input: {
|
|
149
|
+
[x: string]: unknown;
|
|
150
|
+
classId: string;
|
|
151
|
+
name: string;
|
|
152
|
+
maxPoints: number;
|
|
153
|
+
gradeCategoryId?: string | null | undefined;
|
|
154
|
+
position?: number | undefined;
|
|
155
|
+
};
|
|
156
|
+
output: {
|
|
157
|
+
id: string;
|
|
158
|
+
name: string;
|
|
159
|
+
classId: string;
|
|
160
|
+
gradeCategoryId: string | null;
|
|
161
|
+
position: number;
|
|
162
|
+
maxPoints: number;
|
|
163
|
+
};
|
|
164
|
+
meta: object;
|
|
165
|
+
}>;
|
|
166
|
+
updateColumn: import("@trpc/server").TRPCMutationProcedure<{
|
|
167
|
+
input: {
|
|
168
|
+
[x: string]: unknown;
|
|
169
|
+
classId: string;
|
|
170
|
+
columnId: string;
|
|
171
|
+
name?: string | undefined;
|
|
172
|
+
gradeCategoryId?: string | null | undefined;
|
|
173
|
+
position?: number | undefined;
|
|
174
|
+
maxPoints?: number | undefined;
|
|
175
|
+
};
|
|
176
|
+
output: {
|
|
177
|
+
id: string;
|
|
178
|
+
name: string;
|
|
179
|
+
classId: string;
|
|
180
|
+
gradeCategoryId: string | null;
|
|
181
|
+
position: number;
|
|
182
|
+
maxPoints: number;
|
|
183
|
+
};
|
|
184
|
+
meta: object;
|
|
185
|
+
}>;
|
|
186
|
+
deleteColumn: import("@trpc/server").TRPCMutationProcedure<{
|
|
187
|
+
input: {
|
|
188
|
+
[x: string]: unknown;
|
|
189
|
+
classId: string;
|
|
190
|
+
columnId: string;
|
|
191
|
+
};
|
|
192
|
+
output: {
|
|
193
|
+
id: string;
|
|
194
|
+
name: string;
|
|
195
|
+
classId: string;
|
|
196
|
+
gradeCategoryId: string | null;
|
|
197
|
+
position: number;
|
|
198
|
+
maxPoints: number;
|
|
199
|
+
};
|
|
200
|
+
meta: object;
|
|
201
|
+
}>;
|
|
202
|
+
setEntry: import("@trpc/server").TRPCMutationProcedure<{
|
|
203
|
+
input: {
|
|
204
|
+
[x: string]: unknown;
|
|
205
|
+
classId: string;
|
|
206
|
+
points: number | null;
|
|
207
|
+
studentId: string;
|
|
208
|
+
columnId: string;
|
|
209
|
+
note?: string | null | undefined;
|
|
210
|
+
};
|
|
211
|
+
output: {
|
|
212
|
+
id: string;
|
|
213
|
+
points: number;
|
|
214
|
+
studentId: string;
|
|
215
|
+
columnId: string;
|
|
216
|
+
note: string | null;
|
|
217
|
+
} | null;
|
|
218
|
+
meta: object;
|
|
219
|
+
}>;
|
|
220
|
+
getPolicies: import("@trpc/server").TRPCQueryProcedure<{
|
|
221
|
+
input: {
|
|
222
|
+
[x: string]: unknown;
|
|
223
|
+
classId: string;
|
|
224
|
+
};
|
|
225
|
+
output: {
|
|
226
|
+
id: string;
|
|
227
|
+
treatMissingAsZero: boolean;
|
|
228
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
229
|
+
};
|
|
230
|
+
meta: object;
|
|
231
|
+
}>;
|
|
232
|
+
updatePolicies: import("@trpc/server").TRPCMutationProcedure<{
|
|
233
|
+
input: {
|
|
234
|
+
[x: string]: unknown;
|
|
235
|
+
classId: string;
|
|
236
|
+
treatMissingAsZero?: boolean | undefined;
|
|
237
|
+
gradeRoundingMode?: "NONE" | "HALF_UP" | "FLOOR" | "CEILING" | undefined;
|
|
238
|
+
};
|
|
239
|
+
output: {
|
|
240
|
+
id: string;
|
|
241
|
+
treatMissingAsZero: boolean;
|
|
242
|
+
gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
243
|
+
};
|
|
244
|
+
meta: object;
|
|
245
|
+
}>;
|
|
246
|
+
getComputed: import("@trpc/server").TRPCQueryProcedure<{
|
|
247
|
+
input: {
|
|
248
|
+
[x: string]: unknown;
|
|
249
|
+
classId: string;
|
|
250
|
+
};
|
|
251
|
+
output: {
|
|
252
|
+
policies: {
|
|
253
|
+
treatMissingAsZero: boolean;
|
|
254
|
+
roundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
|
|
255
|
+
};
|
|
256
|
+
categories: {
|
|
257
|
+
id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
classId: string;
|
|
260
|
+
weight: number;
|
|
261
|
+
dropLowest: number;
|
|
262
|
+
position: number;
|
|
263
|
+
}[];
|
|
264
|
+
assignments: {
|
|
265
|
+
id: string;
|
|
266
|
+
title: string;
|
|
267
|
+
maxGrade: number | null;
|
|
268
|
+
weight: number;
|
|
269
|
+
gradeCategoryId: string | null;
|
|
270
|
+
dueDate: Date;
|
|
271
|
+
}[];
|
|
272
|
+
customColumns: {
|
|
273
|
+
id: string;
|
|
274
|
+
name: string;
|
|
275
|
+
maxPoints: number;
|
|
276
|
+
gradeCategoryId: string | null;
|
|
277
|
+
position: number;
|
|
278
|
+
}[];
|
|
279
|
+
gradingBoundary: {
|
|
280
|
+
id: string;
|
|
281
|
+
name: string | null;
|
|
282
|
+
structured: string;
|
|
283
|
+
};
|
|
284
|
+
students: import("../services/gradebook.js").GradebookStudentRow[];
|
|
285
|
+
};
|
|
286
|
+
meta: object;
|
|
287
|
+
}>;
|
|
288
|
+
exportCsv: import("@trpc/server").TRPCQueryProcedure<{
|
|
289
|
+
input: {
|
|
290
|
+
[x: string]: unknown;
|
|
291
|
+
classId: string;
|
|
292
|
+
};
|
|
293
|
+
output: {
|
|
294
|
+
csv: string;
|
|
295
|
+
};
|
|
296
|
+
meta: object;
|
|
297
|
+
}>;
|
|
298
|
+
}>>;
|
|
299
|
+
//# sourceMappingURL=gradebook.d.ts.map
|