@whereby.com/core 1.12.1 → 1.14.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 +422 -63
- package/dist/index.d.cts +57 -6
- package/dist/index.d.mts +57 -6
- package/dist/index.d.ts +57 -6
- package/dist/index.mjs +420 -66
- package/dist/legacy-esm.js +420 -66
- package/dist/redux/index.cjs +338 -19
- package/dist/redux/index.d.cts +207 -5
- package/dist/redux/index.d.mts +207 -5
- package/dist/redux/index.d.ts +207 -5
- package/dist/redux/index.js +324 -20
- package/dist/redux/index.mjs +324 -20
- package/package.json +6 -12
package/dist/redux/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createAsyncThunk, createListenerMiddleware, addListener, createSlice, createAction, createSelector, isAnyOf, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
2
|
-
import { ServerSocket, getDeviceData, getStream, getUpdatedDevices, replaceTracksInStream, getDisplayMedia, CAMERA_STREAM_ID, RtcManagerDispatcher, setClientProvider, subscribeIssues, assert, fromLocation } from '@whereby.com/media';
|
|
2
|
+
import { ServerSocket, isFileShareError, getDeviceData, getStream, getUpdatedDevices, replaceTracksInStream, getDisplayMedia, CAMERA_STREAM_ID, RtcManagerDispatcher, setClientProvider, subscribeIssues, assert, fromLocation } from '@whereby.com/media';
|
|
3
|
+
import { v4 } from 'uuid';
|
|
3
4
|
import { EventEmitter } from 'events';
|
|
4
5
|
import nodeBtoa from 'btoa';
|
|
5
6
|
import axios from 'axios';
|
|
@@ -73,9 +74,9 @@ const createReactor = (selectors, callback) => {
|
|
|
73
74
|
});
|
|
74
75
|
};
|
|
75
76
|
|
|
76
|
-
const coreVersion = "1.
|
|
77
|
+
const coreVersion = "1.14.0";
|
|
77
78
|
|
|
78
|
-
const initialState$
|
|
79
|
+
const initialState$2 = {
|
|
79
80
|
displayName: null,
|
|
80
81
|
externalId: null,
|
|
81
82
|
ignoreBreakoutGroups: false,
|
|
@@ -90,7 +91,7 @@ const initialState$1 = {
|
|
|
90
91
|
};
|
|
91
92
|
const appSlice = createSlice({
|
|
92
93
|
name: "app",
|
|
93
|
-
initialState: initialState$
|
|
94
|
+
initialState: initialState$2,
|
|
94
95
|
reducers: {
|
|
95
96
|
doAppStart: (state, action) => {
|
|
96
97
|
const url = new URL(action.payload.roomUrl);
|
|
@@ -128,6 +129,7 @@ const signalEvents = {
|
|
|
128
129
|
breakoutSessionUpdated: createSignalEventAction("breakoutSessionUpdated"),
|
|
129
130
|
chatMessage: createSignalEventAction("chatMessage"),
|
|
130
131
|
chatMessageRemoved: createSignalEventAction("chatMessageRemoved"),
|
|
132
|
+
fileSharingError: createSignalEventAction("fileSharingError"),
|
|
131
133
|
clientLeft: createSignalEventAction("clientLeft"),
|
|
132
134
|
clientKicked: createSignalEventAction("clientKicked"),
|
|
133
135
|
clientMetadataReceived: createSignalEventAction("clientMetadataReceived"),
|
|
@@ -305,7 +307,13 @@ function forwardSocketEvents(socket, dispatch) {
|
|
|
305
307
|
socket.on("video_enabled", (payload) => dispatch(signalEvents.videoEnabled(payload)));
|
|
306
308
|
socket.on("audio_enable_requested", (payload) => dispatch(signalEvents.audioEnableRequested(payload)));
|
|
307
309
|
socket.on("client_metadata_received", (payload) => dispatch(signalEvents.clientMetadataReceived(payload)));
|
|
308
|
-
socket.on("chat_message", (payload) =>
|
|
310
|
+
socket.on("chat_message", (payload) => {
|
|
311
|
+
if (isFileShareError(payload)) {
|
|
312
|
+
dispatch(signalEvents.fileSharingError(payload));
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
dispatch(signalEvents.chatMessage(payload));
|
|
316
|
+
});
|
|
309
317
|
socket.on("chat_message_removed", (payload) => dispatch(signalEvents.chatMessageRemoved(payload)));
|
|
310
318
|
socket.on("disconnect", () => dispatch(signalEvents.disconnect()));
|
|
311
319
|
socket.on("room_knocked", (payload) => dispatch(signalEvents.roomKnocked(payload)));
|
|
@@ -988,9 +996,10 @@ startAppListening({
|
|
|
988
996
|
const devices = selectLocalMediaDevices(state);
|
|
989
997
|
if (!stream)
|
|
990
998
|
return;
|
|
999
|
+
const beforeEffectTracks = selectLocalMediaBeforeEffectTracks(state);
|
|
991
1000
|
const deviceData = getDeviceData({
|
|
992
|
-
audioTrack: stream.getAudioTracks()[0],
|
|
993
|
-
videoTrack: stream.getVideoTracks()[0],
|
|
1001
|
+
audioTrack: (beforeEffectTracks === null || beforeEffectTracks === void 0 ? void 0 : beforeEffectTracks.audio) || stream.getAudioTracks()[0],
|
|
1002
|
+
videoTrack: (beforeEffectTracks === null || beforeEffectTracks === void 0 ? void 0 : beforeEffectTracks.video) || stream.getVideoTracks()[0],
|
|
994
1003
|
devices,
|
|
995
1004
|
});
|
|
996
1005
|
dispatch(localStreamMetadataUpdated(deviceData));
|
|
@@ -1157,15 +1166,7 @@ const chatSlice = createSlice({
|
|
|
1157
1166
|
reducers: {},
|
|
1158
1167
|
extraReducers(builder) {
|
|
1159
1168
|
builder.addCase(signalEvents.chatMessage, (state, action) => {
|
|
1160
|
-
const message = {
|
|
1161
|
-
id: action.payload.id,
|
|
1162
|
-
senderId: action.payload.senderId,
|
|
1163
|
-
parentId: action.payload.parentId,
|
|
1164
|
-
timestamp: action.payload.timestamp,
|
|
1165
|
-
text: action.payload.text,
|
|
1166
|
-
sig: action.payload.sig,
|
|
1167
|
-
removed: false,
|
|
1168
|
-
};
|
|
1169
|
+
const message = Object.assign({ id: action.payload.id, senderId: action.payload.senderId, parentId: action.payload.parentId, timestamp: action.payload.timestamp, text: action.payload.text, sig: action.payload.sig, removed: false }, (action.payload.file && { file: action.payload.file }));
|
|
1169
1170
|
return Object.assign(Object.assign({}, state), { chatMessages: [...state.chatMessages, message] });
|
|
1170
1171
|
});
|
|
1171
1172
|
builder.addCase(signalEvents.chatMessageRemoved, (state, action) => {
|
|
@@ -2274,6 +2275,177 @@ createReactor([selectShouldStopConnectionMonitor], ({ dispatch }, shouldStartCon
|
|
|
2274
2275
|
}
|
|
2275
2276
|
});
|
|
2276
2277
|
|
|
2278
|
+
const MAX_FILES_PER_UPLOAD = 10;
|
|
2279
|
+
const MAX_FILE_SIZE = 15 * 1024 * 1024;
|
|
2280
|
+
const ACCEPTED_FILE_TYPES = {
|
|
2281
|
+
"application/doc": [".doc", ".docx"],
|
|
2282
|
+
"application/msword": [".doc", ".docx"],
|
|
2283
|
+
"application/pdf": [".pdf"],
|
|
2284
|
+
"application/rtf": [".rtf"],
|
|
2285
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
|
2286
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
|
|
2287
|
+
"audio/mpeg": [".mp3"],
|
|
2288
|
+
"audio/wav": [".wav"],
|
|
2289
|
+
"image/gif": [".gif"],
|
|
2290
|
+
"image/jpeg": [".jpeg", ".jpg"],
|
|
2291
|
+
"image/png": [".png"],
|
|
2292
|
+
"image/webp": [".webp"],
|
|
2293
|
+
"text/csv": [".csv"],
|
|
2294
|
+
"text/plain": [".txt"],
|
|
2295
|
+
"video/mp4": [".mp4"],
|
|
2296
|
+
"video/quicktime": [".mov"],
|
|
2297
|
+
"video/webm": [".webm"],
|
|
2298
|
+
"video/x-matroska": [".mkv"],
|
|
2299
|
+
};
|
|
2300
|
+
function isAcceptedFileType(file) {
|
|
2301
|
+
if (file.type && ACCEPTED_FILE_TYPES[file.type]) {
|
|
2302
|
+
return true;
|
|
2303
|
+
}
|
|
2304
|
+
const dot = file.name.lastIndexOf(".");
|
|
2305
|
+
if (dot < 0) {
|
|
2306
|
+
return false;
|
|
2307
|
+
}
|
|
2308
|
+
const extension = file.name.slice(dot).toLowerCase();
|
|
2309
|
+
return Object.values(ACCEPTED_FILE_TYPES).some((extensions) => extensions.includes(extension));
|
|
2310
|
+
}
|
|
2311
|
+
function validateFile(file) {
|
|
2312
|
+
if (!isAcceptedFileType(file)) {
|
|
2313
|
+
return "unsupported_file_type";
|
|
2314
|
+
}
|
|
2315
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
2316
|
+
return "file_too_large";
|
|
2317
|
+
}
|
|
2318
|
+
return undefined;
|
|
2319
|
+
}
|
|
2320
|
+
const fileShareSliceInitialState = {
|
|
2321
|
+
uploads: [],
|
|
2322
|
+
requestInFlight: false,
|
|
2323
|
+
};
|
|
2324
|
+
const fileShareSlice = createSlice({
|
|
2325
|
+
name: "fileShare",
|
|
2326
|
+
initialState: fileShareSliceInitialState,
|
|
2327
|
+
reducers: {
|
|
2328
|
+
fileUploadsStarted: (state, action) => {
|
|
2329
|
+
state.uploads.push(...action.payload);
|
|
2330
|
+
state.requestInFlight = true;
|
|
2331
|
+
},
|
|
2332
|
+
fileShareRequestSettled: (state) => {
|
|
2333
|
+
state.requestInFlight = false;
|
|
2334
|
+
},
|
|
2335
|
+
fileUploadSucceeded: (state, action) => {
|
|
2336
|
+
const upload = state.uploads.find((u) => u.id === action.payload.id);
|
|
2337
|
+
if (upload) {
|
|
2338
|
+
upload.status = "sent";
|
|
2339
|
+
}
|
|
2340
|
+
},
|
|
2341
|
+
fileUploadFailed: (state, action) => {
|
|
2342
|
+
const upload = state.uploads.find((u) => u.id === action.payload.id);
|
|
2343
|
+
if (upload) {
|
|
2344
|
+
upload.status = "error";
|
|
2345
|
+
upload.error = action.payload.error;
|
|
2346
|
+
}
|
|
2347
|
+
},
|
|
2348
|
+
clearFileUploads: (state) => {
|
|
2349
|
+
state.uploads = [];
|
|
2350
|
+
},
|
|
2351
|
+
},
|
|
2352
|
+
});
|
|
2353
|
+
const { fileUploadsStarted, fileShareRequestSettled, fileUploadSucceeded, fileUploadFailed, clearFileUploads } = fileShareSlice.actions;
|
|
2354
|
+
function uploadFile(file, uploadUrl) {
|
|
2355
|
+
const form = new FormData();
|
|
2356
|
+
form.append("Content-Type", file.type);
|
|
2357
|
+
Object.entries(uploadUrl.fields).forEach(([key, value]) => form.append(key, value));
|
|
2358
|
+
form.append("file", file);
|
|
2359
|
+
return fetch(uploadUrl.url, { method: "POST", body: form });
|
|
2360
|
+
}
|
|
2361
|
+
const doSendFiles = createAsyncRoomConnectedThunk("fileShare/sendFiles", (payload_1, _a) => __awaiter(void 0, [payload_1, _a], void 0, function* (payload, { dispatch, getState }) {
|
|
2362
|
+
const state = getState();
|
|
2363
|
+
if (state.fileShare.requestInFlight) {
|
|
2364
|
+
return Promise.reject(new Error("A file upload request is already in flight"));
|
|
2365
|
+
}
|
|
2366
|
+
const socket = selectSignalConnectionRaw(state).socket;
|
|
2367
|
+
if (!socket) {
|
|
2368
|
+
return Promise.reject(new Error("No signal connection"));
|
|
2369
|
+
}
|
|
2370
|
+
const breakoutCurrentId = selectBreakoutCurrentId(state);
|
|
2371
|
+
const { files } = payload;
|
|
2372
|
+
if (!files.length) {
|
|
2373
|
+
return;
|
|
2374
|
+
}
|
|
2375
|
+
const tooManyFiles = files.length > MAX_FILES_PER_UPLOAD;
|
|
2376
|
+
const entries = files.map((file) => {
|
|
2377
|
+
const error = tooManyFiles ? "too_many_files" : validateFile(file);
|
|
2378
|
+
const upload = Object.assign({ id: v4(), name: file.name, size: file.size, type: file.type, status: error ? "error" : "uploading" }, (error && { error }));
|
|
2379
|
+
return { file, upload };
|
|
2380
|
+
});
|
|
2381
|
+
dispatch(fileUploadsStarted(entries.map((entry) => entry.upload)));
|
|
2382
|
+
const accepted = entries.filter((entry) => entry.upload.status === "uploading");
|
|
2383
|
+
if (!accepted.length) {
|
|
2384
|
+
dispatch(fileShareRequestSettled());
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
const acceptedFiles = accepted.map((entry) => entry.file);
|
|
2388
|
+
const outcome = yield new Promise((resolve) => {
|
|
2389
|
+
let settled = false;
|
|
2390
|
+
const removeListener = dispatch(addAppListener({
|
|
2391
|
+
actionCreator: signalEvents.fileSharingError,
|
|
2392
|
+
effect: (action, listenerApi) => {
|
|
2393
|
+
if (settled)
|
|
2394
|
+
return;
|
|
2395
|
+
settled = true;
|
|
2396
|
+
listenerApi.unsubscribe();
|
|
2397
|
+
resolve({ error: action.payload.error });
|
|
2398
|
+
},
|
|
2399
|
+
}));
|
|
2400
|
+
socket.emit("request_file_upload_url", { files: acceptedFiles.map((f) => ({ name: f.name, size: f.size, type: f.type })) }, (urls) => {
|
|
2401
|
+
if (settled)
|
|
2402
|
+
return;
|
|
2403
|
+
settled = true;
|
|
2404
|
+
removeListener({ cancelActive: true });
|
|
2405
|
+
resolve({ urls });
|
|
2406
|
+
});
|
|
2407
|
+
});
|
|
2408
|
+
dispatch(fileShareRequestSettled());
|
|
2409
|
+
if ("error" in outcome) {
|
|
2410
|
+
accepted.forEach((entry) => dispatch(fileUploadFailed({ id: entry.upload.id, error: outcome.error })));
|
|
2411
|
+
return;
|
|
2412
|
+
}
|
|
2413
|
+
yield Promise.all(accepted.map((_a, index_1) => __awaiter(void 0, [_a, index_1], void 0, function* ({ file, upload }, index) {
|
|
2414
|
+
const urls = outcome.urls[index];
|
|
2415
|
+
if (!urls) {
|
|
2416
|
+
dispatch(fileUploadFailed({ id: upload.id, error: "upload_failed" }));
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2419
|
+
try {
|
|
2420
|
+
const response = yield uploadFile(file, urls.uploadUrl);
|
|
2421
|
+
if (!response.ok) {
|
|
2422
|
+
throw new Error(`S3 upload failed with status ${response.status}`);
|
|
2423
|
+
}
|
|
2424
|
+
socket.emit("chat_message", Object.assign({ text: "", file: {
|
|
2425
|
+
downloadUrl: urls.downloadUrl,
|
|
2426
|
+
name: file.name,
|
|
2427
|
+
size: file.size,
|
|
2428
|
+
type: file.type,
|
|
2429
|
+
key: urls.uploadUrl.fields.key,
|
|
2430
|
+
} }, (breakoutCurrentId && { breakoutGroup: breakoutCurrentId })));
|
|
2431
|
+
dispatch(fileUploadSucceeded({ id: upload.id }));
|
|
2432
|
+
}
|
|
2433
|
+
catch (_b) {
|
|
2434
|
+
dispatch(fileUploadFailed({ id: upload.id, error: "upload_failed" }));
|
|
2435
|
+
}
|
|
2436
|
+
})));
|
|
2437
|
+
}));
|
|
2438
|
+
const doDownloadFile = createAppAsyncThunk("fileShare/downloadFile", (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2439
|
+
const response = yield fetch(payload.file.downloadUrl, { mode: "cors", cache: "no-cache" });
|
|
2440
|
+
if (!response.ok) {
|
|
2441
|
+
throw new Error(`Failed to download file: ${response.status}`);
|
|
2442
|
+
}
|
|
2443
|
+
return response.blob();
|
|
2444
|
+
}));
|
|
2445
|
+
const selectFileShareRaw = (state) => state.fileShare;
|
|
2446
|
+
const selectFileUploads = (state) => state.fileShare.uploads;
|
|
2447
|
+
const selectFileShareRequestInFlight = (state) => state.fileShare.requestInFlight;
|
|
2448
|
+
|
|
2277
2449
|
const initialLiveTranscriptionState = {
|
|
2278
2450
|
isInitiator: false,
|
|
2279
2451
|
isTranscribing: false,
|
|
@@ -3162,13 +3334,13 @@ const doRejectWaitingParticipant = createRoomConnectedThunk((payload) => (dispat
|
|
|
3162
3334
|
const selectWaitingParticipantsRaw = (state) => state.waitingParticipants;
|
|
3163
3335
|
const selectWaitingParticipants = (state) => state.waitingParticipants.waitingParticipants;
|
|
3164
3336
|
|
|
3165
|
-
const initialState = {
|
|
3337
|
+
const initialState$1 = {
|
|
3166
3338
|
isSwitching: false,
|
|
3167
3339
|
raw: {},
|
|
3168
3340
|
};
|
|
3169
3341
|
const cameraEffectsSlice = createSlice({
|
|
3170
3342
|
name: "cameraEffects",
|
|
3171
|
-
initialState,
|
|
3343
|
+
initialState: initialState$1,
|
|
3172
3344
|
reducers: {
|
|
3173
3345
|
cameraEffectsSwitching(state, action) {
|
|
3174
3346
|
state.isSwitching = action.payload.isSwitching;
|
|
@@ -3238,7 +3410,7 @@ const doCameraEffectsSwitchPreset = createAppAsyncThunk("cameraEffects/switchPre
|
|
|
3238
3410
|
mod = yield import('@whereby.com/camera-effects');
|
|
3239
3411
|
}
|
|
3240
3412
|
catch (_f) {
|
|
3241
|
-
throw new Error("@whereby.com/camera-effects
|
|
3413
|
+
throw new Error("Failed to load @whereby.com/camera-effects. Check your network connection and that the package is resolvable.");
|
|
3242
3414
|
}
|
|
3243
3415
|
const { createEffectStream, getUsablePresets } = mod;
|
|
3244
3416
|
const usable = getUsablePresets({ filter: () => true, options: { allowSafari } });
|
|
@@ -3266,9 +3438,139 @@ startAppListening({
|
|
|
3266
3438
|
},
|
|
3267
3439
|
});
|
|
3268
3440
|
|
|
3441
|
+
const initialState = {
|
|
3442
|
+
wanted: false,
|
|
3443
|
+
isSwitching: false,
|
|
3444
|
+
raw: {},
|
|
3445
|
+
};
|
|
3446
|
+
const audioDenoiserSlice = createSlice({
|
|
3447
|
+
name: "audioDenoiser",
|
|
3448
|
+
initialState,
|
|
3449
|
+
reducers: {
|
|
3450
|
+
audioDenoiserSwitching(state, action) {
|
|
3451
|
+
state.isSwitching = action.payload.isSwitching;
|
|
3452
|
+
},
|
|
3453
|
+
audioDenoiserWantedSet(state, action) {
|
|
3454
|
+
state.wanted = action.payload.wanted;
|
|
3455
|
+
},
|
|
3456
|
+
audioDenoiserApplied(state, action) {
|
|
3457
|
+
state.raw = action.payload;
|
|
3458
|
+
state.error = undefined;
|
|
3459
|
+
state.isSwitching = false;
|
|
3460
|
+
},
|
|
3461
|
+
audioDenoiserCleared(state) {
|
|
3462
|
+
state.raw = {};
|
|
3463
|
+
state.error = undefined;
|
|
3464
|
+
state.isSwitching = false;
|
|
3465
|
+
},
|
|
3466
|
+
audioDenoiserError(state, action) {
|
|
3467
|
+
state.error = action.payload.error;
|
|
3468
|
+
state.isSwitching = false;
|
|
3469
|
+
},
|
|
3470
|
+
},
|
|
3471
|
+
});
|
|
3472
|
+
const { audioDenoiserSwitching, audioDenoiserWantedSet, audioDenoiserApplied, audioDenoiserCleared, audioDenoiserError, } = audioDenoiserSlice.actions;
|
|
3473
|
+
const selectAudioDenoiserRaw = (state) => state.audioDenoiser.raw;
|
|
3474
|
+
const selectAudioDenoiserWanted = (state) => state.audioDenoiser.wanted;
|
|
3475
|
+
const selectAudioDenoiserEnabled = (state) => !!state.audioDenoiser.raw.stop;
|
|
3476
|
+
const doAudioDenoiserApply = createAppAsyncThunk("audioDenoiser/apply", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { getState, dispatch, rejectWithValue }) {
|
|
3477
|
+
var _b;
|
|
3478
|
+
const state = getState();
|
|
3479
|
+
if (selectLocalMediaIsSwitchingStream(state))
|
|
3480
|
+
return;
|
|
3481
|
+
const localStream = selectLocalMediaStream(state);
|
|
3482
|
+
if (!((_b = localStream === null || localStream === void 0 ? void 0 : localStream.getAudioTracks()) === null || _b === void 0 ? void 0 : _b[0])) {
|
|
3483
|
+
return;
|
|
3484
|
+
}
|
|
3485
|
+
if (selectAudioDenoiserEnabled(state))
|
|
3486
|
+
return;
|
|
3487
|
+
dispatch(audioDenoiserSwitching({ isSwitching: true }));
|
|
3488
|
+
try {
|
|
3489
|
+
let mod;
|
|
3490
|
+
try {
|
|
3491
|
+
mod = yield import('@whereby.com/audio-denoiser');
|
|
3492
|
+
}
|
|
3493
|
+
catch (_c) {
|
|
3494
|
+
throw new Error("Failed to load @whereby.com/audio-denoiser. Check your network connection and that the package is resolvable.");
|
|
3495
|
+
}
|
|
3496
|
+
const { applyAudioDenoiser, canUse } = mod;
|
|
3497
|
+
if (!canUse()) {
|
|
3498
|
+
throw new Error("Audio denoiser is not supported in this browser");
|
|
3499
|
+
}
|
|
3500
|
+
const handle = yield applyAudioDenoiser({
|
|
3501
|
+
inputStream: localStream,
|
|
3502
|
+
doCaptureException: (err, ctx) => {
|
|
3503
|
+
console.error("[audioDenoiser]", err, ctx);
|
|
3504
|
+
},
|
|
3505
|
+
});
|
|
3506
|
+
yield dispatch(doLocalStreamEffect({ effectStream: handle.outputStream, only: "audio" }));
|
|
3507
|
+
dispatch(audioDenoiserApplied({
|
|
3508
|
+
stop: handle.stop,
|
|
3509
|
+
outputStream: handle.outputStream,
|
|
3510
|
+
audioContext: handle.audioContext,
|
|
3511
|
+
denoiserNode: handle.denoiserNode,
|
|
3512
|
+
}));
|
|
3513
|
+
}
|
|
3514
|
+
catch (error) {
|
|
3515
|
+
dispatch(audioDenoiserError({ error }));
|
|
3516
|
+
return rejectWithValue(error);
|
|
3517
|
+
}
|
|
3518
|
+
}));
|
|
3519
|
+
const doAudioDenoiserTeardown = createAppAsyncThunk("audioDenoiser/teardown", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { getState, dispatch }) {
|
|
3520
|
+
const raw = selectAudioDenoiserRaw(getState());
|
|
3521
|
+
if (!raw.stop)
|
|
3522
|
+
return;
|
|
3523
|
+
dispatch(audioDenoiserSwitching({ isSwitching: true }));
|
|
3524
|
+
try {
|
|
3525
|
+
if (raw.outputStream) {
|
|
3526
|
+
yield dispatch(doLocalStreamEffect({ effectStream: undefined, only: "audio" }));
|
|
3527
|
+
}
|
|
3528
|
+
raw.stop();
|
|
3529
|
+
}
|
|
3530
|
+
finally {
|
|
3531
|
+
dispatch(audioDenoiserCleared());
|
|
3532
|
+
}
|
|
3533
|
+
}));
|
|
3534
|
+
createAppAsyncThunk("audioDenoiser/enable", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { dispatch }) {
|
|
3535
|
+
dispatch(audioDenoiserWantedSet({ wanted: true }));
|
|
3536
|
+
yield dispatch(doAudioDenoiserApply());
|
|
3537
|
+
}));
|
|
3538
|
+
const doAudioDenoiserDisable = createAppAsyncThunk("audioDenoiser/disable", (arg_1, _a) => __awaiter(void 0, [arg_1, _a], void 0, function* (arg, { dispatch }) {
|
|
3539
|
+
if (!(arg === null || arg === void 0 ? void 0 : arg.keepWanted)) {
|
|
3540
|
+
dispatch(audioDenoiserWantedSet({ wanted: false }));
|
|
3541
|
+
}
|
|
3542
|
+
yield dispatch(doAudioDenoiserTeardown());
|
|
3543
|
+
}));
|
|
3544
|
+
startAppListening({
|
|
3545
|
+
actionCreator: doSwitchLocalStream.pending,
|
|
3546
|
+
effect: (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { getState, dispatch }) {
|
|
3547
|
+
if (selectAudioDenoiserEnabled(getState())) {
|
|
3548
|
+
yield dispatch(doAudioDenoiserDisable({ keepWanted: true }));
|
|
3549
|
+
}
|
|
3550
|
+
}),
|
|
3551
|
+
});
|
|
3552
|
+
startAppListening({
|
|
3553
|
+
actionCreator: doSwitchLocalStream.fulfilled,
|
|
3554
|
+
effect: (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { getState, dispatch }) {
|
|
3555
|
+
const state = getState();
|
|
3556
|
+
if (selectAudioDenoiserWanted(state) && !selectAudioDenoiserEnabled(state)) {
|
|
3557
|
+
yield dispatch(doAudioDenoiserApply());
|
|
3558
|
+
}
|
|
3559
|
+
}),
|
|
3560
|
+
});
|
|
3561
|
+
startAppListening({
|
|
3562
|
+
actionCreator: doAppStop,
|
|
3563
|
+
effect: (_, { dispatch, getState }) => {
|
|
3564
|
+
if (selectAudioDenoiserRaw(getState()).stop) {
|
|
3565
|
+
dispatch(doAudioDenoiserDisable());
|
|
3566
|
+
}
|
|
3567
|
+
},
|
|
3568
|
+
});
|
|
3569
|
+
|
|
3269
3570
|
const IS_DEV = undefined === "true";
|
|
3270
3571
|
const appReducer = combineReducers({
|
|
3271
3572
|
app: appSlice.reducer,
|
|
3573
|
+
audioDenoiser: audioDenoiserSlice.reducer,
|
|
3272
3574
|
authorization: authorizationSlice.reducer,
|
|
3273
3575
|
breakout: breakoutSlice.reducer,
|
|
3274
3576
|
cameraEffects: cameraEffectsSlice.reducer,
|
|
@@ -3276,6 +3578,7 @@ const appReducer = combineReducers({
|
|
|
3276
3578
|
cloudRecording: cloudRecordingSlice.reducer,
|
|
3277
3579
|
connectionMonitor: connectionMonitorSlice.reducer,
|
|
3278
3580
|
deviceCredentials: deviceCredentialsSlice.reducer,
|
|
3581
|
+
fileShare: fileShareSlice.reducer,
|
|
3279
3582
|
liveTranscription: liveTranscriptionSlice.reducer,
|
|
3280
3583
|
localMedia: localMediaSlice.reducer,
|
|
3281
3584
|
localParticipant: localParticipantSlice.reducer,
|
|
@@ -3299,6 +3602,7 @@ const rootReducer = (state, action) => {
|
|
|
3299
3602
|
app: Object.assign(Object.assign({}, appSlice.getInitialState()), { initialConfig: (_a = state === null || state === void 0 ? void 0 : state.app) === null || _a === void 0 ? void 0 : _a.initialConfig }),
|
|
3300
3603
|
localMedia: Object.assign(Object.assign({}, localMediaSlice.getInitialState()), state === null || state === void 0 ? void 0 : state.localMedia),
|
|
3301
3604
|
cameraEffects: Object.assign(Object.assign({}, cameraEffectsSlice.getInitialState()), state === null || state === void 0 ? void 0 : state.cameraEffects),
|
|
3605
|
+
audioDenoiser: Object.assign(Object.assign({}, audioDenoiserSlice.getInitialState()), state === null || state === void 0 ? void 0 : state.audioDenoiser),
|
|
3302
3606
|
};
|
|
3303
3607
|
return appReducer(resetState, action);
|
|
3304
3608
|
}
|
|
@@ -4051,4 +4355,4 @@ function createServices() {
|
|
|
4051
4355
|
};
|
|
4052
4356
|
}
|
|
4053
4357
|
|
|
4054
|
-
export { addAppListener, addSpotlight, appSlice, authorizationSlice, authorizationSliceInitialState, breakoutSlice, breakoutSliceInitialState, chatSlice, chatSliceInitialState, cloudRecordingSlice, connectionMonitorSlice, connectionMonitorSliceInitialState, connectionMonitorStarted, connectionMonitorStopped, createAppAsyncThunk, createAppAuthorizedThunk, createAppThunk, createAsyncRoomConnectedThunk, createAuthorizedRoomConnectedThunk, createReactor, createRemoteParticipant, createRoomConnectedThunk, createServices, createStore, createWebRtcEmitter, deviceBusy, deviceCredentialsSlice, deviceCredentialsSliceInitialState, deviceIdentified, deviceIdentifying, doAcceptWaitingParticipant, doAppStart, doAppStop, doBreakoutJoin, doCancelKnock, doClearNotifications, doConnectRoom, doConnectRtc, doDisconnectRtc, doEnableAudio, doEnableVideo, doEndMeeting, doGetDeviceCredentials, doHandleAcceptStreams, doHandleStreamingStarted, doHandleStreamingStopped, doKickParticipant, doKnockRoom, doLocalStreamEffect, doLockRoom, doOrganizationFetch, doRejectWaitingParticipant, doRemoveChatMessage, doRemoveSpotlight, doRequestAudioEnable, doRequestVideoEnable, doRtcAnalyticsCustomEventsInitialize, doRtcManagerCreated, doRtcManagerInitialize, doRtcReportStreamResolution, doSendChatMessage, doSendClientMetadata, doSetDevice, doSetDisplayName, doSetLocalStickyReaction, doSetNotification, doSignalConnect, doSignalDisconnect, doSignalIdentifyDevice, doSpotlightParticipant, doStartCloudRecording, doStartConnectionMonitor, doStartLiveTranscription, doStartLocalMedia, doStartScreenshare, doStopCloudRecording, doStopConnectionMonitor, doStopLiveTranscription, doStopLocalMedia, doStopScreenshare, doSwitchLocalStream, doToggleCamera, doTriggerLocalStreamRefresh, doUpdateDeviceList, initialCloudRecordingState, initialLiveTranscriptionState, initialLocalMediaState, initialNotificationsState, initialState$
|
|
4358
|
+
export { ACCEPTED_FILE_TYPES, MAX_FILES_PER_UPLOAD, MAX_FILE_SIZE, addAppListener, addSpotlight, appSlice, authorizationSlice, authorizationSliceInitialState, breakoutSlice, breakoutSliceInitialState, chatSlice, chatSliceInitialState, clearFileUploads, cloudRecordingSlice, connectionMonitorSlice, connectionMonitorSliceInitialState, connectionMonitorStarted, connectionMonitorStopped, createAppAsyncThunk, createAppAuthorizedThunk, createAppThunk, createAsyncRoomConnectedThunk, createAuthorizedRoomConnectedThunk, createReactor, createRemoteParticipant, createRoomConnectedThunk, createServices, createStore, createWebRtcEmitter, deviceBusy, deviceCredentialsSlice, deviceCredentialsSliceInitialState, deviceIdentified, deviceIdentifying, doAcceptWaitingParticipant, doAppStart, doAppStop, doBreakoutJoin, doCancelKnock, doClearNotifications, doConnectRoom, doConnectRtc, doDisconnectRtc, doDownloadFile, doEnableAudio, doEnableVideo, doEndMeeting, doGetDeviceCredentials, doHandleAcceptStreams, doHandleStreamingStarted, doHandleStreamingStopped, doKickParticipant, doKnockRoom, doLocalStreamEffect, doLockRoom, doOrganizationFetch, doRejectWaitingParticipant, doRemoveChatMessage, doRemoveSpotlight, doRequestAudioEnable, doRequestVideoEnable, doRtcAnalyticsCustomEventsInitialize, doRtcManagerCreated, doRtcManagerInitialize, doRtcReportStreamResolution, doSendChatMessage, doSendClientMetadata, doSendFiles, doSetDevice, doSetDisplayName, doSetLocalStickyReaction, doSetNotification, doSignalConnect, doSignalDisconnect, doSignalIdentifyDevice, doSpotlightParticipant, doStartCloudRecording, doStartConnectionMonitor, doStartLiveTranscription, doStartLocalMedia, doStartScreenshare, doStopCloudRecording, doStopConnectionMonitor, doStopLiveTranscription, doStopLocalMedia, doStopScreenshare, doSwitchLocalStream, doToggleCamera, doTriggerLocalStreamRefresh, doUpdateDeviceList, fileShareRequestSettled, fileShareSlice, fileShareSliceInitialState, fileUploadFailed, fileUploadSucceeded, fileUploadsStarted, initialCloudRecordingState, initialLiveTranscriptionState, initialLocalMediaState, initialNotificationsState, initialState$2 as initialState, isAcceptingStreams, isClientSpotlighted, listenerMiddleware, liveTranscriptionSlice, localMediaSlice, localMediaStopped, localParticipantSlice, localParticipantSliceInitialState, localScreenshareSlice, localScreenshareSliceInitialState, localStreamMetadataUpdated, notificationsSlice, observeStore, organizationSlice, organizationSliceInitialState, participantStreamAdded, participantStreamIdAdded, recordingRequestStarted, remoteParticipantsSlice, remoteParticipantsSliceInitialState, removeSpotlight, resolutionReported, roomConnectionSlice, roomConnectionSliceInitialState, roomSlice, roomSliceInitialState, rootReducer, rtcAnalyticsCustomEvents, rtcAnalyticsSlice, rtcAnalyticsSliceInitialState, rtcClientConnectionStatusChanged, rtcConnectionSlice, rtcConnectionSliceInitialState, rtcDisconnected, rtcDispatcherCreated, rtcEvents, rtcManagerCreated, rtcManagerDestroyed, rtcManagerInitialized, selectAllClientViews, selectAllClientViewsInCurrentGroup, selectAppDisplayName, selectAppExternalId, selectAppIgnoreBreakoutGroups, selectAppInitialConfig, selectAppIsActive, selectAppIsAssistant, selectAppIsAudioRecorder, selectAppIsDialIn, selectAppIsNodeSdk, selectAppRaw, selectAppRoomName, selectAppRoomUrl, selectAppUserAgent, selectAssistantKey, selectAuthorizationRoleName, selectBreakoutActive, selectBreakoutAssignments, selectBreakoutCurrentGroup, selectBreakoutCurrentId, selectBreakoutGroupedParticipants, selectBreakoutGroups, selectBreakoutInitiatedBy, selectBreakoutRaw, selectBusyDeviceIds, selectCameraDeviceError, selectCameraDevices, selectChatMessages, selectChatRaw, selectCloudRecordingError, selectCloudRecordingIsInitiator, selectCloudRecordingRaw, selectCloudRecordingStartedAt, selectCloudRecordingStatus, selectConnectionMonitorIsRunning, selectCurrentCameraDeviceId, selectCurrentMicrophoneDeviceId, selectCurrentSpeakerDeviceId, selectDeviceCredentialsRaw, selectDeviceId, selectFileShareRaw, selectFileShareRequestInFlight, selectFileUploads, selectHasFetchedDeviceCredentials, selectIsAcceptingStreams, selectIsAuthorizedToAskToSpeak, selectIsAuthorizedToEndMeeting, selectIsAuthorizedToKickClient, selectIsAuthorizedToLockRoom, selectIsAuthorizedToRequestAudioEnable, selectIsAuthorizedToRequestVideoEnable, selectIsAuthorizedToSpotlight, selectIsCameraEnabled, selectIsCloudRecording, selectIsHDModeEnabled, selectIsLiveTranscription, selectIsLocalMediaStarting, selectIsLocalParticipantSpotlighted, selectIsLowDataModeEnabled, selectIsMicrophoneEnabled, selectIsSettingCameraDevice, selectIsSettingMicrophoneDevice, selectIsToggleCamera, selectIsWidescreenModeEnabled, selectLiveTranscriptionError, selectLiveTranscriptionIsInitiator, selectLiveTranscriptionRaw, selectLiveTranscriptionStartedAt, selectLiveTranscriptionStatus, selectLocalMediaBeforeEffectTracks, selectLocalMediaConstraintsOptions, selectLocalMediaDevices, selectLocalMediaIsSwitchingStream, selectLocalMediaOptions, selectLocalMediaOwnsStream, selectLocalMediaRaw, selectLocalMediaShouldStartWithOptions, selectLocalMediaShouldStop, selectLocalMediaStartError, selectLocalMediaStatus, selectLocalMediaStream, selectLocalParticipantBreakoutAssigned, selectLocalParticipantBreakoutGroup, selectLocalParticipantClientClaim, selectLocalParticipantDisplayName, selectLocalParticipantIsScreenSharing, selectLocalParticipantRaw, selectLocalParticipantStickyReaction, selectLocalParticipantView, selectLocalScreenshareRaw, selectLocalScreenshareStatus, selectLocalScreenshareStream, selectMicrophoneDeviceError, selectMicrophoneDevices, selectNotificationsEmitter, selectNotificationsEvents, selectNotificationsRaw, selectNumClients, selectNumParticipants, selectOrganizationId, selectOrganizationPreferences, selectOrganizationRaw, selectRemoteClientViews, selectRemoteClients, selectRemoteParticipants, selectRemoteParticipantsRaw, selectRoomConnectionError, selectRoomConnectionRaw, selectRoomConnectionSession, selectRoomConnectionSessionId, selectRoomConnectionStatus, selectRoomIsLocked, selectRoomKey, selectRtcConnectionRaw, selectRtcDispatcherCreated, selectRtcIsCreatingDispatcher, selectRtcManager, selectRtcManagerInitialized, selectRtcStatus, selectScreenshares, selectSelfId, selectShouldConnectRoom, selectShouldConnectRtc, selectShouldConnectSignal, selectShouldDisconnectRtc, selectShouldFetchDeviceCredentials, selectShouldFetchOrganization, selectShouldIdentifyDevice, selectShouldInitializeRtc, selectShouldStartConnectionMonitor, selectShouldStopConnectionMonitor, selectSignalConnectionDeviceIdentified, selectSignalConnectionRaw, selectSignalConnectionSocket, selectSignalIsIdentifyingDevice, selectSignalStatus, selectSpeakerDevices, selectSpotlightedClientViews, selectSpotlights, selectSpotlightsRaw, selectStopCallbackFunction, selectStreamingRaw, selectStreamsToAccept, selectWaitingParticipants, selectWaitingParticipantsRaw, setBreakoutGroupAssigned, setCurrentCameraDeviceId, setCurrentMicrophoneDeviceId, setCurrentSpeakerDeviceId, setDisplayName, setLocalMediaOptions, setLocalMediaStream, setRoomKey, signalConnectionSlice, signalConnectionSliceInitialState, signalEvents, socketConnected, socketConnecting, socketDisconnected, socketReconnecting, spotlightsSlice, spotlightsSliceInitialState, startAppListening, stopScreenshare, streamIdForClient, streamStatusUpdated, streamingSlice, streamingSliceInitialState, toggleCameraEnabled, toggleHdModeEnabled, toggleLowDataModeEnabled, toggleMicrophoneEnabled, toggleWidescreenModeEnabled, transcribingRequestStarted, updateReportedValues, waitingParticipantsSlice, waitingParticipantsSliceInitialState };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@whereby.com/core",
|
|
3
3
|
"description": "Core library for whereby.com sdk",
|
|
4
4
|
"author": "Whereby AS",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.14.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -60,25 +60,19 @@
|
|
|
60
60
|
"typescript": "^5.8.3",
|
|
61
61
|
"@whereby.com/eslint-config": "0.1.0",
|
|
62
62
|
"@whereby.com/prettier-config": "0.1.0",
|
|
63
|
-
"@whereby.com/jest-config": "0.1.0",
|
|
64
63
|
"@whereby.com/rollup-config": "0.1.1",
|
|
65
|
-
"@whereby.com/tsconfig": "0.1.0"
|
|
64
|
+
"@whereby.com/tsconfig": "0.1.0",
|
|
65
|
+
"@whereby.com/jest-config": "0.1.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@reduxjs/toolkit": "^2.2.3",
|
|
69
|
-
"@whereby.com/media": "9.2.
|
|
69
|
+
"@whereby.com/media": "9.2.5",
|
|
70
|
+
"@whereby.com/audio-denoiser": "1.0.1",
|
|
71
|
+
"@whereby.com/camera-effects": "1.1.1",
|
|
70
72
|
"axios": "^1.11.0",
|
|
71
73
|
"btoa": "^1.2.1",
|
|
72
74
|
"events": "^3.3.0"
|
|
73
75
|
},
|
|
74
|
-
"peerDependencies": {
|
|
75
|
-
"@whereby.com/camera-effects": "*"
|
|
76
|
-
},
|
|
77
|
-
"peerDependenciesMeta": {
|
|
78
|
-
"@whereby.com/camera-effects": {
|
|
79
|
-
"optional": true
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
76
|
"prettier": "@whereby.com/prettier-config",
|
|
83
77
|
"scripts": {
|
|
84
78
|
"clean": "rimraf dist node_modules .turbo",
|