@studious-lms/server 1.1.11 → 1.1.13
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/LAB_CHAT_API_SPEC.md +518 -0
- package/dist/routers/_app.d.ts +442 -0
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +2 -0
- package/dist/routers/conversation.d.ts +4 -0
- package/dist/routers/conversation.d.ts.map +1 -1
- package/dist/routers/conversation.js +7 -0
- package/dist/routers/folder.d.ts +13 -0
- package/dist/routers/folder.d.ts.map +1 -1
- package/dist/routers/folder.js +20 -1
- package/dist/routers/labChat.d.ts +206 -0
- package/dist/routers/labChat.d.ts.map +1 -0
- package/dist/routers/labChat.js +741 -0
- package/dist/utils/aiUser.d.ts +13 -0
- package/dist/utils/aiUser.d.ts.map +1 -0
- package/dist/utils/aiUser.js +57 -0
- package/dist/utils/inference.d.ts +56 -0
- package/dist/utils/inference.d.ts.map +1 -0
- package/dist/utils/inference.js +135 -0
- package/package.json +2 -1
- package/prisma/migrations/20250925072732_add_lab_chat_system/migration.sql +25 -0
- package/prisma/schema.prisma +18 -0
- package/src/routers/_app.ts +2 -0
- package/src/routers/conversation.ts +7 -0
- package/src/routers/folder.ts +23 -0
- package/src/routers/labChat.ts +824 -0
- package/src/utils/aiUser.ts +65 -0
- package/src/utils/inference.ts +193 -0
package/dist/routers/_app.d.ts
CHANGED
|
@@ -3272,6 +3272,19 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
3272
3272
|
};
|
|
3273
3273
|
meta: object;
|
|
3274
3274
|
}>;
|
|
3275
|
+
getParents: import("@trpc/server").TRPCQueryProcedure<{
|
|
3276
|
+
input: {
|
|
3277
|
+
folderId: string;
|
|
3278
|
+
};
|
|
3279
|
+
output: {
|
|
3280
|
+
id: string;
|
|
3281
|
+
name: string;
|
|
3282
|
+
color: string | null;
|
|
3283
|
+
classId: string | null;
|
|
3284
|
+
parentFolderId: string | null;
|
|
3285
|
+
}[];
|
|
3286
|
+
meta: object;
|
|
3287
|
+
}>;
|
|
3275
3288
|
}>>;
|
|
3276
3289
|
notification: import("@trpc/server").TRPCBuiltRouter<{
|
|
3277
3290
|
ctx: import("../trpc.js").Context;
|
|
@@ -3399,6 +3412,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
3399
3412
|
name: string | null;
|
|
3400
3413
|
createdAt: Date;
|
|
3401
3414
|
updatedAt: Date;
|
|
3415
|
+
labChat: {
|
|
3416
|
+
id: string;
|
|
3417
|
+
title: string;
|
|
3418
|
+
} | null;
|
|
3402
3419
|
members: ({
|
|
3403
3420
|
user: {
|
|
3404
3421
|
id: string;
|
|
@@ -3646,6 +3663,210 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
3646
3663
|
meta: object;
|
|
3647
3664
|
}>;
|
|
3648
3665
|
}>>;
|
|
3666
|
+
labChat: import("@trpc/server").TRPCBuiltRouter<{
|
|
3667
|
+
ctx: import("../trpc.js").Context;
|
|
3668
|
+
meta: object;
|
|
3669
|
+
errorShape: {
|
|
3670
|
+
data: {
|
|
3671
|
+
zodError: import("zod").typeToFlattenedError<any, string> | null;
|
|
3672
|
+
prismaError: import("../utils/prismaErrorHandler.js").PrismaErrorInfo | null;
|
|
3673
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
3674
|
+
httpStatus: number;
|
|
3675
|
+
path?: string;
|
|
3676
|
+
stack?: string;
|
|
3677
|
+
};
|
|
3678
|
+
message: string;
|
|
3679
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
3680
|
+
};
|
|
3681
|
+
transformer: false;
|
|
3682
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
3683
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
3684
|
+
input: {
|
|
3685
|
+
context: string;
|
|
3686
|
+
title: string;
|
|
3687
|
+
classId: string;
|
|
3688
|
+
};
|
|
3689
|
+
output: {
|
|
3690
|
+
class: {
|
|
3691
|
+
id: string;
|
|
3692
|
+
name: string;
|
|
3693
|
+
subject: string;
|
|
3694
|
+
section: string;
|
|
3695
|
+
};
|
|
3696
|
+
conversation: {
|
|
3697
|
+
members: ({
|
|
3698
|
+
user: {
|
|
3699
|
+
id: string;
|
|
3700
|
+
username: string;
|
|
3701
|
+
profile: {
|
|
3702
|
+
displayName: string | null;
|
|
3703
|
+
profilePicture: string | null;
|
|
3704
|
+
} | null;
|
|
3705
|
+
};
|
|
3706
|
+
} & {
|
|
3707
|
+
id: string;
|
|
3708
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
3709
|
+
userId: string;
|
|
3710
|
+
conversationId: string;
|
|
3711
|
+
joinedAt: Date;
|
|
3712
|
+
lastViewedAt: Date | null;
|
|
3713
|
+
lastViewedMentionAt: Date | null;
|
|
3714
|
+
})[];
|
|
3715
|
+
} & {
|
|
3716
|
+
type: import(".prisma/client").$Enums.ConversationType;
|
|
3717
|
+
id: string;
|
|
3718
|
+
name: string | null;
|
|
3719
|
+
createdAt: Date;
|
|
3720
|
+
updatedAt: Date;
|
|
3721
|
+
displayInChat: boolean;
|
|
3722
|
+
};
|
|
3723
|
+
createdBy: {
|
|
3724
|
+
id: string;
|
|
3725
|
+
username: string;
|
|
3726
|
+
profile: {
|
|
3727
|
+
displayName: string | null;
|
|
3728
|
+
} | null;
|
|
3729
|
+
};
|
|
3730
|
+
} & {
|
|
3731
|
+
context: string;
|
|
3732
|
+
id: string;
|
|
3733
|
+
title: string;
|
|
3734
|
+
classId: string;
|
|
3735
|
+
createdAt: Date;
|
|
3736
|
+
updatedAt: Date;
|
|
3737
|
+
conversationId: string;
|
|
3738
|
+
createdById: string;
|
|
3739
|
+
};
|
|
3740
|
+
meta: object;
|
|
3741
|
+
}>;
|
|
3742
|
+
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
3743
|
+
input: {
|
|
3744
|
+
labChatId: string;
|
|
3745
|
+
};
|
|
3746
|
+
output: {
|
|
3747
|
+
class: {
|
|
3748
|
+
id: string;
|
|
3749
|
+
name: string;
|
|
3750
|
+
subject: string;
|
|
3751
|
+
section: string;
|
|
3752
|
+
};
|
|
3753
|
+
conversation: {
|
|
3754
|
+
members: ({
|
|
3755
|
+
user: {
|
|
3756
|
+
id: string;
|
|
3757
|
+
username: string;
|
|
3758
|
+
profile: {
|
|
3759
|
+
displayName: string | null;
|
|
3760
|
+
profilePicture: string | null;
|
|
3761
|
+
} | null;
|
|
3762
|
+
};
|
|
3763
|
+
} & {
|
|
3764
|
+
id: string;
|
|
3765
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
3766
|
+
userId: string;
|
|
3767
|
+
conversationId: string;
|
|
3768
|
+
joinedAt: Date;
|
|
3769
|
+
lastViewedAt: Date | null;
|
|
3770
|
+
lastViewedMentionAt: Date | null;
|
|
3771
|
+
})[];
|
|
3772
|
+
} & {
|
|
3773
|
+
type: import(".prisma/client").$Enums.ConversationType;
|
|
3774
|
+
id: string;
|
|
3775
|
+
name: string | null;
|
|
3776
|
+
createdAt: Date;
|
|
3777
|
+
updatedAt: Date;
|
|
3778
|
+
displayInChat: boolean;
|
|
3779
|
+
};
|
|
3780
|
+
createdBy: {
|
|
3781
|
+
id: string;
|
|
3782
|
+
username: string;
|
|
3783
|
+
profile: {
|
|
3784
|
+
displayName: string | null;
|
|
3785
|
+
} | null;
|
|
3786
|
+
};
|
|
3787
|
+
} & {
|
|
3788
|
+
context: string;
|
|
3789
|
+
id: string;
|
|
3790
|
+
title: string;
|
|
3791
|
+
classId: string;
|
|
3792
|
+
createdAt: Date;
|
|
3793
|
+
updatedAt: Date;
|
|
3794
|
+
conversationId: string;
|
|
3795
|
+
createdById: string;
|
|
3796
|
+
};
|
|
3797
|
+
meta: object;
|
|
3798
|
+
}>;
|
|
3799
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
3800
|
+
input: {
|
|
3801
|
+
classId: string;
|
|
3802
|
+
};
|
|
3803
|
+
output: {
|
|
3804
|
+
id: string;
|
|
3805
|
+
title: string;
|
|
3806
|
+
classId: string;
|
|
3807
|
+
conversationId: string;
|
|
3808
|
+
createdBy: {
|
|
3809
|
+
id: string;
|
|
3810
|
+
username: string;
|
|
3811
|
+
profile: {
|
|
3812
|
+
displayName: string | null;
|
|
3813
|
+
} | null;
|
|
3814
|
+
};
|
|
3815
|
+
createdAt: Date;
|
|
3816
|
+
updatedAt: Date;
|
|
3817
|
+
lastMessage: {
|
|
3818
|
+
sender: {
|
|
3819
|
+
id: string;
|
|
3820
|
+
username: string;
|
|
3821
|
+
profile: {
|
|
3822
|
+
displayName: string | null;
|
|
3823
|
+
} | null;
|
|
3824
|
+
};
|
|
3825
|
+
} & {
|
|
3826
|
+
id: string;
|
|
3827
|
+
content: string;
|
|
3828
|
+
createdAt: Date;
|
|
3829
|
+
senderId: string;
|
|
3830
|
+
conversationId: string;
|
|
3831
|
+
};
|
|
3832
|
+
messageCount: number;
|
|
3833
|
+
}[];
|
|
3834
|
+
meta: object;
|
|
3835
|
+
}>;
|
|
3836
|
+
postToLabChat: import("@trpc/server").TRPCMutationProcedure<{
|
|
3837
|
+
input: {
|
|
3838
|
+
content: string;
|
|
3839
|
+
labChatId: string;
|
|
3840
|
+
mentionedUserIds?: string[] | undefined;
|
|
3841
|
+
};
|
|
3842
|
+
output: {
|
|
3843
|
+
id: string;
|
|
3844
|
+
content: string;
|
|
3845
|
+
senderId: string;
|
|
3846
|
+
conversationId: string;
|
|
3847
|
+
createdAt: Date;
|
|
3848
|
+
sender: {
|
|
3849
|
+
id: string;
|
|
3850
|
+
username: string;
|
|
3851
|
+
profile: {
|
|
3852
|
+
displayName: string | null;
|
|
3853
|
+
profilePicture: string | null;
|
|
3854
|
+
} | null;
|
|
3855
|
+
};
|
|
3856
|
+
mentionedUserIds: string[];
|
|
3857
|
+
};
|
|
3858
|
+
meta: object;
|
|
3859
|
+
}>;
|
|
3860
|
+
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
3861
|
+
input: {
|
|
3862
|
+
labChatId: string;
|
|
3863
|
+
};
|
|
3864
|
+
output: {
|
|
3865
|
+
success: boolean;
|
|
3866
|
+
};
|
|
3867
|
+
meta: object;
|
|
3868
|
+
}>;
|
|
3869
|
+
}>>;
|
|
3649
3870
|
}>>;
|
|
3650
3871
|
export type AppRouter = typeof appRouter;
|
|
3651
3872
|
export type RouterInputs = inferRouterInputs<AppRouter>;
|
|
@@ -6923,6 +7144,19 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
6923
7144
|
};
|
|
6924
7145
|
meta: object;
|
|
6925
7146
|
}>;
|
|
7147
|
+
getParents: import("@trpc/server").TRPCQueryProcedure<{
|
|
7148
|
+
input: {
|
|
7149
|
+
folderId: string;
|
|
7150
|
+
};
|
|
7151
|
+
output: {
|
|
7152
|
+
id: string;
|
|
7153
|
+
name: string;
|
|
7154
|
+
color: string | null;
|
|
7155
|
+
classId: string | null;
|
|
7156
|
+
parentFolderId: string | null;
|
|
7157
|
+
}[];
|
|
7158
|
+
meta: object;
|
|
7159
|
+
}>;
|
|
6926
7160
|
}>>;
|
|
6927
7161
|
notification: import("@trpc/server").TRPCBuiltRouter<{
|
|
6928
7162
|
ctx: import("../trpc.js").Context;
|
|
@@ -7050,6 +7284,10 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
7050
7284
|
name: string | null;
|
|
7051
7285
|
createdAt: Date;
|
|
7052
7286
|
updatedAt: Date;
|
|
7287
|
+
labChat: {
|
|
7288
|
+
id: string;
|
|
7289
|
+
title: string;
|
|
7290
|
+
} | null;
|
|
7053
7291
|
members: ({
|
|
7054
7292
|
user: {
|
|
7055
7293
|
id: string;
|
|
@@ -7297,5 +7535,209 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
7297
7535
|
meta: object;
|
|
7298
7536
|
}>;
|
|
7299
7537
|
}>>;
|
|
7538
|
+
labChat: import("@trpc/server").TRPCBuiltRouter<{
|
|
7539
|
+
ctx: import("../trpc.js").Context;
|
|
7540
|
+
meta: object;
|
|
7541
|
+
errorShape: {
|
|
7542
|
+
data: {
|
|
7543
|
+
zodError: import("zod").typeToFlattenedError<any, string> | null;
|
|
7544
|
+
prismaError: import("../utils/prismaErrorHandler.js").PrismaErrorInfo | null;
|
|
7545
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
7546
|
+
httpStatus: number;
|
|
7547
|
+
path?: string;
|
|
7548
|
+
stack?: string;
|
|
7549
|
+
};
|
|
7550
|
+
message: string;
|
|
7551
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
7552
|
+
};
|
|
7553
|
+
transformer: false;
|
|
7554
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
7555
|
+
create: import("@trpc/server").TRPCMutationProcedure<{
|
|
7556
|
+
input: {
|
|
7557
|
+
context: string;
|
|
7558
|
+
title: string;
|
|
7559
|
+
classId: string;
|
|
7560
|
+
};
|
|
7561
|
+
output: {
|
|
7562
|
+
class: {
|
|
7563
|
+
id: string;
|
|
7564
|
+
name: string;
|
|
7565
|
+
subject: string;
|
|
7566
|
+
section: string;
|
|
7567
|
+
};
|
|
7568
|
+
conversation: {
|
|
7569
|
+
members: ({
|
|
7570
|
+
user: {
|
|
7571
|
+
id: string;
|
|
7572
|
+
username: string;
|
|
7573
|
+
profile: {
|
|
7574
|
+
displayName: string | null;
|
|
7575
|
+
profilePicture: string | null;
|
|
7576
|
+
} | null;
|
|
7577
|
+
};
|
|
7578
|
+
} & {
|
|
7579
|
+
id: string;
|
|
7580
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
7581
|
+
userId: string;
|
|
7582
|
+
conversationId: string;
|
|
7583
|
+
joinedAt: Date;
|
|
7584
|
+
lastViewedAt: Date | null;
|
|
7585
|
+
lastViewedMentionAt: Date | null;
|
|
7586
|
+
})[];
|
|
7587
|
+
} & {
|
|
7588
|
+
type: import(".prisma/client").$Enums.ConversationType;
|
|
7589
|
+
id: string;
|
|
7590
|
+
name: string | null;
|
|
7591
|
+
createdAt: Date;
|
|
7592
|
+
updatedAt: Date;
|
|
7593
|
+
displayInChat: boolean;
|
|
7594
|
+
};
|
|
7595
|
+
createdBy: {
|
|
7596
|
+
id: string;
|
|
7597
|
+
username: string;
|
|
7598
|
+
profile: {
|
|
7599
|
+
displayName: string | null;
|
|
7600
|
+
} | null;
|
|
7601
|
+
};
|
|
7602
|
+
} & {
|
|
7603
|
+
context: string;
|
|
7604
|
+
id: string;
|
|
7605
|
+
title: string;
|
|
7606
|
+
classId: string;
|
|
7607
|
+
createdAt: Date;
|
|
7608
|
+
updatedAt: Date;
|
|
7609
|
+
conversationId: string;
|
|
7610
|
+
createdById: string;
|
|
7611
|
+
};
|
|
7612
|
+
meta: object;
|
|
7613
|
+
}>;
|
|
7614
|
+
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
7615
|
+
input: {
|
|
7616
|
+
labChatId: string;
|
|
7617
|
+
};
|
|
7618
|
+
output: {
|
|
7619
|
+
class: {
|
|
7620
|
+
id: string;
|
|
7621
|
+
name: string;
|
|
7622
|
+
subject: string;
|
|
7623
|
+
section: string;
|
|
7624
|
+
};
|
|
7625
|
+
conversation: {
|
|
7626
|
+
members: ({
|
|
7627
|
+
user: {
|
|
7628
|
+
id: string;
|
|
7629
|
+
username: string;
|
|
7630
|
+
profile: {
|
|
7631
|
+
displayName: string | null;
|
|
7632
|
+
profilePicture: string | null;
|
|
7633
|
+
} | null;
|
|
7634
|
+
};
|
|
7635
|
+
} & {
|
|
7636
|
+
id: string;
|
|
7637
|
+
role: import(".prisma/client").$Enums.ConversationRole;
|
|
7638
|
+
userId: string;
|
|
7639
|
+
conversationId: string;
|
|
7640
|
+
joinedAt: Date;
|
|
7641
|
+
lastViewedAt: Date | null;
|
|
7642
|
+
lastViewedMentionAt: Date | null;
|
|
7643
|
+
})[];
|
|
7644
|
+
} & {
|
|
7645
|
+
type: import(".prisma/client").$Enums.ConversationType;
|
|
7646
|
+
id: string;
|
|
7647
|
+
name: string | null;
|
|
7648
|
+
createdAt: Date;
|
|
7649
|
+
updatedAt: Date;
|
|
7650
|
+
displayInChat: boolean;
|
|
7651
|
+
};
|
|
7652
|
+
createdBy: {
|
|
7653
|
+
id: string;
|
|
7654
|
+
username: string;
|
|
7655
|
+
profile: {
|
|
7656
|
+
displayName: string | null;
|
|
7657
|
+
} | null;
|
|
7658
|
+
};
|
|
7659
|
+
} & {
|
|
7660
|
+
context: string;
|
|
7661
|
+
id: string;
|
|
7662
|
+
title: string;
|
|
7663
|
+
classId: string;
|
|
7664
|
+
createdAt: Date;
|
|
7665
|
+
updatedAt: Date;
|
|
7666
|
+
conversationId: string;
|
|
7667
|
+
createdById: string;
|
|
7668
|
+
};
|
|
7669
|
+
meta: object;
|
|
7670
|
+
}>;
|
|
7671
|
+
list: import("@trpc/server").TRPCQueryProcedure<{
|
|
7672
|
+
input: {
|
|
7673
|
+
classId: string;
|
|
7674
|
+
};
|
|
7675
|
+
output: {
|
|
7676
|
+
id: string;
|
|
7677
|
+
title: string;
|
|
7678
|
+
classId: string;
|
|
7679
|
+
conversationId: string;
|
|
7680
|
+
createdBy: {
|
|
7681
|
+
id: string;
|
|
7682
|
+
username: string;
|
|
7683
|
+
profile: {
|
|
7684
|
+
displayName: string | null;
|
|
7685
|
+
} | null;
|
|
7686
|
+
};
|
|
7687
|
+
createdAt: Date;
|
|
7688
|
+
updatedAt: Date;
|
|
7689
|
+
lastMessage: {
|
|
7690
|
+
sender: {
|
|
7691
|
+
id: string;
|
|
7692
|
+
username: string;
|
|
7693
|
+
profile: {
|
|
7694
|
+
displayName: string | null;
|
|
7695
|
+
} | null;
|
|
7696
|
+
};
|
|
7697
|
+
} & {
|
|
7698
|
+
id: string;
|
|
7699
|
+
content: string;
|
|
7700
|
+
createdAt: Date;
|
|
7701
|
+
senderId: string;
|
|
7702
|
+
conversationId: string;
|
|
7703
|
+
};
|
|
7704
|
+
messageCount: number;
|
|
7705
|
+
}[];
|
|
7706
|
+
meta: object;
|
|
7707
|
+
}>;
|
|
7708
|
+
postToLabChat: import("@trpc/server").TRPCMutationProcedure<{
|
|
7709
|
+
input: {
|
|
7710
|
+
content: string;
|
|
7711
|
+
labChatId: string;
|
|
7712
|
+
mentionedUserIds?: string[] | undefined;
|
|
7713
|
+
};
|
|
7714
|
+
output: {
|
|
7715
|
+
id: string;
|
|
7716
|
+
content: string;
|
|
7717
|
+
senderId: string;
|
|
7718
|
+
conversationId: string;
|
|
7719
|
+
createdAt: Date;
|
|
7720
|
+
sender: {
|
|
7721
|
+
id: string;
|
|
7722
|
+
username: string;
|
|
7723
|
+
profile: {
|
|
7724
|
+
displayName: string | null;
|
|
7725
|
+
profilePicture: string | null;
|
|
7726
|
+
} | null;
|
|
7727
|
+
};
|
|
7728
|
+
mentionedUserIds: string[];
|
|
7729
|
+
};
|
|
7730
|
+
meta: object;
|
|
7731
|
+
}>;
|
|
7732
|
+
delete: import("@trpc/server").TRPCMutationProcedure<{
|
|
7733
|
+
input: {
|
|
7734
|
+
labChatId: string;
|
|
7735
|
+
};
|
|
7736
|
+
output: {
|
|
7737
|
+
success: boolean;
|
|
7738
|
+
};
|
|
7739
|
+
meta: object;
|
|
7740
|
+
}>;
|
|
7741
|
+
}>>;
|
|
7300
7742
|
}>>;
|
|
7301
7743
|
//# sourceMappingURL=_app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_app.d.ts","sourceRoot":"","sources":["../../src/routers/_app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"_app.d.ts","sourceRoot":"","sources":["../../src/routers/_app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAa1E,eAAO,MAAM,SAAS;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAC"}
|
package/dist/routers/_app.js
CHANGED
|
@@ -14,6 +14,7 @@ import { folderRouter } from "./folder.js";
|
|
|
14
14
|
import { notificationRouter } from "./notifications.js";
|
|
15
15
|
import { conversationRouter } from "./conversation.js";
|
|
16
16
|
import { messageRouter } from "./message.js";
|
|
17
|
+
import { labChatRouter } from "./labChat.js";
|
|
17
18
|
export const appRouter = createTRPCRouter({
|
|
18
19
|
class: classRouter,
|
|
19
20
|
announcement: announcementRouter,
|
|
@@ -29,6 +30,7 @@ export const appRouter = createTRPCRouter({
|
|
|
29
30
|
notification: notificationRouter,
|
|
30
31
|
conversation: conversationRouter,
|
|
31
32
|
message: messageRouter,
|
|
33
|
+
labChat: labChatRouter,
|
|
32
34
|
});
|
|
33
35
|
// Export caller
|
|
34
36
|
export const createCaller = createCallerFactory(appRouter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/routers/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/routers/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqS7B,CAAC"}
|
|
@@ -14,6 +14,12 @@ export const conversationRouter = createTRPCRouter({
|
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
include: {
|
|
17
|
+
labChat: {
|
|
18
|
+
select: {
|
|
19
|
+
id: true,
|
|
20
|
+
title: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
17
23
|
members: {
|
|
18
24
|
include: {
|
|
19
25
|
user: {
|
|
@@ -93,6 +99,7 @@ export const conversationRouter = createTRPCRouter({
|
|
|
93
99
|
name: conversation.name,
|
|
94
100
|
createdAt: conversation.createdAt,
|
|
95
101
|
updatedAt: conversation.updatedAt,
|
|
102
|
+
labChat: conversation.labChat,
|
|
96
103
|
members: conversation.members,
|
|
97
104
|
lastMessage: conversation.messages[0] || null,
|
|
98
105
|
unreadCount,
|
package/dist/routers/folder.d.ts
CHANGED
|
@@ -304,5 +304,18 @@ export declare const folderRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
304
304
|
};
|
|
305
305
|
meta: object;
|
|
306
306
|
}>;
|
|
307
|
+
getParents: import("@trpc/server").TRPCQueryProcedure<{
|
|
308
|
+
input: {
|
|
309
|
+
folderId: string;
|
|
310
|
+
};
|
|
311
|
+
output: {
|
|
312
|
+
id: string;
|
|
313
|
+
name: string;
|
|
314
|
+
color: string | null;
|
|
315
|
+
classId: string | null;
|
|
316
|
+
parentFolderId: string | null;
|
|
317
|
+
}[];
|
|
318
|
+
meta: object;
|
|
319
|
+
}>;
|
|
307
320
|
}>>;
|
|
308
321
|
//# sourceMappingURL=folder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../src/routers/folder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../src/routers/folder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0vBvB,CAAC"}
|
package/dist/routers/folder.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { createTRPCRouter, protectedClassMemberProcedure, protectedTeacherProcedure } from "../trpc.js";
|
|
2
|
+
import { createTRPCRouter, protectedProcedure, protectedClassMemberProcedure, protectedTeacherProcedure } from "../trpc.js";
|
|
3
3
|
import { TRPCError } from "@trpc/server";
|
|
4
4
|
import { prisma } from "../lib/prisma.js";
|
|
5
5
|
import { uploadFiles } from "../lib/fileUpload.js";
|
|
@@ -704,4 +704,23 @@ export const folderRouter = createTRPCRouter({
|
|
|
704
704
|
});
|
|
705
705
|
return updatedFolder;
|
|
706
706
|
}),
|
|
707
|
+
getParents: protectedProcedure
|
|
708
|
+
.input(z.object({
|
|
709
|
+
folderId: z.string(),
|
|
710
|
+
}))
|
|
711
|
+
.query(async ({ ctx, input }) => {
|
|
712
|
+
const { folderId } = input;
|
|
713
|
+
let currentParent = folderId;
|
|
714
|
+
const parents = [];
|
|
715
|
+
while (currentParent) {
|
|
716
|
+
const parent = await prisma.folder.findFirst({
|
|
717
|
+
where: {
|
|
718
|
+
id: currentParent,
|
|
719
|
+
},
|
|
720
|
+
});
|
|
721
|
+
currentParent = parent?.parentFolderId;
|
|
722
|
+
parents.push(parent);
|
|
723
|
+
}
|
|
724
|
+
return parents;
|
|
725
|
+
}),
|
|
707
726
|
});
|