@studious-lms/server 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/package.json +1 -6
  2. package/prisma/schema.prisma +228 -0
  3. package/src/exportType.ts +9 -0
  4. package/src/index.ts +94 -0
  5. package/src/lib/fileUpload.ts +163 -0
  6. package/src/lib/googleCloudStorage.ts +94 -0
  7. package/src/lib/prisma.ts +16 -0
  8. package/src/lib/thumbnailGenerator.ts +185 -0
  9. package/src/logger.ts +163 -0
  10. package/src/middleware/auth.ts +191 -0
  11. package/src/middleware/logging.ts +54 -0
  12. package/src/routers/_app.ts +34 -0
  13. package/src/routers/agenda.ts +79 -0
  14. package/src/routers/announcement.ts +134 -0
  15. package/src/routers/assignment.ts +1614 -0
  16. package/src/routers/attendance.ts +284 -0
  17. package/src/routers/auth.ts +286 -0
  18. package/src/routers/class.ts +753 -0
  19. package/src/routers/event.ts +509 -0
  20. package/src/routers/file.ts +96 -0
  21. package/src/routers/section.ts +138 -0
  22. package/src/routers/user.ts +82 -0
  23. package/src/socket/handlers.ts +143 -0
  24. package/src/trpc.ts +90 -0
  25. package/src/types/trpc.ts +15 -0
  26. package/src/utils/email.ts +11 -0
  27. package/src/utils/generateInviteCode.ts +8 -0
  28. package/src/utils/logger.ts +156 -0
  29. package/tsconfig.json +17 -0
  30. package/generated/prisma/client.d.ts +0 -1
  31. package/generated/prisma/client.js +0 -4
  32. package/generated/prisma/default.d.ts +0 -1
  33. package/generated/prisma/default.js +0 -4
  34. package/generated/prisma/edge.d.ts +0 -1
  35. package/generated/prisma/edge.js +0 -389
  36. package/generated/prisma/index-browser.js +0 -375
  37. package/generated/prisma/index.d.ts +0 -34865
  38. package/generated/prisma/index.js +0 -410
  39. package/generated/prisma/libquery_engine-darwin-arm64.dylib.node +0 -0
  40. package/generated/prisma/package.json +0 -140
  41. package/generated/prisma/runtime/edge-esm.js +0 -34
  42. package/generated/prisma/runtime/edge.js +0 -34
  43. package/generated/prisma/runtime/index-browser.d.ts +0 -370
  44. package/generated/prisma/runtime/index-browser.js +0 -16
  45. package/generated/prisma/runtime/library.d.ts +0 -3647
  46. package/generated/prisma/runtime/library.js +0 -146
  47. package/generated/prisma/runtime/react-native.js +0 -83
  48. package/generated/prisma/runtime/wasm.js +0 -35
  49. package/generated/prisma/schema.prisma +0 -304
  50. package/generated/prisma/wasm.d.ts +0 -1
  51. package/generated/prisma/wasm.js +0 -375
@@ -1,375 +0,0 @@
1
-
2
- /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
- /* eslint-disable */
4
-
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
-
7
- const {
8
- Decimal,
9
- objectEnumValues,
10
- makeStrictEnum,
11
- Public,
12
- getRuntime,
13
- skip
14
- } = require('./runtime/index-browser.js')
15
-
16
-
17
- const Prisma = {}
18
-
19
- exports.Prisma = Prisma
20
- exports.$Enums = {}
21
-
22
- /**
23
- * Prisma Client JS version: 6.7.0
24
- * Query Engine version: 3cff47a7f5d65c3ea74883f1d736e41d68ce91ed
25
- */
26
- Prisma.prismaVersion = {
27
- client: "6.7.0",
28
- engine: "3cff47a7f5d65c3ea74883f1d736e41d68ce91ed"
29
- }
30
-
31
- Prisma.PrismaClientKnownRequestError = () => {
32
- const runtimeName = getRuntime().prettyName;
33
- throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
34
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
35
- )};
36
- Prisma.PrismaClientUnknownRequestError = () => {
37
- const runtimeName = getRuntime().prettyName;
38
- throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
39
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
40
- )}
41
- Prisma.PrismaClientRustPanicError = () => {
42
- const runtimeName = getRuntime().prettyName;
43
- throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
44
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
45
- )}
46
- Prisma.PrismaClientInitializationError = () => {
47
- const runtimeName = getRuntime().prettyName;
48
- throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
49
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
50
- )}
51
- Prisma.PrismaClientValidationError = () => {
52
- const runtimeName = getRuntime().prettyName;
53
- throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
54
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
55
- )}
56
- Prisma.Decimal = Decimal
57
-
58
- /**
59
- * Re-export of sql-template-tag
60
- */
61
- Prisma.sql = () => {
62
- const runtimeName = getRuntime().prettyName;
63
- throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
64
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
65
- )}
66
- Prisma.empty = () => {
67
- const runtimeName = getRuntime().prettyName;
68
- throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
69
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
70
- )}
71
- Prisma.join = () => {
72
- const runtimeName = getRuntime().prettyName;
73
- throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
74
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
75
- )}
76
- Prisma.raw = () => {
77
- const runtimeName = getRuntime().prettyName;
78
- throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
79
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
80
- )}
81
- Prisma.validator = Public.validator
82
-
83
- /**
84
- * Extensions
85
- */
86
- Prisma.getExtensionContext = () => {
87
- const runtimeName = getRuntime().prettyName;
88
- throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
89
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
90
- )}
91
- Prisma.defineExtension = () => {
92
- const runtimeName = getRuntime().prettyName;
93
- throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
94
- In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
95
- )}
96
-
97
- /**
98
- * Shorthand utilities for JSON filtering
99
- */
100
- Prisma.DbNull = objectEnumValues.instances.DbNull
101
- Prisma.JsonNull = objectEnumValues.instances.JsonNull
102
- Prisma.AnyNull = objectEnumValues.instances.AnyNull
103
-
104
- Prisma.NullTypes = {
105
- DbNull: objectEnumValues.classes.DbNull,
106
- JsonNull: objectEnumValues.classes.JsonNull,
107
- AnyNull: objectEnumValues.classes.AnyNull
108
- }
109
-
110
-
111
-
112
- /**
113
- * Enums
114
- */
115
-
116
- exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
117
- ReadUncommitted: 'ReadUncommitted',
118
- ReadCommitted: 'ReadCommitted',
119
- RepeatableRead: 'RepeatableRead',
120
- Serializable: 'Serializable'
121
- });
122
-
123
- exports.Prisma.InstitutionScalarFieldEnum = {
124
- id: 'id',
125
- name: 'name',
126
- settings: 'settings',
127
- address: 'address',
128
- phone: 'phone',
129
- email: 'email',
130
- website: 'website',
131
- logo: 'logo',
132
- academicYear: 'academicYear',
133
- term: 'term',
134
- startDate: 'startDate',
135
- endDate: 'endDate',
136
- gradingSystem: 'gradingSystem',
137
- attendancePolicy: 'attendancePolicy',
138
- academicCalendar: 'academicCalendar',
139
- tuitionRates: 'tuitionRates',
140
- paymentSchedule: 'paymentSchedule',
141
- notificationPreferences: 'notificationPreferences',
142
- communicationTemplates: 'communicationTemplates'
143
- };
144
-
145
- exports.Prisma.DepartmentScalarFieldEnum = {
146
- id: 'id',
147
- name: 'name',
148
- description: 'description',
149
- headId: 'headId',
150
- institutionId: 'institutionId',
151
- createdAt: 'createdAt',
152
- updatedAt: 'updatedAt'
153
- };
154
-
155
- exports.Prisma.CourseScalarFieldEnum = {
156
- id: 'id',
157
- code: 'code',
158
- name: 'name',
159
- description: 'description',
160
- credits: 'credits',
161
- departmentId: 'departmentId',
162
- institutionId: 'institutionId',
163
- prerequisites: 'prerequisites',
164
- syllabus: 'syllabus',
165
- createdAt: 'createdAt',
166
- updatedAt: 'updatedAt'
167
- };
168
-
169
- exports.Prisma.ScheduleScalarFieldEnum = {
170
- id: 'id',
171
- name: 'name',
172
- startDate: 'startDate',
173
- endDate: 'endDate',
174
- institutionId: 'institutionId',
175
- type: 'type',
176
- description: 'description',
177
- createdAt: 'createdAt',
178
- updatedAt: 'updatedAt'
179
- };
180
-
181
- exports.Prisma.UserScalarFieldEnum = {
182
- id: 'id',
183
- username: 'username',
184
- password: 'password',
185
- profile: 'profile',
186
- institutionId: 'institutionId',
187
- role: 'role',
188
- status: 'status',
189
- enrollmentDate: 'enrollmentDate',
190
- graduationDate: 'graduationDate',
191
- studentId: 'studentId',
192
- employeeId: 'employeeId',
193
- emergencyContact: 'emergencyContact',
194
- medicalInfo: 'medicalInfo',
195
- academicInfo: 'academicInfo'
196
- };
197
-
198
- exports.Prisma.ClassScalarFieldEnum = {
199
- id: 'id',
200
- name: 'name',
201
- subject: 'subject',
202
- section: 'section',
203
- institutionId: 'institutionId'
204
- };
205
-
206
- exports.Prisma.FileScalarFieldEnum = {
207
- id: 'id',
208
- name: 'name',
209
- path: 'path',
210
- size: 'size',
211
- type: 'type',
212
- userId: 'userId',
213
- uploadedAt: 'uploadedAt',
214
- thumbnailId: 'thumbnailId',
215
- assignmentId: 'assignmentId',
216
- submissionId: 'submissionId',
217
- annotationId: 'annotationId'
218
- };
219
-
220
- exports.Prisma.AssignmentScalarFieldEnum = {
221
- id: 'id',
222
- title: 'title',
223
- instructions: 'instructions',
224
- dueDate: 'dueDate',
225
- createdAt: 'createdAt',
226
- modifiedAt: 'modifiedAt',
227
- teacherId: 'teacherId',
228
- classId: 'classId',
229
- sectionId: 'sectionId',
230
- graded: 'graded',
231
- maxGrade: 'maxGrade',
232
- weight: 'weight',
233
- type: 'type',
234
- rubric: 'rubric'
235
- };
236
-
237
- exports.Prisma.AnnouncementScalarFieldEnum = {
238
- id: 'id',
239
- remarks: 'remarks',
240
- teacherId: 'teacherId',
241
- createdAt: 'createdAt',
242
- classId: 'classId',
243
- institutionId: 'institutionId'
244
- };
245
-
246
- exports.Prisma.SubmissionScalarFieldEnum = {
247
- id: 'id',
248
- createdAt: 'createdAt',
249
- modifiedAt: 'modifiedAt',
250
- assignmentId: 'assignmentId',
251
- studentId: 'studentId',
252
- gradeReceived: 'gradeReceived',
253
- submittedAt: 'submittedAt',
254
- submitted: 'submitted',
255
- returned: 'returned'
256
- };
257
-
258
- exports.Prisma.SectionScalarFieldEnum = {
259
- id: 'id',
260
- name: 'name',
261
- classId: 'classId'
262
- };
263
-
264
- exports.Prisma.SessionScalarFieldEnum = {
265
- id: 'id',
266
- createdAt: 'createdAt',
267
- expiresAt: 'expiresAt',
268
- userId: 'userId',
269
- classId: 'classId'
270
- };
271
-
272
- exports.Prisma.EventScalarFieldEnum = {
273
- id: 'id',
274
- name: 'name',
275
- startTime: 'startTime',
276
- endTime: 'endTime',
277
- location: 'location',
278
- remarks: 'remarks',
279
- userId: 'userId',
280
- classId: 'classId',
281
- institutionId: 'institutionId'
282
- };
283
-
284
- exports.Prisma.AttendanceScalarFieldEnum = {
285
- id: 'id',
286
- date: 'date',
287
- classId: 'classId',
288
- eventId: 'eventId'
289
- };
290
-
291
- exports.Prisma.SortOrder = {
292
- asc: 'asc',
293
- desc: 'desc'
294
- };
295
-
296
- exports.Prisma.NullableJsonNullValueInput = {
297
- DbNull: Prisma.DbNull,
298
- JsonNull: Prisma.JsonNull
299
- };
300
-
301
- exports.Prisma.QueryMode = {
302
- default: 'default',
303
- insensitive: 'insensitive'
304
- };
305
-
306
- exports.Prisma.JsonNullValueFilter = {
307
- DbNull: Prisma.DbNull,
308
- JsonNull: Prisma.JsonNull,
309
- AnyNull: Prisma.AnyNull
310
- };
311
-
312
- exports.Prisma.NullsOrder = {
313
- first: 'first',
314
- last: 'last'
315
- };
316
- exports.AssignmentType = exports.$Enums.AssignmentType = {
317
- HOMEWORK: 'HOMEWORK',
318
- QUIZ: 'QUIZ',
319
- TEST: 'TEST',
320
- PROJECT: 'PROJECT',
321
- ESSAY: 'ESSAY',
322
- DISCUSSION: 'DISCUSSION',
323
- PRESENTATION: 'PRESENTATION',
324
- LAB: 'LAB',
325
- OTHER: 'OTHER',
326
- ANNOUNCEMENT: 'ANNOUNCEMENT'
327
- };
328
-
329
- exports.Prisma.ModelName = {
330
- Institution: 'Institution',
331
- Department: 'Department',
332
- Course: 'Course',
333
- Schedule: 'Schedule',
334
- User: 'User',
335
- Class: 'Class',
336
- File: 'File',
337
- Assignment: 'Assignment',
338
- Announcement: 'Announcement',
339
- Submission: 'Submission',
340
- Section: 'Section',
341
- Session: 'Session',
342
- Event: 'Event',
343
- Attendance: 'Attendance'
344
- };
345
-
346
- /**
347
- * This is a stub Prisma Client that will error at runtime if called.
348
- */
349
- class PrismaClient {
350
- constructor() {
351
- return new Proxy(this, {
352
- get(target, prop) {
353
- let message
354
- const runtime = getRuntime()
355
- if (runtime.isEdge) {
356
- message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
357
- - Use Prisma Accelerate: https://pris.ly/d/accelerate
358
- - Use Driver Adapters: https://pris.ly/d/driver-adapters
359
- `;
360
- } else {
361
- message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
362
- }
363
-
364
- message += `
365
- If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
366
-
367
- throw new Error(message)
368
- }
369
- })
370
- }
371
- }
372
-
373
- exports.PrismaClient = PrismaClient
374
-
375
- Object.assign(exports, Prisma)