@studious-lms/server 1.0.7 → 1.1.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/API_SPECIFICATION.md +352 -8
- package/dist/exportType.d.ts +3 -3
- package/dist/exportType.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/fileUpload.js +3 -3
- package/dist/lib/thumbnailGenerator.js +2 -2
- package/dist/middleware/auth.js +1 -1
- package/dist/middleware/logging.js +1 -1
- package/dist/routers/_app.d.ts +64 -64
- package/dist/routers/_app.js +14 -14
- package/dist/routers/agenda.d.ts +2 -2
- package/dist/routers/agenda.js +2 -2
- package/dist/routers/announcement.d.ts +2 -2
- package/dist/routers/announcement.js +2 -2
- package/dist/routers/assignment.d.ts +2 -2
- package/dist/routers/assignment.js +4 -4
- package/dist/routers/attendance.d.ts +2 -2
- package/dist/routers/attendance.js +2 -2
- package/dist/routers/auth.d.ts +2 -2
- package/dist/routers/auth.js +3 -3
- package/dist/routers/class.d.ts +7 -7
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/class.js +21 -13
- package/dist/routers/event.d.ts +2 -2
- package/dist/routers/event.js +2 -2
- package/dist/routers/file.d.ts +2 -2
- package/dist/routers/file.d.ts.map +1 -1
- package/dist/routers/file.js +4 -11
- package/dist/routers/folder.d.ts +3 -3
- package/dist/routers/folder.js +5 -5
- package/dist/routers/notifications.d.ts +2 -2
- package/dist/routers/notifications.js +2 -2
- package/dist/routers/section.d.ts +2 -2
- package/dist/routers/section.js +2 -2
- package/dist/routers/user.d.ts +2 -2
- package/dist/routers/user.js +3 -3
- package/dist/seedDatabase.d.ts.map +1 -1
- package/dist/seedDatabase.js +21 -3
- package/dist/socket/handlers.js +1 -1
- package/dist/trpc.d.ts +1 -1
- package/dist/trpc.d.ts.map +1 -1
- package/dist/trpc.js +5 -5
- package/dist/types/trpc.d.ts +1 -1
- package/dist/types/trpc.d.ts.map +1 -1
- package/dist/utils/prismaWrapper.js +1 -1
- package/package.json +4 -3
- package/prisma/schema.prisma +2 -2
- package/src/exportType.ts +3 -3
- package/src/index.ts +4 -4
- package/src/lib/fileUpload.ts +3 -3
- package/src/lib/thumbnailGenerator.ts +2 -2
- package/src/middleware/auth.ts +2 -2
- package/src/middleware/logging.ts +2 -2
- package/src/routers/_app.ts +14 -14
- package/src/routers/agenda.ts +2 -2
- package/src/routers/announcement.ts +2 -2
- package/src/routers/assignment.ts +4 -4
- package/src/routers/attendance.ts +2 -2
- package/src/routers/auth.ts +4 -4
- package/src/routers/class.ts +25 -14
- package/src/routers/event.ts +2 -2
- package/src/routers/file.ts +4 -12
- package/src/routers/folder.ts +5 -5
- package/src/routers/notifications.ts +2 -2
- package/src/routers/section.ts +2 -2
- package/src/routers/user.ts +3 -3
- package/src/seedDatabase.ts +25 -3
- package/src/socket/handlers.ts +1 -1
- package/src/trpc.ts +5 -5
- package/src/types/trpc.ts +1 -1
- package/src/utils/prismaWrapper.ts +1 -1
package/API_SPECIFICATION.md
CHANGED
|
@@ -569,6 +569,130 @@ Easy LMS is a comprehensive Learning Management System built with tRPC, Prisma,
|
|
|
569
569
|
|
|
570
570
|
---
|
|
571
571
|
|
|
572
|
+
## 📁 Folder Management
|
|
573
|
+
|
|
574
|
+
### `folder.create`
|
|
575
|
+
**Type**: Mutation
|
|
576
|
+
**Access**: Teacher Only
|
|
577
|
+
**Description**: Create a new folder in a class
|
|
578
|
+
|
|
579
|
+
**Input**:
|
|
580
|
+
```typescript
|
|
581
|
+
{
|
|
582
|
+
classId: string;
|
|
583
|
+
name: string;
|
|
584
|
+
parentFolderId?: string;
|
|
585
|
+
}
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
### `folder.get`
|
|
589
|
+
**Type**: Query
|
|
590
|
+
**Access**: Class Member
|
|
591
|
+
**Description**: Get folder details and contents
|
|
592
|
+
|
|
593
|
+
**Input**:
|
|
594
|
+
```typescript
|
|
595
|
+
{
|
|
596
|
+
classId: string;
|
|
597
|
+
folderId: string;
|
|
598
|
+
}
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
### `folder.getChildFolders`
|
|
602
|
+
**Type**: Query
|
|
603
|
+
**Access**: Class Member
|
|
604
|
+
**Description**: Get child folders of a folder
|
|
605
|
+
|
|
606
|
+
**Input**:
|
|
607
|
+
```typescript
|
|
608
|
+
{
|
|
609
|
+
classId: string;
|
|
610
|
+
folderId: string;
|
|
611
|
+
}
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### `folder.getFolderChildren`
|
|
615
|
+
**Type**: Query
|
|
616
|
+
**Access**: Class Member
|
|
617
|
+
**Description**: Get all children (files and folders) of a folder
|
|
618
|
+
|
|
619
|
+
**Input**:
|
|
620
|
+
```typescript
|
|
621
|
+
{
|
|
622
|
+
classId: string;
|
|
623
|
+
folderId: string;
|
|
624
|
+
}
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### `folder.getRootFolder`
|
|
628
|
+
**Type**: Query
|
|
629
|
+
**Access**: Class Member
|
|
630
|
+
**Description**: Get root folder for a class
|
|
631
|
+
|
|
632
|
+
**Input**:
|
|
633
|
+
```typescript
|
|
634
|
+
{
|
|
635
|
+
classId: string;
|
|
636
|
+
}
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
### `folder.uploadFiles`
|
|
640
|
+
**Type**: Mutation
|
|
641
|
+
**Access**: Teacher Only
|
|
642
|
+
**Description**: Upload files to a folder
|
|
643
|
+
|
|
644
|
+
**Input**:
|
|
645
|
+
```typescript
|
|
646
|
+
{
|
|
647
|
+
classId: string;
|
|
648
|
+
folderId: string;
|
|
649
|
+
files: File[];
|
|
650
|
+
}
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
### `folder.delete`
|
|
654
|
+
**Type**: Mutation
|
|
655
|
+
**Access**: Teacher Only
|
|
656
|
+
**Description**: Delete a folder
|
|
657
|
+
|
|
658
|
+
**Input**:
|
|
659
|
+
```typescript
|
|
660
|
+
{
|
|
661
|
+
classId: string;
|
|
662
|
+
folderId: string;
|
|
663
|
+
}
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
### `folder.move`
|
|
667
|
+
**Type**: Mutation
|
|
668
|
+
**Access**: Teacher Only
|
|
669
|
+
**Description**: Move folder to different parent
|
|
670
|
+
|
|
671
|
+
**Input**:
|
|
672
|
+
```typescript
|
|
673
|
+
{
|
|
674
|
+
classId: string;
|
|
675
|
+
folderId: string;
|
|
676
|
+
newParentFolderId: string;
|
|
677
|
+
}
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
### `folder.rename`
|
|
681
|
+
**Type**: Mutation
|
|
682
|
+
**Access**: Teacher Only
|
|
683
|
+
**Description**: Rename a folder
|
|
684
|
+
|
|
685
|
+
**Input**:
|
|
686
|
+
```typescript
|
|
687
|
+
{
|
|
688
|
+
classId: string;
|
|
689
|
+
folderId: string;
|
|
690
|
+
newName: string;
|
|
691
|
+
}
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
---
|
|
695
|
+
|
|
572
696
|
## 📁 File Management
|
|
573
697
|
|
|
574
698
|
### `file.getSignedUrl`
|
|
@@ -633,6 +757,221 @@ Easy LMS is a comprehensive Learning Management System built with tRPC, Prisma,
|
|
|
633
757
|
|
|
634
758
|
---
|
|
635
759
|
|
|
760
|
+
## 📚 Section Management
|
|
761
|
+
|
|
762
|
+
### `section.create`
|
|
763
|
+
**Type**: Mutation
|
|
764
|
+
**Access**: Teacher Only
|
|
765
|
+
**Description**: Create a new section in a class
|
|
766
|
+
|
|
767
|
+
**Input**:
|
|
768
|
+
```typescript
|
|
769
|
+
{
|
|
770
|
+
classId: string;
|
|
771
|
+
name: string;
|
|
772
|
+
}
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
**Output**:
|
|
776
|
+
```typescript
|
|
777
|
+
{
|
|
778
|
+
id: string;
|
|
779
|
+
name: string;
|
|
780
|
+
classId: string;
|
|
781
|
+
}
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
### `section.update`
|
|
785
|
+
**Type**: Mutation
|
|
786
|
+
**Access**: Teacher Only
|
|
787
|
+
**Description**: Update section name
|
|
788
|
+
|
|
789
|
+
**Input**:
|
|
790
|
+
```typescript
|
|
791
|
+
{
|
|
792
|
+
id: string;
|
|
793
|
+
classId: string;
|
|
794
|
+
name: string;
|
|
795
|
+
}
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
**Output**:
|
|
799
|
+
```typescript
|
|
800
|
+
{
|
|
801
|
+
id: string;
|
|
802
|
+
name: string;
|
|
803
|
+
classId: string;
|
|
804
|
+
}
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
### `section.delete`
|
|
808
|
+
**Type**: Mutation
|
|
809
|
+
**Access**: Teacher Only
|
|
810
|
+
**Description**: Delete a section
|
|
811
|
+
|
|
812
|
+
**Input**:
|
|
813
|
+
```typescript
|
|
814
|
+
{
|
|
815
|
+
id: string;
|
|
816
|
+
classId: string;
|
|
817
|
+
}
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
**Output**:
|
|
821
|
+
```typescript
|
|
822
|
+
{
|
|
823
|
+
id: string;
|
|
824
|
+
}
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
---
|
|
828
|
+
|
|
829
|
+
## 📊 Attendance Management
|
|
830
|
+
|
|
831
|
+
### `attendance.get`
|
|
832
|
+
**Type**: Query
|
|
833
|
+
**Access**: Class Member
|
|
834
|
+
**Description**: Get attendance records for a class
|
|
835
|
+
|
|
836
|
+
**Input**:
|
|
837
|
+
```typescript
|
|
838
|
+
{
|
|
839
|
+
classId: string;
|
|
840
|
+
eventId?: string;
|
|
841
|
+
}
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
**Output**:
|
|
845
|
+
```typescript
|
|
846
|
+
Array<{
|
|
847
|
+
id: string;
|
|
848
|
+
date: Date;
|
|
849
|
+
event?: {
|
|
850
|
+
id: string;
|
|
851
|
+
name: string;
|
|
852
|
+
startTime: Date;
|
|
853
|
+
endTime: Date;
|
|
854
|
+
location: string;
|
|
855
|
+
color: string;
|
|
856
|
+
};
|
|
857
|
+
present: Array<{
|
|
858
|
+
id: string;
|
|
859
|
+
username: string;
|
|
860
|
+
}>;
|
|
861
|
+
late: Array<{
|
|
862
|
+
id: string;
|
|
863
|
+
username: string;
|
|
864
|
+
}>;
|
|
865
|
+
absent: Array<{
|
|
866
|
+
id: string;
|
|
867
|
+
username: string;
|
|
868
|
+
}>;
|
|
869
|
+
}>
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
### `attendance.update`
|
|
873
|
+
**Type**: Mutation
|
|
874
|
+
**Access**: Teacher Only
|
|
875
|
+
**Description**: Update attendance for a class event
|
|
876
|
+
|
|
877
|
+
**Input**:
|
|
878
|
+
```typescript
|
|
879
|
+
{
|
|
880
|
+
classId: string;
|
|
881
|
+
eventId?: string;
|
|
882
|
+
attendance: {
|
|
883
|
+
present: Array<{
|
|
884
|
+
id: string;
|
|
885
|
+
username: string;
|
|
886
|
+
}>;
|
|
887
|
+
late: Array<{
|
|
888
|
+
id: string;
|
|
889
|
+
username: string;
|
|
890
|
+
}>;
|
|
891
|
+
absent: Array<{
|
|
892
|
+
id: string;
|
|
893
|
+
username: string;
|
|
894
|
+
}>;
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
**Output**:
|
|
900
|
+
```typescript
|
|
901
|
+
{
|
|
902
|
+
id: string;
|
|
903
|
+
date: Date;
|
|
904
|
+
event?: {
|
|
905
|
+
id: string;
|
|
906
|
+
name: string;
|
|
907
|
+
startTime: Date;
|
|
908
|
+
endTime: Date;
|
|
909
|
+
location: string;
|
|
910
|
+
};
|
|
911
|
+
present: Array<{
|
|
912
|
+
id: string;
|
|
913
|
+
username: string;
|
|
914
|
+
}>;
|
|
915
|
+
late: Array<{
|
|
916
|
+
id: string;
|
|
917
|
+
username: string;
|
|
918
|
+
}>;
|
|
919
|
+
absent: Array<{
|
|
920
|
+
id: string;
|
|
921
|
+
username: string;
|
|
922
|
+
}>;
|
|
923
|
+
}
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
---
|
|
927
|
+
|
|
928
|
+
## 📅 Agenda Management
|
|
929
|
+
|
|
930
|
+
### `agenda.get`
|
|
931
|
+
**Type**: Query
|
|
932
|
+
**Access**: Protected
|
|
933
|
+
**Description**: Get user's weekly agenda with personal and class events
|
|
934
|
+
|
|
935
|
+
**Input**:
|
|
936
|
+
```typescript
|
|
937
|
+
{
|
|
938
|
+
weekStart: string; // ISO date string
|
|
939
|
+
}
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
**Output**:
|
|
943
|
+
```typescript
|
|
944
|
+
{
|
|
945
|
+
events: {
|
|
946
|
+
personal: Array<{
|
|
947
|
+
id: string;
|
|
948
|
+
name: string;
|
|
949
|
+
startTime: Date;
|
|
950
|
+
endTime: Date;
|
|
951
|
+
location?: string;
|
|
952
|
+
color?: string;
|
|
953
|
+
class: null;
|
|
954
|
+
}>;
|
|
955
|
+
class: Array<{
|
|
956
|
+
id: string;
|
|
957
|
+
name: string;
|
|
958
|
+
startTime: Date;
|
|
959
|
+
endTime: Date;
|
|
960
|
+
location?: string;
|
|
961
|
+
color?: string;
|
|
962
|
+
class: {
|
|
963
|
+
id: string;
|
|
964
|
+
name: string;
|
|
965
|
+
subject: string;
|
|
966
|
+
section: string;
|
|
967
|
+
};
|
|
968
|
+
}>;
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
---
|
|
974
|
+
|
|
636
975
|
## 🔔 Notifications
|
|
637
976
|
|
|
638
977
|
### `notification.list`
|
|
@@ -711,11 +1050,6 @@ Array<{
|
|
|
711
1050
|
|
|
712
1051
|
---
|
|
713
1052
|
|
|
714
|
-
## 🏫 School Management
|
|
715
|
-
|
|
716
|
-
*Note: Router exists but implementation details need to be examined*
|
|
717
|
-
|
|
718
|
-
---
|
|
719
1053
|
|
|
720
1054
|
## 📊 Grading & Assessment
|
|
721
1055
|
|
|
@@ -1112,6 +1446,16 @@ const assignment = await trpc.assignment.create.mutate({
|
|
|
1112
1446
|
|
|
1113
1447
|
---
|
|
1114
1448
|
|
|
1115
|
-
*Generated on:
|
|
1116
|
-
*Version: 1.0
|
|
1117
|
-
*Last Updated:
|
|
1449
|
+
*Generated on: September 14, 2025*
|
|
1450
|
+
*Version: 1.1.0*
|
|
1451
|
+
*Last Updated: September 2025*
|
|
1452
|
+
|
|
1453
|
+
## 📋 Changelog
|
|
1454
|
+
|
|
1455
|
+
### Version 1.1.0 (September 2025)
|
|
1456
|
+
- ✅ Added complete Folder Management endpoints (`folder.*`)
|
|
1457
|
+
- ✅ Added Section Management endpoints (`section.*`)
|
|
1458
|
+
- ✅ Added Attendance Management endpoints (`attendance.*`)
|
|
1459
|
+
- ✅ Added Agenda Management endpoints (`agenda.*`)
|
|
1460
|
+
- ❌ Removed School Management section (not implemented)
|
|
1461
|
+
- 🔧 Improved API coverage from ~70% to ~95%
|
package/dist/exportType.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* This is used to export the types for the server
|
|
4
4
|
* to the client via npmjs
|
|
5
5
|
*/
|
|
6
|
-
export type { AppRouter } from "./routers/_app";
|
|
7
|
-
export type { RouterInputs } from "./routers/_app";
|
|
8
|
-
export type { RouterOutputs } from "./routers/_app";
|
|
6
|
+
export type { AppRouter } from "./routers/_app.js";
|
|
7
|
+
export type { RouterInputs } from "./routers/_app.js";
|
|
8
|
+
export type { RouterOutputs } from "./routers/_app.js";
|
|
9
9
|
//# sourceMappingURL=exportType.d.ts.map
|
package/dist/exportType.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportType.d.ts","sourceRoot":"","sources":["../src/exportType.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"exportType.d.ts","sourceRoot":"","sources":["../src/exportType.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import { Server } from 'socket.io';
|
|
|
4
4
|
import cors from 'cors';
|
|
5
5
|
import dotenv from 'dotenv';
|
|
6
6
|
import { createExpressMiddleware } from '@trpc/server/adapters/express';
|
|
7
|
-
import { appRouter } from './routers/_app';
|
|
8
|
-
import { createTRPCContext, createCallerFactory } from './trpc';
|
|
9
|
-
import { logger } from './utils/logger';
|
|
10
|
-
import { setupSocketHandlers } from './socket/handlers';
|
|
7
|
+
import { appRouter } from './routers/_app.js';
|
|
8
|
+
import { createTRPCContext, createCallerFactory } from './trpc.js';
|
|
9
|
+
import { logger } from './utils/logger.js';
|
|
10
|
+
import { setupSocketHandlers } from './socket/handlers.js';
|
|
11
11
|
dotenv.config();
|
|
12
12
|
const app = express();
|
|
13
13
|
// CORS middleware
|
package/dist/lib/fileUpload.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TRPCError } from "@trpc/server";
|
|
2
2
|
import { v4 as uuidv4 } from "uuid";
|
|
3
|
-
import { uploadFile as uploadToGCS, getSignedUrl } from "./googleCloudStorage";
|
|
4
|
-
import { generateMediaThumbnail } from "./thumbnailGenerator";
|
|
5
|
-
import { prisma } from "./prisma";
|
|
3
|
+
import { uploadFile as uploadToGCS, getSignedUrl } from "./googleCloudStorage.js";
|
|
4
|
+
import { generateMediaThumbnail } from "./thumbnailGenerator.js";
|
|
5
|
+
import { prisma } from "./prisma.js";
|
|
6
6
|
/**
|
|
7
7
|
* Uploads a single file to Google Cloud Storage and creates a file record
|
|
8
8
|
* @param file The file data to upload
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import sharp from 'sharp';
|
|
2
|
-
import { prisma } from './prisma';
|
|
3
|
-
import { uploadFile, getSignedUrl } from './googleCloudStorage';
|
|
2
|
+
import { prisma } from './prisma.js';
|
|
3
|
+
import { uploadFile, getSignedUrl } from './googleCloudStorage.js';
|
|
4
4
|
// Thumbnail size configuration
|
|
5
5
|
const THUMBNAIL_WIDTH = 200;
|
|
6
6
|
const THUMBNAIL_HEIGHT = 200;
|
package/dist/middleware/auth.js
CHANGED