feat: update client to use service-based signaling endpoints

BREAKING CHANGE: Client API now uses service UUIDs for WebRTC signaling

- Replace answerOffer() with answerService()
- Replace getAnswer() with getServiceAnswer()
- Replace addIceCandidates() with addServiceIceCandidates()
- Replace getIceCandidates() with getServiceIceCandidates()
- Update RondevuSignaler to use service UUID instead of offer ID for signaling
- Automatically track offerId returned from service endpoints
- Bump version to 0.12.0

Matches server v0.4.0 service-based API refactor.
This commit is contained in:
2025-12-07 22:17:36 +01:00
parent d06b2166c1
commit 177ee2ec2d
13 changed files with 1019 additions and 205 deletions

View File

@@ -15,14 +15,16 @@ export interface ConnectionEvents {
message: Message
}
export const ConnectionStates = ['connected', 'disconnected', 'connecting'] as const
export const ConnectionStates = [
'connected',
'disconnected',
'connecting'
] as const
export const isConnectionState = (state: string): state is (typeof ConnectionStates)[number] =>
ConnectionStates.includes(state as any)
export interface ConnectionInterface {
id: string
service: string
state: (typeof ConnectionStates)[number]
lastActive: number
expiresAt?: number
@@ -33,7 +35,7 @@ export interface ConnectionInterface {
}
export interface Signaler {
addIceCandidate(candidate: RTCIceCandidate): Promise<void> | void
addIceCandidate(candidate: RTCIceCandidate): Promise<void>
addListener(callback: (candidate: RTCIceCandidate) => void): Binnable
addOfferListener(callback: (offer: RTCSessionDescriptionInit) => void): Binnable
addAnswerListener(callback: (answer: RTCSessionDescriptionInit) => void): Binnable