@signalwire/js 3.29.2 → 4.0.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/dist/base-A5AZTrAd.d.cts +23 -0
- package/dist/base-A5AZTrAd.d.cts.map +1 -0
- package/dist/base-aVtoG8Wk.d.mts +23 -0
- package/dist/base-aVtoG8Wk.d.mts.map +1 -0
- package/dist/browser.mjs +16625 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/browser.umd.js +16646 -0
- package/dist/browser.umd.js.map +1 -0
- package/dist/index.cjs +6210 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2690 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +2690 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +6194 -0
- package/dist/index.mjs.map +1 -0
- package/dist/operators/index.cjs +6 -0
- package/dist/operators/index.d.cts +109 -0
- package/dist/operators/index.d.cts.map +1 -0
- package/dist/operators/index.d.mts +109 -0
- package/dist/operators/index.d.mts.map +1 -0
- package/dist/operators/index.mjs +3 -0
- package/dist/operators-BHQMSEzq.mjs +371 -0
- package/dist/operators-BHQMSEzq.mjs.map +1 -0
- package/dist/operators-DT4UB24-.cjs +596 -0
- package/dist/operators-DT4UB24-.cjs.map +1 -0
- package/package.json +73 -37
- package/README.md +0 -40
- package/dist/core/src/BaseClient.d.ts +0 -19
- package/dist/core/src/BaseClient.d.ts.map +0 -1
- package/dist/core/src/BaseComponent.d.ts +0 -101
- package/dist/core/src/BaseComponent.d.ts.map +0 -1
- package/dist/core/src/BaseComponent.test.d.ts +0 -2
- package/dist/core/src/BaseComponent.test.d.ts.map +0 -1
- package/dist/core/src/BaseConsumer.d.ts +0 -18
- package/dist/core/src/BaseConsumer.d.ts.map +0 -1
- package/dist/core/src/BaseConsumer.test.d.ts +0 -2
- package/dist/core/src/BaseConsumer.test.d.ts.map +0 -1
- package/dist/core/src/BaseJWTSession.d.ts +0 -47
- package/dist/core/src/BaseJWTSession.d.ts.map +0 -1
- package/dist/core/src/BaseJWTSession.test.d.ts +0 -2
- package/dist/core/src/BaseJWTSession.test.d.ts.map +0 -1
- package/dist/core/src/BaseSession.d.ts +0 -117
- package/dist/core/src/BaseSession.d.ts.map +0 -1
- package/dist/core/src/BaseSession.test.d.ts +0 -2
- package/dist/core/src/BaseSession.test.d.ts.map +0 -1
- package/dist/core/src/CustomErrors.d.ts +0 -17
- package/dist/core/src/CustomErrors.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCConnect.d.ts +0 -42
- package/dist/core/src/RPCMessages/RPCConnect.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCDisconnect.d.ts +0 -8
- package/dist/core/src/RPCMessages/RPCDisconnect.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCEventAck.d.ts +0 -8
- package/dist/core/src/RPCMessages/RPCEventAck.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCExecute.d.ts +0 -16
- package/dist/core/src/RPCMessages/RPCExecute.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCPing.d.ts +0 -16
- package/dist/core/src/RPCMessages/RPCPing.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/RPCReauthenticate.d.ts +0 -13
- package/dist/core/src/RPCMessages/RPCReauthenticate.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/VertoMessages.d.ts +0 -84
- package/dist/core/src/RPCMessages/VertoMessages.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/helpers.d.ts +0 -31
- package/dist/core/src/RPCMessages/helpers.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/index.d.ts +0 -9
- package/dist/core/src/RPCMessages/index.d.ts.map +0 -1
- package/dist/core/src/RPCMessages/index.test.d.ts +0 -2
- package/dist/core/src/RPCMessages/index.test.d.ts.map +0 -1
- package/dist/core/src/chat/BaseChat.d.ts +0 -23
- package/dist/core/src/chat/BaseChat.d.ts.map +0 -1
- package/dist/core/src/chat/ChatMember.d.ts +0 -15
- package/dist/core/src/chat/ChatMember.d.ts.map +0 -1
- package/dist/core/src/chat/ChatMessage.d.ts +0 -10
- package/dist/core/src/chat/ChatMessage.d.ts.map +0 -1
- package/dist/core/src/chat/applyCommonMethods.d.ts +0 -22
- package/dist/core/src/chat/applyCommonMethods.d.ts.map +0 -1
- package/dist/core/src/chat/index.d.ts +0 -6
- package/dist/core/src/chat/index.d.ts.map +0 -1
- package/dist/core/src/chat/methods.d.ts +0 -31
- package/dist/core/src/chat/methods.d.ts.map +0 -1
- package/dist/core/src/chat/utils/index.d.ts +0 -3
- package/dist/core/src/chat/utils/index.d.ts.map +0 -1
- package/dist/core/src/chat/utils/toInternalChatChannels.d.ts +0 -3
- package/dist/core/src/chat/utils/toInternalChatChannels.d.ts.map +0 -1
- package/dist/core/src/chat/utils/toInternalChatChannels.test.d.ts +0 -2
- package/dist/core/src/chat/utils/toInternalChatChannels.test.d.ts.map +0 -1
- package/dist/core/src/chat/workers/chatWorker.d.ts +0 -4
- package/dist/core/src/chat/workers/chatWorker.d.ts.map +0 -1
- package/dist/core/src/chat/workers/index.d.ts +0 -2
- package/dist/core/src/chat/workers/index.d.ts.map +0 -1
- package/dist/core/src/index.d.ts +0 -45
- package/dist/core/src/index.d.ts.map +0 -1
- package/dist/core/src/index.test.d.ts +0 -1
- package/dist/core/src/index.test.d.ts.map +0 -1
- package/dist/core/src/memberPosition/index.d.ts +0 -2
- package/dist/core/src/memberPosition/index.d.ts.map +0 -1
- package/dist/core/src/memberPosition/workers.d.ts +0 -13
- package/dist/core/src/memberPosition/workers.d.ts.map +0 -1
- package/dist/core/src/memberPosition/workers.test.d.ts +0 -2
- package/dist/core/src/memberPosition/workers.test.d.ts.map +0 -1
- package/dist/core/src/pubSub/BasePubSub.d.ts +0 -43
- package/dist/core/src/pubSub/BasePubSub.d.ts.map +0 -1
- package/dist/core/src/pubSub/PubSubMessage.d.ts +0 -19
- package/dist/core/src/pubSub/PubSubMessage.d.ts.map +0 -1
- package/dist/core/src/pubSub/index.d.ts +0 -3
- package/dist/core/src/pubSub/index.d.ts.map +0 -1
- package/dist/core/src/pubSub/workers/index.d.ts +0 -2
- package/dist/core/src/pubSub/workers/index.d.ts.map +0 -1
- package/dist/core/src/pubSub/workers/pubSubWorker.d.ts +0 -4
- package/dist/core/src/pubSub/workers/pubSubWorker.d.ts.map +0 -1
- package/dist/core/src/redux/actions.d.ts +0 -25
- package/dist/core/src/redux/actions.d.ts.map +0 -1
- package/dist/core/src/redux/connect.d.ts +0 -23
- package/dist/core/src/redux/connect.d.ts.map +0 -1
- package/dist/core/src/redux/connect.test.d.ts +0 -2
- package/dist/core/src/redux/connect.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSaga.d.ts +0 -4
- package/dist/core/src/redux/features/component/componentSaga.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSaga.test.d.ts +0 -2
- package/dist/core/src/redux/features/component/componentSaga.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSelectors.d.ts +0 -7
- package/dist/core/src/redux/features/component/componentSelectors.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSelectors.test.d.ts +0 -2
- package/dist/core/src/redux/features/component/componentSelectors.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSlice.d.ts +0 -2319
- package/dist/core/src/redux/features/component/componentSlice.d.ts.map +0 -1
- package/dist/core/src/redux/features/component/componentSlice.test.d.ts +0 -2
- package/dist/core/src/redux/features/component/componentSlice.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/index.d.ts +0 -3
- package/dist/core/src/redux/features/index.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSaga.d.ts +0 -11
- package/dist/core/src/redux/features/session/sessionSaga.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSelectors.d.ts +0 -9
- package/dist/core/src/redux/features/session/sessionSelectors.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSlice.d.ts +0 -521
- package/dist/core/src/redux/features/session/sessionSlice.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSlice.test.d.ts +0 -2
- package/dist/core/src/redux/features/session/sessionSlice.test.d.ts.map +0 -1
- package/dist/core/src/redux/index.d.ts +0 -31
- package/dist/core/src/redux/index.d.ts.map +0 -1
- package/dist/core/src/redux/interfaces.d.ts +0 -87
- package/dist/core/src/redux/interfaces.d.ts.map +0 -1
- package/dist/core/src/redux/rootReducer.d.ts +0 -457
- package/dist/core/src/redux/rootReducer.d.ts.map +0 -1
- package/dist/core/src/redux/rootSaga.d.ts +0 -40
- package/dist/core/src/redux/rootSaga.d.ts.map +0 -1
- package/dist/core/src/redux/rootSaga.test.d.ts +0 -2
- package/dist/core/src/redux/rootSaga.test.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/configureStore.d.ts +0 -77
- package/dist/core/src/redux/toolkit/configureStore.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/createAction.d.ts +0 -180
- package/dist/core/src/redux/toolkit/createAction.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/createReducer.d.ts +0 -42
- package/dist/core/src/redux/toolkit/createReducer.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/createSlice.d.ts +0 -142
- package/dist/core/src/redux/toolkit/createSlice.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/devtoolsExtension.d.ts +0 -185
- package/dist/core/src/redux/toolkit/devtoolsExtension.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/getDefaultMiddleware.d.ts +0 -12
- package/dist/core/src/redux/toolkit/getDefaultMiddleware.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/index.d.ts +0 -13
- package/dist/core/src/redux/toolkit/index.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/isPlainObject.d.ts +0 -12
- package/dist/core/src/redux/toolkit/isPlainObject.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/mapBuilders.d.ts +0 -38
- package/dist/core/src/redux/toolkit/mapBuilders.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/tsHelpers.d.ts +0 -51
- package/dist/core/src/redux/toolkit/tsHelpers.d.ts.map +0 -1
- package/dist/core/src/redux/toolkit/utils.d.ts +0 -11
- package/dist/core/src/redux/toolkit/utils.d.ts.map +0 -1
- package/dist/core/src/redux/utils/createDestroyableSlice.d.ts +0 -9
- package/dist/core/src/redux/utils/createDestroyableSlice.d.ts.map +0 -1
- package/dist/core/src/redux/utils/createDestroyableSlice.test.d.ts +0 -2
- package/dist/core/src/redux/utils/createDestroyableSlice.test.d.ts.map +0 -1
- package/dist/core/src/redux/utils/sagaHelpers.d.ts +0 -5
- package/dist/core/src/redux/utils/sagaHelpers.d.ts.map +0 -1
- package/dist/core/src/redux/utils/useInstanceMap.d.ts +0 -3
- package/dist/core/src/redux/utils/useInstanceMap.d.ts.map +0 -1
- package/dist/core/src/redux/utils/useSession.d.ts +0 -16
- package/dist/core/src/redux/utils/useSession.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionPlayback.d.ts +0 -40
- package/dist/core/src/rooms/RoomSessionPlayback.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionPlayback.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionPlayback.test.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRecording.d.ts +0 -30
- package/dist/core/src/rooms/RoomSessionRecording.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRecording.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionRecording.test.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionStream.d.ts +0 -29
- package/dist/core/src/rooms/RoomSessionStream.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionStream.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionStream.test.d.ts.map +0 -1
- package/dist/core/src/rooms/index.d.ts +0 -11
- package/dist/core/src/rooms/index.d.ts.map +0 -1
- package/dist/core/src/rooms/methods.d.ts +0 -179
- package/dist/core/src/rooms/methods.d.ts.map +0 -1
- package/dist/core/src/rooms/methods.test.d.ts +0 -2
- package/dist/core/src/rooms/methods.test.d.ts.map +0 -1
- package/dist/core/src/setupTests.d.ts +0 -1
- package/dist/core/src/setupTests.d.ts.map +0 -1
- package/dist/core/src/testUtils.d.ts +0 -54
- package/dist/core/src/testUtils.d.ts.map +0 -1
- package/dist/core/src/types/cantina.d.ts +0 -82
- package/dist/core/src/types/cantina.d.ts.map +0 -1
- package/dist/core/src/types/chat.d.ts +0 -270
- package/dist/core/src/types/chat.d.ts.map +0 -1
- package/dist/core/src/types/common.d.ts +0 -34
- package/dist/core/src/types/common.d.ts.map +0 -1
- package/dist/core/src/types/conversation.d.ts +0 -33
- package/dist/core/src/types/conversation.d.ts.map +0 -1
- package/dist/core/src/types/fabric.d.ts +0 -15
- package/dist/core/src/types/fabric.d.ts.map +0 -1
- package/dist/core/src/types/fabricLayout.d.ts +0 -25
- package/dist/core/src/types/fabricLayout.d.ts.map +0 -1
- package/dist/core/src/types/fabricMember.d.ts +0 -148
- package/dist/core/src/types/fabricMember.d.ts.map +0 -1
- package/dist/core/src/types/fabricRoomSession.d.ts +0 -631
- package/dist/core/src/types/fabricRoomSession.d.ts.map +0 -1
- package/dist/core/src/types/index.d.ts +0 -276
- package/dist/core/src/types/index.d.ts.map +0 -1
- package/dist/core/src/types/messaging.d.ts +0 -90
- package/dist/core/src/types/messaging.d.ts.map +0 -1
- package/dist/core/src/types/pubSub.d.ts +0 -123
- package/dist/core/src/types/pubSub.d.ts.map +0 -1
- package/dist/core/src/types/task.d.ts +0 -36
- package/dist/core/src/types/task.d.ts.map +0 -1
- package/dist/core/src/types/utils.d.ts +0 -71
- package/dist/core/src/types/utils.d.ts.map +0 -1
- package/dist/core/src/types/video.d.ts +0 -62
- package/dist/core/src/types/video.d.ts.map +0 -1
- package/dist/core/src/types/videoLayout.d.ts +0 -75
- package/dist/core/src/types/videoLayout.d.ts.map +0 -1
- package/dist/core/src/types/videoMember.d.ts +0 -384
- package/dist/core/src/types/videoMember.d.ts.map +0 -1
- package/dist/core/src/types/videoPlayback.d.ts +0 -123
- package/dist/core/src/types/videoPlayback.d.ts.map +0 -1
- package/dist/core/src/types/videoRecording.d.ts +0 -114
- package/dist/core/src/types/videoRecording.d.ts.map +0 -1
- package/dist/core/src/types/videoRoomDevice.d.ts +0 -23
- package/dist/core/src/types/videoRoomDevice.d.ts.map +0 -1
- package/dist/core/src/types/videoRoomSession.d.ts +0 -921
- package/dist/core/src/types/videoRoomSession.d.ts.map +0 -1
- package/dist/core/src/types/videoStream.d.ts +0 -104
- package/dist/core/src/types/videoStream.d.ts.map +0 -1
- package/dist/core/src/types/voice.d.ts +0 -15
- package/dist/core/src/types/voice.d.ts.map +0 -1
- package/dist/core/src/types/voiceCall.d.ts +0 -253
- package/dist/core/src/types/voiceCall.d.ts.map +0 -1
- package/dist/core/src/types/voiceCollect.d.ts +0 -166
- package/dist/core/src/types/voiceCollect.d.ts.map +0 -1
- package/dist/core/src/types/voiceConnect.d.ts +0 -77
- package/dist/core/src/types/voiceConnect.d.ts.map +0 -1
- package/dist/core/src/types/voiceDetect.d.ts +0 -127
- package/dist/core/src/types/voiceDetect.d.ts.map +0 -1
- package/dist/core/src/types/voicePlayback.d.ts +0 -141
- package/dist/core/src/types/voicePlayback.d.ts.map +0 -1
- package/dist/core/src/types/voicePrompt.d.ts +0 -105
- package/dist/core/src/types/voicePrompt.d.ts.map +0 -1
- package/dist/core/src/types/voiceRecording.d.ts +0 -107
- package/dist/core/src/types/voiceRecording.d.ts.map +0 -1
- package/dist/core/src/types/voiceSendDigits.d.ts +0 -21
- package/dist/core/src/types/voiceSendDigits.d.ts.map +0 -1
- package/dist/core/src/types/voiceTap.d.ts +0 -116
- package/dist/core/src/types/voiceTap.d.ts.map +0 -1
- package/dist/core/src/utils/EventEmitter.d.ts +0 -9
- package/dist/core/src/utils/EventEmitter.d.ts.map +0 -1
- package/dist/core/src/utils/EventEmitter.test.d.ts +0 -2
- package/dist/core/src/utils/EventEmitter.test.d.ts.map +0 -1
- package/dist/core/src/utils/SWCloseEvent.d.ts +0 -18
- package/dist/core/src/utils/SWCloseEvent.d.ts.map +0 -1
- package/dist/core/src/utils/asyncRetry.d.ts +0 -18
- package/dist/core/src/utils/asyncRetry.d.ts.map +0 -1
- package/dist/core/src/utils/asyncRetry.test.d.ts +0 -2
- package/dist/core/src/utils/asyncRetry.test.d.ts.map +0 -1
- package/dist/core/src/utils/common.d.ts +0 -9
- package/dist/core/src/utils/common.d.ts.map +0 -1
- package/dist/core/src/utils/constants.d.ts +0 -44
- package/dist/core/src/utils/constants.d.ts.map +0 -1
- package/dist/core/src/utils/debounce.d.ts +0 -8
- package/dist/core/src/utils/debounce.d.ts.map +0 -1
- package/dist/core/src/utils/eventUtils.d.ts +0 -2
- package/dist/core/src/utils/eventUtils.d.ts.map +0 -1
- package/dist/core/src/utils/extendComponent.d.ts +0 -4
- package/dist/core/src/utils/extendComponent.d.ts.map +0 -1
- package/dist/core/src/utils/extendComponent.test.d.ts +0 -2
- package/dist/core/src/utils/extendComponent.test.d.ts.map +0 -1
- package/dist/core/src/utils/index.d.ts +0 -47
- package/dist/core/src/utils/index.d.ts.map +0 -1
- package/dist/core/src/utils/index.test.d.ts +0 -2
- package/dist/core/src/utils/index.test.d.ts.map +0 -1
- package/dist/core/src/utils/interfaces.d.ts +0 -296
- package/dist/core/src/utils/interfaces.d.ts.map +0 -1
- package/dist/core/src/utils/logger.d.ts +0 -6
- package/dist/core/src/utils/logger.d.ts.map +0 -1
- package/dist/core/src/utils/logger.test.d.ts +0 -2
- package/dist/core/src/utils/logger.test.d.ts.map +0 -1
- package/dist/core/src/utils/parseRPCResponse.d.ts +0 -10
- package/dist/core/src/utils/parseRPCResponse.d.ts.map +0 -1
- package/dist/core/src/utils/parseRPCResponse.test.d.ts +0 -2
- package/dist/core/src/utils/parseRPCResponse.test.d.ts.map +0 -1
- package/dist/core/src/utils/storage/index.d.ts +0 -11
- package/dist/core/src/utils/storage/index.d.ts.map +0 -1
- package/dist/core/src/utils/storage/index.native.d.ts +0 -11
- package/dist/core/src/utils/storage/index.native.d.ts.map +0 -1
- package/dist/core/src/utils/toExternalJSON.d.ts +0 -34
- package/dist/core/src/utils/toExternalJSON.d.ts.map +0 -1
- package/dist/core/src/utils/toExternalJSON.test.d.ts +0 -2
- package/dist/core/src/utils/toExternalJSON.test.d.ts.map +0 -1
- package/dist/core/src/utils/toInternalAction.d.ts +0 -7
- package/dist/core/src/utils/toInternalAction.d.ts.map +0 -1
- package/dist/core/src/utils/toInternalAction.test.d.ts +0 -2
- package/dist/core/src/utils/toInternalAction.test.d.ts.map +0 -1
- package/dist/core/src/utils/toInternalEventName.d.ts +0 -8
- package/dist/core/src/utils/toInternalEventName.d.ts.map +0 -1
- package/dist/core/src/utils/toInternalEventName.test.d.ts +0 -2
- package/dist/core/src/utils/toInternalEventName.test.d.ts.map +0 -1
- package/dist/core/src/utils/toSnakeCaseKeys.d.ts +0 -7
- package/dist/core/src/utils/toSnakeCaseKeys.d.ts.map +0 -1
- package/dist/core/src/utils/toSnakeCaseKeys.test.d.ts +0 -2
- package/dist/core/src/utils/toSnakeCaseKeys.test.d.ts.map +0 -1
- package/dist/core/src/workers/executeActionWorker.d.ts +0 -7
- package/dist/core/src/workers/executeActionWorker.d.ts.map +0 -1
- package/dist/core/src/workers/index.d.ts +0 -2
- package/dist/core/src/workers/index.d.ts.map +0 -1
- package/dist/index.esm.js +0 -4673
- package/dist/index.esm.js.map +0 -7
- package/dist/index.js +0 -4655
- package/dist/index.js.map +0 -7
- package/dist/index.umd.js +0 -31
- package/dist/index.umd.js.map +0 -1
- package/dist/js/src/BaseRoomSession.d.ts +0 -52
- package/dist/js/src/BaseRoomSession.d.ts.map +0 -1
- package/dist/js/src/Client.d.ts +0 -38
- package/dist/js/src/Client.d.ts.map +0 -1
- package/dist/js/src/JWTSession.d.ts +0 -31
- package/dist/js/src/JWTSession.d.ts.map +0 -1
- package/dist/js/src/RoomSessionDevice.d.ts +0 -30
- package/dist/js/src/RoomSessionDevice.d.ts.map +0 -1
- package/dist/js/src/RoomSessionScreenShare.d.ts +0 -26
- package/dist/js/src/RoomSessionScreenShare.d.ts.map +0 -1
- package/dist/js/src/VideoOverlays.d.ts +0 -42
- package/dist/js/src/VideoOverlays.d.ts.map +0 -1
- package/dist/js/src/buildVideoElement.d.ts +0 -18
- package/dist/js/src/buildVideoElement.d.ts.map +0 -1
- package/dist/js/src/cantina/VideoManager.d.ts +0 -16
- package/dist/js/src/cantina/VideoManager.d.ts.map +0 -1
- package/dist/js/src/cantina/index.d.ts +0 -2
- package/dist/js/src/cantina/index.d.ts.map +0 -1
- package/dist/js/src/cantina/workers/index.d.ts +0 -2
- package/dist/js/src/cantina/workers/index.d.ts.map +0 -1
- package/dist/js/src/cantina/workers/videoManagerRoomWorker.d.ts +0 -4
- package/dist/js/src/cantina/workers/videoManagerRoomWorker.d.ts.map +0 -1
- package/dist/js/src/cantina/workers/videoManagerRoomsWorker.d.ts +0 -4
- package/dist/js/src/cantina/workers/videoManagerRoomsWorker.d.ts.map +0 -1
- package/dist/js/src/cantina/workers/videoManagerWorker.d.ts +0 -7
- package/dist/js/src/cantina/workers/videoManagerWorker.d.ts.map +0 -1
- package/dist/js/src/chat/Client.d.ts +0 -46
- package/dist/js/src/chat/Client.d.ts.map +0 -1
- package/dist/js/src/chat/index.d.ts +0 -5
- package/dist/js/src/chat/index.d.ts.map +0 -1
- package/dist/js/src/createClient.d.ts +0 -26
- package/dist/js/src/createClient.d.ts.map +0 -1
- package/dist/js/src/createRoomObject.d.ts +0 -38
- package/dist/js/src/createRoomObject.d.ts.map +0 -1
- package/dist/js/src/fabric/FabricRoomSession.d.ts +0 -80
- package/dist/js/src/fabric/FabricRoomSession.d.ts.map +0 -1
- package/dist/js/src/fabric/FabricRoomSessionMember.d.ts +0 -46
- package/dist/js/src/fabric/FabricRoomSessionMember.d.ts.map +0 -1
- package/dist/js/src/fabric/HTTPClient.d.ts +0 -16
- package/dist/js/src/fabric/HTTPClient.d.ts.map +0 -1
- package/dist/js/src/fabric/IncomingCallManager.d.ts +0 -19
- package/dist/js/src/fabric/IncomingCallManager.d.ts.map +0 -1
- package/dist/js/src/fabric/SATSession.d.ts +0 -25
- package/dist/js/src/fabric/SATSession.d.ts.map +0 -1
- package/dist/js/src/fabric/SignalWire.d.ts +0 -3
- package/dist/js/src/fabric/SignalWire.d.ts.map +0 -1
- package/dist/js/src/fabric/WSClient.d.ts +0 -33
- package/dist/js/src/fabric/WSClient.d.ts.map +0 -1
- package/dist/js/src/fabric/createHttpClient.d.ts +0 -22
- package/dist/js/src/fabric/createHttpClient.d.ts.map +0 -1
- package/dist/js/src/fabric/createWSClient.d.ts +0 -38
- package/dist/js/src/fabric/createWSClient.d.ts.map +0 -1
- package/dist/js/src/fabric/index.d.ts +0 -15
- package/dist/js/src/fabric/index.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/address.d.ts +0 -37
- package/dist/js/src/fabric/interfaces/address.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/capabilities.d.ts +0 -29
- package/dist/js/src/fabric/interfaces/capabilities.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/conversation.d.ts +0 -105
- package/dist/js/src/fabric/interfaces/conversation.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/device.d.ts +0 -18
- package/dist/js/src/fabric/interfaces/device.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/httpClient.d.ts +0 -41
- package/dist/js/src/fabric/interfaces/httpClient.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/incomingCallManager.d.ts +0 -30
- package/dist/js/src/fabric/interfaces/incomingCallManager.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/index.d.ts +0 -71
- package/dist/js/src/fabric/interfaces/index.d.ts.map +0 -1
- package/dist/js/src/fabric/interfaces/wsClient.d.ts +0 -132
- package/dist/js/src/fabric/interfaces/wsClient.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/capabilitiesHelpers.d.ts +0 -28
- package/dist/js/src/fabric/utils/capabilitiesHelpers.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/constants.d.ts +0 -5
- package/dist/js/src/fabric/utils/constants.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/eventMappers.d.ts +0 -151
- package/dist/js/src/fabric/utils/eventMappers.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/typeGuard.d.ts +0 -6
- package/dist/js/src/fabric/utils/typeGuard.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/validationProxy.d.ts +0 -13
- package/dist/js/src/fabric/utils/validationProxy.d.ts.map +0 -1
- package/dist/js/src/fabric/utils/validators.d.ts +0 -20
- package/dist/js/src/fabric/utils/validators.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/callJoinWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/callJoinWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/callLeftWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/callLeftWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/callSegmentWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/callSegmentWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/fabricMemberWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/fabricMemberWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/fabricWorker.d.ts +0 -7
- package/dist/js/src/fabric/workers/fabricWorker.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/index.d.ts +0 -3
- package/dist/js/src/fabric/workers/index.d.ts.map +0 -1
- package/dist/js/src/fabric/workers/wsClientWorker.d.ts +0 -4
- package/dist/js/src/fabric/workers/wsClientWorker.d.ts.map +0 -1
- package/dist/js/src/features/actions.d.ts +0 -2
- package/dist/js/src/features/actions.d.ts.map +0 -1
- package/dist/js/src/features/mediaElements/mediaElementsSagas.d.ts +0 -7
- package/dist/js/src/features/mediaElements/mediaElementsSagas.d.ts.map +0 -1
- package/dist/js/src/index.d.ts +0 -87
- package/dist/js/src/index.d.ts.map +0 -1
- package/dist/js/src/joinRoom.d.ts +0 -24
- package/dist/js/src/joinRoom.d.ts.map +0 -1
- package/dist/js/src/pubSub/Client.d.ts +0 -46
- package/dist/js/src/pubSub/Client.d.ts.map +0 -1
- package/dist/js/src/pubSub/index.d.ts +0 -6
- package/dist/js/src/pubSub/index.d.ts.map +0 -1
- package/dist/js/src/setupTests.d.ts +0 -2
- package/dist/js/src/setupTests.d.ts.map +0 -1
- package/dist/js/src/testUtils.d.ts +0 -77
- package/dist/js/src/testUtils.d.ts.map +0 -1
- package/dist/js/src/utils/CloseEvent.d.ts +0 -7
- package/dist/js/src/utils/CloseEvent.d.ts.map +0 -1
- package/dist/js/src/utils/audioElement.d.ts +0 -6
- package/dist/js/src/utils/audioElement.d.ts.map +0 -1
- package/dist/js/src/utils/constants.d.ts +0 -2
- package/dist/js/src/utils/constants.d.ts.map +0 -1
- package/dist/js/src/utils/interfaces/base.d.ts +0 -55
- package/dist/js/src/utils/interfaces/base.d.ts.map +0 -1
- package/dist/js/src/utils/interfaces/fabric.d.ts +0 -71
- package/dist/js/src/utils/interfaces/fabric.d.ts.map +0 -1
- package/dist/js/src/utils/interfaces/index.d.ts +0 -4
- package/dist/js/src/utils/interfaces/index.d.ts.map +0 -1
- package/dist/js/src/utils/interfaces/video.d.ts +0 -307
- package/dist/js/src/utils/interfaces/video.d.ts.map +0 -1
- package/dist/js/src/utils/makeQueryParamsUrl.d.ts +0 -9
- package/dist/js/src/utils/makeQueryParamsUrl.d.ts.map +0 -1
- package/dist/js/src/utils/paginatedResult.d.ts +0 -12
- package/dist/js/src/utils/paginatedResult.d.ts.map +0 -1
- package/dist/js/src/utils/roomSession.d.ts +0 -26
- package/dist/js/src/utils/roomSession.d.ts.map +0 -1
- package/dist/js/src/utils/storage.d.ts +0 -10
- package/dist/js/src/utils/storage.d.ts.map +0 -1
- package/dist/js/src/utils/videoElement.d.ts +0 -35
- package/dist/js/src/utils/videoElement.d.ts.map +0 -1
- package/dist/js/src/video/RoomSession.d.ts +0 -38
- package/dist/js/src/video/RoomSession.d.ts.map +0 -1
- package/dist/js/src/video/VideoRoomSession.d.ts +0 -57
- package/dist/js/src/video/VideoRoomSession.d.ts.map +0 -1
- package/dist/js/src/video/index.d.ts +0 -16
- package/dist/js/src/video/index.d.ts.map +0 -1
- package/dist/js/src/video/workers/childMemberJoinedWorker.d.ts +0 -10
- package/dist/js/src/video/workers/childMemberJoinedWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/index.d.ts +0 -7
- package/dist/js/src/video/workers/index.d.ts.map +0 -1
- package/dist/js/src/video/workers/memberListUpdatedWorker.d.ts +0 -14
- package/dist/js/src/video/workers/memberListUpdatedWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/videoPlaybackWorker.d.ts +0 -4
- package/dist/js/src/video/workers/videoPlaybackWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/videoRecordWorker.d.ts +0 -4
- package/dist/js/src/video/workers/videoRecordWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/videoStreamWorker.d.ts +0 -4
- package/dist/js/src/video/workers/videoStreamWorker.d.ts.map +0 -1
- package/dist/js/src/video/workers/videoWorker.d.ts +0 -7
- package/dist/js/src/video/workers/videoWorker.d.ts.map +0 -1
- package/dist/js/src/webrtc.d.ts +0 -3
- package/dist/js/src/webrtc.d.ts.map +0 -1
- package/dist/js/tsconfig.build.tsbuildinfo +0 -1
- package/dist/webrtc/src/BaseConnection.d.ts +0 -232
- package/dist/webrtc/src/BaseConnection.d.ts.map +0 -1
- package/dist/webrtc/src/RTCPeer.d.ts +0 -134
- package/dist/webrtc/src/RTCPeer.d.ts.map +0 -1
- package/dist/webrtc/src/RTCPeer.test.d.ts +0 -2
- package/dist/webrtc/src/RTCPeer.test.d.ts.map +0 -1
- package/dist/webrtc/src/RTCPeerConnectionManager.d.ts +0 -63
- package/dist/webrtc/src/RTCPeerConnectionManager.d.ts.map +0 -1
- package/dist/webrtc/src/RTCPeerConnectionManager.test.d.ts +0 -2
- package/dist/webrtc/src/RTCPeerConnectionManager.test.d.ts.map +0 -1
- package/dist/webrtc/src/connectionPoolManager.d.ts +0 -14
- package/dist/webrtc/src/connectionPoolManager.d.ts.map +0 -1
- package/dist/webrtc/src/index.d.ts +0 -7
- package/dist/webrtc/src/index.d.ts.map +0 -1
- package/dist/webrtc/src/index.test.d.ts +0 -1
- package/dist/webrtc/src/index.test.d.ts.map +0 -1
- package/dist/webrtc/src/setupTests.d.ts +0 -2
- package/dist/webrtc/src/setupTests.d.ts.map +0 -1
- package/dist/webrtc/src/utils/constants.d.ts +0 -7
- package/dist/webrtc/src/utils/constants.d.ts.map +0 -1
- package/dist/webrtc/src/utils/deviceHelpers.d.ts +0 -319
- package/dist/webrtc/src/utils/deviceHelpers.d.ts.map +0 -1
- package/dist/webrtc/src/utils/deviceHelpers.test.d.ts +0 -2
- package/dist/webrtc/src/utils/deviceHelpers.test.d.ts.map +0 -1
- package/dist/webrtc/src/utils/enumerateDevices.d.ts +0 -25
- package/dist/webrtc/src/utils/enumerateDevices.d.ts.map +0 -1
- package/dist/webrtc/src/utils/getDisplayMedia.d.ts +0 -17
- package/dist/webrtc/src/utils/getDisplayMedia.d.ts.map +0 -1
- package/dist/webrtc/src/utils/getUserMedia.d.ts +0 -35
- package/dist/webrtc/src/utils/getUserMedia.d.ts.map +0 -1
- package/dist/webrtc/src/utils/helpers.d.ts +0 -18
- package/dist/webrtc/src/utils/helpers.d.ts.map +0 -1
- package/dist/webrtc/src/utils/helpers.test.d.ts +0 -2
- package/dist/webrtc/src/utils/helpers.test.d.ts.map +0 -1
- package/dist/webrtc/src/utils/index.d.ts +0 -8
- package/dist/webrtc/src/utils/index.d.ts.map +0 -1
- package/dist/webrtc/src/utils/interfaces.d.ts +0 -139
- package/dist/webrtc/src/utils/interfaces.d.ts.map +0 -1
- package/dist/webrtc/src/utils/mockTracks.d.ts +0 -26
- package/dist/webrtc/src/utils/mockTracks.d.ts.map +0 -1
- package/dist/webrtc/src/utils/permissions.d.ts +0 -48
- package/dist/webrtc/src/utils/permissions.d.ts.map +0 -1
- package/dist/webrtc/src/utils/primitives.d.ts +0 -54
- package/dist/webrtc/src/utils/primitives.d.ts.map +0 -1
- package/dist/webrtc/src/utils/primitives.native.d.ts +0 -36
- package/dist/webrtc/src/utils/primitives.native.d.ts.map +0 -1
- package/dist/webrtc/src/utils/requestPermissions.d.ts +0 -27
- package/dist/webrtc/src/utils/requestPermissions.d.ts.map +0 -1
- package/dist/webrtc/src/utils/sdpHelpers.d.ts +0 -61
- package/dist/webrtc/src/utils/sdpHelpers.d.ts.map +0 -1
- package/dist/webrtc/src/utils/sdpHelpers.test.d.ts +0 -2
- package/dist/webrtc/src/utils/sdpHelpers.test.d.ts.map +0 -1
- package/dist/webrtc/src/utils/watchRTCPeerMediaPackets.d.ts +0 -7
- package/dist/webrtc/src/utils/watchRTCPeerMediaPackets.d.ts.map +0 -1
- package/dist/webrtc/src/utils/webrtcHelpers.test.d.ts +0 -2
- package/dist/webrtc/src/utils/webrtcHelpers.test.d.ts.map +0 -1
- package/dist/webrtc/src/webrtcMocks.d.ts +0 -110
- package/dist/webrtc/src/webrtcMocks.d.ts.map +0 -1
- package/dist/webrtc/src/workers/connectionPoolWorker.d.ts +0 -7
- package/dist/webrtc/src/workers/connectionPoolWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/index.d.ts +0 -7
- package/dist/webrtc/src/workers/index.d.ts.map +0 -1
- package/dist/webrtc/src/workers/promoteDemoteWorker.d.ts +0 -10
- package/dist/webrtc/src/workers/promoteDemoteWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/roomSubscribedWorker.d.ts +0 -10
- package/dist/webrtc/src/workers/roomSubscribedWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/sessionAuthWorker.d.ts +0 -10
- package/dist/webrtc/src/workers/sessionAuthWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/sessionConnectionPoolWorker.d.ts +0 -7
- package/dist/webrtc/src/workers/sessionConnectionPoolWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/vertoEventWorker.d.ts +0 -10
- package/dist/webrtc/src/workers/vertoEventWorker.d.ts.map +0 -1
- package/dist/webrtc/src/workers/vertoEventWorker.test.d.ts +0 -2
- package/dist/webrtc/src/workers/vertoEventWorker.test.d.ts.map +0 -1
- package/src/BaseRoomSession.ts +0 -302
- package/src/Client.ts +0 -193
- package/src/JWTSession.test.ts +0 -60
- package/src/JWTSession.ts +0 -146
- package/src/RoomSessionDevice.test.ts +0 -25
- package/src/RoomSessionDevice.ts +0 -62
- package/src/RoomSessionScreenShare.test.ts +0 -25
- package/src/RoomSessionScreenShare.ts +0 -58
- package/src/VideoOverlays.ts +0 -171
- package/src/buildVideoElement.test.ts +0 -933
- package/src/buildVideoElement.ts +0 -290
- package/src/cantina/VideoManager.test.ts +0 -95
- package/src/cantina/VideoManager.ts +0 -72
- package/src/cantina/index.ts +0 -1
- package/src/cantina/workers/index.ts +0 -1
- package/src/cantina/workers/videoManagerRoomWorker.ts +0 -28
- package/src/cantina/workers/videoManagerRoomsWorker.ts +0 -34
- package/src/cantina/workers/videoManagerWorker.ts +0 -64
- package/src/chat/Client.test.ts +0 -688
- package/src/chat/Client.ts +0 -94
- package/src/chat/index.ts +0 -31
- package/src/createClient.test.ts +0 -124
- package/src/createClient.ts +0 -48
- package/src/createRoomObject.ts +0 -149
- package/src/fabric/FabricRoomSession.test.ts +0 -695
- package/src/fabric/FabricRoomSession.ts +0 -446
- package/src/fabric/FabricRoomSessionMember.ts +0 -188
- package/src/fabric/HTTPClient.test.ts +0 -28
- package/src/fabric/HTTPClient.ts +0 -154
- package/src/fabric/IncomingCallManager.test.ts +0 -295
- package/src/fabric/IncomingCallManager.ts +0 -92
- package/src/fabric/SATSession.test.ts +0 -65
- package/src/fabric/SATSession.ts +0 -102
- package/src/fabric/SignalWire.test.ts +0 -115
- package/src/fabric/SignalWire.ts +0 -101
- package/src/fabric/WSClient.ts +0 -430
- package/src/fabric/createHttpClient.ts +0 -188
- package/src/fabric/createWSClient.ts +0 -12
- package/src/fabric/index.ts +0 -30
- package/src/fabric/interfaces/address.ts +0 -46
- package/src/fabric/interfaces/capabilities.ts +0 -30
- package/src/fabric/interfaces/conversation.ts +0 -145
- package/src/fabric/interfaces/device.ts +0 -21
- package/src/fabric/interfaces/httpClient.ts +0 -50
- package/src/fabric/interfaces/incomingCallManager.ts +0 -36
- package/src/fabric/interfaces/index.ts +0 -118
- package/src/fabric/interfaces/wsClient.ts +0 -154
- package/src/fabric/utils/capabilitiesHelpers.test.ts +0 -201
- package/src/fabric/utils/capabilitiesHelpers.ts +0 -208
- package/src/fabric/utils/constants.ts +0 -4
- package/src/fabric/utils/eventMappers.ts +0 -184
- package/src/fabric/utils/typeGuard.ts +0 -31
- package/src/fabric/utils/validationProxy.ts +0 -83
- package/src/fabric/utils/validators.ts +0 -242
- package/src/fabric/workers/callJoinWorker.ts +0 -88
- package/src/fabric/workers/callLeftWorker.ts +0 -32
- package/src/fabric/workers/callSegmentWorker.ts +0 -154
- package/src/fabric/workers/fabricMemberWorker.ts +0 -62
- package/src/fabric/workers/fabricWorker.ts +0 -100
- package/src/fabric/workers/index.ts +0 -2
- package/src/fabric/workers/wsClientWorker.ts +0 -60
- package/src/features/actions.ts +0 -5
- package/src/features/mediaElements/mediaElementsSagas.ts +0 -129
- package/src/index.test.ts +0 -5
- package/src/index.ts +0 -153
- package/src/joinRoom.ts +0 -29
- package/src/pubSub/Client.test.ts +0 -245
- package/src/pubSub/Client.ts +0 -90
- package/src/pubSub/index.ts +0 -10
- package/src/setupTests.ts +0 -122
- package/src/testUtils.ts +0 -259
- package/src/utils/CloseEvent.ts +0 -6
- package/src/utils/audioElement.ts +0 -21
- package/src/utils/constants.ts +0 -7
- package/src/utils/interfaces/base.ts +0 -55
- package/src/utils/interfaces/fabric.ts +0 -156
- package/src/utils/interfaces/index.ts +0 -3
- package/src/utils/interfaces/video.ts +0 -440
- package/src/utils/makeQueryParamsUrl.ts +0 -14
- package/src/utils/paginatedResult.ts +0 -35
- package/src/utils/roomSession.test.ts +0 -140
- package/src/utils/roomSession.ts +0 -85
- package/src/utils/storage.test.ts +0 -24
- package/src/utils/storage.ts +0 -37
- package/src/utils/videoElement.ts +0 -342
- package/src/video/RoomSession.test.ts +0 -31
- package/src/video/RoomSession.ts +0 -290
- package/src/video/VideoRoomSession.test.ts +0 -672
- package/src/video/VideoRoomSession.ts +0 -304
- package/src/video/index.ts +0 -43
- package/src/video/workers/childMemberJoinedWorker.test.ts +0 -99
- package/src/video/workers/childMemberJoinedWorker.ts +0 -75
- package/src/video/workers/index.ts +0 -6
- package/src/video/workers/memberListUpdatedWorker.ts +0 -217
- package/src/video/workers/videoPlaybackWorker.ts +0 -54
- package/src/video/workers/videoRecordWorker.ts +0 -54
- package/src/video/workers/videoStreamWorker.ts +0 -48
- package/src/video/workers/videoWorker.ts +0 -113
- package/src/webrtc.ts +0 -33
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { SignalWire } from './SignalWire'
|
|
2
|
-
import { HTTPClient } from './HTTPClient'
|
|
3
|
-
import { WSClient } from './WSClient'
|
|
4
|
-
|
|
5
|
-
jest.mock('./HTTPClient')
|
|
6
|
-
jest.mock('./WSClient')
|
|
7
|
-
|
|
8
|
-
describe('SignalWire', () => {
|
|
9
|
-
const mockParams = {
|
|
10
|
-
host: 'mock-host',
|
|
11
|
-
token: 'mock-token',
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
let mockConnect: jest.Mock
|
|
15
|
-
let mockDisconnect: jest.Mock
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
// Reset mocks
|
|
19
|
-
jest.clearAllMocks()
|
|
20
|
-
|
|
21
|
-
mockConnect = jest.fn()
|
|
22
|
-
mockDisconnect = jest.fn()
|
|
23
|
-
|
|
24
|
-
// Mock WSClient behavior
|
|
25
|
-
;(WSClient as jest.Mock).mockImplementation(() => ({
|
|
26
|
-
connect: mockConnect,
|
|
27
|
-
disconnect: mockDisconnect,
|
|
28
|
-
online: jest.fn(),
|
|
29
|
-
offline: jest.fn(),
|
|
30
|
-
dial: jest.fn(),
|
|
31
|
-
reattach: jest.fn(),
|
|
32
|
-
handlePushNotification: jest.fn(),
|
|
33
|
-
updateToken: jest.fn(),
|
|
34
|
-
on: jest.fn(),
|
|
35
|
-
off: jest.fn(),
|
|
36
|
-
}))
|
|
37
|
-
|
|
38
|
-
// Mock HTTPClient behavior
|
|
39
|
-
;(HTTPClient as jest.Mock).mockImplementation(() => ({
|
|
40
|
-
registerDevice: jest.fn(),
|
|
41
|
-
unregisterDevice: jest.fn(),
|
|
42
|
-
getSubscriberInfo: jest.fn(),
|
|
43
|
-
getAddresses: jest.fn(),
|
|
44
|
-
getAddress: jest.fn(),
|
|
45
|
-
}))
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('should create a single instance on the first call', async () => {
|
|
49
|
-
const client1 = await SignalWire(mockParams)
|
|
50
|
-
const client2 = await SignalWire(mockParams)
|
|
51
|
-
|
|
52
|
-
expect(client1).toBe(client2)
|
|
53
|
-
|
|
54
|
-
expect(WSClient).toHaveBeenCalledTimes(1)
|
|
55
|
-
expect(HTTPClient).toHaveBeenCalledTimes(1)
|
|
56
|
-
expect(mockConnect).toHaveBeenCalledTimes(1)
|
|
57
|
-
|
|
58
|
-
await client1.disconnect()
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('should reset the instance after calling disconnect', async () => {
|
|
62
|
-
const client = await SignalWire(mockParams)
|
|
63
|
-
|
|
64
|
-
await client.disconnect()
|
|
65
|
-
expect(mockDisconnect).toHaveBeenCalledTimes(1)
|
|
66
|
-
const newClient = await SignalWire(mockParams)
|
|
67
|
-
|
|
68
|
-
expect(newClient).not.toBe(client)
|
|
69
|
-
|
|
70
|
-
expect(WSClient).toHaveBeenCalledTimes(2)
|
|
71
|
-
expect(HTTPClient).toHaveBeenCalledTimes(2)
|
|
72
|
-
expect(mockConnect).toHaveBeenCalledTimes(2)
|
|
73
|
-
|
|
74
|
-
await client.disconnect()
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
it('should handle errors during initialization and allow retry', async () => {
|
|
78
|
-
mockConnect.mockImplementationOnce(() => {
|
|
79
|
-
throw new Error('Connection failed')
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
await expect(SignalWire(mockParams)).rejects.toThrow('Connection failed')
|
|
83
|
-
|
|
84
|
-
expect(WSClient).toHaveBeenCalledTimes(1)
|
|
85
|
-
expect(HTTPClient).toHaveBeenCalledTimes(1)
|
|
86
|
-
expect(mockConnect).toHaveBeenCalledTimes(1)
|
|
87
|
-
|
|
88
|
-
const client = await SignalWire(mockParams)
|
|
89
|
-
expect(client).toBeDefined()
|
|
90
|
-
expect(WSClient).toHaveBeenCalledTimes(2)
|
|
91
|
-
expect(HTTPClient).toHaveBeenCalledTimes(2)
|
|
92
|
-
expect(mockConnect).toHaveBeenCalledTimes(2)
|
|
93
|
-
|
|
94
|
-
await client.disconnect()
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
it('should throw error for conversation methods', async () => {
|
|
98
|
-
const client = await SignalWire(mockParams)
|
|
99
|
-
|
|
100
|
-
await expect(() => client.conversation.getConversations()).toThrow(
|
|
101
|
-
'This version Conversation.getConversations is unsupported by the backend. Use @signalwire/client instead.'
|
|
102
|
-
)
|
|
103
|
-
await expect(() => client.conversation.getMessages()).toThrow(
|
|
104
|
-
'This version Conversation.getMessages is unsupported by the backend. Use @signalwire/client instead.'
|
|
105
|
-
)
|
|
106
|
-
await expect(() => client.conversation.sendMessage()).toThrow(
|
|
107
|
-
'This version Conversation.sendMessage is unsupported by the backend. Use @signalwire/client instead.'
|
|
108
|
-
)
|
|
109
|
-
await expect(() => client.chat.getMessages()).toThrow(
|
|
110
|
-
'This version Conversation.getMessages is unsupported by the backend. Use @signalwire/client instead.'
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
await client.disconnect()
|
|
114
|
-
})
|
|
115
|
-
})
|
package/src/fabric/SignalWire.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { HTTPClient } from './HTTPClient'
|
|
2
|
-
import { SignalWireClient, SignalWireClientParams } from './interfaces'
|
|
3
|
-
import { WSClient } from './WSClient'
|
|
4
|
-
import {
|
|
5
|
-
DEFAULT_API_REQUEST_RETRIES,
|
|
6
|
-
DEFAULT_API_REQUEST_RETRIES_DELAY,
|
|
7
|
-
DEFAULT_API_REQUEST_RETRIES_DELAY_INCREMENT,
|
|
8
|
-
} from './utils/constants'
|
|
9
|
-
|
|
10
|
-
export const SignalWire = (() => {
|
|
11
|
-
let instance: Promise<SignalWireClient> | null = null
|
|
12
|
-
|
|
13
|
-
return (params: SignalWireClientParams): Promise<SignalWireClient> => {
|
|
14
|
-
if (!instance) {
|
|
15
|
-
instance = new Promise<SignalWireClient>(async (resolve, reject) => {
|
|
16
|
-
try {
|
|
17
|
-
const options = {
|
|
18
|
-
maxApiRequestRetries: DEFAULT_API_REQUEST_RETRIES,
|
|
19
|
-
apiRequestRetriesDelay: DEFAULT_API_REQUEST_RETRIES_DELAY,
|
|
20
|
-
apiRequestRetriesDelayIncrement:
|
|
21
|
-
DEFAULT_API_REQUEST_RETRIES_DELAY_INCREMENT,
|
|
22
|
-
...params,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const wsClient = new WSClient(options)
|
|
26
|
-
const httpClient = new HTTPClient(options)
|
|
27
|
-
const conversationError = (method: string) => {
|
|
28
|
-
return () => {
|
|
29
|
-
throw new Error(
|
|
30
|
-
`This version Conversation.${method} is unsupported by the backend. Use @signalwire/client instead.`
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Connect the WebSocket and authenticate the user
|
|
36
|
-
await wsClient.connect()
|
|
37
|
-
|
|
38
|
-
resolve({
|
|
39
|
-
registerDevice: httpClient.registerDevice.bind(httpClient),
|
|
40
|
-
unregisterDevice: httpClient.unregisterDevice.bind(httpClient),
|
|
41
|
-
getSubscriberInfo: httpClient.getSubscriberInfo.bind(httpClient),
|
|
42
|
-
disconnect: async () => {
|
|
43
|
-
await wsClient.disconnect()
|
|
44
|
-
instance = null // Reset the singleton instance on disconnect
|
|
45
|
-
},
|
|
46
|
-
online: wsClient.online.bind(wsClient),
|
|
47
|
-
offline: wsClient.offline.bind(wsClient),
|
|
48
|
-
dial: wsClient.dial.bind(wsClient),
|
|
49
|
-
reattach: wsClient.reattach.bind(wsClient),
|
|
50
|
-
handlePushNotification:
|
|
51
|
-
wsClient.handlePushNotification.bind(wsClient),
|
|
52
|
-
updateToken: wsClient.updateToken.bind(wsClient),
|
|
53
|
-
address: {
|
|
54
|
-
getAddresses: httpClient.getAddresses.bind(httpClient),
|
|
55
|
-
getAddress: httpClient.getAddress.bind(httpClient),
|
|
56
|
-
},
|
|
57
|
-
conversation: {
|
|
58
|
-
getConversations: conversationError(
|
|
59
|
-
'getConversations'),
|
|
60
|
-
getMessages: conversationError(
|
|
61
|
-
'getMessages'),
|
|
62
|
-
getConversationMessages: conversationError(
|
|
63
|
-
'getConversationMessages'),
|
|
64
|
-
subscribe: conversationError(
|
|
65
|
-
'subscribe'),
|
|
66
|
-
sendMessage: conversationError(
|
|
67
|
-
'sendMessage'),
|
|
68
|
-
join: conversationError(
|
|
69
|
-
'join'),
|
|
70
|
-
},
|
|
71
|
-
chat: {
|
|
72
|
-
getMessages: conversationError(
|
|
73
|
-
'getMessages'),
|
|
74
|
-
subscribe: conversationError(
|
|
75
|
-
'subscribe'),
|
|
76
|
-
sendMessage: conversationError(
|
|
77
|
-
'sendMessage'),
|
|
78
|
-
join: conversationError(
|
|
79
|
-
'join'),
|
|
80
|
-
},
|
|
81
|
-
// @ts-expect-error For debugging purposes
|
|
82
|
-
on: wsClient.on.bind(wsClient),
|
|
83
|
-
off: wsClient.off.bind(wsClient),
|
|
84
|
-
__httpClient: httpClient,
|
|
85
|
-
__wsClient: wsClient,
|
|
86
|
-
})
|
|
87
|
-
} catch (error) {
|
|
88
|
-
reject(error)
|
|
89
|
-
}
|
|
90
|
-
}).catch((error) => {
|
|
91
|
-
/**
|
|
92
|
-
* Reset the instance to null explicitly since
|
|
93
|
-
* Promises are immutable: once rejected, a Promise remains rejected forever.
|
|
94
|
-
*/
|
|
95
|
-
instance = null
|
|
96
|
-
throw error
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
return instance
|
|
100
|
-
}
|
|
101
|
-
})()
|
package/src/fabric/WSClient.ts
DELETED
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
actions,
|
|
3
|
-
BaseClient,
|
|
4
|
-
CallJoinedEventParams as InternalCallJoinedEventParams,
|
|
5
|
-
VertoBye,
|
|
6
|
-
VertoSubscribe,
|
|
7
|
-
} from '@signalwire/core'
|
|
8
|
-
import { sessionConnectionPoolWorker } from '@signalwire/webrtc'
|
|
9
|
-
import { MakeRoomOptions } from '../video'
|
|
10
|
-
import {
|
|
11
|
-
createFabricRoomSessionObject,
|
|
12
|
-
FabricRoomSession,
|
|
13
|
-
} from './FabricRoomSession'
|
|
14
|
-
import { buildVideoElement } from '../buildVideoElement'
|
|
15
|
-
import {
|
|
16
|
-
CallParams,
|
|
17
|
-
DialParams,
|
|
18
|
-
ReattachParams,
|
|
19
|
-
IncomingInvite,
|
|
20
|
-
OnlineParams,
|
|
21
|
-
HandlePushNotificationParams,
|
|
22
|
-
WSClientOptions,
|
|
23
|
-
HandlePushNotificationResult,
|
|
24
|
-
} from './interfaces'
|
|
25
|
-
import { IncomingCallManager } from './IncomingCallManager'
|
|
26
|
-
import { wsClientWorker } from './workers'
|
|
27
|
-
import { createWSClient } from './createWSClient'
|
|
28
|
-
import { WSClientContract } from './interfaces/wsClient'
|
|
29
|
-
import { getStorage } from '../utils/storage'
|
|
30
|
-
import { PREVIOUS_CALLID_STORAGE_KEY } from './utils/constants'
|
|
31
|
-
|
|
32
|
-
export class WSClient extends BaseClient<{}> implements WSClientContract {
|
|
33
|
-
private _incomingCallManager: IncomingCallManager
|
|
34
|
-
private _disconnected: boolean = false
|
|
35
|
-
|
|
36
|
-
constructor(private wsClientOptions: WSClientOptions) {
|
|
37
|
-
const client = createWSClient(wsClientOptions)
|
|
38
|
-
super(client)
|
|
39
|
-
|
|
40
|
-
this._incomingCallManager = new IncomingCallManager({
|
|
41
|
-
client: this,
|
|
42
|
-
buildInboundCall: this.buildInboundCall.bind(this),
|
|
43
|
-
executeVertoBye: this.executeVertoBye.bind(this),
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
this.runWorker('wsClientWorker', {
|
|
47
|
-
worker: wsClientWorker,
|
|
48
|
-
initialState: {
|
|
49
|
-
handleIncomingInvite: (invite: IncomingInvite) => {
|
|
50
|
-
this._incomingCallManager.handleIncomingInvite({
|
|
51
|
-
source: 'websocket',
|
|
52
|
-
...invite,
|
|
53
|
-
})
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
// Initialize the session-level connection pool
|
|
59
|
-
// This will start pre-warming connections as soon as the session is authorized
|
|
60
|
-
this.initializeSessionConnectionPool()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
private makeFabricObject(makeRoomOptions: MakeRoomOptions) {
|
|
64
|
-
const {
|
|
65
|
-
rootElement,
|
|
66
|
-
applyLocalVideoOverlay = true,
|
|
67
|
-
applyMemberOverlay = true,
|
|
68
|
-
stopCameraWhileMuted = true,
|
|
69
|
-
stopMicrophoneWhileMuted = true,
|
|
70
|
-
mirrorLocalVideoOverlay = true,
|
|
71
|
-
...options
|
|
72
|
-
} = makeRoomOptions
|
|
73
|
-
|
|
74
|
-
const room = createFabricRoomSessionObject({
|
|
75
|
-
...options,
|
|
76
|
-
store: this.store,
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* If the user provides a `rootElement` we'll
|
|
81
|
-
* automatically handle the Video element for them
|
|
82
|
-
*/
|
|
83
|
-
if (rootElement) {
|
|
84
|
-
try {
|
|
85
|
-
buildVideoElement({
|
|
86
|
-
applyLocalVideoOverlay,
|
|
87
|
-
applyMemberOverlay,
|
|
88
|
-
mirrorLocalVideoOverlay,
|
|
89
|
-
room,
|
|
90
|
-
rootElement,
|
|
91
|
-
})
|
|
92
|
-
} catch (error) {
|
|
93
|
-
this.logger.error('Unable to build the video element automatically')
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* If the user joins with `join_video_muted: true` or
|
|
99
|
-
* `join_audio_muted: true` we'll stop the streams
|
|
100
|
-
* right away.
|
|
101
|
-
*/
|
|
102
|
-
const joinMutedHandler = (params: InternalCallJoinedEventParams) => {
|
|
103
|
-
const member = params.room_session.members?.find(
|
|
104
|
-
(m) => m.member_id === room.memberId
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
if (member?.audio_muted) {
|
|
108
|
-
try {
|
|
109
|
-
room.stopOutboundAudio()
|
|
110
|
-
} catch (error) {
|
|
111
|
-
this.logger.error('Error handling audio_muted', error)
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (member?.video_muted) {
|
|
116
|
-
try {
|
|
117
|
-
room.stopOutboundVideo()
|
|
118
|
-
} catch (error) {
|
|
119
|
-
this.logger.error('Error handling video_muted', error)
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
room.on('room.subscribed', joinMutedHandler)
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Stop or Restore outbound audio on "member.updated" event
|
|
128
|
-
*/
|
|
129
|
-
if (stopMicrophoneWhileMuted) {
|
|
130
|
-
room.on('member.updated.audioMuted', ({ member }) => {
|
|
131
|
-
try {
|
|
132
|
-
if (member.member_id === room.memberId && 'audio_muted' in member) {
|
|
133
|
-
member.audio_muted
|
|
134
|
-
? room.stopOutboundAudio()
|
|
135
|
-
: room.restoreOutboundAudio()
|
|
136
|
-
}
|
|
137
|
-
} catch (error) {
|
|
138
|
-
this.logger.error('Error handling audio_muted', error)
|
|
139
|
-
}
|
|
140
|
-
})
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Stop or Restore outbound video on "member.updated" event
|
|
145
|
-
*/
|
|
146
|
-
if (stopCameraWhileMuted) {
|
|
147
|
-
room.on('member.updated.videoMuted', ({ member }) => {
|
|
148
|
-
try {
|
|
149
|
-
if (member.member_id === room.memberId && 'video_muted' in member) {
|
|
150
|
-
member.video_muted
|
|
151
|
-
? room.stopOutboundVideo()
|
|
152
|
-
: room.restoreOutboundVideo()
|
|
153
|
-
}
|
|
154
|
-
} catch (error) {
|
|
155
|
-
this.logger.error('Error handling video_muted', error)
|
|
156
|
-
}
|
|
157
|
-
})
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return room
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
private buildOutboundCall(params: ReattachParams & { attach?: boolean }) {
|
|
164
|
-
let video = false
|
|
165
|
-
let negotiateVideo = false
|
|
166
|
-
|
|
167
|
-
if (params.to) {
|
|
168
|
-
const [pathname, query] = params.to.split('?')
|
|
169
|
-
if (!pathname) {
|
|
170
|
-
throw new Error('Invalid destination address')
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const queryParams = new URLSearchParams(query)
|
|
174
|
-
const channel = queryParams.get('channel')
|
|
175
|
-
if (channel === 'video') {
|
|
176
|
-
video = true
|
|
177
|
-
negotiateVideo = true
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const call = this.makeFabricObject({
|
|
182
|
-
audio: params.audio ?? true,
|
|
183
|
-
video: params.video ?? video,
|
|
184
|
-
negotiateAudio: params.negotiateAudio ?? true,
|
|
185
|
-
negotiateVideo: params.negotiateVideo ?? negotiateVideo,
|
|
186
|
-
rootElement: params.rootElement || this.wsClientOptions.rootElement,
|
|
187
|
-
applyLocalVideoOverlay: params.applyLocalVideoOverlay,
|
|
188
|
-
applyMemberOverlay: params.applyMemberOverlay,
|
|
189
|
-
stopCameraWhileMuted: params.stopCameraWhileMuted,
|
|
190
|
-
stopMicrophoneWhileMuted: params.stopMicrophoneWhileMuted,
|
|
191
|
-
mirrorLocalVideoOverlay: params.mirrorLocalVideoOverlay,
|
|
192
|
-
watchMediaPackets: false,
|
|
193
|
-
destinationNumber: params.to ?? '',
|
|
194
|
-
nodeId: params.nodeId,
|
|
195
|
-
attach: params.attach ?? false,
|
|
196
|
-
disableUdpIceServers: params.disableUdpIceServers || false,
|
|
197
|
-
userVariables: params.userVariables || this.wsClientOptions.userVariables,
|
|
198
|
-
fromFabricAddressId: params.fromFabricAddressId,
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
// WebRTC connection left the room.
|
|
202
|
-
call.once('destroy', () => {
|
|
203
|
-
this.logger.debug('RTC Connection Destroyed')
|
|
204
|
-
call.destroy()
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
this.session.once('session.disconnected', () => {
|
|
208
|
-
this.logger.debug('Session Disconnected')
|
|
209
|
-
call.destroy()
|
|
210
|
-
this.destroy()
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
// TODO: This is for memberList.updated event and it is not yet supported in CF SDK
|
|
214
|
-
// @ts-expect-error
|
|
215
|
-
call.attachPreConnectWorkers()
|
|
216
|
-
return call
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
private buildInboundCall(payload: IncomingInvite, params: CallParams) {
|
|
220
|
-
const call = this.makeFabricObject({
|
|
221
|
-
audio: params.audio ?? true,
|
|
222
|
-
video: params.video ?? true,
|
|
223
|
-
negotiateAudio: params.negotiateAudio ?? true,
|
|
224
|
-
negotiateVideo: params.negotiateVideo ?? true,
|
|
225
|
-
rootElement: params.rootElement || this.wsClientOptions.rootElement,
|
|
226
|
-
applyLocalVideoOverlay: true,
|
|
227
|
-
applyMemberOverlay: true,
|
|
228
|
-
stopCameraWhileMuted: true,
|
|
229
|
-
stopMicrophoneWhileMuted: true,
|
|
230
|
-
watchMediaPackets: false,
|
|
231
|
-
nodeId: payload.nodeId,
|
|
232
|
-
remoteSdp: payload.sdp,
|
|
233
|
-
prevCallId: payload.callID,
|
|
234
|
-
disableUdpIceServers: params.disableUdpIceServers || false,
|
|
235
|
-
userVariables: params.userVariables || this.wsClientOptions.userVariables,
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
// WebRTC connection left the room.
|
|
239
|
-
call.once('destroy', () => {
|
|
240
|
-
this.logger.debug('RTC Connection Destroyed')
|
|
241
|
-
call.destroy()
|
|
242
|
-
})
|
|
243
|
-
|
|
244
|
-
this.session.once('session.disconnected', () => {
|
|
245
|
-
this.logger.debug('Session Disconnected')
|
|
246
|
-
call.destroy()
|
|
247
|
-
this.destroy()
|
|
248
|
-
})
|
|
249
|
-
|
|
250
|
-
// TODO: This is for memberList.updated event and it is not yet supported in CF SDK
|
|
251
|
-
// @ts-expect-error
|
|
252
|
-
call.attachPreConnectWorkers()
|
|
253
|
-
return call
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
private async executeVertoBye(callId: string, nodeId: string) {
|
|
257
|
-
try {
|
|
258
|
-
return await this.execute<unknown, void>({
|
|
259
|
-
method: 'webrtc.verto',
|
|
260
|
-
params: {
|
|
261
|
-
callID: callId,
|
|
262
|
-
node_id: nodeId,
|
|
263
|
-
message: VertoBye({
|
|
264
|
-
cause: 'USER_BUSY',
|
|
265
|
-
causeCode: '17',
|
|
266
|
-
dialogParams: { callID: callId },
|
|
267
|
-
}),
|
|
268
|
-
},
|
|
269
|
-
})
|
|
270
|
-
} catch (error) {
|
|
271
|
-
this.logger.warn('The call is not available anymore', callId)
|
|
272
|
-
throw error
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
private async executeVertoSubscribe(callId: string, nodeId: string) {
|
|
277
|
-
try {
|
|
278
|
-
return await this.execute<unknown, void>({
|
|
279
|
-
method: 'webrtc.verto',
|
|
280
|
-
params: {
|
|
281
|
-
callID: callId,
|
|
282
|
-
node_id: nodeId,
|
|
283
|
-
subscribe: [],
|
|
284
|
-
message: VertoSubscribe({
|
|
285
|
-
sessid: callId,
|
|
286
|
-
eventChannel: [],
|
|
287
|
-
}),
|
|
288
|
-
},
|
|
289
|
-
})
|
|
290
|
-
} catch (error) {
|
|
291
|
-
this.logger.warn('The call is not available anymore', callId)
|
|
292
|
-
throw error
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
public override disconnect() {
|
|
297
|
-
return new Promise<void>((resolve, _reject) => {
|
|
298
|
-
if (this._disconnected) {
|
|
299
|
-
resolve()
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
this.session.once('session.disconnected', () => {
|
|
303
|
-
this.destroy()
|
|
304
|
-
resolve()
|
|
305
|
-
this._disconnected = true
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
super.disconnect()
|
|
309
|
-
})
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
public async dial(params: DialParams) {
|
|
313
|
-
return new Promise<FabricRoomSession>(async (resolve, reject) => {
|
|
314
|
-
try {
|
|
315
|
-
// in case the user left the previous call with hangup, and is not reattaching
|
|
316
|
-
getStorage()?.removeItem(PREVIOUS_CALLID_STORAGE_KEY)
|
|
317
|
-
const call = this.buildOutboundCall(params)
|
|
318
|
-
resolve(call)
|
|
319
|
-
} catch (error) {
|
|
320
|
-
this.logger.error('Unable to connect and dial a call', error)
|
|
321
|
-
reject(error)
|
|
322
|
-
}
|
|
323
|
-
})
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
public async reattach(params: ReattachParams) {
|
|
327
|
-
return new Promise<FabricRoomSession>(async (resolve, reject) => {
|
|
328
|
-
try {
|
|
329
|
-
const call = this.buildOutboundCall({ ...params, attach: true })
|
|
330
|
-
resolve(call)
|
|
331
|
-
} catch (error) {
|
|
332
|
-
this.logger.error('Unable to connect and reattach a call', error)
|
|
333
|
-
reject(error)
|
|
334
|
-
}
|
|
335
|
-
})
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
public handlePushNotification(params: HandlePushNotificationParams) {
|
|
339
|
-
const { incomingCallHandler } = params
|
|
340
|
-
this._incomingCallManager.setNotificationHandlers({
|
|
341
|
-
pushNotification: incomingCallHandler,
|
|
342
|
-
})
|
|
343
|
-
|
|
344
|
-
return new Promise<HandlePushNotificationResult>(
|
|
345
|
-
async (resolve, reject) => {
|
|
346
|
-
const { decrypted, type } = params
|
|
347
|
-
if (type !== 'call_invite') {
|
|
348
|
-
this.logger.warn('Unknown notification type', params)
|
|
349
|
-
reject('Unknown notification type')
|
|
350
|
-
}
|
|
351
|
-
this.logger.debug('handlePushNotification', params)
|
|
352
|
-
const {
|
|
353
|
-
params: { params: payload },
|
|
354
|
-
node_id: nodeId,
|
|
355
|
-
} = decrypted
|
|
356
|
-
try {
|
|
357
|
-
// Catch the error temporarly
|
|
358
|
-
try {
|
|
359
|
-
// Send verto.subscribe
|
|
360
|
-
await this.executeVertoSubscribe(payload.callID, nodeId)
|
|
361
|
-
} catch (error) {
|
|
362
|
-
this.logger.warn('Verto Subscribe', error)
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
this._incomingCallManager.handleIncomingInvite({
|
|
366
|
-
source: 'pushNotification',
|
|
367
|
-
nodeId,
|
|
368
|
-
...payload,
|
|
369
|
-
})
|
|
370
|
-
|
|
371
|
-
resolve({ resultType: 'inboundCall' })
|
|
372
|
-
} catch (error) {
|
|
373
|
-
reject(error)
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
)
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
public updateToken(token: string) {
|
|
380
|
-
return new Promise<void>((resolve, reject) => {
|
|
381
|
-
this.session.once('session.auth_error', (error) => {
|
|
382
|
-
reject(error)
|
|
383
|
-
})
|
|
384
|
-
this.session.once('session.connected', () => {
|
|
385
|
-
resolve()
|
|
386
|
-
})
|
|
387
|
-
this.store.dispatch(actions.reauthAction({ token }))
|
|
388
|
-
})
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Mark the client as 'online' to receive calls over WebSocket
|
|
393
|
-
*/
|
|
394
|
-
public async online({ incomingCallHandlers }: OnlineParams) {
|
|
395
|
-
if (incomingCallHandlers.all || incomingCallHandlers.pushNotification) {
|
|
396
|
-
this.logger.warn(
|
|
397
|
-
`Make sure the device is not registered to receive Push Notifications while it is online`
|
|
398
|
-
)
|
|
399
|
-
}
|
|
400
|
-
this._incomingCallManager.setNotificationHandlers(incomingCallHandlers)
|
|
401
|
-
return this.execute<unknown, void>({
|
|
402
|
-
method: 'subscriber.online',
|
|
403
|
-
params: {},
|
|
404
|
-
})
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Mark the client as 'offline' to receive calls over WebSocket
|
|
409
|
-
*/
|
|
410
|
-
public offline() {
|
|
411
|
-
this._incomingCallManager.setNotificationHandlers({})
|
|
412
|
-
return this.execute<unknown, void>({
|
|
413
|
-
method: 'subscriber.offline',
|
|
414
|
-
params: {},
|
|
415
|
-
})
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Initialize the session-level connection pool
|
|
420
|
-
*/
|
|
421
|
-
private initializeSessionConnectionPool() {
|
|
422
|
-
this.runWorker('sessionConnectionPoolWorker', {
|
|
423
|
-
worker: sessionConnectionPoolWorker,
|
|
424
|
-
initialState: {
|
|
425
|
-
poolSize: 1, // Only one connection per session is required
|
|
426
|
-
iceCandidatePoolSize: 10,
|
|
427
|
-
},
|
|
428
|
-
})
|
|
429
|
-
}
|
|
430
|
-
}
|