@whereby.com/browser-sdk 2.1.0-beta4 → 2.2.0-beta.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/README.md +48 -43
- package/dist/cdn/{v2-embed-beta4.js → v2-embed-beta.js} +2 -2
- package/dist/cdn/v2-react-beta.js +3 -0
- package/dist/embed/index.esm.js +113 -137
- package/dist/react/index.d.ts +10 -726
- package/dist/react/index.esm.js +877 -10485
- package/package.json +12 -40
- package/dist/cdn/v2-react-beta4.js +0 -3
- package/dist/core/index.d.ts +0 -2360
- package/dist/core/index.js +0 -62963
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.esm.js +0 -70
package/dist/react/index.d.ts
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import * as React
|
|
2
|
-
import
|
|
3
|
-
import { AxiosRequestConfig } from 'axios';
|
|
4
|
-
import EventEmitter from 'events';
|
|
5
|
-
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
6
|
-
import * as redux from 'redux';
|
|
7
|
-
import _whereby_jslib_media_src_utils_ServerSocket, { ChatMessage as ChatMessage$2 } from '@whereby/jslib-media/src/utils/ServerSocket';
|
|
8
|
-
import RtcManagerDispatcher from '@whereby/jslib-media/src/webrtc/RtcManagerDispatcher';
|
|
9
|
-
import RtcManager from '@whereby/jslib-media/src/webrtc/RtcManager';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Store, LocalMediaOptions, RemoteParticipant, LocalParticipant, Screenshare, ChatMessage as ChatMessage$1 } from '@whereby.com/core';
|
|
10
3
|
|
|
11
4
|
interface VideoViewSelfProps {
|
|
12
5
|
stream: MediaStream;
|
|
13
6
|
muted?: boolean;
|
|
14
7
|
mirror?: boolean;
|
|
15
|
-
style?: React
|
|
8
|
+
style?: React.CSSProperties;
|
|
16
9
|
onResize?: ({ width, height, stream }: {
|
|
17
10
|
width: number;
|
|
18
11
|
height: number;
|
|
@@ -22,717 +15,8 @@ interface VideoViewSelfProps {
|
|
|
22
15
|
aspectRatio: number;
|
|
23
16
|
}) => void;
|
|
24
17
|
}
|
|
25
|
-
type VideoViewProps = VideoViewSelfProps & React
|
|
26
|
-
declare const _default: ({ muted, mirror, stream, onResize, onSetAspectRatio, ...rest }: VideoViewProps) => React
|
|
27
|
-
|
|
28
|
-
type Json = string | number | boolean | null | Array<Json> | {
|
|
29
|
-
[key: string]: Json;
|
|
30
|
-
};
|
|
31
|
-
interface ResponseOptions {
|
|
32
|
-
data?: Json;
|
|
33
|
-
headers?: Record<string, unknown>;
|
|
34
|
-
status?: number;
|
|
35
|
-
statusText?: string;
|
|
36
|
-
url?: string | null;
|
|
37
|
-
}
|
|
38
|
-
declare class Response {
|
|
39
|
-
data: Json;
|
|
40
|
-
headers: Record<string, unknown>;
|
|
41
|
-
status: number;
|
|
42
|
-
statusText: string;
|
|
43
|
-
url: string | null;
|
|
44
|
-
constructor(initialValues?: ResponseOptions);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare class EmbeddedFreeTierStatus {
|
|
48
|
-
isExhausted: boolean;
|
|
49
|
-
renewsAt: Date;
|
|
50
|
-
totalMinutesLimit: number;
|
|
51
|
-
totalMinutesUsed: number;
|
|
52
|
-
constructor({ isExhausted, renewsAt, totalMinutesLimit, totalMinutesUsed, }: {
|
|
53
|
-
isExhausted: boolean;
|
|
54
|
-
renewsAt: Date;
|
|
55
|
-
totalMinutesLimit: number;
|
|
56
|
-
totalMinutesUsed: number;
|
|
57
|
-
});
|
|
58
|
-
static fromJson(data: Record<string, unknown>): EmbeddedFreeTierStatus;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
interface AccountProps {
|
|
62
|
-
basePlanId: string | null;
|
|
63
|
-
isDeactivated: boolean;
|
|
64
|
-
isOnTrial: boolean;
|
|
65
|
-
onTrialUntil: Date | null;
|
|
66
|
-
trialStatus: string | null;
|
|
67
|
-
embeddedFreeTierStatus: EmbeddedFreeTierStatus | null;
|
|
68
|
-
}
|
|
69
|
-
declare class Account {
|
|
70
|
-
basePlanId: string | null;
|
|
71
|
-
embeddedFreeTierStatus: EmbeddedFreeTierStatus | null;
|
|
72
|
-
isDeactivated: boolean;
|
|
73
|
-
isOnTrial: boolean;
|
|
74
|
-
onTrialUntil: Date | null;
|
|
75
|
-
trialStatus: string | null;
|
|
76
|
-
constructor({ basePlanId, embeddedFreeTierStatus, isDeactivated, isOnTrial, onTrialUntil, trialStatus, }: AccountProps);
|
|
77
|
-
static fromJson(data: Record<string, unknown>): Account;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
interface OrganizationPermissionAction {
|
|
81
|
-
isAllowed: boolean;
|
|
82
|
-
isSupported: boolean;
|
|
83
|
-
}
|
|
84
|
-
interface FullOrganizationPermissions {
|
|
85
|
-
images: {
|
|
86
|
-
logoImageUrl: {
|
|
87
|
-
set: OrganizationPermissionAction;
|
|
88
|
-
reset: OrganizationPermissionAction;
|
|
89
|
-
};
|
|
90
|
-
roomBackgroundImageUrl: {
|
|
91
|
-
set: OrganizationPermissionAction;
|
|
92
|
-
reset: OrganizationPermissionAction;
|
|
93
|
-
};
|
|
94
|
-
roomKnockPageBackgroundImageUrl: {
|
|
95
|
-
set: OrganizationPermissionAction;
|
|
96
|
-
reset: OrganizationPermissionAction;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
invitations: {
|
|
100
|
-
add: OrganizationPermissionAction;
|
|
101
|
-
delete: OrganizationPermissionAction;
|
|
102
|
-
list: OrganizationPermissionAction;
|
|
103
|
-
};
|
|
104
|
-
roles: {
|
|
105
|
-
set: OrganizationPermissionAction;
|
|
106
|
-
remove: OrganizationPermissionAction;
|
|
107
|
-
removeSelf: OrganizationPermissionAction;
|
|
108
|
-
list: OrganizationPermissionAction;
|
|
109
|
-
};
|
|
110
|
-
users: {
|
|
111
|
-
signUpWithoutInvitation: OrganizationPermissionAction;
|
|
112
|
-
};
|
|
113
|
-
rooms: {
|
|
114
|
-
customize: OrganizationPermissionAction;
|
|
115
|
-
customizeSelf: OrganizationPermissionAction;
|
|
116
|
-
list: OrganizationPermissionAction;
|
|
117
|
-
lock: OrganizationPermissionAction;
|
|
118
|
-
unclaim: OrganizationPermissionAction;
|
|
119
|
-
unclaimSelf: OrganizationPermissionAction;
|
|
120
|
-
};
|
|
121
|
-
subscriptions: {
|
|
122
|
-
add: OrganizationPermissionAction;
|
|
123
|
-
list: OrganizationPermissionAction;
|
|
124
|
-
payLatestInvoice: OrganizationPermissionAction;
|
|
125
|
-
updatePlan: OrganizationPermissionAction;
|
|
126
|
-
};
|
|
127
|
-
browserExtension: {
|
|
128
|
-
install: OrganizationPermissionAction;
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
type OrganizationPermissions = Partial<FullOrganizationPermissions>;
|
|
132
|
-
interface OrganizationLimits {
|
|
133
|
-
maxNumberOfInvitationsAndUsers: number | null;
|
|
134
|
-
maxNumberOfClaimedRooms: number | null;
|
|
135
|
-
maxRoomLimitPerOrganization: number | null;
|
|
136
|
-
trialMinutesLimit: number | null;
|
|
137
|
-
includedUnits: number | null;
|
|
138
|
-
}
|
|
139
|
-
interface OrganizationOnboardingSurvey {
|
|
140
|
-
name: string;
|
|
141
|
-
value: unknown;
|
|
142
|
-
}
|
|
143
|
-
type OrganizationPreferences = Record<string, boolean | string | null | number>;
|
|
144
|
-
declare class Organization {
|
|
145
|
-
static GLOBAL_ORGANIZATION_ID: string;
|
|
146
|
-
organizationId: string;
|
|
147
|
-
organizationName: string;
|
|
148
|
-
subdomain: string;
|
|
149
|
-
permissions: OrganizationPermissions;
|
|
150
|
-
limits: OrganizationLimits;
|
|
151
|
-
account: Account | null;
|
|
152
|
-
logoImageUrl: string | null;
|
|
153
|
-
roomBackgroundImageUrl: string | null;
|
|
154
|
-
roomBackgroundThumbnailUrl: string | null;
|
|
155
|
-
roomKnockPageBackgroundImageUrl: string | null;
|
|
156
|
-
roomKnockPageBackgroundThumbnailUrl: string | null;
|
|
157
|
-
preferences: OrganizationPreferences | null;
|
|
158
|
-
onboardingSurvey: OrganizationOnboardingSurvey | null;
|
|
159
|
-
type: string | null;
|
|
160
|
-
constructor(properties: {
|
|
161
|
-
account: Account | null;
|
|
162
|
-
organizationId: string;
|
|
163
|
-
organizationName: string;
|
|
164
|
-
subdomain: string;
|
|
165
|
-
permissions: OrganizationPermissions;
|
|
166
|
-
limits: OrganizationLimits;
|
|
167
|
-
logoImageUrl: string | null;
|
|
168
|
-
roomBackgroundImageUrl: string | null;
|
|
169
|
-
roomBackgroundThumbnailUrl: string | null;
|
|
170
|
-
roomKnockPageBackgroundImageUrl: string | null;
|
|
171
|
-
roomKnockPageBackgroundThumbnailUrl: string | null;
|
|
172
|
-
preferences: OrganizationPreferences | null;
|
|
173
|
-
onboardingSurvey: OrganizationOnboardingSurvey | null;
|
|
174
|
-
type: string | null;
|
|
175
|
-
});
|
|
176
|
-
static fromJson(data: Json): Organization;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
type HttpClientRequestConfig = AxiosRequestConfig | {
|
|
180
|
-
[key: string]: unknown;
|
|
181
|
-
};
|
|
182
|
-
interface IHttpClient {
|
|
183
|
-
request(url: string, options: HttpClientRequestConfig): Promise<Response>;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Class used for making http calls. This is just a pure
|
|
187
|
-
* wrapper around the http lib that we decide to use,
|
|
188
|
-
* so that we can switch implementations.
|
|
189
|
-
*/
|
|
190
|
-
declare class HttpClient implements IHttpClient {
|
|
191
|
-
_baseUrl: string;
|
|
192
|
-
/**
|
|
193
|
-
* Creates an HttpClient instance.
|
|
194
|
-
*
|
|
195
|
-
* @param {string} [baseUrl] - The base URL where all requests are made.
|
|
196
|
-
*/
|
|
197
|
-
constructor({ baseUrl }: {
|
|
198
|
-
baseUrl: string;
|
|
199
|
-
});
|
|
200
|
-
private _requestAxios;
|
|
201
|
-
/**
|
|
202
|
-
* Wrapper for the axios API
|
|
203
|
-
*
|
|
204
|
-
* @param {string} url - Required. URL (appended to base URL) where API call will be made
|
|
205
|
-
* @param {object} options - Required. Contains the data needed for the fetch API
|
|
206
|
-
* @return {Promise<Response>} - A promise which will return a Response object (https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
207
|
-
*/
|
|
208
|
-
request(url: string, options: HttpClientRequestConfig): Promise<Response>;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* ApiClient for doing multipart/form-data requests.
|
|
213
|
-
*/
|
|
214
|
-
declare class MultipartHttpClient implements IHttpClient {
|
|
215
|
-
_httpClient: IHttpClient;
|
|
216
|
-
constructor({ httpClient }: {
|
|
217
|
-
httpClient: IHttpClient;
|
|
218
|
-
});
|
|
219
|
-
/**
|
|
220
|
-
* Convert the provided object to a FormData object containing the same keys and values.
|
|
221
|
-
* @param {object} data - the data to convert.
|
|
222
|
-
* @returns {FormData}
|
|
223
|
-
*/
|
|
224
|
-
static dataToFormData(data: Record<string, string>): FormData;
|
|
225
|
-
/**
|
|
226
|
-
* Request a resource using multipart/form-data encoding.
|
|
227
|
-
*
|
|
228
|
-
* @param {string} url - the url to request
|
|
229
|
-
* @param {object} options - Required. Contains the data needed for the fetch API
|
|
230
|
-
* @return {Promise<Response>} - A promise which will return a Response object (https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
231
|
-
*/
|
|
232
|
-
request(url: string, options?: HttpClientRequestConfig): Promise<Response>;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
interface CredentialsOptions {
|
|
236
|
-
uuid: string;
|
|
237
|
-
hmac: string;
|
|
238
|
-
userId?: string;
|
|
239
|
-
}
|
|
240
|
-
declare class Credentials {
|
|
241
|
-
credentials: {
|
|
242
|
-
uuid: CredentialsOptions["uuid"];
|
|
243
|
-
};
|
|
244
|
-
hmac: CredentialsOptions["hmac"];
|
|
245
|
-
userId: CredentialsOptions["userId"];
|
|
246
|
-
constructor(uuid: CredentialsOptions["uuid"], hmac: CredentialsOptions["hmac"], userId?: CredentialsOptions["userId"]);
|
|
247
|
-
toJson(): Json;
|
|
248
|
-
static fromJson(json: Json): Credentials;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
interface AuthenticatedHttpClientOptions {
|
|
252
|
-
httpClient: HttpClient;
|
|
253
|
-
fetchDeviceCredentials: () => Promise<Credentials | null>;
|
|
254
|
-
}
|
|
255
|
-
declare class AuthenticatedHttpClient {
|
|
256
|
-
private _httpClient;
|
|
257
|
-
private _fetchDeviceCredentials;
|
|
258
|
-
constructor({ httpClient, fetchDeviceCredentials }: AuthenticatedHttpClientOptions);
|
|
259
|
-
request(url: string, options: HttpClientRequestConfig): Promise<Response>;
|
|
260
|
-
}
|
|
261
|
-
interface ApiClientOptions {
|
|
262
|
-
baseUrl?: string;
|
|
263
|
-
fetchDeviceCredentials?: AuthenticatedHttpClientOptions["fetchDeviceCredentials"];
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Class used for all Whereby API calls.
|
|
267
|
-
*/
|
|
268
|
-
declare class ApiClient {
|
|
269
|
-
authenticatedHttpClient: AuthenticatedHttpClient;
|
|
270
|
-
authenticatedFormDataHttpClient: MultipartHttpClient;
|
|
271
|
-
/**
|
|
272
|
-
* Create an ApiClient instance.
|
|
273
|
-
*/
|
|
274
|
-
constructor({ baseUrl, fetchDeviceCredentials, }?: ApiClientOptions);
|
|
275
|
-
/**
|
|
276
|
-
* Wrapper for the fetch API
|
|
277
|
-
*/
|
|
278
|
-
request(url: string, options: HttpClientRequestConfig): Promise<Response>;
|
|
279
|
-
/**
|
|
280
|
-
* Performs a multipart request where data is multipart/form-data encoded.
|
|
281
|
-
*/
|
|
282
|
-
requestMultipart(url: string, options: HttpClientRequestConfig): Promise<Response>;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Related to device calls needed to obtain credentials
|
|
287
|
-
*/
|
|
288
|
-
declare class DeviceService {
|
|
289
|
-
_apiClient: ApiClient;
|
|
290
|
-
constructor({ apiClient }: {
|
|
291
|
-
apiClient: ApiClient;
|
|
292
|
-
});
|
|
293
|
-
/**
|
|
294
|
-
* Get's the device credentials needed for most of the other API services
|
|
295
|
-
*
|
|
296
|
-
* @return {Promise} A promise which is fulfilled or failed based on the
|
|
297
|
-
* response.
|
|
298
|
-
*/
|
|
299
|
-
getCredentials(): Promise<Credentials | null>;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
interface AbstractStore {
|
|
303
|
-
loadOrDefault(defaultValue: Json): Promise<Json>;
|
|
304
|
-
save(value: Json): Promise<void>;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
declare class CredentialsService extends EventEmitter {
|
|
308
|
-
_deviceService: DeviceService;
|
|
309
|
-
_credentialsStore: AbstractStore;
|
|
310
|
-
credentialsPromise?: Promise<Credentials | null>;
|
|
311
|
-
/**
|
|
312
|
-
* Service to manage Whereby's Rest API credentials.
|
|
313
|
-
*
|
|
314
|
-
* @param {ObjectStore} credentialsStore - Store to manage the credentials.
|
|
315
|
-
*/
|
|
316
|
-
constructor({ deviceService, credentialsStore, }: {
|
|
317
|
-
deviceService: DeviceService;
|
|
318
|
-
credentialsStore: AbstractStore;
|
|
319
|
-
});
|
|
320
|
-
static create({ baseUrl, storeName, storeType, }: {
|
|
321
|
-
baseUrl: string;
|
|
322
|
-
storeName?: string;
|
|
323
|
-
storeType?: "localStorage" | "chromeStorage";
|
|
324
|
-
}): CredentialsService;
|
|
325
|
-
/**
|
|
326
|
-
* Contacts the REST API to get new credentials. DO NOT USE directly, call getCredentials() instead.
|
|
327
|
-
*
|
|
328
|
-
* @see getCredentials
|
|
329
|
-
* @returns {Promise.<Credentials>} - Promise that resolves with the credentials.
|
|
330
|
-
*/
|
|
331
|
-
_fetchNewCredentialsFromApi(): Promise<Credentials | null>;
|
|
332
|
-
/**
|
|
333
|
-
* Returns the current credentials without triggering an API request to get new ones.
|
|
334
|
-
* If no credentials are currently available it will return null.
|
|
335
|
-
*
|
|
336
|
-
* @returns {?Credentials} - The credentials currently in use, null otherwise.
|
|
337
|
-
*/
|
|
338
|
-
getCurrentCredentials(): Promise<Credentials | null>;
|
|
339
|
-
/**
|
|
340
|
-
* Returns a promise that will contain the credentials for this client.
|
|
341
|
-
* If no credentials are available in local storage, new ones will be fetched from the server.
|
|
342
|
-
*
|
|
343
|
-
* @returns {Promise.<Credentials>} - Promise that resolves with the credentials.
|
|
344
|
-
*/
|
|
345
|
-
getCredentials(): Promise<Credentials | null>;
|
|
346
|
-
/**
|
|
347
|
-
* Saves new credentials which replace the existing ones and abort any pending request to get new ones.
|
|
348
|
-
*
|
|
349
|
-
* @param {Credentials} credentials - New credentials to store.
|
|
350
|
-
*/
|
|
351
|
-
saveCredentials(credentials: Credentials): Promise<Credentials>;
|
|
352
|
-
/**
|
|
353
|
-
* It will set the userId for the current credentials.
|
|
354
|
-
*
|
|
355
|
-
* @param userId - The user id to set.
|
|
356
|
-
*/
|
|
357
|
-
setUserId(userId: string | null): Promise<void>;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
type UserConsentAction = "accepted" | "rejected" | null;
|
|
361
|
-
type ConsentGrantRequest = {
|
|
362
|
-
readonly consentRevisionId: string;
|
|
363
|
-
readonly action: UserConsentAction;
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
declare class OrganizationService {
|
|
367
|
-
_apiClient: ApiClient;
|
|
368
|
-
constructor({ apiClient }: {
|
|
369
|
-
apiClient: ApiClient;
|
|
370
|
-
});
|
|
371
|
-
/**
|
|
372
|
-
* Creates an organization.
|
|
373
|
-
*/
|
|
374
|
-
createOrganization({ organizationName, subdomain, owner, }: {
|
|
375
|
-
organizationName: string;
|
|
376
|
-
subdomain: string;
|
|
377
|
-
owner: {
|
|
378
|
-
email: string;
|
|
379
|
-
displayName: string;
|
|
380
|
-
verificationCode: string;
|
|
381
|
-
consents?: ReadonlyArray<ConsentGrantRequest>;
|
|
382
|
-
} | {
|
|
383
|
-
idToken: string;
|
|
384
|
-
displayName: string;
|
|
385
|
-
consents?: ReadonlyArray<ConsentGrantRequest>;
|
|
386
|
-
};
|
|
387
|
-
}): Promise<string>;
|
|
388
|
-
/**
|
|
389
|
-
* Retrieves the organization based on the subdomain.
|
|
390
|
-
*/
|
|
391
|
-
getOrganizationBySubdomain(subdomain: string): Promise<Organization | null>;
|
|
392
|
-
/**
|
|
393
|
-
* Retrieves the organization based on the organizationId.
|
|
394
|
-
*
|
|
395
|
-
* Note: This endpoint should only be used to retrieve an organization when the device is linked
|
|
396
|
-
* to a user in that organization. Use getOrganizationBySubdomain instead if you just want the information
|
|
397
|
-
* about an organization that is mapped to a given subdomain.
|
|
398
|
-
*/
|
|
399
|
-
getOrganizationByOrganizationId(organizationId: string): Promise<Organization | null>;
|
|
400
|
-
/**
|
|
401
|
-
* Retrieves the organizations that contain a user
|
|
402
|
-
* matching provided the email+code or phoneNumber+code
|
|
403
|
-
* combination.
|
|
404
|
-
*/
|
|
405
|
-
getOrganizationsByContactPoint(options: {
|
|
406
|
-
email: string;
|
|
407
|
-
code: string;
|
|
408
|
-
} | {
|
|
409
|
-
phoneNumber: string;
|
|
410
|
-
code: string;
|
|
411
|
-
}): Promise<ReadonlyArray<Organization>>;
|
|
412
|
-
/**
|
|
413
|
-
* Retrieves the organizations that contain a user
|
|
414
|
-
* matching provided the idToken
|
|
415
|
-
*/
|
|
416
|
-
getOrganizationsByIdToken({ idToken }: {
|
|
417
|
-
idToken: string;
|
|
418
|
-
}): Promise<ReadonlyArray<Organization>>;
|
|
419
|
-
/**
|
|
420
|
-
* Retrieves the organizations containing a user
|
|
421
|
-
* with either the email or phoneNumber matching the logged in user.
|
|
422
|
-
*
|
|
423
|
-
* This is useful for showing the possible organization that the current
|
|
424
|
-
* user could log in to.
|
|
425
|
-
*/
|
|
426
|
-
getOrganizationsByLoggedInUser(): Promise<ReadonlyArray<Organization>>;
|
|
427
|
-
/**
|
|
428
|
-
* Checks if a subdomain is available and verifies its format.
|
|
429
|
-
*/
|
|
430
|
-
getSubdomainAvailability(subdomain: string): Promise<{
|
|
431
|
-
status: string;
|
|
432
|
-
}>;
|
|
433
|
-
/**
|
|
434
|
-
* Updates preferences of the organization.
|
|
435
|
-
*/
|
|
436
|
-
updatePreferences({ organizationId, preferences, }: {
|
|
437
|
-
organizationId: string;
|
|
438
|
-
preferences: OrganizationPreferences;
|
|
439
|
-
}): Promise<undefined>;
|
|
440
|
-
/**
|
|
441
|
-
* Delete organization
|
|
442
|
-
*/
|
|
443
|
-
deleteOrganization({ organizationId }: {
|
|
444
|
-
organizationId: string;
|
|
445
|
-
}): Promise<undefined>;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
interface RoomParticipantData {
|
|
449
|
-
displayName: string;
|
|
450
|
-
id: string;
|
|
451
|
-
stream?: MediaStream;
|
|
452
|
-
isAudioEnabled: boolean;
|
|
453
|
-
isVideoEnabled: boolean;
|
|
454
|
-
}
|
|
455
|
-
declare class RoomParticipant {
|
|
456
|
-
readonly displayName: string;
|
|
457
|
-
readonly id: string;
|
|
458
|
-
readonly stream?: MediaStream;
|
|
459
|
-
readonly isAudioEnabled: boolean;
|
|
460
|
-
readonly isLocalParticipant: boolean;
|
|
461
|
-
readonly isVideoEnabled: boolean;
|
|
462
|
-
constructor({ displayName, id, stream, isAudioEnabled, isVideoEnabled }: RoomParticipantData);
|
|
463
|
-
}
|
|
464
|
-
type StreamState = "new_accept" | "to_accept" | "old_accept" | "done_accept" | "to_unaccept" | "done_unaccept" | "auto";
|
|
465
|
-
interface Stream {
|
|
466
|
-
id: string;
|
|
467
|
-
state: StreamState;
|
|
468
|
-
}
|
|
469
|
-
interface RemoteParticipant {
|
|
470
|
-
id: string;
|
|
471
|
-
displayName: string;
|
|
472
|
-
isAudioEnabled: boolean;
|
|
473
|
-
isVideoEnabled: boolean;
|
|
474
|
-
isLocalParticipant: boolean;
|
|
475
|
-
stream: (MediaStream & {
|
|
476
|
-
inboundId?: string;
|
|
477
|
-
}) | null;
|
|
478
|
-
streams: Stream[];
|
|
479
|
-
newJoiner: boolean;
|
|
480
|
-
presentationStream: (MediaStream & {
|
|
481
|
-
inboundId?: string;
|
|
482
|
-
}) | null;
|
|
483
|
-
}
|
|
484
|
-
declare class LocalParticipant extends RoomParticipant {
|
|
485
|
-
readonly isLocalParticipant = true;
|
|
486
|
-
constructor({ displayName, id, stream, isAudioEnabled, isVideoEnabled }: RoomParticipantData);
|
|
487
|
-
}
|
|
488
|
-
interface WaitingParticipant {
|
|
489
|
-
id: string;
|
|
490
|
-
displayName: string | null;
|
|
491
|
-
}
|
|
492
|
-
interface Screenshare {
|
|
493
|
-
participantId: string;
|
|
494
|
-
id: string;
|
|
495
|
-
hasAudioTrack: boolean;
|
|
496
|
-
stream?: MediaStream;
|
|
497
|
-
isLocal: boolean;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Reducer
|
|
502
|
-
*/
|
|
503
|
-
interface WaitingParticipantsState {
|
|
504
|
-
waitingParticipants: WaitingParticipant[];
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Reducer
|
|
509
|
-
*/
|
|
510
|
-
interface StreamingState {
|
|
511
|
-
isStreaming: boolean;
|
|
512
|
-
error: unknown;
|
|
513
|
-
startedAt?: number;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* Reducer
|
|
518
|
-
*/
|
|
519
|
-
interface rtcAnalyticsState {
|
|
520
|
-
reportedValues: {
|
|
521
|
-
[key: string]: unknown;
|
|
522
|
-
};
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
interface LocalScreenshareState {
|
|
526
|
-
status: "" | "starting" | "active";
|
|
527
|
-
stream: MediaStream | null;
|
|
528
|
-
error: unknown | null;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
interface LocalParticipantState$1 extends LocalParticipantState {
|
|
532
|
-
isScreenSharing: boolean;
|
|
533
|
-
roleName: string;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
/**
|
|
537
|
-
* Reducer
|
|
538
|
-
*/
|
|
539
|
-
interface CloudRecordingState$1 {
|
|
540
|
-
isRecording: boolean;
|
|
541
|
-
error: unknown;
|
|
542
|
-
status?: "recording" | "requested" | "error";
|
|
543
|
-
startedAt?: number;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
type ChatMessage$1 = Pick<ChatMessage$2, "senderId" | "timestamp" | "text">;
|
|
547
|
-
/**
|
|
548
|
-
* Reducer
|
|
549
|
-
*/
|
|
550
|
-
interface ChatState {
|
|
551
|
-
chatMessages: ChatMessage$1[];
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* Reducer
|
|
556
|
-
*/
|
|
557
|
-
interface AppState {
|
|
558
|
-
wantsToJoin: boolean;
|
|
559
|
-
roomUrl: string | null;
|
|
560
|
-
roomName: string | null;
|
|
561
|
-
roomKey: string | null;
|
|
562
|
-
displayName: string | null;
|
|
563
|
-
sdkVersion: string | null;
|
|
564
|
-
externalId: string | null;
|
|
565
|
-
isNodeSdk: boolean;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* Reducer
|
|
570
|
-
*/
|
|
571
|
-
interface DeviceCredentialsState {
|
|
572
|
-
isFetching: boolean;
|
|
573
|
-
data?: Credentials | null;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
type LocalMediaOptions = {
|
|
577
|
-
disabled?: boolean;
|
|
578
|
-
audio: boolean;
|
|
579
|
-
video: boolean;
|
|
580
|
-
};
|
|
581
|
-
/**
|
|
582
|
-
* Reducer
|
|
583
|
-
*/
|
|
584
|
-
interface LocalMediaState$1 {
|
|
585
|
-
busyDeviceIds: string[];
|
|
586
|
-
cameraDeviceError?: unknown;
|
|
587
|
-
cameraEnabled: boolean;
|
|
588
|
-
currentCameraDeviceId?: string;
|
|
589
|
-
currentMicrophoneDeviceId?: string;
|
|
590
|
-
devices: MediaDeviceInfo[];
|
|
591
|
-
isSettingCameraDevice: boolean;
|
|
592
|
-
isSettingMicrophoneDevice: boolean;
|
|
593
|
-
isTogglingCamera: boolean;
|
|
594
|
-
microphoneDeviceError?: unknown;
|
|
595
|
-
microphoneEnabled: boolean;
|
|
596
|
-
options?: LocalMediaOptions;
|
|
597
|
-
status: "" | "stopped" | "starting" | "started" | "error";
|
|
598
|
-
startError?: unknown;
|
|
599
|
-
stream?: MediaStream;
|
|
600
|
-
isSwitchingStream: boolean;
|
|
601
|
-
onDeviceChange?: () => void;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Reducer
|
|
606
|
-
*/
|
|
607
|
-
interface OrganizationState {
|
|
608
|
-
data: Organization | null | undefined;
|
|
609
|
-
isFetching: boolean;
|
|
610
|
-
error: unknown;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* Reducer
|
|
615
|
-
*/
|
|
616
|
-
interface RemoteParticipantState$1 {
|
|
617
|
-
remoteParticipants: RemoteParticipant[];
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
type ConnectionStatus$1 = "initializing" | "connecting" | "connected" | "reconnect" | "room_locked" | "knocking" | "disconnecting" | "disconnected" | "knock_rejected";
|
|
621
|
-
/**
|
|
622
|
-
* Reducer
|
|
623
|
-
*/
|
|
624
|
-
interface RoomConnectionState$1 {
|
|
625
|
-
session: {
|
|
626
|
-
createdAt: string;
|
|
627
|
-
id: string;
|
|
628
|
-
} | null;
|
|
629
|
-
status: ConnectionStatus$1;
|
|
630
|
-
error: unknown;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* Reducer
|
|
635
|
-
*/
|
|
636
|
-
interface StreamResolutionUpdate {
|
|
637
|
-
streamId: string;
|
|
638
|
-
width: number;
|
|
639
|
-
height: number;
|
|
640
|
-
}
|
|
641
|
-
interface RtcConnectionState {
|
|
642
|
-
dispatcherCreated: boolean;
|
|
643
|
-
error: unknown;
|
|
644
|
-
isCreatingDispatcher: boolean;
|
|
645
|
-
reportedStreamResolutions: {
|
|
646
|
-
[streamId: string]: Omit<StreamResolutionUpdate, "streamId">;
|
|
647
|
-
};
|
|
648
|
-
rtcManager: RtcManager | null;
|
|
649
|
-
rtcManagerDispatcher: RtcManagerDispatcher | null;
|
|
650
|
-
rtcManagerInitialized: boolean;
|
|
651
|
-
status: "" | "ready" | "reconnect";
|
|
652
|
-
isAcceptingStreams: boolean;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Reducer
|
|
657
|
-
*/
|
|
658
|
-
interface SignalConnectionState {
|
|
659
|
-
deviceIdentified: boolean;
|
|
660
|
-
isIdentifyingDevice: boolean;
|
|
661
|
-
status: "connected" | "connecting" | "disconnected" | "reconnect" | "";
|
|
662
|
-
socket: _whereby_jslib_media_src_utils_ServerSocket | null;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
declare function createServices(): {
|
|
666
|
-
credentialsService: CredentialsService;
|
|
667
|
-
apiClient: ApiClient;
|
|
668
|
-
organizationService: OrganizationService;
|
|
669
|
-
fetchOrganizationFromRoomUrl: (roomUrl: string) => Promise<Organization | null>;
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
declare const createStore: ({ preloadedState, injectServices, }: {
|
|
673
|
-
preloadedState?: Partial<{
|
|
674
|
-
app: AppState;
|
|
675
|
-
chat: ChatState;
|
|
676
|
-
cloudRecording: CloudRecordingState$1;
|
|
677
|
-
deviceCredentials: DeviceCredentialsState;
|
|
678
|
-
localMedia: LocalMediaState$1;
|
|
679
|
-
localParticipant: LocalParticipantState$1;
|
|
680
|
-
localScreenshare: LocalScreenshareState;
|
|
681
|
-
organization: OrganizationState;
|
|
682
|
-
remoteParticipants: RemoteParticipantState$1;
|
|
683
|
-
roomConnection: RoomConnectionState$1;
|
|
684
|
-
rtcAnalytics: rtcAnalyticsState;
|
|
685
|
-
rtcConnection: RtcConnectionState;
|
|
686
|
-
signalConnection: SignalConnectionState;
|
|
687
|
-
streaming: StreamingState;
|
|
688
|
-
waitingParticipants: WaitingParticipantsState;
|
|
689
|
-
}> | undefined;
|
|
690
|
-
injectServices: ReturnType<typeof createServices>;
|
|
691
|
-
}) => _reduxjs_toolkit.EnhancedStore<{
|
|
692
|
-
app: AppState;
|
|
693
|
-
chat: ChatState;
|
|
694
|
-
cloudRecording: CloudRecordingState$1;
|
|
695
|
-
deviceCredentials: DeviceCredentialsState;
|
|
696
|
-
localMedia: LocalMediaState$1;
|
|
697
|
-
localParticipant: LocalParticipantState$1;
|
|
698
|
-
localScreenshare: LocalScreenshareState;
|
|
699
|
-
organization: OrganizationState;
|
|
700
|
-
remoteParticipants: RemoteParticipantState$1;
|
|
701
|
-
roomConnection: RoomConnectionState$1;
|
|
702
|
-
rtcAnalytics: rtcAnalyticsState;
|
|
703
|
-
rtcConnection: RtcConnectionState;
|
|
704
|
-
signalConnection: SignalConnectionState;
|
|
705
|
-
streaming: StreamingState;
|
|
706
|
-
waitingParticipants: WaitingParticipantsState;
|
|
707
|
-
}, redux.UnknownAction, _reduxjs_toolkit.Tuple<[redux.StoreEnhancer<{
|
|
708
|
-
dispatch: ((action: redux.Action<"listenerMiddleware/add">) => _reduxjs_toolkit.UnsubscribeListener) & redux_thunk.ThunkDispatch<{
|
|
709
|
-
app: AppState;
|
|
710
|
-
chat: ChatState;
|
|
711
|
-
cloudRecording: CloudRecordingState$1;
|
|
712
|
-
deviceCredentials: DeviceCredentialsState;
|
|
713
|
-
localMedia: LocalMediaState$1;
|
|
714
|
-
localParticipant: LocalParticipantState$1;
|
|
715
|
-
localScreenshare: LocalScreenshareState;
|
|
716
|
-
organization: OrganizationState;
|
|
717
|
-
remoteParticipants: RemoteParticipantState$1;
|
|
718
|
-
roomConnection: RoomConnectionState$1;
|
|
719
|
-
rtcAnalytics: rtcAnalyticsState;
|
|
720
|
-
rtcConnection: RtcConnectionState;
|
|
721
|
-
signalConnection: SignalConnectionState;
|
|
722
|
-
streaming: StreamingState;
|
|
723
|
-
waitingParticipants: WaitingParticipantsState;
|
|
724
|
-
}, {
|
|
725
|
-
services: {
|
|
726
|
-
credentialsService: CredentialsService;
|
|
727
|
-
apiClient: ApiClient;
|
|
728
|
-
organizationService: OrganizationService;
|
|
729
|
-
fetchOrganizationFromRoomUrl: (roomUrl: string) => Promise<Organization | null>;
|
|
730
|
-
};
|
|
731
|
-
}, redux.UnknownAction>;
|
|
732
|
-
}, {}>, redux.StoreEnhancer<{}, {}>]>>;
|
|
733
|
-
type Store = ReturnType<typeof createStore>;
|
|
734
|
-
|
|
735
|
-
declare const sdkVersion = "__SDK_VERSION__";
|
|
18
|
+
type VideoViewProps = VideoViewSelfProps & React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
|
|
19
|
+
declare const _default: ({ muted, mirror, stream, onResize, onSetAspectRatio, ...rest }: VideoViewProps) => React.JSX.Element;
|
|
736
20
|
|
|
737
21
|
interface LocalMediaState {
|
|
738
22
|
currentCameraDeviceId?: string;
|
|
@@ -774,7 +58,7 @@ interface ChatMessageState {
|
|
|
774
58
|
}
|
|
775
59
|
type ScreenshareState = Screenshare;
|
|
776
60
|
type LocalScreenshareStatus = "starting" | "active";
|
|
777
|
-
type ChatMessage = Pick<ChatMessage$
|
|
61
|
+
type ChatMessage = Pick<ChatMessage$1, "senderId" | "timestamp" | "text">;
|
|
778
62
|
type ConnectionStatus = "initializing" | "connecting" | "connected" | "reconnect" | "room_locked" | "knocking" | "disconnecting" | "disconnected" | "knock_rejected";
|
|
779
63
|
type CloudRecordingState = {
|
|
780
64
|
error?: string;
|
|
@@ -819,6 +103,7 @@ interface RoomConnectionActions {
|
|
|
819
103
|
stopCloudRecording(): void;
|
|
820
104
|
stopScreenshare(): void;
|
|
821
105
|
}
|
|
106
|
+
|
|
822
107
|
type VideoViewComponentProps = Omit<React.ComponentProps<typeof _default>, "onResize">;
|
|
823
108
|
interface RoomConnectionComponents {
|
|
824
109
|
VideoView: (props: VideoViewComponentProps) => ReturnType<typeof _default>;
|
|
@@ -829,7 +114,6 @@ type RoomConnectionRef = {
|
|
|
829
114
|
components: RoomConnectionComponents;
|
|
830
115
|
_ref: Store;
|
|
831
116
|
};
|
|
832
|
-
|
|
833
117
|
declare function useRoomConnection(roomUrl: string, roomConnectionOptions?: UseRoomConnectionOptions): RoomConnectionRef;
|
|
834
118
|
|
|
835
119
|
declare function useLocalMedia(optionsOrStream?: UseLocalMediaOptions | MediaStream): UseLocalMediaResult;
|
|
@@ -852,9 +136,9 @@ interface GridProps {
|
|
|
852
136
|
origin: Origin;
|
|
853
137
|
};
|
|
854
138
|
participant: RemoteParticipantState | LocalParticipantState;
|
|
855
|
-
}) => React
|
|
139
|
+
}) => React.ReactNode;
|
|
856
140
|
videoGridGap?: number;
|
|
857
141
|
}
|
|
858
|
-
declare function Grid({ roomConnection, renderParticipant, videoGridGap }: GridProps): React
|
|
142
|
+
declare function Grid({ roomConnection, renderParticipant, videoGridGap }: GridProps): React.JSX.Element;
|
|
859
143
|
|
|
860
|
-
export { type ChatMessageState as ChatMessage, type LocalParticipantState as LocalParticipant, type RemoteParticipantState as RemoteParticipant, type RoomConnectionState as RoomConnection, type ScreenshareState as Screenshare, type UseLocalMediaResult, Grid as VideoGrid, _default as VideoView, type WaitingParticipantState as WaitingParticipant,
|
|
144
|
+
export { type ChatMessageState as ChatMessage, type LocalParticipantState as LocalParticipant, type RemoteParticipantState as RemoteParticipant, type RoomConnectionState as RoomConnection, type ScreenshareState as Screenshare, type UseLocalMediaResult, Grid as VideoGrid, _default as VideoView, type WaitingParticipantState as WaitingParticipant, useLocalMedia, useRoomConnection };
|