@studious-lms/server 1.0.2 → 1.0.4
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/routers/_app.d.ts +216 -88
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/agenda.d.ts +5 -4
- package/dist/routers/agenda.d.ts.map +1 -1
- package/dist/routers/announcement.d.ts +8 -4
- package/dist/routers/announcement.d.ts.map +1 -1
- package/dist/routers/assignment.d.ts +20 -4
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/attendance.d.ts +6 -4
- package/dist/routers/attendance.d.ts.map +1 -1
- package/dist/routers/auth.d.ts +10 -4
- package/dist/routers/auth.d.ts.map +1 -1
- package/dist/routers/class.d.ts +26 -4
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/event.d.ts +11 -4
- package/dist/routers/event.d.ts.map +1 -1
- package/dist/routers/file.d.ts +5 -4
- package/dist/routers/file.d.ts.map +1 -1
- package/dist/routers/section.d.ts +7 -4
- package/dist/routers/section.d.ts.map +1 -1
- package/dist/routers/user.d.ts +6 -4
- package/dist/routers/user.d.ts.map +1 -1
- package/dist/trpc.d.ts +43 -90
- package/dist/trpc.d.ts.map +1 -1
- package/package.json +2 -7
- package/prisma/schema.prisma +228 -0
- package/src/exportType.ts +9 -0
- package/src/index.ts +94 -0
- package/src/lib/fileUpload.ts +163 -0
- package/src/lib/googleCloudStorage.ts +94 -0
- package/src/lib/prisma.ts +16 -0
- package/src/lib/thumbnailGenerator.ts +185 -0
- package/src/logger.ts +163 -0
- package/src/middleware/auth.ts +191 -0
- package/src/middleware/logging.ts +54 -0
- package/src/routers/_app.ts +34 -0
- package/src/routers/agenda.ts +79 -0
- package/src/routers/announcement.ts +134 -0
- package/src/routers/assignment.ts +1614 -0
- package/src/routers/attendance.ts +284 -0
- package/src/routers/auth.ts +286 -0
- package/src/routers/class.ts +753 -0
- package/src/routers/event.ts +509 -0
- package/src/routers/file.ts +96 -0
- package/src/routers/section.ts +138 -0
- package/src/routers/user.ts +82 -0
- package/src/socket/handlers.ts +143 -0
- package/src/trpc.ts +90 -0
- package/src/types/trpc.ts +15 -0
- package/src/utils/email.ts +11 -0
- package/src/utils/generateInviteCode.ts +8 -0
- package/src/utils/logger.ts +156 -0
- package/tsconfig.json +17 -0
- package/generated/prisma/client.d.ts +0 -1
- package/generated/prisma/client.js +0 -4
- package/generated/prisma/default.d.ts +0 -1
- package/generated/prisma/default.js +0 -4
- package/generated/prisma/edge.d.ts +0 -1
- package/generated/prisma/edge.js +0 -389
- package/generated/prisma/index-browser.js +0 -375
- package/generated/prisma/index.d.ts +0 -34865
- package/generated/prisma/index.js +0 -410
- package/generated/prisma/libquery_engine-darwin-arm64.dylib.node +0 -0
- package/generated/prisma/package.json +0 -140
- package/generated/prisma/runtime/edge-esm.js +0 -34
- package/generated/prisma/runtime/edge.js +0 -34
- package/generated/prisma/runtime/index-browser.d.ts +0 -370
- package/generated/prisma/runtime/index-browser.js +0 -16
- package/generated/prisma/runtime/library.d.ts +0 -3647
- package/generated/prisma/runtime/library.js +0 -146
- package/generated/prisma/runtime/react-native.js +0 -83
- package/generated/prisma/runtime/wasm.js +0 -35
- package/generated/prisma/schema.prisma +0 -304
- package/generated/prisma/wasm.d.ts +0 -1
- package/generated/prisma/wasm.js +0 -375
package/dist/routers/event.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const eventRouter: import("@trpc/server
|
|
2
|
+
export declare const eventRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: import("../trpc").Context;
|
|
4
4
|
meta: object;
|
|
5
5
|
errorShape: {
|
|
6
6
|
data: {
|
|
7
7
|
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
-
code: import("@trpc/server
|
|
8
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
9
9
|
httpStatus: number;
|
|
10
10
|
path?: string;
|
|
11
11
|
stack?: string;
|
|
12
12
|
};
|
|
13
13
|
message: string;
|
|
14
|
-
code: import("@trpc/server
|
|
14
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
15
15
|
};
|
|
16
16
|
transformer: false;
|
|
17
|
-
}, import("@trpc/server
|
|
17
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
18
18
|
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
19
19
|
input: {
|
|
20
20
|
id: string;
|
|
@@ -71,6 +71,7 @@ export declare const eventRouter: import("@trpc/server/dist/unstable-core-do-not
|
|
|
71
71
|
location: string | null;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
+
meta: object;
|
|
74
75
|
}>;
|
|
75
76
|
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
76
77
|
input: {
|
|
@@ -99,6 +100,7 @@ export declare const eventRouter: import("@trpc/server/dist/unstable-core-do-not
|
|
|
99
100
|
location: string | null;
|
|
100
101
|
};
|
|
101
102
|
};
|
|
103
|
+
meta: object;
|
|
102
104
|
}>;
|
|
103
105
|
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
104
106
|
input: {
|
|
@@ -126,6 +128,7 @@ export declare const eventRouter: import("@trpc/server/dist/unstable-core-do-not
|
|
|
126
128
|
location: string | null;
|
|
127
129
|
};
|
|
128
130
|
};
|
|
131
|
+
meta: object;
|
|
129
132
|
}>;
|
|
130
133
|
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
131
134
|
input: {
|
|
@@ -134,6 +137,7 @@ export declare const eventRouter: import("@trpc/server/dist/unstable-core-do-not
|
|
|
134
137
|
output: {
|
|
135
138
|
success: boolean;
|
|
136
139
|
};
|
|
140
|
+
meta: object;
|
|
137
141
|
}>;
|
|
138
142
|
attachAssignment: import("@trpc/server").TRPCMutationProcedure<{
|
|
139
143
|
input: {
|
|
@@ -174,6 +178,7 @@ export declare const eventRouter: import("@trpc/server/dist/unstable-core-do-not
|
|
|
174
178
|
eventId: string | null;
|
|
175
179
|
};
|
|
176
180
|
};
|
|
181
|
+
meta: object;
|
|
177
182
|
}>;
|
|
178
183
|
detachAssignment: import("@trpc/server").TRPCMutationProcedure<{
|
|
179
184
|
input: {
|
|
@@ -214,6 +219,7 @@ export declare const eventRouter: import("@trpc/server/dist/unstable-core-do-not
|
|
|
214
219
|
eventId: string | null;
|
|
215
220
|
};
|
|
216
221
|
};
|
|
222
|
+
meta: object;
|
|
217
223
|
}>;
|
|
218
224
|
getAvailableAssignments: import("@trpc/server").TRPCQueryProcedure<{
|
|
219
225
|
input: {
|
|
@@ -244,6 +250,7 @@ export declare const eventRouter: import("@trpc/server/dist/unstable-core-do-not
|
|
|
244
250
|
}[];
|
|
245
251
|
}[];
|
|
246
252
|
};
|
|
253
|
+
meta: object;
|
|
247
254
|
}>;
|
|
248
255
|
}>>;
|
|
249
256
|
//# sourceMappingURL=event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/routers/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/routers/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4etB,CAAC"}
|
package/dist/routers/file.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const fileRouter: import("@trpc/server
|
|
2
|
+
export declare const fileRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: import("../trpc").Context;
|
|
4
4
|
meta: object;
|
|
5
5
|
errorShape: {
|
|
6
6
|
data: {
|
|
7
7
|
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
-
code: import("@trpc/server
|
|
8
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
9
9
|
httpStatus: number;
|
|
10
10
|
path?: string;
|
|
11
11
|
stack?: string;
|
|
12
12
|
};
|
|
13
13
|
message: string;
|
|
14
|
-
code: import("@trpc/server
|
|
14
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
15
15
|
};
|
|
16
16
|
transformer: false;
|
|
17
|
-
}, import("@trpc/server
|
|
17
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
18
18
|
getSignedUrl: import("@trpc/server").TRPCMutationProcedure<{
|
|
19
19
|
input: {
|
|
20
20
|
fileId: string;
|
|
@@ -22,6 +22,7 @@ export declare const fileRouter: import("@trpc/server/dist/unstable-core-do-not-
|
|
|
22
22
|
output: {
|
|
23
23
|
signedUrl: string;
|
|
24
24
|
};
|
|
25
|
+
meta: object;
|
|
25
26
|
}>;
|
|
26
27
|
}>>;
|
|
27
28
|
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/routers/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/routers/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;GAwFrB,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const sectionRouter: import("@trpc/server
|
|
2
|
+
export declare const sectionRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: import("../trpc").Context;
|
|
4
4
|
meta: object;
|
|
5
5
|
errorShape: {
|
|
6
6
|
data: {
|
|
7
7
|
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
-
code: import("@trpc/server
|
|
8
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
9
9
|
httpStatus: number;
|
|
10
10
|
path?: string;
|
|
11
11
|
stack?: string;
|
|
12
12
|
};
|
|
13
13
|
message: string;
|
|
14
|
-
code: import("@trpc/server
|
|
14
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
15
15
|
};
|
|
16
16
|
transformer: false;
|
|
17
|
-
}, import("@trpc/server
|
|
17
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
18
18
|
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
19
19
|
input: {
|
|
20
20
|
name: string;
|
|
@@ -25,6 +25,7 @@ export declare const sectionRouter: import("@trpc/server/dist/unstable-core-do-n
|
|
|
25
25
|
name: string;
|
|
26
26
|
classId: string;
|
|
27
27
|
};
|
|
28
|
+
meta: object;
|
|
28
29
|
}>;
|
|
29
30
|
update: import("@trpc/server").TRPCMutationProcedure<{
|
|
30
31
|
input: {
|
|
@@ -37,6 +38,7 @@ export declare const sectionRouter: import("@trpc/server/dist/unstable-core-do-n
|
|
|
37
38
|
name: string;
|
|
38
39
|
classId: string;
|
|
39
40
|
};
|
|
41
|
+
meta: object;
|
|
40
42
|
}>;
|
|
41
43
|
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
42
44
|
input: {
|
|
@@ -46,6 +48,7 @@ export declare const sectionRouter: import("@trpc/server/dist/unstable-core-do-n
|
|
|
46
48
|
output: {
|
|
47
49
|
id: string;
|
|
48
50
|
};
|
|
51
|
+
meta: object;
|
|
49
52
|
}>;
|
|
50
53
|
}>>;
|
|
51
54
|
//# sourceMappingURL=section.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/routers/section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/routers/section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoHxB,CAAC"}
|
package/dist/routers/user.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const userRouter: import("@trpc/server
|
|
2
|
+
export declare const userRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
3
|
ctx: import("../trpc").Context;
|
|
4
4
|
meta: object;
|
|
5
5
|
errorShape: {
|
|
6
6
|
data: {
|
|
7
7
|
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
-
code: import("@trpc/server
|
|
8
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
9
9
|
httpStatus: number;
|
|
10
10
|
path?: string;
|
|
11
11
|
stack?: string;
|
|
12
12
|
};
|
|
13
13
|
message: string;
|
|
14
|
-
code: import("@trpc/server
|
|
14
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
15
15
|
};
|
|
16
16
|
transformer: false;
|
|
17
|
-
}, import("@trpc/server
|
|
17
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
18
18
|
getProfile: import("@trpc/server").TRPCQueryProcedure<{
|
|
19
19
|
input: void;
|
|
20
20
|
output: {
|
|
@@ -25,6 +25,7 @@ export declare const userRouter: import("@trpc/server/dist/unstable-core-do-not-
|
|
|
25
25
|
userId: string;
|
|
26
26
|
} | null;
|
|
27
27
|
};
|
|
28
|
+
meta: object;
|
|
28
29
|
}>;
|
|
29
30
|
updateProfile: import("@trpc/server").TRPCMutationProcedure<{
|
|
30
31
|
input: {
|
|
@@ -44,6 +45,7 @@ export declare const userRouter: import("@trpc/server/dist/unstable-core-do-not-
|
|
|
44
45
|
userId: string;
|
|
45
46
|
} | null;
|
|
46
47
|
};
|
|
48
|
+
meta: object;
|
|
47
49
|
}>;
|
|
48
50
|
}>>;
|
|
49
51
|
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/routers/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/routers/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DrB,CAAC"}
|
package/dist/trpc.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TRPCError } from '@trpc/server';
|
|
1
2
|
import { Request, Response } from 'express';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
interface CreateContextOptions {
|
|
@@ -16,132 +17,84 @@ export type Context = {
|
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
export declare const createTRPCContext: (opts: CreateContextOptions) => Promise<Context>;
|
|
19
|
-
export declare const t: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
transformer: false;
|
|
35
|
-
}>;
|
|
36
|
-
procedure: import("@trpc/server/dist/unstable-core-do-not-import").ProcedureBuilder<Context, object, object, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, false>;
|
|
37
|
-
middleware: <$ContextOverrides>(fn: import("@trpc/server/dist/unstable-core-do-not-import").MiddlewareFunction<Context, object, object, $ContextOverrides, unknown>) => import("@trpc/server/dist/unstable-core-do-not-import").MiddlewareBuilder<Context, object, $ContextOverrides, unknown>;
|
|
38
|
-
router: <TInput extends import("@trpc/server/dist/unstable-core-do-not-import").CreateRouterOptions>(input: TInput) => import("@trpc/server/dist/unstable-core-do-not-import").BuiltRouter<{
|
|
39
|
-
ctx: Context;
|
|
40
|
-
meta: object;
|
|
41
|
-
errorShape: {
|
|
42
|
-
data: {
|
|
43
|
-
zodError: z.typeToFlattenedError<any, string> | null;
|
|
44
|
-
code: import("@trpc/server/dist/unstable-core-do-not-import").TRPC_ERROR_CODE_KEY;
|
|
45
|
-
httpStatus: number;
|
|
46
|
-
path?: string;
|
|
47
|
-
stack?: string;
|
|
48
|
-
};
|
|
49
|
-
message: string;
|
|
50
|
-
code: import("@trpc/server/dist/unstable-core-do-not-import").TRPC_ERROR_CODE_NUMBER;
|
|
51
|
-
};
|
|
52
|
-
transformer: false;
|
|
53
|
-
}, import("@trpc/server/dist/unstable-core-do-not-import").DecorateCreateRouterOptions<TInput>>;
|
|
54
|
-
mergeRouters: typeof import("@trpc/server/dist/unstable-core-do-not-import").mergeRouters;
|
|
55
|
-
createCallerFactory: <TRecord extends import("@trpc/server").RouterRecord>(router: Pick<import("@trpc/server/dist/unstable-core-do-not-import").Router<{
|
|
56
|
-
ctx: Context;
|
|
57
|
-
meta: object;
|
|
58
|
-
errorShape: {
|
|
59
|
-
data: {
|
|
60
|
-
zodError: z.typeToFlattenedError<any, string> | null;
|
|
61
|
-
code: import("@trpc/server/dist/unstable-core-do-not-import").TRPC_ERROR_CODE_KEY;
|
|
62
|
-
httpStatus: number;
|
|
63
|
-
path?: string;
|
|
64
|
-
stack?: string;
|
|
65
|
-
};
|
|
66
|
-
message: string;
|
|
67
|
-
code: import("@trpc/server/dist/unstable-core-do-not-import").TRPC_ERROR_CODE_NUMBER;
|
|
68
|
-
};
|
|
69
|
-
transformer: false;
|
|
70
|
-
}, TRecord>, "_def">) => import("@trpc/server/dist/unstable-core-do-not-import").RouterCaller<{
|
|
71
|
-
ctx: Context;
|
|
72
|
-
meta: object;
|
|
73
|
-
errorShape: {
|
|
74
|
-
data: {
|
|
75
|
-
zodError: z.typeToFlattenedError<any, string> | null;
|
|
76
|
-
code: import("@trpc/server/dist/unstable-core-do-not-import").TRPC_ERROR_CODE_KEY;
|
|
77
|
-
httpStatus: number;
|
|
78
|
-
path?: string;
|
|
79
|
-
stack?: string;
|
|
80
|
-
};
|
|
81
|
-
message: string;
|
|
82
|
-
code: import("@trpc/server/dist/unstable-core-do-not-import").TRPC_ERROR_CODE_NUMBER;
|
|
20
|
+
export declare const t: import("@trpc/server").TRPCRootObject<Context, object, {
|
|
21
|
+
errorFormatter({ shape, error }: {
|
|
22
|
+
error: TRPCError;
|
|
23
|
+
type: import("@trpc/server").ProcedureType | "unknown";
|
|
24
|
+
path: string | undefined;
|
|
25
|
+
input: unknown;
|
|
26
|
+
ctx: Context | undefined;
|
|
27
|
+
shape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
28
|
+
}): {
|
|
29
|
+
data: {
|
|
30
|
+
zodError: z.typeToFlattenedError<any, string> | null;
|
|
31
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
32
|
+
httpStatus: number;
|
|
33
|
+
path?: string;
|
|
34
|
+
stack?: string;
|
|
83
35
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
};
|
|
87
|
-
|
|
36
|
+
message: string;
|
|
37
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
38
|
+
};
|
|
39
|
+
}, {
|
|
88
40
|
ctx: Context;
|
|
89
41
|
meta: object;
|
|
90
42
|
errorShape: {
|
|
91
43
|
data: {
|
|
92
44
|
zodError: z.typeToFlattenedError<any, string> | null;
|
|
93
|
-
code: import("@trpc/server
|
|
45
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
94
46
|
httpStatus: number;
|
|
95
47
|
path?: string;
|
|
96
48
|
stack?: string;
|
|
97
49
|
};
|
|
98
50
|
message: string;
|
|
99
|
-
code: import("@trpc/server
|
|
51
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
100
52
|
};
|
|
101
53
|
transformer: false;
|
|
102
|
-
}
|
|
103
|
-
export declare const
|
|
104
|
-
export declare const protectedProcedure: import("@trpc/server/dist/unstable-core-do-not-import").ProcedureBuilder<Context, object, {}, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, false>;
|
|
105
|
-
export declare const protectedClassMemberProcedure: import("@trpc/server/dist/unstable-core-do-not-import").ProcedureBuilder<Context, object, {}, z.objectInputType<{
|
|
106
|
-
classId: z.ZodString;
|
|
107
|
-
}, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
|
|
108
|
-
classId: z.ZodString;
|
|
109
|
-
}, z.ZodTypeAny, "passthrough">, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, false>;
|
|
110
|
-
export declare const protectedTeacherProcedure: import("@trpc/server/dist/unstable-core-do-not-import").ProcedureBuilder<Context, object, {}, z.objectInputType<{
|
|
111
|
-
classId: z.ZodString;
|
|
112
|
-
}, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
|
|
113
|
-
classId: z.ZodString;
|
|
114
|
-
}, z.ZodTypeAny, "passthrough">, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, typeof import("@trpc/server/dist/unstable-core-do-not-import").unsetMarker, false>;
|
|
115
|
-
export declare const createCallerFactory: <TRecord extends import("@trpc/server").RouterRecord>(router: Pick<import("@trpc/server/dist/unstable-core-do-not-import").Router<{
|
|
54
|
+
}>;
|
|
55
|
+
export declare const createTRPCRouter: import("@trpc/server").TRPCRouterBuilder<{
|
|
116
56
|
ctx: Context;
|
|
117
57
|
meta: object;
|
|
118
58
|
errorShape: {
|
|
119
59
|
data: {
|
|
120
60
|
zodError: z.typeToFlattenedError<any, string> | null;
|
|
121
|
-
code: import("@trpc/server
|
|
61
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
122
62
|
httpStatus: number;
|
|
123
63
|
path?: string;
|
|
124
64
|
stack?: string;
|
|
125
65
|
};
|
|
126
66
|
message: string;
|
|
127
|
-
code: import("@trpc/server
|
|
67
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
128
68
|
};
|
|
129
69
|
transformer: false;
|
|
130
|
-
}
|
|
70
|
+
}>;
|
|
71
|
+
export declare const publicProcedure: import("@trpc/server").TRPCProcedureBuilder<Context, object, {}, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
72
|
+
export declare const protectedProcedure: import("@trpc/server").TRPCProcedureBuilder<Context, object, {}, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
73
|
+
export declare const protectedClassMemberProcedure: import("@trpc/server").TRPCProcedureBuilder<Context, object, {}, z.objectInputType<{
|
|
74
|
+
classId: z.ZodString;
|
|
75
|
+
}, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
|
|
76
|
+
classId: z.ZodString;
|
|
77
|
+
}, z.ZodTypeAny, "passthrough">, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
78
|
+
export declare const protectedTeacherProcedure: import("@trpc/server").TRPCProcedureBuilder<Context, object, {}, z.objectInputType<{
|
|
79
|
+
classId: z.ZodString;
|
|
80
|
+
}, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
|
|
81
|
+
classId: z.ZodString;
|
|
82
|
+
}, z.ZodTypeAny, "passthrough">, import("@trpc/server").TRPCUnsetMarker, import("@trpc/server").TRPCUnsetMarker, false>;
|
|
83
|
+
export declare const createCallerFactory: import("@trpc/server").TRPCRouterCallerFactory<{
|
|
131
84
|
ctx: Context;
|
|
132
85
|
meta: object;
|
|
133
86
|
errorShape: {
|
|
134
87
|
data: {
|
|
135
88
|
zodError: z.typeToFlattenedError<any, string> | null;
|
|
136
|
-
code: import("@trpc/server
|
|
89
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
137
90
|
httpStatus: number;
|
|
138
91
|
path?: string;
|
|
139
92
|
stack?: string;
|
|
140
93
|
};
|
|
141
94
|
message: string;
|
|
142
|
-
code: import("@trpc/server
|
|
95
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
143
96
|
};
|
|
144
97
|
transformer: false;
|
|
145
|
-
}
|
|
98
|
+
}>;
|
|
146
99
|
export {};
|
|
147
100
|
//# sourceMappingURL=trpc.d.ts.map
|
package/dist/trpc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trpc.d.ts","sourceRoot":"","sources":["../src/trpc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trpc.d.ts","sourceRoot":"","sources":["../src/trpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAE,MAAM,cAAc,CAAC;AAMnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,UAAU,oBAAoB;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAC;CACf;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE;QACL,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,MAAM,oBAAoB,KAAG,OAAO,CAAC,OAAO,CAwBnF,CAAC;AAEF,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBZ,CAAC;AAOH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAAW,CAAC;AACzC,eAAO,MAAM,eAAe,yOAAqC,CAAC;AAGlE,eAAO,MAAM,kBAAkB,yOAAgC,CAAC;AAChE,eAAO,MAAM,6BAA6B;;;;uHAEnB,CAAC;AACxB,eAAO,MAAM,yBAAyB;;;;uHAEd,CAAC;AAIzB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studious-lms/server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Backend server for Studious application",
|
|
5
5
|
"main": "dist/exportType.js",
|
|
6
6
|
"types": "dist/exportType.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist/**/*",
|
|
9
|
-
"generated/**/*",
|
|
10
|
-
"README.md"
|
|
11
|
-
],
|
|
12
7
|
"scripts": {
|
|
13
8
|
"dev": "ts-node-dev -r tsconfig-paths/register --respawn --transpile-only src/index.ts",
|
|
14
9
|
"build": "tsc",
|
|
@@ -19,7 +14,7 @@
|
|
|
19
14
|
"dependencies": {
|
|
20
15
|
"@google-cloud/storage": "^7.16.0",
|
|
21
16
|
"@prisma/client": "^6.7.0",
|
|
22
|
-
"@trpc/server": "^11.
|
|
17
|
+
"@trpc/server": "^11.4.3",
|
|
23
18
|
"bcryptjs": "^3.0.2",
|
|
24
19
|
"cors": "^2.8.5",
|
|
25
20
|
"date-fns": "^4.1.0",
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// This is your Prisma schema file,
|
|
2
|
+
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
3
|
+
|
|
4
|
+
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
5
|
+
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
6
|
+
|
|
7
|
+
generator client {
|
|
8
|
+
provider = "prisma-client-js"
|
|
9
|
+
// output = "../generated/prisma"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
datasource db {
|
|
13
|
+
provider = "postgresql"
|
|
14
|
+
url = env("DATABASE_URL")
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
enum AssignmentType {
|
|
18
|
+
HOMEWORK
|
|
19
|
+
QUIZ
|
|
20
|
+
TEST
|
|
21
|
+
PROJECT
|
|
22
|
+
ESSAY
|
|
23
|
+
DISCUSSION
|
|
24
|
+
PRESENTATION
|
|
25
|
+
LAB
|
|
26
|
+
OTHER
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
model User {
|
|
31
|
+
id String @id @default(uuid())
|
|
32
|
+
username String
|
|
33
|
+
email String
|
|
34
|
+
password String
|
|
35
|
+
profile UserProfile?
|
|
36
|
+
verified Boolean @default(false)
|
|
37
|
+
|
|
38
|
+
profileId String? @unique
|
|
39
|
+
|
|
40
|
+
teacherIn Class[] @relation("UserTeacherToClass")
|
|
41
|
+
studentIn Class[] @relation("UserStudentToClass")
|
|
42
|
+
|
|
43
|
+
submissions Submission[]
|
|
44
|
+
sessions Session[]
|
|
45
|
+
files File[]
|
|
46
|
+
assignments Assignment[]
|
|
47
|
+
events Event[]
|
|
48
|
+
announcements Announcement[]
|
|
49
|
+
|
|
50
|
+
presentAttendance Attendance[] @relation("PresentAttendance")
|
|
51
|
+
lateAttendance Attendance[] @relation("LateAttendance")
|
|
52
|
+
absentAttendance Attendance[] @relation("AbsentAttendance")
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
model UserProfile {
|
|
56
|
+
id String @id @default(uuid())
|
|
57
|
+
userId String @unique
|
|
58
|
+
user User? @relation(fields: [userId], references: [id])
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
model Class {
|
|
63
|
+
id String @id @default(uuid())
|
|
64
|
+
name String
|
|
65
|
+
subject String
|
|
66
|
+
color String? @default("#3B82F6")
|
|
67
|
+
section String
|
|
68
|
+
announcements Announcement[]
|
|
69
|
+
assignments Assignment[]
|
|
70
|
+
attendance Attendance[]
|
|
71
|
+
events Event[]
|
|
72
|
+
sections Section[]
|
|
73
|
+
sessions Session[]
|
|
74
|
+
students User[] @relation("UserStudentToClass")
|
|
75
|
+
teachers User[] @relation("UserTeacherToClass")
|
|
76
|
+
markSchemes MarkScheme[] @relation("ClassToMarkScheme")
|
|
77
|
+
gradingBoundaries GradingBoundary[] @relation("ClassToGradingBoundary")
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
model MarkScheme {
|
|
81
|
+
id String @id @default(uuid())
|
|
82
|
+
classId String
|
|
83
|
+
class Class[] @relation("ClassToMarkScheme")
|
|
84
|
+
structured String
|
|
85
|
+
assignments Assignment[]
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
model GradingBoundary {
|
|
89
|
+
id String @id @default(uuid())
|
|
90
|
+
classId String
|
|
91
|
+
class Class[] @relation("ClassToGradingBoundary")
|
|
92
|
+
structured String
|
|
93
|
+
assignments Assignment[]
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
model File {
|
|
97
|
+
id String @id @default(uuid())
|
|
98
|
+
name String
|
|
99
|
+
path String
|
|
100
|
+
size Int?
|
|
101
|
+
type String
|
|
102
|
+
user User? @relation(fields: [userId], references: [id])
|
|
103
|
+
userId String?
|
|
104
|
+
uploadedAt DateTime? @default(now())
|
|
105
|
+
|
|
106
|
+
// Thumbnail relationship
|
|
107
|
+
thumbnail File? @relation("Thumbnail", fields: [thumbnailId], references: [id])
|
|
108
|
+
thumbnailId String? @unique
|
|
109
|
+
originalFile File? @relation("Thumbnail")
|
|
110
|
+
|
|
111
|
+
assignment Assignment? @relation(fields: [assignmentId], references: [id], onDelete: Cascade)
|
|
112
|
+
assignmentId String?
|
|
113
|
+
|
|
114
|
+
submission Submission? @relation("SubmissionFile", fields: [submissionId], references: [id], onDelete: Cascade)
|
|
115
|
+
submissionId String?
|
|
116
|
+
|
|
117
|
+
annotations Submission? @relation("SubmissionAnnotations", fields: [annotationId], references: [id], onDelete: Cascade)
|
|
118
|
+
annotationId String?
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
model Assignment {
|
|
122
|
+
id String @id @default(uuid())
|
|
123
|
+
title String
|
|
124
|
+
instructions String
|
|
125
|
+
dueDate DateTime
|
|
126
|
+
createdAt DateTime? @default(now())
|
|
127
|
+
modifiedAt DateTime? @updatedAt
|
|
128
|
+
teacher User @relation(fields: [teacherId], references: [id], onDelete: NoAction)
|
|
129
|
+
teacherId String
|
|
130
|
+
class Class @relation(fields: [classId], references: [id], onDelete: Cascade)
|
|
131
|
+
classId String
|
|
132
|
+
attachments File[]
|
|
133
|
+
submissions Submission[]
|
|
134
|
+
section Section? @relation(fields: [sectionId], references: [id], onDelete: Cascade)
|
|
135
|
+
sectionId String?
|
|
136
|
+
graded Boolean @default(false)
|
|
137
|
+
maxGrade Int? @default(0)
|
|
138
|
+
weight Float @default(1)
|
|
139
|
+
type AssignmentType @default(HOMEWORK)
|
|
140
|
+
eventAttached Event? @relation(fields: [eventId], references: [id], onDelete: NoAction)
|
|
141
|
+
eventId String?
|
|
142
|
+
markScheme MarkScheme? @relation(fields: [markSchemeId], references: [id], onDelete: Cascade)
|
|
143
|
+
markSchemeId String?
|
|
144
|
+
gradingBoundary GradingBoundary? @relation(fields: [gradingBoundaryId], references: [id], onDelete: Cascade)
|
|
145
|
+
gradingBoundaryId String?
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
model Announcement {
|
|
149
|
+
id String @id @default(uuid())
|
|
150
|
+
remarks String
|
|
151
|
+
teacher User @relation(fields: [teacherId], references: [id])
|
|
152
|
+
teacherId String
|
|
153
|
+
createdAt DateTime @default(now())
|
|
154
|
+
class Class @relation(fields: [classId], references: [id], onDelete: Cascade)
|
|
155
|
+
classId String
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
model Submission {
|
|
159
|
+
id String @id @default(uuid())
|
|
160
|
+
createdAt DateTime @default(now())
|
|
161
|
+
modifiedAt DateTime @default(now())
|
|
162
|
+
|
|
163
|
+
assignment Assignment @relation(fields: [assignmentId], references: [id], onDelete: Cascade)
|
|
164
|
+
assignmentId String
|
|
165
|
+
|
|
166
|
+
student User @relation(fields: [studentId], references: [id])
|
|
167
|
+
studentId String
|
|
168
|
+
|
|
169
|
+
attachments File[] @relation("SubmissionFile")
|
|
170
|
+
annotations File[] @relation("SubmissionAnnotations")
|
|
171
|
+
|
|
172
|
+
gradeReceived Int?
|
|
173
|
+
|
|
174
|
+
rubricState String?
|
|
175
|
+
|
|
176
|
+
submittedAt DateTime?
|
|
177
|
+
submitted Boolean? @default(false)
|
|
178
|
+
returned Boolean? @default(false)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
model Section {
|
|
182
|
+
id String @id @default(uuid())
|
|
183
|
+
name String
|
|
184
|
+
classId String
|
|
185
|
+
class Class @relation(fields: [classId], references: [id], onDelete: Cascade)
|
|
186
|
+
assignments Assignment[]
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
model Session {
|
|
190
|
+
id String @id @default(uuid())
|
|
191
|
+
createdAt DateTime? @default(now())
|
|
192
|
+
expiresAt DateTime?
|
|
193
|
+
userId String?
|
|
194
|
+
user User? @relation(fields: [userId], references: [id], onDelete: NoAction)
|
|
195
|
+
classId String?
|
|
196
|
+
class Class? @relation(fields: [classId], references: [id], onDelete: Cascade)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
model Event {
|
|
200
|
+
id String @id @default(uuid())
|
|
201
|
+
name String?
|
|
202
|
+
startTime DateTime
|
|
203
|
+
endTime DateTime
|
|
204
|
+
location String?
|
|
205
|
+
remarks String?
|
|
206
|
+
userId String?
|
|
207
|
+
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
208
|
+
classId String?
|
|
209
|
+
class Class? @relation(fields: [classId], references: [id], onDelete: Cascade)
|
|
210
|
+
color String? @default("#3B82F6")
|
|
211
|
+
assignmentsAttached Assignment[]
|
|
212
|
+
attendance Attendance[]
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
model Attendance {
|
|
216
|
+
id String @id @default(uuid())
|
|
217
|
+
date DateTime @default(now())
|
|
218
|
+
|
|
219
|
+
class Class @relation(fields: [classId], references: [id], onDelete: Cascade)
|
|
220
|
+
classId String
|
|
221
|
+
|
|
222
|
+
event Event? @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
|
223
|
+
eventId String?
|
|
224
|
+
|
|
225
|
+
present User[] @relation("PresentAttendance")
|
|
226
|
+
late User[] @relation("LateAttendance")
|
|
227
|
+
absent User[] @relation("AbsentAttendance")
|
|
228
|
+
}
|