@signalwire/js 3.29.2 → 4.0.0-beta.1
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 +16628 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/browser.umd.js +16649 -0
- package/dist/browser.umd.js.map +1 -0
- package/dist/index.cjs +6213 -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 +6197 -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
package/src/fabric/HTTPClient.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import jwtDecode from 'jwt-decode'
|
|
2
|
-
import { getLogger, HttpError } from '@signalwire/core'
|
|
3
|
-
import type {
|
|
4
|
-
GetAddressResponse,
|
|
5
|
-
GetAddressesParams,
|
|
6
|
-
RegisterDeviceParams,
|
|
7
|
-
UnregisterDeviceParams,
|
|
8
|
-
RegisterDeviceResponse,
|
|
9
|
-
GetAddressParams,
|
|
10
|
-
GetAddressResult,
|
|
11
|
-
GetAddressesResponse,
|
|
12
|
-
GetAddressesResult,
|
|
13
|
-
RegisterDeviceResult,
|
|
14
|
-
GetSubscriberInfoResponse,
|
|
15
|
-
GetSubscriberInfoResult,
|
|
16
|
-
FabricUserOptions,
|
|
17
|
-
} from './interfaces'
|
|
18
|
-
import { CreateHttpClient, createHttpClient } from './createHttpClient'
|
|
19
|
-
import { buildPaginatedResult } from '../utils/paginatedResult'
|
|
20
|
-
import { makeQueryParamsUrls } from '../utils/makeQueryParamsUrl'
|
|
21
|
-
import {
|
|
22
|
-
isGetAddressByIdParams,
|
|
23
|
-
isGetAddressByNameParams,
|
|
24
|
-
isGetAddressesResponse,
|
|
25
|
-
} from './utils/typeGuard'
|
|
26
|
-
import { HTTPClientContract } from './interfaces/httpClient'
|
|
27
|
-
|
|
28
|
-
type JWTHeader = { ch?: string; typ?: string }
|
|
29
|
-
|
|
30
|
-
// TODO: extends from a Base class to share from core
|
|
31
|
-
export class HTTPClient implements HTTPClientContract {
|
|
32
|
-
private httpClient: CreateHttpClient
|
|
33
|
-
|
|
34
|
-
constructor(public options: FabricUserOptions) {
|
|
35
|
-
this.httpClient = createHttpClient({
|
|
36
|
-
baseUrl: `https://${this.httpHost}`,
|
|
37
|
-
headers: {
|
|
38
|
-
Authorization: `Bearer ${this.options.token}`,
|
|
39
|
-
},
|
|
40
|
-
maxApiRequestRetries: this.options.maxApiRequestRetries,
|
|
41
|
-
apiRequestRetriesDelay: this.options.apiRequestRetriesDelay,
|
|
42
|
-
apiRequestRetriesDelayIncrement: this.options.apiRequestRetriesDelayIncrement
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
get fetch(): CreateHttpClient {
|
|
47
|
-
return this.httpClient
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
get httpHost() {
|
|
51
|
-
let decodedJwt: JWTHeader = {}
|
|
52
|
-
try {
|
|
53
|
-
decodedJwt = jwtDecode<JWTHeader>(this.options.token, {
|
|
54
|
-
header: true,
|
|
55
|
-
})
|
|
56
|
-
} catch (e) {
|
|
57
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
58
|
-
getLogger().debug('[JWTSession] error decoding the JWT')
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
// Shouldn't this be other way around?
|
|
62
|
-
const host = this.options.host || decodedJwt?.ch
|
|
63
|
-
if (!host) {
|
|
64
|
-
return 'fabric.signalwire.com'
|
|
65
|
-
}
|
|
66
|
-
return `fabric.${host.split('.').splice(1).join('.')}`
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
public async getAddress(params: GetAddressParams): Promise<GetAddressResult> {
|
|
70
|
-
let path = '/api/fabric/addresses'
|
|
71
|
-
if (isGetAddressByNameParams(params)) {
|
|
72
|
-
path = `${path}?name=${params.name}`
|
|
73
|
-
} else if (isGetAddressByIdParams(params)) {
|
|
74
|
-
path = `${path}/${params.id}`
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const { body } = await this.httpClient<
|
|
78
|
-
GetAddressResponse | GetAddressesResponse
|
|
79
|
-
>(path)
|
|
80
|
-
if (isGetAddressesResponse(body)) {
|
|
81
|
-
// FIXME until the server handles a index lookup by name we need to handle it as a search result
|
|
82
|
-
if (!body.data[0]) throw new HttpError(404, 'Not Found')
|
|
83
|
-
return body.data[0]
|
|
84
|
-
}
|
|
85
|
-
return body
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
public async getAddresses(
|
|
89
|
-
params?: GetAddressesParams
|
|
90
|
-
): Promise<GetAddressesResult> {
|
|
91
|
-
const { type, displayName, pageSize, sortBy, sortOrder } = params || {}
|
|
92
|
-
|
|
93
|
-
let path = '/api/fabric/addresses'
|
|
94
|
-
|
|
95
|
-
const queryParams = new URLSearchParams()
|
|
96
|
-
if (type) {
|
|
97
|
-
queryParams.append('type', type)
|
|
98
|
-
}
|
|
99
|
-
if (displayName) {
|
|
100
|
-
queryParams.append('display_name', displayName)
|
|
101
|
-
}
|
|
102
|
-
if (pageSize) {
|
|
103
|
-
queryParams.append('page_size', pageSize.toString())
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (sortBy) {
|
|
107
|
-
queryParams.append('sort_by', sortBy)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (sortOrder) {
|
|
111
|
-
queryParams.append('sort_order', sortOrder)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const queryUrl = makeQueryParamsUrls(path, queryParams)
|
|
115
|
-
getLogger().debug(`[getAddresses] query URL ${queryUrl}`)
|
|
116
|
-
const { body } = await this.httpClient<GetAddressesResponse>(queryUrl)
|
|
117
|
-
|
|
118
|
-
return buildPaginatedResult(body, this.httpClient)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
public async registerDevice(
|
|
122
|
-
params: RegisterDeviceParams
|
|
123
|
-
): Promise<RegisterDeviceResult> {
|
|
124
|
-
const { deviceType, deviceToken } = params
|
|
125
|
-
|
|
126
|
-
const path = '/subscriber/devices' as const
|
|
127
|
-
const { body } = await this.httpClient<RegisterDeviceResponse>(path, {
|
|
128
|
-
method: 'POST',
|
|
129
|
-
body: {
|
|
130
|
-
device_type: deviceType,
|
|
131
|
-
device_token: deviceToken,
|
|
132
|
-
},
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
return body
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
public async unregisterDevice(params: UnregisterDeviceParams) {
|
|
139
|
-
const { id } = params
|
|
140
|
-
|
|
141
|
-
const path = `/subscriber/devices/${id}` as const
|
|
142
|
-
await this.httpClient<void>(path, {
|
|
143
|
-
method: 'DELETE',
|
|
144
|
-
})
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
public async getSubscriberInfo(): Promise<GetSubscriberInfoResult> {
|
|
148
|
-
let path = '/api/fabric/subscriber/info'
|
|
149
|
-
|
|
150
|
-
const { body } = await this.httpClient<GetSubscriberInfoResponse>(path)
|
|
151
|
-
|
|
152
|
-
return body
|
|
153
|
-
}
|
|
154
|
-
}
|
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import { IncomingCallManager } from './IncomingCallManager'
|
|
2
|
-
import {
|
|
3
|
-
CallParams,
|
|
4
|
-
IncomingCallNotification,
|
|
5
|
-
IncomingInvite,
|
|
6
|
-
} from './interfaces'
|
|
7
|
-
import { WSClient } from './WSClient'
|
|
8
|
-
|
|
9
|
-
describe('IncomingCallManager', () => {
|
|
10
|
-
const mockAnswer = jest.fn()
|
|
11
|
-
const buildInboundCall = jest
|
|
12
|
-
.fn()
|
|
13
|
-
.mockImplementation((_invite: IncomingInvite, _params: CallParams) => ({
|
|
14
|
-
answer: mockAnswer,
|
|
15
|
-
}))
|
|
16
|
-
const executeVertoBye = jest.fn()
|
|
17
|
-
const client = {
|
|
18
|
-
logger: {
|
|
19
|
-
debug: jest.fn(),
|
|
20
|
-
warn: jest.fn(),
|
|
21
|
-
},
|
|
22
|
-
} as unknown as WSClient
|
|
23
|
-
|
|
24
|
-
beforeEach(() => {
|
|
25
|
-
jest.clearAllMocks()
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
const allNotificationListerner = jest.fn()
|
|
29
|
-
const pnNotificationListerner = jest.fn()
|
|
30
|
-
const wsNotificationListerner = jest.fn()
|
|
31
|
-
|
|
32
|
-
test('it should invoke the proper listeners', () => {
|
|
33
|
-
const manager = new IncomingCallManager({
|
|
34
|
-
client,
|
|
35
|
-
buildInboundCall,
|
|
36
|
-
executeVertoBye,
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
manager.setNotificationHandlers({
|
|
40
|
-
all: allNotificationListerner,
|
|
41
|
-
websocket: wsNotificationListerner,
|
|
42
|
-
pushNotification: pnNotificationListerner,
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
manager.handleIncomingInvite({
|
|
46
|
-
source: 'websocket',
|
|
47
|
-
callID: 'foo1',
|
|
48
|
-
callee_id_name: 'foo',
|
|
49
|
-
callee_id_number: 'foo',
|
|
50
|
-
caller_id_name: 'foo',
|
|
51
|
-
caller_id_number: 'foo',
|
|
52
|
-
sdp: 'foo',
|
|
53
|
-
display_direction: 'foo',
|
|
54
|
-
nodeId: 'foo',
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
expect(allNotificationListerner).toHaveBeenCalledTimes(1)
|
|
58
|
-
expect(wsNotificationListerner).toHaveBeenCalledTimes(1)
|
|
59
|
-
expect(pnNotificationListerner).toHaveBeenCalledTimes(0)
|
|
60
|
-
|
|
61
|
-
manager.handleIncomingInvite({
|
|
62
|
-
source: 'pushNotification',
|
|
63
|
-
callID: 'foo2',
|
|
64
|
-
callee_id_name: 'foo',
|
|
65
|
-
callee_id_number: 'foo',
|
|
66
|
-
caller_id_name: 'foo',
|
|
67
|
-
caller_id_number: 'foo',
|
|
68
|
-
sdp: 'foo',
|
|
69
|
-
display_direction: 'foo',
|
|
70
|
-
nodeId: 'foo',
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
expect(allNotificationListerner).toHaveBeenCalledTimes(2)
|
|
74
|
-
expect(wsNotificationListerner).toHaveBeenCalledTimes(1)
|
|
75
|
-
expect(pnNotificationListerner).toHaveBeenCalledTimes(1)
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
test('it should not answer the call when the invite is rejected', () => {
|
|
79
|
-
const manager = new IncomingCallManager({
|
|
80
|
-
client,
|
|
81
|
-
buildInboundCall,
|
|
82
|
-
executeVertoBye,
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
const allNotificationListerner = jest.fn(
|
|
86
|
-
(notification: IncomingCallNotification) => {
|
|
87
|
-
notification.invite.reject()
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
manager.setNotificationHandlers({
|
|
92
|
-
all: allNotificationListerner,
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
manager.handleIncomingInvite({
|
|
96
|
-
source: 'websocket',
|
|
97
|
-
callID: 'foo1',
|
|
98
|
-
callee_id_name: 'foo',
|
|
99
|
-
callee_id_number: 'foo',
|
|
100
|
-
caller_id_name: 'foo',
|
|
101
|
-
caller_id_number: 'foo',
|
|
102
|
-
sdp: 'foo',
|
|
103
|
-
display_direction: 'foo',
|
|
104
|
-
nodeId: 'foo',
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
expect(allNotificationListerner).toHaveBeenCalledTimes(1)
|
|
108
|
-
expect(mockAnswer).toBeCalledTimes(0)
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
test('it should answer the call when the invite is accepted', () => {
|
|
112
|
-
const manager = new IncomingCallManager({
|
|
113
|
-
client,
|
|
114
|
-
buildInboundCall,
|
|
115
|
-
executeVertoBye,
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
const allNotificationListerner = jest.fn(
|
|
119
|
-
(notification: IncomingCallNotification) => {
|
|
120
|
-
notification.invite.accept({})
|
|
121
|
-
}
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
manager.setNotificationHandlers({
|
|
125
|
-
all: allNotificationListerner,
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
manager.handleIncomingInvite({
|
|
129
|
-
source: 'websocket',
|
|
130
|
-
callID: 'foo1',
|
|
131
|
-
callee_id_name: 'foo',
|
|
132
|
-
callee_id_number: 'foo',
|
|
133
|
-
caller_id_name: 'foo',
|
|
134
|
-
caller_id_number: 'foo',
|
|
135
|
-
sdp: 'foo',
|
|
136
|
-
display_direction: 'foo',
|
|
137
|
-
nodeId: 'foo',
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
expect(allNotificationListerner).toHaveBeenCalledTimes(1)
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
test('it should dedupe overlaping listeners', () => {
|
|
144
|
-
const manager = new IncomingCallManager({
|
|
145
|
-
client,
|
|
146
|
-
buildInboundCall,
|
|
147
|
-
executeVertoBye,
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
const notificationListerner = jest.fn()
|
|
151
|
-
manager.setNotificationHandlers({
|
|
152
|
-
all: notificationListerner,
|
|
153
|
-
websocket: notificationListerner,
|
|
154
|
-
pushNotification: notificationListerner,
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
manager.handleIncomingInvite({
|
|
158
|
-
source: 'websocket',
|
|
159
|
-
callID: 'foo',
|
|
160
|
-
callee_id_name: 'foo',
|
|
161
|
-
callee_id_number: 'foo',
|
|
162
|
-
caller_id_name: 'foo',
|
|
163
|
-
caller_id_number: 'foo',
|
|
164
|
-
sdp: 'foo',
|
|
165
|
-
display_direction: 'foo',
|
|
166
|
-
nodeId: 'foo',
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
expect(notificationListerner).toHaveBeenCalledTimes(1)
|
|
170
|
-
})
|
|
171
|
-
|
|
172
|
-
test('it should dedupe invites', () => {
|
|
173
|
-
const manager = new IncomingCallManager({
|
|
174
|
-
client,
|
|
175
|
-
buildInboundCall,
|
|
176
|
-
executeVertoBye,
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
manager.setNotificationHandlers({
|
|
180
|
-
all: allNotificationListerner,
|
|
181
|
-
})
|
|
182
|
-
|
|
183
|
-
manager.handleIncomingInvite({
|
|
184
|
-
source: 'websocket',
|
|
185
|
-
callID: 'same-id',
|
|
186
|
-
callee_id_name: 'foo',
|
|
187
|
-
callee_id_number: 'foo',
|
|
188
|
-
caller_id_name: 'foo',
|
|
189
|
-
caller_id_number: 'foo',
|
|
190
|
-
sdp: 'foo',
|
|
191
|
-
display_direction: 'foo',
|
|
192
|
-
nodeId: 'foo',
|
|
193
|
-
})
|
|
194
|
-
|
|
195
|
-
manager.handleIncomingInvite({
|
|
196
|
-
source: 'websocket',
|
|
197
|
-
callID: 'same-id',
|
|
198
|
-
callee_id_name: 'foo',
|
|
199
|
-
callee_id_number: 'foo',
|
|
200
|
-
caller_id_name: 'foo',
|
|
201
|
-
caller_id_number: 'foo',
|
|
202
|
-
sdp: 'foo',
|
|
203
|
-
display_direction: 'foo',
|
|
204
|
-
nodeId: 'foo',
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
expect(allNotificationListerner).toHaveBeenCalledTimes(1)
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
test('it should clean up invites after reject', () => {
|
|
211
|
-
const manager = new IncomingCallManager({
|
|
212
|
-
client,
|
|
213
|
-
buildInboundCall,
|
|
214
|
-
executeVertoBye,
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
const notificationListerner = jest.fn(
|
|
218
|
-
(notification: IncomingCallNotification) => {
|
|
219
|
-
notification.invite.reject()
|
|
220
|
-
}
|
|
221
|
-
)
|
|
222
|
-
manager.setNotificationHandlers({
|
|
223
|
-
all: notificationListerner,
|
|
224
|
-
})
|
|
225
|
-
|
|
226
|
-
manager.handleIncomingInvite({
|
|
227
|
-
source: 'websocket',
|
|
228
|
-
callID: 'same-id',
|
|
229
|
-
callee_id_name: 'foo',
|
|
230
|
-
callee_id_number: 'foo',
|
|
231
|
-
caller_id_name: 'foo',
|
|
232
|
-
caller_id_number: 'foo',
|
|
233
|
-
sdp: 'foo',
|
|
234
|
-
display_direction: 'foo',
|
|
235
|
-
nodeId: 'foo',
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
manager.handleIncomingInvite({
|
|
239
|
-
source: 'websocket',
|
|
240
|
-
callID: 'same-id',
|
|
241
|
-
callee_id_name: 'foo',
|
|
242
|
-
callee_id_number: 'foo',
|
|
243
|
-
caller_id_name: 'foo',
|
|
244
|
-
caller_id_number: 'foo',
|
|
245
|
-
sdp: 'foo',
|
|
246
|
-
display_direction: 'foo',
|
|
247
|
-
nodeId: 'foo',
|
|
248
|
-
})
|
|
249
|
-
|
|
250
|
-
expect(notificationListerner).toHaveBeenCalledTimes(2)
|
|
251
|
-
})
|
|
252
|
-
|
|
253
|
-
test('it should clean up invites after accept', () => {
|
|
254
|
-
const manager = new IncomingCallManager({
|
|
255
|
-
client,
|
|
256
|
-
buildInboundCall,
|
|
257
|
-
executeVertoBye,
|
|
258
|
-
})
|
|
259
|
-
|
|
260
|
-
const notificationListerner = jest.fn(
|
|
261
|
-
(notification: IncomingCallNotification) => {
|
|
262
|
-
notification.invite.accept({})
|
|
263
|
-
}
|
|
264
|
-
)
|
|
265
|
-
manager.setNotificationHandlers({
|
|
266
|
-
all: notificationListerner,
|
|
267
|
-
})
|
|
268
|
-
|
|
269
|
-
manager.handleIncomingInvite({
|
|
270
|
-
source: 'websocket',
|
|
271
|
-
callID: 'same-id',
|
|
272
|
-
callee_id_name: 'foo',
|
|
273
|
-
callee_id_number: 'foo',
|
|
274
|
-
caller_id_name: 'foo',
|
|
275
|
-
caller_id_number: 'foo',
|
|
276
|
-
sdp: 'foo',
|
|
277
|
-
display_direction: 'foo',
|
|
278
|
-
nodeId: 'foo',
|
|
279
|
-
})
|
|
280
|
-
|
|
281
|
-
manager.handleIncomingInvite({
|
|
282
|
-
source: 'websocket',
|
|
283
|
-
callID: 'same-id',
|
|
284
|
-
callee_id_name: 'foo',
|
|
285
|
-
callee_id_number: 'foo',
|
|
286
|
-
caller_id_name: 'foo',
|
|
287
|
-
caller_id_number: 'foo',
|
|
288
|
-
sdp: 'foo',
|
|
289
|
-
display_direction: 'foo',
|
|
290
|
-
nodeId: 'foo',
|
|
291
|
-
})
|
|
292
|
-
|
|
293
|
-
expect(notificationListerner).toHaveBeenCalledTimes(2)
|
|
294
|
-
})
|
|
295
|
-
})
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { FabricRoomSession } from './FabricRoomSession'
|
|
2
|
-
import {
|
|
3
|
-
CallParams,
|
|
4
|
-
IncomingCallHandlers,
|
|
5
|
-
IncomingCallNotification,
|
|
6
|
-
IncomingInvite,
|
|
7
|
-
IncomingInviteWithSource,
|
|
8
|
-
} from './interfaces'
|
|
9
|
-
import { WSClient } from './WSClient'
|
|
10
|
-
|
|
11
|
-
interface IncomingCallManagerOptions {
|
|
12
|
-
client: WSClient
|
|
13
|
-
buildInboundCall: WSClient['buildInboundCall']
|
|
14
|
-
executeVertoBye: WSClient['executeVertoBye']
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class IncomingCallManager {
|
|
18
|
-
private _client: WSClient
|
|
19
|
-
private _pendingInvites: Record<string, IncomingInvite> = {}
|
|
20
|
-
private _handlers: IncomingCallHandlers = {}
|
|
21
|
-
|
|
22
|
-
constructor(private options: IncomingCallManagerOptions) {
|
|
23
|
-
this._client = options.client
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
private _buildNotification(invite: IncomingInvite): IncomingCallNotification {
|
|
27
|
-
const accept = async (params: CallParams) => {
|
|
28
|
-
return new Promise<FabricRoomSession>((resolve, reject) => {
|
|
29
|
-
delete this._pendingInvites[invite.callID]
|
|
30
|
-
try {
|
|
31
|
-
const call = this.options.buildInboundCall(invite, params)
|
|
32
|
-
call.answer()
|
|
33
|
-
|
|
34
|
-
resolve(call)
|
|
35
|
-
} catch (e) {
|
|
36
|
-
reject(e)
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const reject = () => {
|
|
42
|
-
delete this._pendingInvites[invite.callID]
|
|
43
|
-
return this.options.executeVertoBye(invite.callID, invite.nodeId)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
invite: {
|
|
48
|
-
details: invite,
|
|
49
|
-
accept: (params) => accept(params),
|
|
50
|
-
reject: () => reject(),
|
|
51
|
-
},
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
setNotificationHandlers(handlers: IncomingCallHandlers) {
|
|
56
|
-
this._handlers.all = handlers.all
|
|
57
|
-
if (
|
|
58
|
-
(handlers.pushNotification &&
|
|
59
|
-
this._handlers.all != handlers.pushNotification) ||
|
|
60
|
-
!handlers.pushNotification
|
|
61
|
-
) {
|
|
62
|
-
this._handlers.pushNotification = handlers.pushNotification
|
|
63
|
-
}
|
|
64
|
-
if (
|
|
65
|
-
(handlers.websocket && this._handlers.all != handlers.websocket) ||
|
|
66
|
-
!handlers.websocket
|
|
67
|
-
) {
|
|
68
|
-
this._handlers.websocket = handlers.websocket
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
handleIncomingInvite(incomingInvite: IncomingInviteWithSource) {
|
|
73
|
-
if (incomingInvite.callID in this._pendingInvites) {
|
|
74
|
-
this._client.logger.debug(
|
|
75
|
-
`skiping nottification for pending invite to callID: ${incomingInvite.callID}`
|
|
76
|
-
)
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
this._pendingInvites[incomingInvite.callID] = incomingInvite
|
|
80
|
-
|
|
81
|
-
if (!(this._handlers.all || this._handlers[incomingInvite.source])) {
|
|
82
|
-
this._client.logger.warn('Skiping nottification due to no listeners')
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const notification = this._buildNotification(incomingInvite)
|
|
87
|
-
|
|
88
|
-
this._handlers.all?.(notification)
|
|
89
|
-
const handler = this._handlers[incomingInvite.source]
|
|
90
|
-
handler?.(notification)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import WS from 'jest-websocket-mock'
|
|
2
|
-
import { SATSession } from './SATSession'
|
|
3
|
-
import { SWCloseEvent, UNIFIED_CONNECT_VERSION } from '@signalwire/core'
|
|
4
|
-
|
|
5
|
-
jest.mock('uuid', () => {
|
|
6
|
-
return {
|
|
7
|
-
v4: jest.fn(() => 'mocked-uuid'),
|
|
8
|
-
}
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
describe('SATSession', () => {
|
|
12
|
-
const host = 'ws://localhost:8080'
|
|
13
|
-
const project = '2506edbc-35c4-4d9f-a5f0-45a03d82dab1'
|
|
14
|
-
const token = 'PT1234abc'
|
|
15
|
-
|
|
16
|
-
let ws: WS
|
|
17
|
-
let session: SATSession
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
ws = new WS(host)
|
|
20
|
-
// Respond to RPCs
|
|
21
|
-
ws.on('connection', (socket: any) => {
|
|
22
|
-
socket.on('message', (data: any) => {
|
|
23
|
-
const parsedData = JSON.parse(data)
|
|
24
|
-
if (parsedData.params) {
|
|
25
|
-
socket.send(
|
|
26
|
-
JSON.stringify({
|
|
27
|
-
jsonrpc: '2.0',
|
|
28
|
-
id: parsedData.id,
|
|
29
|
-
result: {},
|
|
30
|
-
})
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
session = new SATSession({
|
|
37
|
-
host,
|
|
38
|
-
project,
|
|
39
|
-
token,
|
|
40
|
-
})
|
|
41
|
-
session.WebSocketConstructor = WebSocket
|
|
42
|
-
session.CloseEventConstructor = SWCloseEvent
|
|
43
|
-
session.dispatch = jest.fn()
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
afterEach(() => {
|
|
47
|
-
WS.clean()
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('should subscribe with the latest version', async () => {
|
|
51
|
-
session.connect()
|
|
52
|
-
await ws.connected
|
|
53
|
-
|
|
54
|
-
expect(session.connected).toBe(true)
|
|
55
|
-
|
|
56
|
-
await expect(ws).toReceiveMessage(
|
|
57
|
-
expect.stringContaining(JSON.stringify(UNIFIED_CONNECT_VERSION))
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
session.disconnect()
|
|
61
|
-
|
|
62
|
-
expect(session.connected).toBe(false)
|
|
63
|
-
expect(session.closed).toBe(true)
|
|
64
|
-
})
|
|
65
|
-
})
|
package/src/fabric/SATSession.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
asyncRetry,
|
|
3
|
-
increasingDelay,
|
|
4
|
-
JSONRPCRequest,
|
|
5
|
-
JSONRPCResponse,
|
|
6
|
-
RPCReauthenticate,
|
|
7
|
-
RPCReauthenticateParams,
|
|
8
|
-
SATAuthorization,
|
|
9
|
-
UNIFIED_CONNECT_VERSION,
|
|
10
|
-
isConnectRequest,
|
|
11
|
-
getLogger,
|
|
12
|
-
isVertoInvite,
|
|
13
|
-
SYMBOL_EXECUTE_CONNECTION_CLOSED,
|
|
14
|
-
SYMBOL_EXECUTE_TIMEOUT,
|
|
15
|
-
} from '@signalwire/core'
|
|
16
|
-
import { JWTSession } from '../JWTSession'
|
|
17
|
-
import { SATSessionOptions } from './interfaces'
|
|
18
|
-
/**
|
|
19
|
-
* SAT Session is for the Call Fabric SDK
|
|
20
|
-
*/
|
|
21
|
-
export class SATSession extends JWTSession {
|
|
22
|
-
public connectVersion = UNIFIED_CONNECT_VERSION
|
|
23
|
-
|
|
24
|
-
constructor(public options: SATSessionOptions) {
|
|
25
|
-
super(options)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
override get signature() {
|
|
29
|
-
if (this._rpcConnectResult) {
|
|
30
|
-
const { authorization } = this._rpcConnectResult
|
|
31
|
-
return (authorization as SATAuthorization).jti
|
|
32
|
-
}
|
|
33
|
-
return undefined
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
override async _checkTokenExpiration() {
|
|
37
|
-
/**
|
|
38
|
-
* noop
|
|
39
|
-
*
|
|
40
|
-
* The Call Fabric SDK does not attach any timer and
|
|
41
|
-
* does not emit any events to inform the user about the token expiry.
|
|
42
|
-
*/
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Reauthenticate with the SignalWire Network using a newer SAT.
|
|
47
|
-
* If the session has expired, this will reconnect it.
|
|
48
|
-
* @return Promise<void>
|
|
49
|
-
*/
|
|
50
|
-
override async reauthenticate() {
|
|
51
|
-
this.logger.debug('Session Reauthenticate', {
|
|
52
|
-
ready: this.ready,
|
|
53
|
-
expired: this.expired,
|
|
54
|
-
})
|
|
55
|
-
if (!this.ready || this.expired) {
|
|
56
|
-
return this.connect()
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const params: RPCReauthenticateParams = {
|
|
60
|
-
project: this._rpcConnectResult.authorization.project_id,
|
|
61
|
-
jwt_token: this.options.token,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
const reauthResponse = await this.execute(RPCReauthenticate(params))
|
|
66
|
-
|
|
67
|
-
this._rpcConnectResult = {
|
|
68
|
-
...this._rpcConnectResult,
|
|
69
|
-
...reauthResponse,
|
|
70
|
-
}
|
|
71
|
-
} catch (error) {
|
|
72
|
-
throw error
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
override async execute(msg: JSONRPCRequest | JSONRPCResponse): Promise<any> {
|
|
77
|
-
return asyncRetry({
|
|
78
|
-
asyncCallable: async () => {
|
|
79
|
-
await this._waitConnected() // avoid queuing a retry
|
|
80
|
-
return super.execute(msg)
|
|
81
|
-
},
|
|
82
|
-
maxRetries: this.options.maxApiRequestRetries,
|
|
83
|
-
delayFn: increasingDelay({
|
|
84
|
-
initialDelay: this.options.apiRequestRetriesDelay,
|
|
85
|
-
variation: this.options.apiRequestRetriesDelayIncrement,
|
|
86
|
-
}),
|
|
87
|
-
expectedErrorHandler: (error) => {
|
|
88
|
-
getLogger().warn(error)
|
|
89
|
-
if (isConnectRequest(msg)) {
|
|
90
|
-
// `signalwire.connect` retries are handle by the connection
|
|
91
|
-
return true
|
|
92
|
-
}
|
|
93
|
-
if (isVertoInvite(msg) && ![SYMBOL_EXECUTE_CONNECTION_CLOSED, SYMBOL_EXECUTE_TIMEOUT].includes(error)) {
|
|
94
|
-
// we can't retry verto.invites after errors on the transport layer
|
|
95
|
-
getLogger().debug('skip verto.invite retry on error:', error)
|
|
96
|
-
return true
|
|
97
|
-
}
|
|
98
|
-
return false
|
|
99
|
-
},
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
}
|