vg-x07df 1.2.0 → 1.3.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/dist/index.cjs +1055 -613
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +762 -215
- package/dist/index.d.ts +762 -215
- package/dist/index.mjs +1035 -614
- package/dist/index.mjs.map +1 -1
- package/dist/livekit/index.cjs +61 -0
- package/dist/livekit/index.cjs.map +1 -1
- package/dist/livekit/index.d.cts +6 -1
- package/dist/livekit/index.d.ts +6 -1
- package/dist/livekit/index.mjs +66 -0
- package/dist/livekit/index.mjs.map +1 -1
- package/package.json +7 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as immer from 'immer';
|
|
3
3
|
import * as zustand from 'zustand';
|
|
4
|
-
import
|
|
4
|
+
import { RoomOptions, Room, Participant } from 'livekit-client';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
type AuthProvider = () => string | null;
|
|
@@ -39,12 +39,124 @@ declare class SocketManager {
|
|
|
39
39
|
destroy(): void;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
type CallsData = {
|
|
43
|
+
payloads: {
|
|
44
|
+
PostSignalCallsInvite: {
|
|
45
|
+
appId: string;
|
|
46
|
+
requestBody?: {
|
|
47
|
+
participants: Array<{
|
|
48
|
+
userId: string;
|
|
49
|
+
}>;
|
|
50
|
+
mode: 'AUDIO' | 'VIDEO';
|
|
51
|
+
callId?: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
PostSignalCallsByCallIdAccept: {
|
|
55
|
+
appId: string;
|
|
56
|
+
callId: string;
|
|
57
|
+
};
|
|
58
|
+
PostSignalCallsByCallIdDecline: {
|
|
59
|
+
appId: string;
|
|
60
|
+
callId: string;
|
|
61
|
+
requestBody?: {
|
|
62
|
+
reason?: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
PostSignalCallsByCallIdCancel: {
|
|
66
|
+
appId: string;
|
|
67
|
+
callId: string;
|
|
68
|
+
};
|
|
69
|
+
PostSignalCallsByCallIdTransfer: {
|
|
70
|
+
appId: string;
|
|
71
|
+
callId: string;
|
|
72
|
+
requestBody?: {
|
|
73
|
+
targetParticipantId: string;
|
|
74
|
+
reason?: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
PostSignalCallsByCallIdKick: {
|
|
78
|
+
appId: string;
|
|
79
|
+
callId: string;
|
|
80
|
+
requestBody?: {
|
|
81
|
+
participantId: string;
|
|
82
|
+
reason?: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
PostSignalCallsByCallIdMute: {
|
|
86
|
+
appId: string;
|
|
87
|
+
callId: string;
|
|
88
|
+
requestBody?: {
|
|
89
|
+
participantId: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
PostSignalCallsByCallIdEnd: {
|
|
93
|
+
appId: string;
|
|
94
|
+
callId: string;
|
|
95
|
+
};
|
|
96
|
+
PostSignalCallsByCallIdLeave: {
|
|
97
|
+
appId: string;
|
|
98
|
+
callId: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
responses: {
|
|
102
|
+
PostSignalCallsInvite: {
|
|
103
|
+
callId: string;
|
|
104
|
+
success: boolean;
|
|
105
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
106
|
+
message: string;
|
|
107
|
+
};
|
|
108
|
+
PostSignalCallsByCallIdAccept: {
|
|
109
|
+
callId: string;
|
|
110
|
+
success: boolean;
|
|
111
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
112
|
+
message: string;
|
|
113
|
+
};
|
|
114
|
+
PostSignalCallsByCallIdDecline: {
|
|
115
|
+
callId: string;
|
|
116
|
+
success: boolean;
|
|
117
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
118
|
+
message: string;
|
|
119
|
+
};
|
|
120
|
+
PostSignalCallsByCallIdCancel: {
|
|
121
|
+
callId: string;
|
|
122
|
+
success: boolean;
|
|
123
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
124
|
+
message: string;
|
|
125
|
+
};
|
|
126
|
+
PostSignalCallsByCallIdTransfer: {
|
|
127
|
+
callId: string;
|
|
128
|
+
success: boolean;
|
|
129
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
130
|
+
message: string;
|
|
131
|
+
};
|
|
132
|
+
PostSignalCallsByCallIdKick: {
|
|
133
|
+
callId: string;
|
|
134
|
+
success: boolean;
|
|
135
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
136
|
+
message: string;
|
|
137
|
+
};
|
|
138
|
+
PostSignalCallsByCallIdMute: {
|
|
139
|
+
callId: string;
|
|
140
|
+
success: boolean;
|
|
141
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
142
|
+
message: string;
|
|
143
|
+
};
|
|
144
|
+
PostSignalCallsByCallIdEnd: {
|
|
145
|
+
callId: string;
|
|
146
|
+
success: boolean;
|
|
147
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
148
|
+
message: string;
|
|
149
|
+
};
|
|
150
|
+
PostSignalCallsByCallIdLeave: {
|
|
151
|
+
callId: string;
|
|
152
|
+
success: boolean;
|
|
153
|
+
action: 'call_initiated' | 'invite_sent' | 'accepted' | 'declined' | 'cancelled' | 'transfer_initiated' | 'participant_kicked' | 'participant_muted';
|
|
154
|
+
message: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
interface InitiateCallParams$1 {
|
|
48
160
|
invitees: string[];
|
|
49
161
|
mode?: "AUDIO" | "VIDEO";
|
|
50
162
|
metadata?: any;
|
|
@@ -85,49 +197,49 @@ interface CallActionResponse {
|
|
|
85
197
|
roomName?: string;
|
|
86
198
|
}
|
|
87
199
|
|
|
88
|
-
declare class SignalClient {
|
|
89
|
-
private config;
|
|
90
|
-
private logger;
|
|
91
|
-
constructor(config: SignalClientConfig);
|
|
92
|
-
initiate(params: InitiateCallParams): Promise<CallResponse>;
|
|
93
|
-
accept(callId: string): Promise<CallActionResponse>;
|
|
94
|
-
decline(callId: string): Promise<CallActionResponse>;
|
|
95
|
-
leave(callId: string): Promise<CallActionResponse>;
|
|
96
|
-
private handleApiError;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
200
|
declare class OpenApiConfigService {
|
|
100
201
|
private static instance;
|
|
202
|
+
private configured;
|
|
101
203
|
private constructor();
|
|
102
204
|
static getInstance(): OpenApiConfigService;
|
|
103
205
|
configure(config: ApiConfig): void;
|
|
206
|
+
isConfigured(): boolean;
|
|
104
207
|
setToken(token: string): void;
|
|
105
208
|
}
|
|
106
209
|
declare const apiConfig: OpenApiConfigService;
|
|
107
210
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
firstName
|
|
112
|
-
lastName
|
|
113
|
-
|
|
114
|
-
email
|
|
115
|
-
|
|
116
|
-
interface Participant {
|
|
117
|
-
id: string;
|
|
118
|
-
info?: ParticipantInfo;
|
|
119
|
-
role: "CALLER" | "CALLEE" | "HOST" | "MEMBER";
|
|
120
|
-
audioEnabled: boolean;
|
|
121
|
-
videoEnabled: boolean;
|
|
122
|
-
isSpeaking: boolean;
|
|
123
|
-
connectionQuality?: "excellent" | "good" | "poor" | "lost" | "unknown";
|
|
124
|
-
joinedAt: number;
|
|
211
|
+
interface ParticipantMetadata {
|
|
212
|
+
userId: string;
|
|
213
|
+
role: "HOST" | "PARTICIPANT" | "GUEST";
|
|
214
|
+
firstName: string;
|
|
215
|
+
lastName: string;
|
|
216
|
+
username: string;
|
|
217
|
+
email: string;
|
|
218
|
+
profilePhoto: string;
|
|
125
219
|
}
|
|
126
220
|
interface LiveKitJoinInfo {
|
|
127
221
|
token: string;
|
|
128
222
|
roomName: string;
|
|
223
|
+
url: string;
|
|
224
|
+
}
|
|
225
|
+
interface Session {
|
|
226
|
+
id: string;
|
|
227
|
+
status: "pending" | "active" | "ended";
|
|
228
|
+
mode: "AUDIO" | "VIDEO";
|
|
229
|
+
role: "HOST" | "PARTICIPANT" | "GUEST";
|
|
230
|
+
livekitInfo?: LiveKitJoinInfo;
|
|
231
|
+
}
|
|
232
|
+
interface IncomingInvite {
|
|
129
233
|
callId: string;
|
|
130
|
-
|
|
234
|
+
caller: ParticipantMetadata;
|
|
235
|
+
mode: "AUDIO" | "VIDEO";
|
|
236
|
+
expiresAt: string;
|
|
237
|
+
expiresInMs: number;
|
|
238
|
+
}
|
|
239
|
+
interface OutgoingInvite {
|
|
240
|
+
userId: string;
|
|
241
|
+
status: "sent" | "accepted" | "declined" | "missed";
|
|
242
|
+
participant: ParticipantMetadata;
|
|
131
243
|
}
|
|
132
244
|
interface RtcError {
|
|
133
245
|
code: string;
|
|
@@ -135,24 +247,11 @@ interface RtcError {
|
|
|
135
247
|
timestamp: number;
|
|
136
248
|
context?: any;
|
|
137
249
|
}
|
|
138
|
-
interface TrackReference {
|
|
139
|
-
participant: Participant;
|
|
140
|
-
publication: livekit_client.TrackPublication;
|
|
141
|
-
source: livekit_client.Track.Source;
|
|
142
|
-
track?: livekit_client.Track;
|
|
143
|
-
}
|
|
144
250
|
interface RtcState {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
livekitInfo?: LiveKitJoinInfo;
|
|
150
|
-
myRole?: "CALLER" | "CALLEE";
|
|
151
|
-
initiatedByMe: boolean;
|
|
152
|
-
};
|
|
153
|
-
room: {
|
|
154
|
-
participants: Record<string, Participant>;
|
|
155
|
-
};
|
|
251
|
+
initiated: boolean;
|
|
252
|
+
session: Session | null;
|
|
253
|
+
incomingInvite: IncomingInvite | null;
|
|
254
|
+
outgoingInvites: Record<string, OutgoingInvite>;
|
|
156
255
|
errors: RtcError[];
|
|
157
256
|
}
|
|
158
257
|
|
|
@@ -178,12 +277,26 @@ declare const rtcStore: zustand.UseBoundStore<Omit<zustand.StoreApi<RtcState & A
|
|
|
178
277
|
*/
|
|
179
278
|
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
180
279
|
|
|
181
|
-
interface
|
|
182
|
-
|
|
183
|
-
accept: (callId: string) => Promise<CallActionResponse>;
|
|
184
|
-
decline: (callId: string, reason?: string) => Promise<CallActionResponse>;
|
|
185
|
-
leave: (callId: string) => Promise<void>;
|
|
280
|
+
interface CallsServiceConfig {
|
|
281
|
+
appId: string;
|
|
186
282
|
}
|
|
283
|
+
interface InitiateCallParams {
|
|
284
|
+
invitees: string[];
|
|
285
|
+
mode?: "AUDIO" | "VIDEO";
|
|
286
|
+
callId?: string;
|
|
287
|
+
}
|
|
288
|
+
declare function createCallsService(config: CallsServiceConfig): {
|
|
289
|
+
initiate: (params: InitiateCallParams) => Promise<CallsData["responses"]["PostSignalCallsInvite"]>;
|
|
290
|
+
accept: (callId: string) => Promise<CallsData["responses"]["PostSignalCallsByCallIdAccept"]>;
|
|
291
|
+
decline: (callId: string, reason?: string) => Promise<CallsData["responses"]["PostSignalCallsByCallIdDecline"]>;
|
|
292
|
+
cancel: (callId: string) => Promise<CallsData["responses"]["PostSignalCallsByCallIdCancel"]>;
|
|
293
|
+
leave: (callId: string) => Promise<CallsData["responses"]["PostSignalCallsByCallIdLeave"]>;
|
|
294
|
+
end: (callId: string) => Promise<CallsData["responses"]["PostSignalCallsByCallIdEnd"]>;
|
|
295
|
+
transfer: (callId: string, targetParticipantId: string, reason?: string) => Promise<CallsData["responses"]["PostSignalCallsByCallIdTransfer"]>;
|
|
296
|
+
kick: (callId: string, participantId: string, reason?: string) => Promise<CallsData["responses"]["PostSignalCallsByCallIdKick"]>;
|
|
297
|
+
mute: (callId: string, participantId: string) => Promise<CallsData["responses"]["PostSignalCallsByCallIdMute"]>;
|
|
298
|
+
};
|
|
299
|
+
type CallsServiceInstance = ReturnType<typeof createCallsService>;
|
|
187
300
|
|
|
188
301
|
interface SdkBuildOptions {
|
|
189
302
|
appId: string;
|
|
@@ -193,11 +306,11 @@ interface SdkBuildOptions {
|
|
|
193
306
|
enableDebug?: boolean;
|
|
194
307
|
log?: (level: LogLevel, message: string, meta?: any) => void;
|
|
195
308
|
}
|
|
196
|
-
interface RtcSdk
|
|
309
|
+
interface RtcSdk {
|
|
197
310
|
store: typeof rtcStore;
|
|
198
311
|
auth: AuthManager;
|
|
199
312
|
socket: SocketManager;
|
|
200
|
-
|
|
313
|
+
calls: CallsServiceInstance;
|
|
201
314
|
cleanup: () => void;
|
|
202
315
|
configureApi: (config: ApiConfig) => void;
|
|
203
316
|
}
|
|
@@ -211,19 +324,74 @@ declare function RtcProvider({ options, children, }: {
|
|
|
211
324
|
declare const useSdk: () => RtcSdk;
|
|
212
325
|
|
|
213
326
|
interface CallState {
|
|
214
|
-
id: string |
|
|
215
|
-
status:
|
|
216
|
-
mode: "AUDIO" | "VIDEO" |
|
|
217
|
-
roomName: string |
|
|
327
|
+
id: string | null;
|
|
328
|
+
status: "pending" | "active" | "ended" | null;
|
|
329
|
+
mode: "AUDIO" | "VIDEO" | null;
|
|
330
|
+
roomName: string | null;
|
|
218
331
|
}
|
|
219
332
|
declare function useCallState(): CallState;
|
|
220
333
|
|
|
221
334
|
declare function useCallActions(): {
|
|
222
|
-
initiate: (participants: string[], type: "AUDIO" | "VIDEO") => Promise<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
335
|
+
initiate: (participants: string[], type: "AUDIO" | "VIDEO") => Promise<{
|
|
336
|
+
callId: string;
|
|
337
|
+
success: boolean;
|
|
338
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
339
|
+
message: string;
|
|
340
|
+
}>;
|
|
341
|
+
invite: (participants: string[]) => Promise<{
|
|
342
|
+
callId: string;
|
|
343
|
+
success: boolean;
|
|
344
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
345
|
+
message: string;
|
|
346
|
+
}>;
|
|
347
|
+
accept: () => Promise<{
|
|
348
|
+
callId: string;
|
|
349
|
+
success: boolean;
|
|
350
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
351
|
+
message: string;
|
|
352
|
+
}>;
|
|
353
|
+
decline: (reason?: string) => Promise<{
|
|
354
|
+
callId: string;
|
|
355
|
+
success: boolean;
|
|
356
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
357
|
+
message: string;
|
|
358
|
+
}>;
|
|
359
|
+
cancel: () => Promise<{
|
|
360
|
+
callId: string;
|
|
361
|
+
success: boolean;
|
|
362
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
363
|
+
message: string;
|
|
364
|
+
}>;
|
|
365
|
+
leave: () => Promise<{
|
|
366
|
+
callId: string;
|
|
367
|
+
success: boolean;
|
|
368
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
369
|
+
message: string;
|
|
370
|
+
}>;
|
|
371
|
+
end: () => Promise<{
|
|
372
|
+
callId: string;
|
|
373
|
+
success: boolean;
|
|
374
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
375
|
+
message: string;
|
|
376
|
+
}>;
|
|
377
|
+
transfer: (targetParticipantId: string, reason?: string) => Promise<{
|
|
378
|
+
callId: string;
|
|
379
|
+
success: boolean;
|
|
380
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
381
|
+
message: string;
|
|
382
|
+
}>;
|
|
383
|
+
kick: (participantId: string, reason?: string) => Promise<{
|
|
384
|
+
callId: string;
|
|
385
|
+
success: boolean;
|
|
386
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
387
|
+
message: string;
|
|
388
|
+
}>;
|
|
389
|
+
mute: (participantId: string) => Promise<{
|
|
390
|
+
callId: string;
|
|
391
|
+
success: boolean;
|
|
392
|
+
action: "call_initiated" | "invite_sent" | "accepted" | "declined" | "cancelled" | "transfer_initiated" | "participant_kicked" | "participant_muted";
|
|
393
|
+
message: string;
|
|
394
|
+
}>;
|
|
227
395
|
};
|
|
228
396
|
|
|
229
397
|
/**
|
|
@@ -237,7 +405,6 @@ interface SdkEvent<T = any> {
|
|
|
237
405
|
type: string;
|
|
238
406
|
payload: T;
|
|
239
407
|
timestamp: number;
|
|
240
|
-
source: "socket" | "livekit" | "user";
|
|
241
408
|
}
|
|
242
409
|
/**
|
|
243
410
|
* SDK Event Types
|
|
@@ -264,66 +431,6 @@ declare enum SdkEventType {
|
|
|
264
431
|
CONNECTION_QUALITY_CHANGED = "connection:quality-changed",
|
|
265
432
|
ERROR_OCCURRED = "error:occurred"
|
|
266
433
|
}
|
|
267
|
-
/**
|
|
268
|
-
* Specific event payload types
|
|
269
|
-
*/
|
|
270
|
-
interface CallInitiatedEvent {
|
|
271
|
-
callId: string;
|
|
272
|
-
participants: string[];
|
|
273
|
-
type: "AUDIO" | "VIDEO";
|
|
274
|
-
timestamp: number;
|
|
275
|
-
}
|
|
276
|
-
interface CallIncomingEvent {
|
|
277
|
-
callId: string;
|
|
278
|
-
caller: {
|
|
279
|
-
id: string;
|
|
280
|
-
name: string;
|
|
281
|
-
avatarUrl?: string;
|
|
282
|
-
};
|
|
283
|
-
type: "AUDIO" | "VIDEO";
|
|
284
|
-
timestamp: number;
|
|
285
|
-
participants?: Array<{
|
|
286
|
-
id: string;
|
|
287
|
-
firstName?: string;
|
|
288
|
-
lastName?: string;
|
|
289
|
-
avatarUrl?: string;
|
|
290
|
-
role?: "CALLER" | "CALLEE" | "HOST" | "MEMBER";
|
|
291
|
-
}>;
|
|
292
|
-
}
|
|
293
|
-
interface CallDeclinedEvent {
|
|
294
|
-
callId: string;
|
|
295
|
-
participantId?: string;
|
|
296
|
-
reason?: string;
|
|
297
|
-
timestamp: number;
|
|
298
|
-
}
|
|
299
|
-
interface CallEndedEvent {
|
|
300
|
-
callId: string;
|
|
301
|
-
endedBy?: string;
|
|
302
|
-
reason?: "user" | "timeout" | "error";
|
|
303
|
-
timestamp: number;
|
|
304
|
-
}
|
|
305
|
-
interface MediaEnabledEvent {
|
|
306
|
-
participantId: string;
|
|
307
|
-
mediaType: "audio" | "video" | "screen";
|
|
308
|
-
timestamp: number;
|
|
309
|
-
}
|
|
310
|
-
interface MediaDisabledEvent {
|
|
311
|
-
participantId: string;
|
|
312
|
-
mediaType: "audio" | "video" | "screen";
|
|
313
|
-
timestamp: number;
|
|
314
|
-
}
|
|
315
|
-
interface ConnectionQualityChangedEvent {
|
|
316
|
-
participantId: string;
|
|
317
|
-
quality: "excellent" | "good" | "poor" | "lost";
|
|
318
|
-
timestamp: number;
|
|
319
|
-
}
|
|
320
|
-
interface ErrorOccurredEvent {
|
|
321
|
-
code: string;
|
|
322
|
-
message: string;
|
|
323
|
-
details?: any;
|
|
324
|
-
source: "socket" | "livekit" | "user";
|
|
325
|
-
timestamp: number;
|
|
326
|
-
}
|
|
327
434
|
/**
|
|
328
435
|
* Event handler type
|
|
329
436
|
*/
|
|
@@ -334,111 +441,551 @@ type EventHandler<T = any> = (event: SdkEvent<T>) => void;
|
|
|
334
441
|
interface EventSubscription {
|
|
335
442
|
unsubscribe: () => void;
|
|
336
443
|
}
|
|
337
|
-
/**
|
|
338
|
-
* Event filter function type
|
|
339
|
-
*/
|
|
340
|
-
type EventFilter<T = any> = (event: SdkEvent<T>) => boolean;
|
|
341
|
-
interface ParticipantInvitedEvent {
|
|
342
|
-
callId: string;
|
|
343
|
-
participant: {
|
|
344
|
-
id: string;
|
|
345
|
-
name: string;
|
|
346
|
-
avatarUrl?: string;
|
|
347
|
-
};
|
|
348
|
-
timestamp: number;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* SDK Event Bus Implementation
|
|
353
|
-
*
|
|
354
|
-
* Provides a centralized event system for internal SDK communication.
|
|
355
|
-
* Supports type-safe event subscription, filtering, and debugging.
|
|
356
|
-
*/
|
|
357
444
|
|
|
358
445
|
declare class EventBus {
|
|
359
|
-
private
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
constructor(debugMode?: boolean);
|
|
364
|
-
/**
|
|
365
|
-
* Subscribe to events of a specific type
|
|
366
|
-
*/
|
|
367
|
-
on<T = any>(eventType: string | SdkEventType, handler: EventHandler<T>, filter?: EventFilter<T>): EventSubscription;
|
|
368
|
-
/**
|
|
369
|
-
* Subscribe to events matching a pattern (e.g., "call:*")
|
|
370
|
-
*/
|
|
371
|
-
onPattern<T = any>(pattern: string, handler: EventHandler<T>, filter?: EventFilter<T>): EventSubscription;
|
|
372
|
-
/**
|
|
373
|
-
* Subscribe to a single event occurrence
|
|
374
|
-
*/
|
|
375
|
-
once<T = any>(eventType: string | SdkEventType, handler: EventHandler<T>, filter?: EventFilter<T>): EventSubscription;
|
|
376
|
-
/**
|
|
377
|
-
* Emit an event
|
|
378
|
-
*/
|
|
379
|
-
emit<T = any>(eventType: string | SdkEventType, payload: T, source?: "socket" | "livekit" | "user"): void;
|
|
380
|
-
/**
|
|
381
|
-
* Remove all listeners for a specific event type
|
|
382
|
-
*/
|
|
446
|
+
private emitter;
|
|
447
|
+
constructor();
|
|
448
|
+
on<T = any>(eventType: string | SdkEventType, handler: EventHandler<T>): EventSubscription;
|
|
449
|
+
emit<T = any>(eventType: string | SdkEventType, payload: T): void;
|
|
383
450
|
off(eventType: string | SdkEventType): void;
|
|
384
|
-
/**
|
|
385
|
-
* Remove all listeners
|
|
386
|
-
*/
|
|
387
451
|
removeAllListeners(): void;
|
|
388
|
-
/**
|
|
389
|
-
* Get the count of listeners for an event type
|
|
390
|
-
*/
|
|
391
|
-
listenerCount(eventType: string | SdkEventType): number;
|
|
392
|
-
/**
|
|
393
|
-
* Get all event types that have listeners
|
|
394
|
-
*/
|
|
395
|
-
getEventTypes(): string[];
|
|
396
|
-
/**
|
|
397
|
-
* Enable or disable debug mode
|
|
398
|
-
*/
|
|
399
|
-
setDebugMode(enabled: boolean): void;
|
|
400
|
-
/**
|
|
401
|
-
* Get event history for debugging
|
|
402
|
-
*/
|
|
403
|
-
getEventHistory(): SdkEvent[];
|
|
404
|
-
/**
|
|
405
|
-
* Clear event history
|
|
406
|
-
*/
|
|
407
|
-
clearHistory(): void;
|
|
408
|
-
/**
|
|
409
|
-
* Get events matching a filter
|
|
410
|
-
*/
|
|
411
|
-
getEventsWhere(filter: EventFilter): SdkEvent[];
|
|
412
|
-
private addToHistory;
|
|
413
|
-
/**
|
|
414
|
-
* Set maximum history size
|
|
415
|
-
*/
|
|
416
|
-
setMaxHistorySize(size: number): void;
|
|
417
452
|
}
|
|
418
453
|
declare const eventBus: EventBus;
|
|
419
454
|
|
|
420
|
-
declare function useEvent<T = any>(eventType: string | SdkEventType, callback?: EventHandler<T> | null
|
|
455
|
+
declare function useEvent<T = any>(eventType: string | SdkEventType, callback?: EventHandler<T> | null): SdkEvent<T> | undefined;
|
|
456
|
+
|
|
457
|
+
declare function useIncomingInvite(): IncomingInvite | null;
|
|
458
|
+
|
|
459
|
+
declare function useOutgoingInvites(): Record<string, OutgoingInvite>;
|
|
421
460
|
|
|
461
|
+
declare function useInviteAccepted(): boolean;
|
|
462
|
+
|
|
463
|
+
declare function useCallInitiated(): boolean;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Get the current session ID.
|
|
467
|
+
* Returns null when no active session.
|
|
468
|
+
*/
|
|
469
|
+
declare function useSessionId(): string | null;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Get the duration of the current session in seconds.
|
|
473
|
+
* Returns 0 for now (placeholder implementation).
|
|
474
|
+
*/
|
|
475
|
+
declare function useSessionDuration(): number;
|
|
476
|
+
|
|
477
|
+
declare function useRoom(options?: RoomOptions): Room | null;
|
|
478
|
+
|
|
479
|
+
declare function useParticipantMetadata(participantOrIdentity?: string | Participant): ParticipantMetadata | null;
|
|
480
|
+
|
|
481
|
+
declare const callCancelledSchema: z.ZodObject<{
|
|
482
|
+
callId: z.ZodString;
|
|
483
|
+
status: z.ZodLiteral<"cancelled">;
|
|
484
|
+
cancelledAt: z.ZodString;
|
|
485
|
+
}, "strict", z.ZodTypeAny, {
|
|
486
|
+
status: "cancelled";
|
|
487
|
+
callId: string;
|
|
488
|
+
cancelledAt: string;
|
|
489
|
+
}, {
|
|
490
|
+
status: "cancelled";
|
|
491
|
+
callId: string;
|
|
492
|
+
cancelledAt: string;
|
|
493
|
+
}>;
|
|
494
|
+
type CallCancelledEvent = z.infer<typeof callCancelledSchema>;
|
|
495
|
+
declare const callCreatedSchema: z.ZodObject<{
|
|
496
|
+
callId: z.ZodString;
|
|
497
|
+
status: z.ZodLiteral<"pending">;
|
|
498
|
+
roomName: z.ZodString;
|
|
499
|
+
createdAt: z.ZodString;
|
|
500
|
+
host: z.ZodObject<{
|
|
501
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
502
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
503
|
+
username: z.ZodNullable<z.ZodString>;
|
|
504
|
+
email: z.ZodNullable<z.ZodString>;
|
|
505
|
+
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
506
|
+
userId: z.ZodString;
|
|
507
|
+
}, "strict", z.ZodTypeAny, {
|
|
508
|
+
userId: string;
|
|
509
|
+
firstName: string | null;
|
|
510
|
+
lastName: string | null;
|
|
511
|
+
username: string | null;
|
|
512
|
+
email: string | null;
|
|
513
|
+
profilePhoto: string | null;
|
|
514
|
+
}, {
|
|
515
|
+
userId: string;
|
|
516
|
+
firstName: string | null;
|
|
517
|
+
lastName: string | null;
|
|
518
|
+
username: string | null;
|
|
519
|
+
email: string | null;
|
|
520
|
+
profilePhoto: string | null;
|
|
521
|
+
}>;
|
|
522
|
+
participants: z.ZodArray<z.ZodObject<{
|
|
523
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
524
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
525
|
+
username: z.ZodNullable<z.ZodString>;
|
|
526
|
+
email: z.ZodNullable<z.ZodString>;
|
|
527
|
+
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
528
|
+
userId: z.ZodString;
|
|
529
|
+
}, "strict", z.ZodTypeAny, {
|
|
530
|
+
userId: string;
|
|
531
|
+
firstName: string | null;
|
|
532
|
+
lastName: string | null;
|
|
533
|
+
username: string | null;
|
|
534
|
+
email: string | null;
|
|
535
|
+
profilePhoto: string | null;
|
|
536
|
+
}, {
|
|
537
|
+
userId: string;
|
|
538
|
+
firstName: string | null;
|
|
539
|
+
lastName: string | null;
|
|
540
|
+
username: string | null;
|
|
541
|
+
email: string | null;
|
|
542
|
+
profilePhoto: string | null;
|
|
543
|
+
}>, "many">;
|
|
544
|
+
}, "strict", z.ZodTypeAny, {
|
|
545
|
+
status: "pending";
|
|
546
|
+
roomName: string;
|
|
547
|
+
callId: string;
|
|
548
|
+
createdAt: string;
|
|
549
|
+
host: {
|
|
550
|
+
userId: string;
|
|
551
|
+
firstName: string | null;
|
|
552
|
+
lastName: string | null;
|
|
553
|
+
username: string | null;
|
|
554
|
+
email: string | null;
|
|
555
|
+
profilePhoto: string | null;
|
|
556
|
+
};
|
|
557
|
+
participants: {
|
|
558
|
+
userId: string;
|
|
559
|
+
firstName: string | null;
|
|
560
|
+
lastName: string | null;
|
|
561
|
+
username: string | null;
|
|
562
|
+
email: string | null;
|
|
563
|
+
profilePhoto: string | null;
|
|
564
|
+
}[];
|
|
565
|
+
}, {
|
|
566
|
+
status: "pending";
|
|
567
|
+
roomName: string;
|
|
568
|
+
callId: string;
|
|
569
|
+
createdAt: string;
|
|
570
|
+
host: {
|
|
571
|
+
userId: string;
|
|
572
|
+
firstName: string | null;
|
|
573
|
+
lastName: string | null;
|
|
574
|
+
username: string | null;
|
|
575
|
+
email: string | null;
|
|
576
|
+
profilePhoto: string | null;
|
|
577
|
+
};
|
|
578
|
+
participants: {
|
|
579
|
+
userId: string;
|
|
580
|
+
firstName: string | null;
|
|
581
|
+
lastName: string | null;
|
|
582
|
+
username: string | null;
|
|
583
|
+
email: string | null;
|
|
584
|
+
profilePhoto: string | null;
|
|
585
|
+
}[];
|
|
586
|
+
}>;
|
|
587
|
+
type CallCreatedEvent = z.infer<typeof callCreatedSchema>;
|
|
588
|
+
declare const callEndedSchema: z.ZodObject<{
|
|
589
|
+
callId: z.ZodString;
|
|
590
|
+
endedAt: z.ZodString;
|
|
591
|
+
endedByUserId: z.ZodOptional<z.ZodString>;
|
|
592
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
593
|
+
}, "strict", z.ZodTypeAny, {
|
|
594
|
+
callId: string;
|
|
595
|
+
endedAt: string;
|
|
596
|
+
endedByUserId?: string | undefined;
|
|
597
|
+
reason?: string | undefined;
|
|
598
|
+
}, {
|
|
599
|
+
callId: string;
|
|
600
|
+
endedAt: string;
|
|
601
|
+
endedByUserId?: string | undefined;
|
|
602
|
+
reason?: string | undefined;
|
|
603
|
+
}>;
|
|
604
|
+
type CallEndedEvent = z.infer<typeof callEndedSchema>;
|
|
605
|
+
declare const callInviteSchema: z.ZodObject<{
|
|
606
|
+
callId: z.ZodString;
|
|
607
|
+
status: z.ZodEnum<["pending", "active", "ended"]>;
|
|
608
|
+
caller: z.ZodObject<{
|
|
609
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
610
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
611
|
+
username: z.ZodNullable<z.ZodString>;
|
|
612
|
+
email: z.ZodNullable<z.ZodString>;
|
|
613
|
+
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
614
|
+
userId: z.ZodString;
|
|
615
|
+
}, "strict", z.ZodTypeAny, {
|
|
616
|
+
userId: string;
|
|
617
|
+
firstName: string | null;
|
|
618
|
+
lastName: string | null;
|
|
619
|
+
username: string | null;
|
|
620
|
+
email: string | null;
|
|
621
|
+
profilePhoto: string | null;
|
|
622
|
+
}, {
|
|
623
|
+
userId: string;
|
|
624
|
+
firstName: string | null;
|
|
625
|
+
lastName: string | null;
|
|
626
|
+
username: string | null;
|
|
627
|
+
email: string | null;
|
|
628
|
+
profilePhoto: string | null;
|
|
629
|
+
}>;
|
|
630
|
+
mode: z.ZodEnum<["VIDEO", "AUDIO"]>;
|
|
631
|
+
expiresAt: z.ZodString;
|
|
632
|
+
expiresInMs: z.ZodNumber;
|
|
633
|
+
}, "strict", z.ZodTypeAny, {
|
|
634
|
+
status: "pending" | "active" | "ended";
|
|
635
|
+
mode: "AUDIO" | "VIDEO";
|
|
636
|
+
callId: string;
|
|
637
|
+
caller: {
|
|
638
|
+
userId: string;
|
|
639
|
+
firstName: string | null;
|
|
640
|
+
lastName: string | null;
|
|
641
|
+
username: string | null;
|
|
642
|
+
email: string | null;
|
|
643
|
+
profilePhoto: string | null;
|
|
644
|
+
};
|
|
645
|
+
expiresAt: string;
|
|
646
|
+
expiresInMs: number;
|
|
647
|
+
}, {
|
|
648
|
+
status: "pending" | "active" | "ended";
|
|
649
|
+
mode: "AUDIO" | "VIDEO";
|
|
650
|
+
callId: string;
|
|
651
|
+
caller: {
|
|
652
|
+
userId: string;
|
|
653
|
+
firstName: string | null;
|
|
654
|
+
lastName: string | null;
|
|
655
|
+
username: string | null;
|
|
656
|
+
email: string | null;
|
|
657
|
+
profilePhoto: string | null;
|
|
658
|
+
};
|
|
659
|
+
expiresAt: string;
|
|
660
|
+
expiresInMs: number;
|
|
661
|
+
}>;
|
|
662
|
+
type CallInviteEvent = z.infer<typeof callInviteSchema>;
|
|
663
|
+
declare const callInviteAcceptedSchema: z.ZodObject<{
|
|
664
|
+
callId: z.ZodString;
|
|
665
|
+
status: z.ZodEnum<["pending", "active", "ended"]>;
|
|
666
|
+
participant: z.ZodObject<{
|
|
667
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
668
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
669
|
+
username: z.ZodNullable<z.ZodString>;
|
|
670
|
+
email: z.ZodNullable<z.ZodString>;
|
|
671
|
+
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
672
|
+
userId: z.ZodString;
|
|
673
|
+
}, "strict", z.ZodTypeAny, {
|
|
674
|
+
userId: string;
|
|
675
|
+
firstName: string | null;
|
|
676
|
+
lastName: string | null;
|
|
677
|
+
username: string | null;
|
|
678
|
+
email: string | null;
|
|
679
|
+
profilePhoto: string | null;
|
|
680
|
+
}, {
|
|
681
|
+
userId: string;
|
|
682
|
+
firstName: string | null;
|
|
683
|
+
lastName: string | null;
|
|
684
|
+
username: string | null;
|
|
685
|
+
email: string | null;
|
|
686
|
+
profilePhoto: string | null;
|
|
687
|
+
}>;
|
|
688
|
+
acceptedAt: z.ZodString;
|
|
689
|
+
}, "strict", z.ZodTypeAny, {
|
|
690
|
+
status: "pending" | "active" | "ended";
|
|
691
|
+
callId: string;
|
|
692
|
+
participant: {
|
|
693
|
+
userId: string;
|
|
694
|
+
firstName: string | null;
|
|
695
|
+
lastName: string | null;
|
|
696
|
+
username: string | null;
|
|
697
|
+
email: string | null;
|
|
698
|
+
profilePhoto: string | null;
|
|
699
|
+
};
|
|
700
|
+
acceptedAt: string;
|
|
701
|
+
}, {
|
|
702
|
+
status: "pending" | "active" | "ended";
|
|
703
|
+
callId: string;
|
|
704
|
+
participant: {
|
|
705
|
+
userId: string;
|
|
706
|
+
firstName: string | null;
|
|
707
|
+
lastName: string | null;
|
|
708
|
+
username: string | null;
|
|
709
|
+
email: string | null;
|
|
710
|
+
profilePhoto: string | null;
|
|
711
|
+
};
|
|
712
|
+
acceptedAt: string;
|
|
713
|
+
}>;
|
|
714
|
+
type CallInviteAcceptedEvent = z.infer<typeof callInviteAcceptedSchema>;
|
|
715
|
+
declare const callInviteCancelledSchema: z.ZodObject<{
|
|
716
|
+
callId: z.ZodString;
|
|
717
|
+
status: z.ZodEnum<["pending", "active", "ended"]>;
|
|
718
|
+
cancelledByUserId: z.ZodString;
|
|
719
|
+
cancelledAt: z.ZodString;
|
|
720
|
+
reason: z.ZodString;
|
|
721
|
+
}, "strict", z.ZodTypeAny, {
|
|
722
|
+
status: "pending" | "active" | "ended";
|
|
723
|
+
callId: string;
|
|
724
|
+
cancelledAt: string;
|
|
725
|
+
reason: string;
|
|
726
|
+
cancelledByUserId: string;
|
|
727
|
+
}, {
|
|
728
|
+
status: "pending" | "active" | "ended";
|
|
729
|
+
callId: string;
|
|
730
|
+
cancelledAt: string;
|
|
731
|
+
reason: string;
|
|
732
|
+
cancelledByUserId: string;
|
|
733
|
+
}>;
|
|
734
|
+
type CallInviteCancelledEvent = z.infer<typeof callInviteCancelledSchema>;
|
|
735
|
+
declare const callInviteDeclinedSchema: z.ZodObject<{
|
|
736
|
+
callId: z.ZodString;
|
|
737
|
+
status: z.ZodEnum<["pending", "active", "ended"]>;
|
|
738
|
+
participant: z.ZodObject<{
|
|
739
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
740
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
741
|
+
username: z.ZodNullable<z.ZodString>;
|
|
742
|
+
email: z.ZodNullable<z.ZodString>;
|
|
743
|
+
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
744
|
+
userId: z.ZodString;
|
|
745
|
+
}, "strict", z.ZodTypeAny, {
|
|
746
|
+
userId: string;
|
|
747
|
+
firstName: string | null;
|
|
748
|
+
lastName: string | null;
|
|
749
|
+
username: string | null;
|
|
750
|
+
email: string | null;
|
|
751
|
+
profilePhoto: string | null;
|
|
752
|
+
}, {
|
|
753
|
+
userId: string;
|
|
754
|
+
firstName: string | null;
|
|
755
|
+
lastName: string | null;
|
|
756
|
+
username: string | null;
|
|
757
|
+
email: string | null;
|
|
758
|
+
profilePhoto: string | null;
|
|
759
|
+
}>;
|
|
760
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
761
|
+
declinedAt: z.ZodString;
|
|
762
|
+
}, "strict", z.ZodTypeAny, {
|
|
763
|
+
status: "pending" | "active" | "ended";
|
|
764
|
+
callId: string;
|
|
765
|
+
participant: {
|
|
766
|
+
userId: string;
|
|
767
|
+
firstName: string | null;
|
|
768
|
+
lastName: string | null;
|
|
769
|
+
username: string | null;
|
|
770
|
+
email: string | null;
|
|
771
|
+
profilePhoto: string | null;
|
|
772
|
+
};
|
|
773
|
+
declinedAt: string;
|
|
774
|
+
reason?: string | undefined;
|
|
775
|
+
}, {
|
|
776
|
+
status: "pending" | "active" | "ended";
|
|
777
|
+
callId: string;
|
|
778
|
+
participant: {
|
|
779
|
+
userId: string;
|
|
780
|
+
firstName: string | null;
|
|
781
|
+
lastName: string | null;
|
|
782
|
+
username: string | null;
|
|
783
|
+
email: string | null;
|
|
784
|
+
profilePhoto: string | null;
|
|
785
|
+
};
|
|
786
|
+
declinedAt: string;
|
|
787
|
+
reason?: string | undefined;
|
|
788
|
+
}>;
|
|
789
|
+
type CallInviteDeclinedEvent = z.infer<typeof callInviteDeclinedSchema>;
|
|
790
|
+
declare const callInviteMissedSchema: z.ZodObject<{
|
|
791
|
+
callId: z.ZodString;
|
|
792
|
+
status: z.ZodEnum<["pending", "active", "ended"]>;
|
|
793
|
+
participant: z.ZodObject<{
|
|
794
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
795
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
796
|
+
username: z.ZodNullable<z.ZodString>;
|
|
797
|
+
email: z.ZodNullable<z.ZodString>;
|
|
798
|
+
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
799
|
+
userId: z.ZodString;
|
|
800
|
+
}, "strict", z.ZodTypeAny, {
|
|
801
|
+
userId: string;
|
|
802
|
+
firstName: string | null;
|
|
803
|
+
lastName: string | null;
|
|
804
|
+
username: string | null;
|
|
805
|
+
email: string | null;
|
|
806
|
+
profilePhoto: string | null;
|
|
807
|
+
}, {
|
|
808
|
+
userId: string;
|
|
809
|
+
firstName: string | null;
|
|
810
|
+
lastName: string | null;
|
|
811
|
+
username: string | null;
|
|
812
|
+
email: string | null;
|
|
813
|
+
profilePhoto: string | null;
|
|
814
|
+
}>;
|
|
815
|
+
missedAt: z.ZodString;
|
|
816
|
+
}, "strict", z.ZodTypeAny, {
|
|
817
|
+
status: "pending" | "active" | "ended";
|
|
818
|
+
callId: string;
|
|
819
|
+
participant: {
|
|
820
|
+
userId: string;
|
|
821
|
+
firstName: string | null;
|
|
822
|
+
lastName: string | null;
|
|
823
|
+
username: string | null;
|
|
824
|
+
email: string | null;
|
|
825
|
+
profilePhoto: string | null;
|
|
826
|
+
};
|
|
827
|
+
missedAt: string;
|
|
828
|
+
}, {
|
|
829
|
+
status: "pending" | "active" | "ended";
|
|
830
|
+
callId: string;
|
|
831
|
+
participant: {
|
|
832
|
+
userId: string;
|
|
833
|
+
firstName: string | null;
|
|
834
|
+
lastName: string | null;
|
|
835
|
+
username: string | null;
|
|
836
|
+
email: string | null;
|
|
837
|
+
profilePhoto: string | null;
|
|
838
|
+
};
|
|
839
|
+
missedAt: string;
|
|
840
|
+
}>;
|
|
841
|
+
type CallInviteMissedEvent = z.infer<typeof callInviteMissedSchema>;
|
|
842
|
+
declare const callInviteSentSchema: z.ZodObject<{
|
|
843
|
+
callId: z.ZodString;
|
|
844
|
+
invitee: z.ZodObject<{
|
|
845
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
846
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
847
|
+
username: z.ZodNullable<z.ZodString>;
|
|
848
|
+
email: z.ZodNullable<z.ZodString>;
|
|
849
|
+
profilePhoto: z.ZodNullable<z.ZodString>;
|
|
850
|
+
userId: z.ZodString;
|
|
851
|
+
}, "strict", z.ZodTypeAny, {
|
|
852
|
+
userId: string;
|
|
853
|
+
firstName: string | null;
|
|
854
|
+
lastName: string | null;
|
|
855
|
+
username: string | null;
|
|
856
|
+
email: string | null;
|
|
857
|
+
profilePhoto: string | null;
|
|
858
|
+
}, {
|
|
859
|
+
userId: string;
|
|
860
|
+
firstName: string | null;
|
|
861
|
+
lastName: string | null;
|
|
862
|
+
username: string | null;
|
|
863
|
+
email: string | null;
|
|
864
|
+
profilePhoto: string | null;
|
|
865
|
+
}>;
|
|
866
|
+
status: z.ZodLiteral<"sent">;
|
|
867
|
+
}, "strict", z.ZodTypeAny, {
|
|
868
|
+
status: "sent";
|
|
869
|
+
callId: string;
|
|
870
|
+
invitee: {
|
|
871
|
+
userId: string;
|
|
872
|
+
firstName: string | null;
|
|
873
|
+
lastName: string | null;
|
|
874
|
+
username: string | null;
|
|
875
|
+
email: string | null;
|
|
876
|
+
profilePhoto: string | null;
|
|
877
|
+
};
|
|
878
|
+
}, {
|
|
879
|
+
status: "sent";
|
|
880
|
+
callId: string;
|
|
881
|
+
invitee: {
|
|
882
|
+
userId: string;
|
|
883
|
+
firstName: string | null;
|
|
884
|
+
lastName: string | null;
|
|
885
|
+
username: string | null;
|
|
886
|
+
email: string | null;
|
|
887
|
+
profilePhoto: string | null;
|
|
888
|
+
};
|
|
889
|
+
}>;
|
|
890
|
+
type CallInviteSentEvent = z.infer<typeof callInviteSentSchema>;
|
|
422
891
|
declare const callJoinInfoSchema: z.ZodObject<{
|
|
423
892
|
callId: z.ZodString;
|
|
424
893
|
token: z.ZodString;
|
|
425
|
-
url: z.ZodOptional<z.ZodString>;
|
|
426
894
|
roomName: z.ZodString;
|
|
427
|
-
|
|
428
|
-
|
|
895
|
+
lkUrl: z.ZodString;
|
|
896
|
+
role: z.ZodEnum<["HOST", "PARTICIPANT", "GUEST"]>;
|
|
897
|
+
participantId: z.ZodOptional<z.ZodString>;
|
|
898
|
+
}, "strict", z.ZodTypeAny, {
|
|
899
|
+
role: "HOST" | "PARTICIPANT" | "GUEST";
|
|
429
900
|
token: string;
|
|
430
901
|
roomName: string;
|
|
431
902
|
callId: string;
|
|
432
|
-
|
|
433
|
-
|
|
903
|
+
lkUrl: string;
|
|
904
|
+
participantId?: string | undefined;
|
|
434
905
|
}, {
|
|
906
|
+
role: "HOST" | "PARTICIPANT" | "GUEST";
|
|
435
907
|
token: string;
|
|
436
908
|
roomName: string;
|
|
437
909
|
callId: string;
|
|
438
|
-
|
|
439
|
-
|
|
910
|
+
lkUrl: string;
|
|
911
|
+
participantId?: string | undefined;
|
|
440
912
|
}>;
|
|
441
913
|
type CallJoinInfoEvent = z.infer<typeof callJoinInfoSchema>;
|
|
914
|
+
declare const callMissedSchema: z.ZodObject<{
|
|
915
|
+
callId: z.ZodString;
|
|
916
|
+
endedAt: z.ZodString;
|
|
917
|
+
}, "strict", z.ZodTypeAny, {
|
|
918
|
+
callId: string;
|
|
919
|
+
endedAt: string;
|
|
920
|
+
}, {
|
|
921
|
+
callId: string;
|
|
922
|
+
endedAt: string;
|
|
923
|
+
}>;
|
|
924
|
+
type CallMissedEvent = z.infer<typeof callMissedSchema>;
|
|
925
|
+
declare const callParticipantAddedSchema: z.ZodObject<{
|
|
926
|
+
callId: z.ZodString;
|
|
927
|
+
status: z.ZodEnum<["pending", "active", "ended"]>;
|
|
928
|
+
participant: z.ZodObject<{
|
|
929
|
+
participantId: z.ZodString;
|
|
930
|
+
userId: z.ZodString;
|
|
931
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
932
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
933
|
+
username: z.ZodOptional<z.ZodString>;
|
|
934
|
+
email: z.ZodOptional<z.ZodString>;
|
|
935
|
+
profilePhoto: z.ZodOptional<z.ZodString>;
|
|
936
|
+
role: z.ZodEnum<["HOST", "PARTICIPANT", "GUEST"]>;
|
|
937
|
+
joinState: z.ZodEnum<["not_joined", "joined"]>;
|
|
938
|
+
}, "strict", z.ZodTypeAny, {
|
|
939
|
+
role: "HOST" | "PARTICIPANT" | "GUEST";
|
|
940
|
+
userId: string;
|
|
941
|
+
participantId: string;
|
|
942
|
+
joinState: "not_joined" | "joined";
|
|
943
|
+
firstName?: string | undefined;
|
|
944
|
+
lastName?: string | undefined;
|
|
945
|
+
username?: string | undefined;
|
|
946
|
+
email?: string | undefined;
|
|
947
|
+
profilePhoto?: string | undefined;
|
|
948
|
+
}, {
|
|
949
|
+
role: "HOST" | "PARTICIPANT" | "GUEST";
|
|
950
|
+
userId: string;
|
|
951
|
+
participantId: string;
|
|
952
|
+
joinState: "not_joined" | "joined";
|
|
953
|
+
firstName?: string | undefined;
|
|
954
|
+
lastName?: string | undefined;
|
|
955
|
+
username?: string | undefined;
|
|
956
|
+
email?: string | undefined;
|
|
957
|
+
profilePhoto?: string | undefined;
|
|
958
|
+
}>;
|
|
959
|
+
}, "strict", z.ZodTypeAny, {
|
|
960
|
+
status: "pending" | "active" | "ended";
|
|
961
|
+
callId: string;
|
|
962
|
+
participant: {
|
|
963
|
+
role: "HOST" | "PARTICIPANT" | "GUEST";
|
|
964
|
+
userId: string;
|
|
965
|
+
participantId: string;
|
|
966
|
+
joinState: "not_joined" | "joined";
|
|
967
|
+
firstName?: string | undefined;
|
|
968
|
+
lastName?: string | undefined;
|
|
969
|
+
username?: string | undefined;
|
|
970
|
+
email?: string | undefined;
|
|
971
|
+
profilePhoto?: string | undefined;
|
|
972
|
+
};
|
|
973
|
+
}, {
|
|
974
|
+
status: "pending" | "active" | "ended";
|
|
975
|
+
callId: string;
|
|
976
|
+
participant: {
|
|
977
|
+
role: "HOST" | "PARTICIPANT" | "GUEST";
|
|
978
|
+
userId: string;
|
|
979
|
+
participantId: string;
|
|
980
|
+
joinState: "not_joined" | "joined";
|
|
981
|
+
firstName?: string | undefined;
|
|
982
|
+
lastName?: string | undefined;
|
|
983
|
+
username?: string | undefined;
|
|
984
|
+
email?: string | undefined;
|
|
985
|
+
profilePhoto?: string | undefined;
|
|
986
|
+
};
|
|
987
|
+
}>;
|
|
988
|
+
type CallParticipantAddedEvent = z.infer<typeof callParticipantAddedSchema>;
|
|
442
989
|
|
|
443
990
|
type ErrorCode = "NETWORK" | "SOCKET_PAYLOAD" | "JOIN_FLOW" | "LIVEKIT_CONNECT" | "LIVEKIT_MEDIA" | "MEDIA_PERMISSION" | "DEVICE_SWITCH" | "API_ERROR" | "UNEXPECTED";
|
|
444
991
|
declare function pushError(code: ErrorCode, message: string, context?: any, logger?: (level: LogLevel, message: string, meta?: any) => void): void;
|
|
@@ -456,4 +1003,4 @@ declare function pushNetworkError(operation: string, error: unknown, logger?: (l
|
|
|
456
1003
|
declare function pushMediaPermissionError(device: string, error?: unknown, logger?: (level: LogLevel, message: string, meta?: any) => void): void;
|
|
457
1004
|
declare function pushDeviceError(operation: string, device: string, error: unknown, logger?: (level: LogLevel, message: string, meta?: any) => void): void;
|
|
458
1005
|
|
|
459
|
-
export { type ApiConfig, type CallActionResponse, type
|
|
1006
|
+
export { type ApiConfig, type CallActionResponse, type CallCancelledEvent, type CallCreatedEvent, type CallEndedEvent, type CallInviteAcceptedEvent, type CallInviteCancelledEvent, type CallInviteDeclinedEvent, type CallInviteEvent, type CallInviteMissedEvent, type CallInviteSentEvent, type CallJoinInfoEvent, type CallMissedEvent, type CallParticipantAddedEvent, type CallResponse, type CallState, type ErrorCode, type EventHandler, type EventSubscription, type IncomingInvite, type InitiateCallParams$1 as InitiateCallParams, type LiveKitJoinInfo, type OutgoingInvite, type ParticipantMetadata, type RtcError, type RtcOptions, RtcProvider, type RtcSdk, type RtcState, type SdkEvent, SdkEventType, type Session, apiConfig, callCancelledSchema, callCreatedSchema, callEndedSchema, callInviteAcceptedSchema, callInviteCancelledSchema, callInviteDeclinedSchema, callInviteMissedSchema, callInviteSchema, callInviteSentSchema, callJoinInfoSchema, callMissedSchema, callParticipantAddedSchema, clearErrors, eventBus, pushApiError, pushDeviceError, pushError, pushIdentityGuardError, pushLiveKitConnectError, pushMediaPermissionError, pushNetworkError, pushSocketValidationError, pushStaleEventError, useCallActions, useCallInitiated, useCallState, useEvent, useIncomingInvite, useInviteAccepted, useOutgoingInvites, useParticipantMetadata, useRoom, useSdk, useSessionDuration, useSessionId };
|