Implemented BroadcastChannelService and FileTransferService
All checks were successful
Setup testing environment and test the code / build (push) Successful in 1m17s

This commit is contained in:
2026-04-08 08:46:16 +02:00
parent e6798b4be8
commit a9322e3454
10 changed files with 428 additions and 3 deletions

View File

@@ -0,0 +1,95 @@
export interface StartNewFileTransferReq {
userid: string
targetUserId: string
metadata: TransferableFileMetadata[]
}
export interface AcceptFileTransferReq {
userid: string
senderId: string
transferId: string
}
export interface DeclineFileTransferReq {
userid: string
senderId: string
transferId: string
}
export interface FileTransferSendOfferRTCReq {
userid: string
peerId: string
transferId: string
offer: string
}
export interface FileTransferSendAnswerRTCReq {
userid: string
peerId: string
transferId: string
answer: string
}
export interface FileTransferSendICERTCReq {
userid: string
peerId: string
transferId: string
candidate: string
}
// Response schemas
export interface StartNewFileTransferResp {
transferId: string
}
// WebSocket payloads
export interface WSNewFileTransferPayload {
from: string
transferId: string
metadata: TransferableFileMetadata[]
}
export interface WSFileTransferAcceptedPayload {
transferId: string
rtcConfig: RTCConfiguration
}
export interface WSFileTransferDeclinedPayload {
transferId: string
}
export interface WSFileTransferRTCOfferPayload {
transferId: string
offer: string
}
export interface WSFileTransferRTCAnswerPayload {
transferId: string
answer: string
}
export interface WSFileTransferRTCIcePayload {
transferId: string
candidate: string
}
// DataChannel payloads
export interface DCStartNewFilePayload {
fileId: string
fileIndex: number
fileName: string
totalChunks: number
}
export interface DCTransferFilePayload {
fileId: string
fileIndex: string
chunk: string
}
// Types
export interface TransferableFileMetadata {
fileId: string
name: string
size: number
}