Code quality improvements and cleanup + Implemented ChatService
Some checks failed
Setup testing environment and test the code / build (push) Has been cancelled
Some checks failed
Setup testing environment and test the code / build (push) Has been cancelled
This commit is contained in:
43
src/domain/chatService.schema.ts
Normal file
43
src/domain/chatService.schema.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
// Request schemas
|
||||
export interface GetChatsReq {
|
||||
userid: string
|
||||
}
|
||||
|
||||
export interface StartNewReq {
|
||||
userid: string
|
||||
peerUsername: string
|
||||
}
|
||||
|
||||
export interface ToggleChatMuteReq {
|
||||
userid: string
|
||||
chatid: string
|
||||
}
|
||||
|
||||
export interface GetAvailabilityReq {
|
||||
targetId: string
|
||||
connId: string
|
||||
}
|
||||
|
||||
export interface GetAvailabilityResp {
|
||||
available: boolean
|
||||
}
|
||||
|
||||
// Types
|
||||
export interface Chat {
|
||||
userid: string
|
||||
chatid: string
|
||||
username: string
|
||||
displayName: string
|
||||
pfp: string
|
||||
status: 0 | 1
|
||||
type: "outgoing" | "incoming"
|
||||
notifications: number
|
||||
muted: boolean
|
||||
latestMessage: LatestMessage
|
||||
}
|
||||
|
||||
export interface LatestMessage {
|
||||
message: string
|
||||
isAuthor: boolean
|
||||
msgid: string
|
||||
}
|
||||
Reference in New Issue
Block a user