sinch-rtc 1.4.11 → 2.42.6
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.
Potentially problematic release.
This version of sinch-rtc might be problematic. Click here for more details.
- package/README.md +67 -153
- package/npm/src/ClientRegistration.d.ts +16 -0
- package/npm/src/ClientRegistration.js +22 -0
- package/npm/src/DefaultSinchClient.d.ts +59 -0
- package/npm/src/DefaultSinchClient.js +253 -0
- package/npm/src/DefaultSinchClientBuilder.d.ts +22 -0
- package/npm/src/DefaultSinchClientBuilder.js +99 -0
- package/npm/src/MediaStreamOptions.d.ts +4 -0
- package/npm/src/MediaStreamOptions.js +3 -0
- package/npm/src/Sinch.d.ts +10 -0
- package/npm/src/Sinch.js +23 -0
- package/npm/src/SinchClient.d.ts +82 -0
- package/npm/src/SinchClient.js +3 -0
- package/npm/src/SinchClientBuilder.d.ts +69 -0
- package/npm/src/SinchClientBuilder.js +3 -0
- package/npm/src/SinchClientListener.d.ts +31 -0
- package/npm/src/SinchClientListener.js +3 -0
- package/npm/src/SinchError.d.ts +27 -0
- package/npm/src/SinchError.js +37 -0
- package/npm/src/calling/Call.d.ts +114 -0
- package/npm/src/calling/Call.js +3 -0
- package/npm/src/calling/CallClient.d.ts +113 -0
- package/npm/src/calling/CallClient.js +3 -0
- package/npm/src/calling/CallClientInstance.d.ts +77 -0
- package/npm/src/calling/CallClientInstance.js +362 -0
- package/npm/src/calling/CallDetails.d.ts +99 -0
- package/npm/src/calling/CallDetails.js +3 -0
- package/npm/src/calling/CallEndCause.d.ts +11 -0
- package/npm/src/calling/CallEndCause.js +16 -0
- package/npm/src/calling/CallInitiator.d.ts +4 -0
- package/npm/src/calling/CallInitiator.js +3 -0
- package/npm/src/calling/DefaultCall.d.ts +87 -0
- package/npm/src/calling/DefaultCall.js +223 -0
- package/npm/src/calling/DefaultCallClient.d.ts +38 -0
- package/npm/src/calling/DefaultCallClient.js +95 -0
- package/npm/src/calling/DefaultCallDetails.d.ts +42 -0
- package/npm/src/calling/DefaultCallDetails.js +116 -0
- package/npm/src/calling/InboundCall.d.ts +16 -0
- package/npm/src/calling/InboundCall.js +52 -0
- package/npm/src/calling/InternalCall.d.ts +7 -0
- package/npm/src/calling/InternalCall.js +3 -0
- package/npm/src/calling/OutboundCall.d.ts +28 -0
- package/npm/src/calling/OutboundCall.js +119 -0
- package/npm/src/calling/PubSubClient.d.ts +30 -0
- package/npm/src/calling/PubSubClient.js +98 -0
- package/npm/src/calling/PublicCallListenerCallbackMapper.d.ts +17 -0
- package/npm/src/calling/PublicCallListenerCallbackMapper.js +79 -0
- package/npm/src/calling/WebRtcStatsUtils.d.ts +3 -0
- package/npm/src/calling/WebRtcStatsUtils.js +24 -0
- package/npm/src/calling/index.d.ts +8 -0
- package/npm/src/calling/index.js +25 -0
- package/npm/src/calling/listeners/CallClientEventFanout.d.ts +9 -0
- package/npm/src/calling/listeners/CallClientEventFanout.js +17 -0
- package/npm/src/calling/listeners/CallClientListener.d.ts +15 -0
- package/npm/src/calling/listeners/CallClientListener.js +3 -0
- package/npm/src/calling/listeners/CallEventsManagers.d.ts +25 -0
- package/npm/src/calling/listeners/CallEventsManagers.js +128 -0
- package/npm/src/calling/listeners/CallListener.d.ts +77 -0
- package/npm/src/calling/listeners/CallListener.js +3 -0
- package/npm/src/calling/listeners/CallQualityWarningEventFanout.d.ts +9 -0
- package/npm/src/calling/listeners/CallQualityWarningEventFanout.js +16 -0
- package/npm/src/calling/listeners/ClientEventFanout.d.ts +13 -0
- package/npm/src/calling/listeners/ClientEventFanout.js +33 -0
- package/npm/src/calling/listeners/EventFanout.d.ts +18 -0
- package/npm/src/calling/listeners/EventFanout.js +40 -0
- package/npm/src/calling/listeners/InternalCallListener.d.ts +13 -0
- package/npm/src/calling/listeners/InternalCallListener.js +3 -0
- package/npm/src/calling/listeners/InternalSinchClientListener.d.ts +9 -0
- package/npm/src/calling/listeners/InternalSinchClientListener.js +3 -0
- package/npm/src/calling/listeners/TrackEventFanout.d.ts +8 -0
- package/npm/src/calling/listeners/TrackEventFanout.js +16 -0
- package/npm/src/calling/models/CallDestination.d.ts +5 -0
- package/npm/src/calling/models/CallDestination.js +3 -0
- package/npm/src/calling/models/CallDirection.d.ts +4 -0
- package/npm/src/calling/models/CallDirection.js +9 -0
- package/npm/src/calling/models/CallState.d.ts +8 -0
- package/npm/src/calling/models/CallState.js +13 -0
- package/npm/src/calling/models/index.d.ts +3 -0
- package/npm/src/calling/models/index.js +20 -0
- package/npm/src/calling/quality/CallQualityDataCollector.d.ts +15 -0
- package/npm/src/calling/quality/CallQualityDataCollector.js +68 -0
- package/npm/src/calling/quality/CallQualityWarningController.d.ts +18 -0
- package/npm/src/calling/quality/CallQualityWarningController.js +41 -0
- package/npm/src/calling/quality/CallQualityWarningControllerFactory.d.ts +6 -0
- package/npm/src/calling/quality/CallQualityWarningControllerFactory.js +3 -0
- package/npm/src/calling/quality/CallQualityWarningEventType.d.ts +13 -0
- package/npm/src/calling/quality/CallQualityWarningEventType.js +18 -0
- package/npm/src/calling/quality/CallQualityWarningMediaStreamType.d.ts +7 -0
- package/npm/src/calling/quality/CallQualityWarningMediaStreamType.js +12 -0
- package/npm/src/calling/quality/DefaultCallQualityWarningControllerFactory.d.ts +7 -0
- package/npm/src/calling/quality/DefaultCallQualityWarningControllerFactory.js +11 -0
- package/npm/src/calling/quality/StatsBuffer.d.ts +49 -0
- package/npm/src/calling/quality/StatsBuffer.js +73 -0
- package/npm/src/calling/quality/detectors/AudioLevelDetectorHandler.d.ts +6 -0
- package/npm/src/calling/quality/detectors/AudioLevelDetectorHandler.js +3 -0
- package/npm/src/calling/quality/detectors/BaseDetector.d.ts +20 -0
- package/npm/src/calling/quality/detectors/BaseDetector.js +37 -0
- package/npm/src/calling/quality/detectors/BufferedWarningDetector.d.ts +20 -0
- package/npm/src/calling/quality/detectors/BufferedWarningDetector.js +40 -0
- package/npm/src/calling/quality/detectors/CallQualityDetectorsFactory.d.ts +9 -0
- package/npm/src/calling/quality/detectors/CallQualityDetectorsFactory.js +39 -0
- package/npm/src/calling/quality/detectors/HighInboundJitterDetector.d.ts +13 -0
- package/npm/src/calling/quality/detectors/HighInboundJitterDetector.js +33 -0
- package/npm/src/calling/quality/detectors/HighInboundPacketLossDetector.d.ts +16 -0
- package/npm/src/calling/quality/detectors/HighInboundPacketLossDetector.js +47 -0
- package/npm/src/calling/quality/detectors/HighRemoteInboundRttDetector.d.ts +10 -0
- package/npm/src/calling/quality/detectors/HighRemoteInboundRttDetector.js +38 -0
- package/npm/src/calling/quality/detectors/MissingMediaStreamWarningDetector.d.ts +23 -0
- package/npm/src/calling/quality/detectors/MissingMediaStreamWarningDetector.js +66 -0
- package/npm/src/calling/quality/detectors/WebRtcStatsDetector.d.ts +5 -0
- package/npm/src/calling/quality/detectors/WebRtcStatsDetector.js +9 -0
- package/npm/src/calling/quality/detectors/constant/ConstantAudioLevelDetector.d.ts +18 -0
- package/npm/src/calling/quality/detectors/constant/ConstantAudioLevelDetector.js +51 -0
- package/npm/src/calling/quality/detectors/constant/ConstantInboundAudioLevelDetectorHandler.d.ts +7 -0
- package/npm/src/calling/quality/detectors/constant/ConstantInboundAudioLevelDetectorHandler.js +16 -0
- package/npm/src/calling/quality/detectors/constant/ConstantOutboundAudioLevelDetectorHandler.d.ts +7 -0
- package/npm/src/calling/quality/detectors/constant/ConstantOutboundAudioLevelDetectorHandler.js +16 -0
- package/npm/src/calling/quality/detectors/zero/ZeroAudioLevelDetector.d.ts +13 -0
- package/npm/src/calling/quality/detectors/zero/ZeroAudioLevelDetector.js +45 -0
- package/npm/src/calling/quality/detectors/zero/ZeroInboundAudioLevelDetectorHandler.d.ts +7 -0
- package/npm/src/calling/quality/detectors/zero/ZeroInboundAudioLevelDetectorHandler.js +16 -0
- package/npm/src/calling/quality/detectors/zero/ZeroOutboundAudioLevelDetectorHandler.d.ts +7 -0
- package/npm/src/calling/quality/detectors/zero/ZeroOutboundAudioLevelDetectorHandler.js +16 -0
- package/npm/src/calling/quality/events/CallQualityWarningEvent.d.ts +20 -0
- package/npm/src/calling/quality/events/CallQualityWarningEvent.js +3 -0
- package/npm/src/calling/quality/events/ConstantInboundAudioLevelWarningEvent.d.ts +13 -0
- package/npm/src/calling/quality/events/ConstantInboundAudioLevelWarningEvent.js +17 -0
- package/npm/src/calling/quality/events/ConstantOutboundAudioLevelWarningEvent.d.ts +13 -0
- package/npm/src/calling/quality/events/ConstantOutboundAudioLevelWarningEvent.js +17 -0
- package/npm/src/calling/quality/events/HighInboundJitterWarningEvent.d.ts +15 -0
- package/npm/src/calling/quality/events/HighInboundJitterWarningEvent.js +18 -0
- package/npm/src/calling/quality/events/HighInboundPacketLossWarningEvent.d.ts +15 -0
- package/npm/src/calling/quality/events/HighInboundPacketLossWarningEvent.js +18 -0
- package/npm/src/calling/quality/events/HighRemoteInboundRttWarningEvent.d.ts +15 -0
- package/npm/src/calling/quality/events/HighRemoteInboundRttWarningEvent.js +18 -0
- package/npm/src/calling/quality/events/MissingMediaStreamWarningEvent.d.ts +12 -0
- package/npm/src/calling/quality/events/MissingMediaStreamWarningEvent.js +16 -0
- package/npm/src/calling/quality/events/ZeroInboundAudioLevelWarningEvent.d.ts +13 -0
- package/npm/src/calling/quality/events/ZeroInboundAudioLevelWarningEvent.js +17 -0
- package/npm/src/calling/quality/events/ZeroOutboundAudioLevelWarningEvent.d.ts +13 -0
- package/npm/src/calling/quality/events/ZeroOutboundAudioLevelWarningEvent.js +17 -0
- package/npm/src/calling/reporting/CallDestination.d.ts +13 -0
- package/npm/src/calling/reporting/CallDestination.js +47 -0
- package/npm/src/calling/reporting/CallOrigin.d.ts +11 -0
- package/npm/src/calling/reporting/CallOrigin.js +28 -0
- package/npm/src/calling/reporting/CallReportUtils.d.ts +36 -0
- package/npm/src/calling/reporting/CallReportUtils.js +195 -0
- package/npm/src/calling/reporting/CallReporter.d.ts +15 -0
- package/npm/src/calling/reporting/CallReporter.js +73 -0
- package/npm/src/calling/reporting/ClientEvent.d.ts +29 -0
- package/npm/src/calling/reporting/ClientEvent.js +48 -0
- package/npm/src/calling/reporting/ClientEventsCollector.d.ts +13 -0
- package/npm/src/calling/reporting/ClientEventsCollector.js +35 -0
- package/npm/src/calling/reporting/MxpEventsCollector.d.ts +54 -0
- package/npm/src/calling/reporting/MxpEventsCollector.js +157 -0
- package/npm/src/calling/reporting/WebRTCStats.d.ts +10 -0
- package/npm/src/calling/reporting/WebRTCStats.js +31 -0
- package/npm/src/calling/reporting/WebRTCStats.types.d.ts +64 -0
- package/npm/src/calling/reporting/WebRTCStats.types.js +21 -0
- package/npm/src/calling/reporting/WebRTCStatsCollector.d.ts +42 -0
- package/npm/src/calling/reporting/WebRTCStatsCollector.js +328 -0
- package/npm/src/constants.d.ts +8 -0
- package/npm/src/constants.js +13 -0
- package/npm/src/features/Features.d.ts +29 -0
- package/npm/src/features/Features.js +156 -0
- package/npm/src/index.d.ts +22 -0
- package/npm/src/index.js +39 -0
- package/npm/src/instance/DeviceVersion.d.ts +10 -0
- package/npm/src/instance/DeviceVersion.js +25 -0
- package/npm/src/instance/InstanceController.d.ts +54 -0
- package/npm/src/instance/InstanceController.js +262 -0
- package/npm/src/instance/UserInstance.d.ts +20 -0
- package/npm/src/instance/UserInstance.js +65 -0
- package/npm/src/instance/index.d.ts +3 -0
- package/npm/src/instance/index.js +20 -0
- package/npm/src/instance/jwt.d.ts +11 -0
- package/npm/src/instance/jwt.js +36 -0
- package/npm/src/models/Capability.d.ts +7 -0
- package/npm/src/models/Capability.js +12 -0
- package/npm/src/models/SinchConfig.d.ts +11 -0
- package/npm/src/models/SinchConfig.js +3 -0
- package/npm/src/models/index.d.ts +2 -0
- package/npm/src/models/index.js +19 -0
- package/npm/src/mxp/Codec.d.ts +35 -0
- package/npm/src/mxp/Codec.js +95 -0
- package/npm/src/mxp/MXPError.d.ts +16 -0
- package/npm/src/mxp/MXPError.js +37 -0
- package/npm/src/mxp/Message.d.ts +32 -0
- package/npm/src/mxp/Message.js +152 -0
- package/npm/src/mxp/MessageBuilder.d.ts +16 -0
- package/npm/src/mxp/MessageBuilder.js +36 -0
- package/npm/src/mxp/MxpClientEvent.d.ts +5 -0
- package/npm/src/mxp/MxpClientEvent.js +10 -0
- package/npm/src/mxp/MxpMessageChannel.d.ts +32 -0
- package/npm/src/mxp/MxpMessageChannel.js +105 -0
- package/npm/src/mxp/Protocol.d.ts +49 -0
- package/npm/src/mxp/Protocol.js +146 -0
- package/npm/src/mxp/SessionMessageBuffer.d.ts +7 -0
- package/npm/src/mxp/SessionMessageBuffer.js +39 -0
- package/npm/src/mxp/index.d.ts +10 -0
- package/npm/src/mxp/index.js +27 -0
- package/npm/src/mxp/models/Body.d.ts +20 -0
- package/npm/src/mxp/models/Body.js +39 -0
- package/npm/src/mxp/models/Client.d.ts +12 -0
- package/npm/src/mxp/models/Client.js +3 -0
- package/npm/src/mxp/models/MessageModel.d.ts +15 -0
- package/npm/src/mxp/models/MessageModel.js +3 -0
- package/npm/src/mxp/models/Method.d.ts +13 -0
- package/npm/src/mxp/models/Method.js +18 -0
- package/npm/src/mxp/models/SymmetricKey.d.ts +10 -0
- package/npm/src/mxp/models/SymmetricKey.js +17 -0
- package/npm/src/mxp/models/index.d.ts +5 -0
- package/npm/src/mxp/models/index.js +22 -0
- package/npm/src/ocra/ApiClient.d.ts +78 -0
- package/npm/src/ocra/ApiClient.js +274 -0
- package/npm/src/ocra/Context.d.ts +11 -0
- package/npm/src/ocra/Context.js +21 -0
- package/npm/src/ocra/GzipEncodingMiddleware.d.ts +8 -0
- package/npm/src/ocra/GzipEncodingMiddleware.js +44 -0
- package/npm/src/ocra/OcraConfig.d.ts +5 -0
- package/npm/src/ocra/OcraConfig.js +6 -0
- package/npm/src/ocra/api/apis/CallApi.d.ts +29 -0
- package/npm/src/ocra/api/apis/CallApi.js +71 -0
- package/npm/src/ocra/api/apis/CallReportApi.d.ts +29 -0
- package/npm/src/ocra/api/apis/CallReportApi.js +70 -0
- package/npm/src/ocra/api/apis/ConfigApi.d.ts +30 -0
- package/npm/src/ocra/api/apis/ConfigApi.js +72 -0
- package/npm/src/ocra/api/apis/DebugApi.d.ts +29 -0
- package/npm/src/ocra/api/apis/DebugApi.js +69 -0
- package/npm/src/ocra/api/apis/FeatureFlagsApi.d.ts +33 -0
- package/npm/src/ocra/api/apis/FeatureFlagsApi.js +71 -0
- package/npm/src/ocra/api/apis/IceApi.d.ts +30 -0
- package/npm/src/ocra/api/apis/IceApi.js +72 -0
- package/npm/src/ocra/api/apis/InstanceApi.d.ts +56 -0
- package/npm/src/ocra/api/apis/InstanceApi.js +167 -0
- package/npm/src/ocra/api/apis/PushApi.d.ts +88 -0
- package/npm/src/ocra/api/apis/PushApi.js +257 -0
- package/npm/src/ocra/api/apis/index.d.ts +8 -0
- package/npm/src/ocra/api/apis/index.js +25 -0
- package/npm/src/ocra/api/index.d.ts +3 -0
- package/npm/src/ocra/api/index.js +20 -0
- package/npm/src/ocra/api/models/ApnPushProfile.d.ts +60 -0
- package/npm/src/ocra/api/models/ApnPushProfile.js +65 -0
- package/npm/src/ocra/api/models/ApplicationConfigPushConfig.d.ts +27 -0
- package/npm/src/ocra/api/models/ApplicationConfigPushConfig.js +42 -0
- package/npm/src/ocra/api/models/AudioRouteEvent.d.ts +33 -0
- package/npm/src/ocra/api/models/AudioRouteEvent.js +43 -0
- package/npm/src/ocra/api/models/AudioRouteEventLog.d.ts +34 -0
- package/npm/src/ocra/api/models/AudioRouteEventLog.js +44 -0
- package/npm/src/ocra/api/models/BasicCallReport.d.ts +168 -0
- package/npm/src/ocra/api/models/BasicCallReport.js +89 -0
- package/npm/src/ocra/api/models/CallInitiationRequest.d.ts +78 -0
- package/npm/src/ocra/api/models/CallInitiationRequest.js +59 -0
- package/npm/src/ocra/api/models/CallInitiationResponse.d.ts +72 -0
- package/npm/src/ocra/api/models/CallInitiationResponse.js +57 -0
- package/npm/src/ocra/api/models/CallQuality.d.ts +34 -0
- package/npm/src/ocra/api/models/CallQuality.js +44 -0
- package/npm/src/ocra/api/models/CallReport.d.ts +228 -0
- package/npm/src/ocra/api/models/CallReport.js +109 -0
- package/npm/src/ocra/api/models/CallReportInstance.d.ts +40 -0
- package/npm/src/ocra/api/models/CallReportInstance.js +47 -0
- package/npm/src/ocra/api/models/CallResult.d.ts +29 -0
- package/npm/src/ocra/api/models/CallResult.js +45 -0
- package/npm/src/ocra/api/models/ClientError.d.ts +40 -0
- package/npm/src/ocra/api/models/ClientError.js +47 -0
- package/npm/src/ocra/api/models/ClientErrorDomain.d.ts +25 -0
- package/npm/src/ocra/api/models/ClientErrorDomain.js +41 -0
- package/npm/src/ocra/api/models/ClientEvent.d.ts +46 -0
- package/npm/src/ocra/api/models/ClientEvent.js +49 -0
- package/npm/src/ocra/api/models/ClientEvents.d.ts +34 -0
- package/npm/src/ocra/api/models/ClientEvents.js +44 -0
- package/npm/src/ocra/api/models/Config.d.ts +73 -0
- package/npm/src/ocra/api/models/Config.js +66 -0
- package/npm/src/ocra/api/models/ConnectionInfo.d.ts +40 -0
- package/npm/src/ocra/api/models/ConnectionInfo.js +46 -0
- package/npm/src/ocra/api/models/ConnectionInfoV2.d.ts +66 -0
- package/npm/src/ocra/api/models/ConnectionInfoV2.js +63 -0
- package/npm/src/ocra/api/models/CreateInstanceRequest.d.ts +52 -0
- package/npm/src/ocra/api/models/CreateInstanceRequest.js +51 -0
- package/npm/src/ocra/api/models/CreateInstanceResponse.d.ts +34 -0
- package/npm/src/ocra/api/models/CreateInstanceResponse.js +44 -0
- package/npm/src/ocra/api/models/Destination.d.ts +50 -0
- package/npm/src/ocra/api/models/Destination.js +58 -0
- package/npm/src/ocra/api/models/Direction.d.ts +23 -0
- package/npm/src/ocra/api/models/Direction.js +39 -0
- package/npm/src/ocra/api/models/Domain.d.ts +25 -0
- package/npm/src/ocra/api/models/Domain.js +41 -0
- package/npm/src/ocra/api/models/ErrorResponse.d.ts +27 -0
- package/npm/src/ocra/api/models/ErrorResponse.js +41 -0
- package/npm/src/ocra/api/models/EventResult.d.ts +48 -0
- package/npm/src/ocra/api/models/EventResult.js +57 -0
- package/npm/src/ocra/api/models/EventType.d.ts +23 -0
- package/npm/src/ocra/api/models/EventType.js +39 -0
- package/npm/src/ocra/api/models/ExtendedCallReport.d.ts +204 -0
- package/npm/src/ocra/api/models/ExtendedCallReport.js +101 -0
- package/npm/src/ocra/api/models/ExtendedCallReportAllOf.d.ts +58 -0
- package/npm/src/ocra/api/models/ExtendedCallReportAllOf.js +53 -0
- package/npm/src/ocra/api/models/FcmPushProfile.d.ts +33 -0
- package/npm/src/ocra/api/models/FcmPushProfile.js +43 -0
- package/npm/src/ocra/api/models/IceCandidate.d.ts +64 -0
- package/npm/src/ocra/api/models/IceCandidate.js +55 -0
- package/npm/src/ocra/api/models/IceCandidateType.d.ts +27 -0
- package/npm/src/ocra/api/models/IceCandidateType.js +43 -0
- package/npm/src/ocra/api/models/IceServer.d.ts +66 -0
- package/npm/src/ocra/api/models/IceServer.js +63 -0
- package/npm/src/ocra/api/models/IceServerAllOf.d.ts +27 -0
- package/npm/src/ocra/api/models/IceServerAllOf.js +41 -0
- package/npm/src/ocra/api/models/IceServersResponse.d.ts +28 -0
- package/npm/src/ocra/api/models/IceServersResponse.js +42 -0
- package/npm/src/ocra/api/models/Instance.d.ts +58 -0
- package/npm/src/ocra/api/models/Instance.js +53 -0
- package/npm/src/ocra/api/models/InstanceVersionData.d.ts +64 -0
- package/npm/src/ocra/api/models/InstanceVersionData.js +55 -0
- package/npm/src/ocra/api/models/IpProtocolVersion.d.ts +24 -0
- package/npm/src/ocra/api/models/IpProtocolVersion.js +40 -0
- package/npm/src/ocra/api/models/MediaStreamType.d.ts +23 -0
- package/npm/src/ocra/api/models/MediaStreamType.js +39 -0
- package/npm/src/ocra/api/models/ModelError.d.ts +39 -0
- package/npm/src/ocra/api/models/ModelError.js +46 -0
- package/npm/src/ocra/api/models/MxpPubSubConfig.d.ts +51 -0
- package/npm/src/ocra/api/models/MxpPubSubConfig.js +50 -0
- package/npm/src/ocra/api/models/OpaquePushProfile.d.ts +45 -0
- package/npm/src/ocra/api/models/OpaquePushProfile.js +47 -0
- package/npm/src/ocra/api/models/Origin.d.ts +34 -0
- package/npm/src/ocra/api/models/Origin.js +45 -0
- package/npm/src/ocra/api/models/PlatformIdentifier.d.ts +25 -0
- package/npm/src/ocra/api/models/PlatformIdentifier.js +41 -0
- package/npm/src/ocra/api/models/PrimaryMediaTransportType.d.ts +23 -0
- package/npm/src/ocra/api/models/PrimaryMediaTransportType.js +39 -0
- package/npm/src/ocra/api/models/PushConfig.d.ts +33 -0
- package/npm/src/ocra/api/models/PushConfig.js +44 -0
- package/npm/src/ocra/api/models/PushNotification.d.ts +48 -0
- package/npm/src/ocra/api/models/PushNotification.js +48 -0
- package/npm/src/ocra/api/models/PushNotificationDestination.d.ts +33 -0
- package/npm/src/ocra/api/models/PushNotificationDestination.js +43 -0
- package/npm/src/ocra/api/models/PushProfile.d.ts +58 -0
- package/npm/src/ocra/api/models/PushProfile.js +53 -0
- package/npm/src/ocra/api/models/PushProvider.d.ts +25 -0
- package/npm/src/ocra/api/models/PushProvider.js +41 -0
- package/npm/src/ocra/api/models/RelayProtocol.d.ts +24 -0
- package/npm/src/ocra/api/models/RelayProtocol.js +40 -0
- package/npm/src/ocra/api/models/RemotePeerInstance.d.ts +40 -0
- package/npm/src/ocra/api/models/RemotePeerInstance.js +47 -0
- package/npm/src/ocra/api/models/RemotePeerInstancePushProfile.d.ts +39 -0
- package/npm/src/ocra/api/models/RemotePeerInstancePushProfile.js +46 -0
- package/npm/src/ocra/api/models/RtcConfig.d.ts +34 -0
- package/npm/src/ocra/api/models/RtcConfig.js +45 -0
- package/npm/src/ocra/api/models/RtcProfile.d.ts +39 -0
- package/npm/src/ocra/api/models/RtcProfile.js +45 -0
- package/npm/src/ocra/api/models/SdpSemantics.d.ts +23 -0
- package/npm/src/ocra/api/models/SdpSemantics.js +39 -0
- package/npm/src/ocra/api/models/SemanticVersion.d.ts +33 -0
- package/npm/src/ocra/api/models/SemanticVersion.js +43 -0
- package/npm/src/ocra/api/models/TransportProtocol.d.ts +23 -0
- package/npm/src/ocra/api/models/TransportProtocol.js +39 -0
- package/npm/src/ocra/api/models/UpaPushProfile.d.ts +41 -0
- package/npm/src/ocra/api/models/UpaPushProfile.js +45 -0
- package/npm/src/ocra/api/models/UpdateInstanceRequest.d.ts +34 -0
- package/npm/src/ocra/api/models/UpdateInstanceRequest.js +44 -0
- package/npm/src/ocra/api/models/UpdateInstanceTtlRequest.d.ts +27 -0
- package/npm/src/ocra/api/models/UpdateInstanceTtlRequest.js +42 -0
- package/npm/src/ocra/api/models/UpdateInstanceTtlResponse.d.ts +33 -0
- package/npm/src/ocra/api/models/UpdateInstanceTtlResponse.js +43 -0
- package/npm/src/ocra/api/models/UserDebugInfoResponse.d.ts +51 -0
- package/npm/src/ocra/api/models/UserDebugInfoResponse.js +49 -0
- package/npm/src/ocra/api/models/W3CPushProfile.d.ts +46 -0
- package/npm/src/ocra/api/models/W3CPushProfile.js +48 -0
- package/npm/src/ocra/api/models/W3CPushProfileKeys.d.ts +33 -0
- package/npm/src/ocra/api/models/W3CPushProfileKeys.js +43 -0
- package/npm/src/ocra/api/models/WarningEvent.d.ts +46 -0
- package/npm/src/ocra/api/models/WarningEvent.js +49 -0
- package/npm/src/ocra/api/models/WarningEventName.d.ts +30 -0
- package/npm/src/ocra/api/models/WarningEventName.js +46 -0
- package/npm/src/ocra/api/models/WarningEventType.d.ts +23 -0
- package/npm/src/ocra/api/models/WarningEventType.js +39 -0
- package/npm/src/ocra/api/models/WebrtcRTCIceServer.d.ts +60 -0
- package/npm/src/ocra/api/models/WebrtcRTCIceServer.js +61 -0
- package/npm/src/ocra/api/models/WebrtcRTCOAuthCredential.d.ts +33 -0
- package/npm/src/ocra/api/models/WebrtcRTCOAuthCredential.js +43 -0
- package/npm/src/ocra/api/models/WebrtcRTCSessionDescription.d.ts +33 -0
- package/npm/src/ocra/api/models/WebrtcRTCSessionDescription.js +43 -0
- package/npm/src/ocra/api/models/index.d.ts +69 -0
- package/npm/src/ocra/api/models/index.js +86 -0
- package/npm/src/ocra/api/runtime.d.ts +140 -0
- package/npm/src/ocra/api/runtime.js +254 -0
- package/npm/src/ocra/auth/Authentication.d.ts +4 -0
- package/npm/src/ocra/auth/Authentication.js +3 -0
- package/npm/src/ocra/auth/InstanceAuthentication.d.ts +8 -0
- package/npm/src/ocra/auth/InstanceAuthentication.js +3 -0
- package/npm/src/ocra/auth/InstanceCredentials.d.ts +6 -0
- package/npm/src/ocra/auth/InstanceCredentials.js +3 -0
- package/npm/src/ocra/auth/InstanceRequestSignatureV1Authentication.d.ts +15 -0
- package/npm/src/ocra/auth/InstanceRequestSignatureV1Authentication.js +37 -0
- package/npm/src/ocra/auth/JwtAuthentication.d.ts +7 -0
- package/npm/src/ocra/auth/JwtAuthentication.js +22 -0
- package/npm/src/ocra/auth/Request.d.ts +7 -0
- package/npm/src/ocra/auth/Request.js +3 -0
- package/npm/src/ocra/auth/SignatureV1.d.ts +20 -0
- package/npm/src/ocra/auth/SignatureV1.js +95 -0
- package/npm/src/ocra/auth/SignatureV1RequestSigner.d.ts +4 -0
- package/npm/src/ocra/auth/SignatureV1RequestSigner.js +15 -0
- package/npm/src/ocra/auth/index.d.ts +7 -0
- package/npm/src/ocra/auth/index.js +24 -0
- package/npm/src/ocra/requestHeaders/CorrelationContext.d.ts +8 -0
- package/npm/src/ocra/requestHeaders/CorrelationContext.js +33 -0
- package/npm/src/ocra/requestHeaders/RequestHeaders.d.ts +4 -0
- package/npm/src/ocra/requestHeaders/RequestHeaders.js +3 -0
- package/npm/src/ocra/requestHeaders/SinchRequestHeaders.d.ts +7 -0
- package/npm/src/ocra/requestHeaders/SinchRequestHeaders.js +24 -0
- package/npm/src/ocra/requestHeaders/index.d.ts +2 -0
- package/npm/src/ocra/requestHeaders/index.js +19 -0
- package/npm/src/push/CallNotificationResult.d.ts +40 -0
- package/npm/src/push/CallNotificationResult.js +3 -0
- package/npm/src/push/DefaultNotificationResult.d.ts +14 -0
- package/npm/src/push/DefaultNotificationResult.js +49 -0
- package/npm/src/push/Domain.d.ts +6 -0
- package/npm/src/push/Domain.js +11 -0
- package/npm/src/push/NotificationResult.d.ts +26 -0
- package/npm/src/push/NotificationResult.js +3 -0
- package/npm/src/push/OcraPushService.d.ts +20 -0
- package/npm/src/push/OcraPushService.js +98 -0
- package/npm/src/push/PushFactory.d.ts +7 -0
- package/npm/src/push/PushFactory.js +15 -0
- package/npm/src/push/PushPayload.d.ts +21 -0
- package/npm/src/push/PushPayload.js +88 -0
- package/npm/src/push/PushService.d.ts +9 -0
- package/npm/src/push/PushService.js +3 -0
- package/npm/src/push/PushServiceWorker.d.ts +22 -0
- package/npm/src/push/PushServiceWorker.js +90 -0
- package/npm/src/push/PushType.d.ts +3 -0
- package/npm/src/push/PushType.js +8 -0
- package/npm/src/push/PushWorker.d.ts +25 -0
- package/npm/src/push/PushWorker.js +70 -0
- package/npm/src/push/index.d.ts +6 -0
- package/npm/src/push/index.js +23 -0
- package/npm/src/rtc/DefaultMediaStreamFactory.d.ts +10 -0
- package/npm/src/rtc/DefaultMediaStreamFactory.js +59 -0
- package/npm/src/rtc/IceServer.d.ts +22 -0
- package/npm/src/rtc/IceServer.js +66 -0
- package/npm/src/rtc/MediaController.d.ts +9 -0
- package/npm/src/rtc/MediaController.js +36 -0
- package/npm/src/rtc/MediaManager.d.ts +9 -0
- package/npm/src/rtc/MediaManager.js +36 -0
- package/npm/src/rtc/MediaStreamFactory.d.ts +4 -0
- package/npm/src/rtc/MediaStreamFactory.js +3 -0
- package/npm/src/rtc/PeerConnection.d.ts +66 -0
- package/npm/src/rtc/PeerConnection.js +283 -0
- package/npm/src/rtc/PeerConnectionClient.d.ts +63 -0
- package/npm/src/rtc/PeerConnectionClient.js +296 -0
- package/npm/src/rtc/PeerConnectionClientObserver.d.ts +4 -0
- package/npm/src/rtc/PeerConnectionClientObserver.js +3 -0
- package/npm/src/rtc/PeerConnectionObserver.d.ts +8 -0
- package/npm/src/rtc/PeerConnectionObserver.js +3 -0
- package/npm/src/rtc/WebRTCFactory.d.ts +3 -0
- package/npm/src/rtc/WebRTCFactory.js +10 -0
- package/npm/src/rtc/index.d.ts +2 -0
- package/npm/src/rtc/index.js +19 -0
- package/npm/src/session/Direction.d.ts +4 -0
- package/npm/src/session/Direction.js +9 -0
- package/npm/src/session/EstablishedState.d.ts +10 -0
- package/npm/src/session/EstablishedState.js +85 -0
- package/npm/src/session/InboundSession.d.ts +11 -0
- package/npm/src/session/InboundSession.js +143 -0
- package/npm/src/session/OutboundSession.d.ts +7 -0
- package/npm/src/session/OutboundSession.js +163 -0
- package/npm/src/session/RealTimeScheduler.d.ts +5 -0
- package/npm/src/session/RealTimeScheduler.js +13 -0
- package/npm/src/session/Scheduler.d.ts +4 -0
- package/npm/src/session/Scheduler.js +3 -0
- package/npm/src/session/Session.d.ts +88 -0
- package/npm/src/session/Session.js +293 -0
- package/npm/src/session/SessionEvent.d.ts +7 -0
- package/npm/src/session/SessionEvent.js +3 -0
- package/npm/src/session/SessionState.d.ts +7 -0
- package/npm/src/session/SessionState.js +12 -0
- package/npm/src/session/SessionStateBase.d.ts +23 -0
- package/npm/src/session/SessionStateBase.js +63 -0
- package/npm/src/session/TerminatedState.d.ts +7 -0
- package/npm/src/session/TerminatedState.js +16 -0
- package/npm/src/session/TerminationCause.d.ts +11 -0
- package/npm/src/session/TerminationCause.js +18 -0
- package/npm/src/session/fsm/CancellationToken.d.ts +15 -0
- package/npm/src/session/fsm/CancellationToken.js +33 -0
- package/npm/src/session/fsm/FsmState.d.ts +34 -0
- package/npm/src/session/fsm/FsmState.js +100 -0
- package/npm/src/session/fsm/FsmTransition.d.ts +5 -0
- package/npm/src/session/fsm/FsmTransition.js +3 -0
- package/npm/src/session/fsm/FsmTransitions.d.ts +9 -0
- package/npm/src/session/fsm/FsmTransitions.js +24 -0
- package/npm/src/session/fsm/InvalidStateTransition.d.ts +5 -0
- package/npm/src/session/fsm/InvalidStateTransition.js +11 -0
- package/npm/src/session/fsm/NullState.d.ts +21 -0
- package/npm/src/session/fsm/NullState.js +54 -0
- package/npm/src/session/fsm/TimerEvent.d.ts +8 -0
- package/npm/src/session/fsm/TimerEvent.js +20 -0
- package/npm/src/session/fsm/index.d.ts +7 -0
- package/npm/src/session/fsm/index.js +24 -0
- package/npm/src/session/jsep/JsepMessage.d.ts +15 -0
- package/npm/src/session/jsep/JsepMessage.js +52 -0
- package/npm/src/session/jsep/Sdp.d.ts +17 -0
- package/npm/src/session/jsep/Sdp.js +29 -0
- package/npm/src/session/jsep/SessionDescription.d.ts +17 -0
- package/npm/src/session/jsep/SessionDescription.js +34 -0
- package/npm/src/session/jsep/index.d.ts +2 -0
- package/npm/src/session/jsep/index.js +19 -0
- package/npm/src/storage/FeatureStorage.d.ts +19 -0
- package/npm/src/storage/FeatureStorage.js +61 -0
- package/npm/src/storage/InstanceStorage.d.ts +6 -0
- package/npm/src/storage/InstanceStorage.js +3 -0
- package/npm/src/storage/KeyValueStorage.d.ts +8 -0
- package/npm/src/storage/KeyValueStorage.js +22 -0
- package/npm/src/storage/SettingStorage.d.ts +8 -0
- package/npm/src/storage/SettingStorage.js +19 -0
- package/npm/src/storage/StorageFactory.d.ts +9 -0
- package/npm/src/storage/StorageFactory.js +22 -0
- package/npm/src/storage/UserInstanceStorage.d.ts +26 -0
- package/npm/src/storage/UserInstanceStorage.js +44 -0
- package/npm/src/utils/Base64.helper.d.ts +34 -0
- package/npm/src/utils/Base64.helper.js +79 -0
- package/npm/src/utils/Crypto.helper.d.ts +9 -0
- package/npm/src/utils/Crypto.helper.js +28 -0
- package/npm/src/utils/Date.helper.d.ts +9 -0
- package/npm/src/utils/Date.helper.js +19 -0
- package/npm/src/utils/Env.helper.d.ts +8 -0
- package/npm/src/utils/Env.helper.js +37 -0
- package/npm/src/utils/Errors.d.ts +11 -0
- package/npm/src/utils/Errors.js +26 -0
- package/npm/src/utils/Event.d.ts +8 -0
- package/npm/src/utils/Event.js +27 -0
- package/npm/src/utils/Promise.helper.d.ts +5 -0
- package/npm/src/utils/Promise.helper.js +29 -0
- package/npm/src/utils/String.helper.d.ts +23 -0
- package/npm/src/utils/String.helper.js +48 -0
- package/npm/src/utils/TimeService.d.ts +6 -0
- package/npm/src/utils/TimeService.js +16 -0
- package/npm/src/utils/Type.helper.d.ts +12 -0
- package/npm/src/utils/Type.helper.js +36 -0
- package/npm/src/utils/Utils.d.ts +4 -0
- package/npm/src/utils/Utils.js +16 -0
- package/npm/src/utils/index.d.ts +8 -0
- package/npm/src/utils/index.js +25 -0
- package/package.json +100 -41
- package/VERSION.js +0 -1
- package/examples/IM_basic_chat.js +0 -111
- package/lib/sinch.node.min.js +0 -1
- package/package.json~ +0 -50
package/README.md
CHANGED
|
@@ -1,189 +1,103 @@
|
|
|
1
|
-
Sinch
|
|
2
|
-
==========================
|
|
3
|
-
Welcome to Sinch JS SDK, http://www.sinch.com
|
|
1
|
+
# Sinch RTC SDK - JavaScript
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
## Setting Up the Development Environment
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
Build tools are installed using [Nix](https://nixos.org/download.html) package manager.
|
|
6
|
+
Before running any `make` commands, ensure your Nix environment is configured to use the correct channel for dependencies.
|
|
8
7
|
|
|
8
|
+
1. **Add the NixOS 25.05 channel**
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
========
|
|
12
|
-
- Sinch SDK for web
|
|
13
|
-
- PSTN Calling
|
|
14
|
-
- Make calls using WebRTC
|
|
15
|
-
- Web/app calling
|
|
16
|
-
- Make and receive calls using WebRTC
|
|
17
|
-
- Call both web clients and native (iOS and Android)
|
|
18
|
-
- SIP calling
|
|
19
|
-
- Make calls connected to SIP clients
|
|
20
|
-
- Conference calling
|
|
21
|
-
- Instant messaging
|
|
22
|
-
- Cross platform, using native SDK's for iOS and Android
|
|
23
|
-
- Conversations with up to 10 participants
|
|
24
|
-
- Delivery receipts
|
|
25
|
-
- Video calling (beta)
|
|
26
|
-
- Web clients only
|
|
27
|
-
- Group p2p calling
|
|
28
|
-
- Web clients only
|
|
29
|
-
- Phone number verification
|
|
30
|
-
- SMS verification
|
|
31
|
-
- Callout verification
|
|
32
|
-
- Partner user management
|
|
33
|
-
- Authentication ticket for session creation
|
|
34
|
-
- Allows full user management for partner
|
|
35
|
-
- Sample python (tornado) backend in samples folder (SinchAUTHsample)
|
|
36
|
-
- NOTE: Review your app setting for "JS Auth" in the Sinch portal
|
|
37
|
-
- Sinch user management
|
|
38
|
-
- Create user, update password and basic profile
|
|
39
|
-
- Authenticate as user
|
|
40
|
-
- Generate authentication tickets when running as backend
|
|
41
|
-
|
|
42
|
-
Should you encounter any bugs, glitches, lack of functionality or other problems
|
|
43
|
-
using our SDK, please send us an email to dev@sinch.com.
|
|
44
|
-
Your help in this regard is greatly appreciated.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Quick start
|
|
48
|
-
===========
|
|
10
|
+
Open your `.nix-channels` file (usually in your home directory) and add the following line:
|
|
49
11
|
|
|
50
|
-
|
|
12
|
+
```bash
|
|
13
|
+
https://nixos.org/channels/nixos-25.05 nixpkgs-25
|
|
14
|
+
```
|
|
51
15
|
|
|
52
|
-
|
|
16
|
+
2. **Update Nix channels**
|
|
53
17
|
|
|
54
|
-
|
|
18
|
+
Run the following commands to update your channels:
|
|
55
19
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
===================
|
|
61
|
-
|
|
62
|
-
You can install Sinch RTC SDK in your project using Bower;
|
|
63
|
-
|
|
64
|
-
bower install sinch
|
|
65
|
-
|
|
66
|
-
Import the Sinch SDK in your website using
|
|
67
|
-
|
|
68
|
-
<script src="PATH_TO_BOWER_MODULES/sinch-rtc/sinch.min.js"></script>
|
|
20
|
+
```bash
|
|
21
|
+
nix-channel --update
|
|
22
|
+
nix-channel --list
|
|
23
|
+
```
|
|
69
24
|
|
|
25
|
+
You should see something like:
|
|
70
26
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Sinch is also available as a node package. Install Sinch RTC SDK using;
|
|
75
|
-
|
|
76
|
-
npm install sinch-rtc
|
|
77
|
-
|
|
78
|
-
Import Sinch SDK in your javascript using
|
|
79
|
-
|
|
80
|
-
var SinchClient = require('sinch-rtc');
|
|
81
|
-
|
|
82
|
-
var sinchClient = new SinchClient({
|
|
83
|
-
applicationKey: 'YOUR KEY',
|
|
84
|
-
capabilities: {messaging: true},
|
|
85
|
-
onLogMessage: function(message) {
|
|
86
|
-
console.log(message);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
27
|
+
```bash
|
|
28
|
+
nixpkgs-25 https://nixos.org/channels/nixos-25.05
|
|
29
|
+
```
|
|
89
30
|
|
|
90
|
-
|
|
91
|
-
console.log('Success!');
|
|
92
|
-
})
|
|
31
|
+
You can now safely run `make` commands
|
|
93
32
|
|
|
94
|
-
|
|
95
|
-
without some minor modifications.
|
|
33
|
+
To install a local devenv, run:
|
|
96
34
|
|
|
35
|
+
make devenv
|
|
97
36
|
|
|
98
|
-
|
|
99
|
-
===============
|
|
100
|
-
Familiarise yourself with the user guide (documentation folder or online).
|
|
37
|
+
In the root of this repository run:
|
|
101
38
|
|
|
102
|
-
|
|
103
|
-
- SinchIMsample, our Instant Messaging sample app
|
|
104
|
-
- SinchPSTNsample, our PSTN calling sample app
|
|
105
|
-
- SinchWEBsample, our Web to Web calling sample app
|
|
106
|
-
- SinchAUTHsample, our sample for demonstrating integrating a custom backend
|
|
107
|
-
for user authentication (useful for native app compatability)
|
|
108
|
-
- python-backend-sample, a sample backend for Sinch written in Python
|
|
109
|
-
(see README.md for more information on getting started)
|
|
110
|
-
- SinchVIDEOsample, sample for person to person video calling
|
|
111
|
-
- SinchGROUPVIDEOsample, sample for group video conferencing
|
|
112
|
-
- SinchVERsample, sample for SMS number verification
|
|
113
|
-
- SinchCALLOUTsample, sample for Callout number verification
|
|
39
|
+
make sync
|
|
114
40
|
|
|
115
|
-
|
|
116
|
-
The interesting stuff can be found in the .js files.
|
|
41
|
+
This will
|
|
117
42
|
|
|
118
|
-
|
|
43
|
+
- Sync git submodules.
|
|
44
|
+
- Set up npm environment [https://www.npmjs.com/]
|
|
119
45
|
|
|
120
|
-
|
|
121
|
-
Open the developer console.
|
|
122
|
-
2. In the browser window you should see a web form where you can either create
|
|
123
|
-
a new user or login as a user.
|
|
124
|
-
3. Try creating a user
|
|
125
|
-
4. An error message "Illegal Authorization Header" error is shown. This is
|
|
126
|
-
because the sample app don't use your app key yet.
|
|
127
|
-
5. Go to www.sinch.com, create an account and a new application (or use an
|
|
128
|
-
already existing app)
|
|
129
|
-
6. Replace MY_APPLICATION_KEY in IMsample.js with your application key.
|
|
130
|
-
7. Try creating a user, now it should work!
|
|
131
|
-
Note: Only if "JS Auth" is enabled in portal for your app
|
|
132
|
-
8. Open the same page in a separate window and create another user
|
|
133
|
-
9. You can now try sending messages between these two users.
|
|
46
|
+
When the script finishes, it should be possible to run.
|
|
134
47
|
|
|
135
|
-
|
|
136
|
-
if you're curious about the activity under the hood. It's a good way to have
|
|
137
|
-
logging enabled during development for easy error tracking.
|
|
48
|
+
make serve
|
|
138
49
|
|
|
139
|
-
|
|
140
|
-
by removing "false" from the if-statement. The PSTN and AUTH sample application
|
|
141
|
-
has this activated by default, please see the PSTNsample.js file for reference.
|
|
50
|
+
this will build the sdk and start a local http server on port 5050 if everything works you should be able to load [http://localhost:5050/reference-apps/javascript/samples/]
|
|
142
51
|
|
|
143
|
-
|
|
144
|
-
server (can be local), depending on the security settings for WebRTC in your
|
|
145
|
-
browser. Also, when trying PSTN calls please ensure you replace
|
|
146
|
-
"MY_APPLICATION_KEY" with your actual key.
|
|
52
|
+
## Build and Test Sdk
|
|
147
53
|
|
|
54
|
+
### Build
|
|
148
55
|
|
|
149
|
-
|
|
150
|
-
=============
|
|
151
|
-
The user-guide is available in the docs/ folder.
|
|
152
|
-
Open index.html and read about:
|
|
56
|
+
make build
|
|
153
57
|
|
|
154
|
-
|
|
155
|
-
- Using Sinch in your app for sending and receiving messages
|
|
156
|
-
- Using Sinch in your app for making PSTN calls
|
|
157
|
-
- Using Sinch in your app for making data calls
|
|
158
|
-
- Learn about sinch authentication
|
|
159
|
-
- Session Management
|
|
160
|
-
- Other information about Sinch, such as creating your app, note on export
|
|
161
|
-
regulations and more.
|
|
58
|
+
### Generate ocra api from ocra design
|
|
162
59
|
|
|
163
|
-
|
|
60
|
+
make ocra
|
|
164
61
|
|
|
165
|
-
|
|
166
|
-
- MessageClient
|
|
167
|
-
- CallClient
|
|
62
|
+
### Build and start local http server
|
|
168
63
|
|
|
64
|
+
make serve
|
|
169
65
|
|
|
170
|
-
|
|
171
|
-
============
|
|
172
|
-
- There is an issue running too many instances at the same time. No more than
|
|
173
|
-
5-6 instances can be run at the same time in the same browser.
|
|
174
|
-
(if problem experienced, restart browser and only run one instance and try
|
|
175
|
-
again with fewer instances)
|
|
176
|
-
- After three failed login attempts on one user accounts, that account is
|
|
177
|
-
locked for a while with no ability to unlock (when using Sinch auth).
|
|
178
|
-
- Restore messages missed since last login is currently disabled.
|
|
179
|
-
- When browser close, any ongoing PSTN calls are not terminated properly but
|
|
180
|
-
relies on B-side doing a time-out. (~ 1 minute)
|
|
181
|
-
- Browserify is not yet supported for Node JS distribution.
|
|
66
|
+
### Tests
|
|
182
67
|
|
|
68
|
+
make test
|
|
183
69
|
|
|
70
|
+
### Create the jssdk package
|
|
184
71
|
|
|
72
|
+
make dist
|
|
185
73
|
|
|
74
|
+
## E2E Smoke test
|
|
186
75
|
|
|
76
|
+
### Build Sdk for E2E smoke test
|
|
187
77
|
|
|
78
|
+
make bidiro
|
|
188
79
|
|
|
80
|
+
### Build and start local host for running test host app
|
|
189
81
|
|
|
82
|
+
make bidiro-serve
|
|
83
|
+
|
|
84
|
+
This will start a local webserver at port 1080 and a WebSocket proxy listening on port 3000. To run the test host app use <http://localhost:1080/sinch/{channel}/?sdk={sdk}>
|
|
85
|
+
|
|
86
|
+
{channel} is an identifier for the channel and can be any string. WebSocket message to this app should be sent to http://{host}:3000/bidiro/{channel}
|
|
87
|
+
|
|
88
|
+
{sdk} is the folder where the sdk is located. By defaulr {sdk} is "sdk" which is the folder where the local built (make bidiro) sdk is located.
|
|
89
|
+
|
|
90
|
+
### Running E2E Tests inside docker locally
|
|
91
|
+
|
|
92
|
+
`npm run e2e`
|
|
93
|
+
|
|
94
|
+
## Prerequisites
|
|
95
|
+
|
|
96
|
+
1. Make sure you have cloned the [E2E repository](https://gitlab.com/sinch/sinch-projects/voice/rtc-sdk-e2e-test) in your home directory
|
|
97
|
+
2. The JS sdk and E2E respository are in the same parent directory
|
|
98
|
+
3. Docker or [Docker Desktop](https://www.docker.com/products/docker-desktop/) is installed on your machine
|
|
99
|
+
4. Replace `localhost` with `bidirohost` for `sinch.device.1` and `sinch.device.1` in `parameters-js-v2.xml`.
|
|
100
|
+
|
|
101
|
+
### Design
|
|
102
|
+
|
|
103
|
+
For design document, see [design/README.md](design/README.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Callback object to be used to proceed in user registration/setup when
|
|
3
|
+
* registration credentials for the user in question have been obtained.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ClientRegistration {
|
|
6
|
+
register: (jwtSignature: string) => Promise<void>;
|
|
7
|
+
registerFailed: () => void;
|
|
8
|
+
/**
|
|
9
|
+
* Methods to call when registration credentials for the user have been
|
|
10
|
+
* obtained.
|
|
11
|
+
*
|
|
12
|
+
* @param register - Callback to call with a signed JWT token for this user.
|
|
13
|
+
* @param registerFailed - Callback to call when registration for the user has failed
|
|
14
|
+
*/
|
|
15
|
+
constructor(register: (jwtSignature: string) => Promise<void>, registerFailed: () => void);
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientRegistration = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Callback object to be used to proceed in user registration/setup when
|
|
6
|
+
* registration credentials for the user in question have been obtained.
|
|
7
|
+
*/
|
|
8
|
+
class ClientRegistration {
|
|
9
|
+
/**
|
|
10
|
+
* Methods to call when registration credentials for the user have been
|
|
11
|
+
* obtained.
|
|
12
|
+
*
|
|
13
|
+
* @param register - Callback to call with a signed JWT token for this user.
|
|
14
|
+
* @param registerFailed - Callback to call when registration for the user has failed
|
|
15
|
+
*/
|
|
16
|
+
constructor(register, registerFailed) {
|
|
17
|
+
this.register = register;
|
|
18
|
+
this.registerFailed = registerFailed;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ClientRegistration = ClientRegistration;
|
|
22
|
+
//# sourceMappingURL=ClientRegistration.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CallInitiator, CallClient } from "./calling";
|
|
2
|
+
import { SinchConfig } from "./models";
|
|
3
|
+
import { SinchClientListener } from "./SinchClientListener";
|
|
4
|
+
import { CallInitiationResponse, Config, InitiateCallRequest } from "./ocra/api";
|
|
5
|
+
import { SinchClient } from "./SinchClient";
|
|
6
|
+
import { NotificationResult } from "./push/NotificationResult";
|
|
7
|
+
export declare class DefaultSinchClient implements CallInitiator, SinchClient {
|
|
8
|
+
private static readonly OCRA_PATH;
|
|
9
|
+
private readonly ServiceWorkerName;
|
|
10
|
+
applicationKey: string;
|
|
11
|
+
userId: string;
|
|
12
|
+
private callerIdentifier?;
|
|
13
|
+
private defaultCallClient;
|
|
14
|
+
private clientEvent;
|
|
15
|
+
private instanceController;
|
|
16
|
+
private isClientStarted;
|
|
17
|
+
private apiClient;
|
|
18
|
+
private onStartedAction;
|
|
19
|
+
private pushWorker?;
|
|
20
|
+
private pushService;
|
|
21
|
+
private features;
|
|
22
|
+
private useRelayIceCandidatesOnly;
|
|
23
|
+
private addTurnListener;
|
|
24
|
+
private isUsingManagedPush;
|
|
25
|
+
private instanceConfigJson?;
|
|
26
|
+
private instanceConfigUpdateInterval?;
|
|
27
|
+
/**
|
|
28
|
+
* @param config -
|
|
29
|
+
* config.applicationKey - application unique key from Sinch portal
|
|
30
|
+
* config.userId - userId for whom instance is created
|
|
31
|
+
* [config.ttl] TODO: TTL param for setting lifetime of Ocra instance
|
|
32
|
+
*/
|
|
33
|
+
constructor(config: SinchConfig);
|
|
34
|
+
set pushNotificationDisplayName(displayName: string | undefined);
|
|
35
|
+
get pushNotificationDisplayName(): string | undefined;
|
|
36
|
+
setUseRelayIceCandidatesOnly(useRelayIceCandidatesOnly: boolean): void;
|
|
37
|
+
private processExternalPushNotification;
|
|
38
|
+
private getBaseUrl;
|
|
39
|
+
private isUrl;
|
|
40
|
+
start(instanceConfig?: Config): Promise<void>;
|
|
41
|
+
setSupportManagedPush(serviceWorker?: string): Promise<void>;
|
|
42
|
+
disableManagedPushSupport(): Promise<void>;
|
|
43
|
+
private failed;
|
|
44
|
+
private setupPush;
|
|
45
|
+
private createAndSetUpCallReporter;
|
|
46
|
+
private started;
|
|
47
|
+
private setupConfigCheck;
|
|
48
|
+
private clearInstanceConfigUpdateInterval;
|
|
49
|
+
addListener(listener: SinchClientListener): void;
|
|
50
|
+
removeListener(listener: SinchClientListener): void;
|
|
51
|
+
initiateCall(request: InitiateCallRequest): Promise<CallInitiationResponse>;
|
|
52
|
+
onPush: (message: any) => void;
|
|
53
|
+
get callClient(): CallClient;
|
|
54
|
+
terminate(): void;
|
|
55
|
+
get localUserId(): string;
|
|
56
|
+
isStarted(): boolean;
|
|
57
|
+
relayRemotePushNotification(payload: Record<string, string>): NotificationResult;
|
|
58
|
+
showPushNotification(title: string, options: NotificationOptions): void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DefaultSinchClient = void 0;
|
|
13
|
+
const calling_1 = require("./calling");
|
|
14
|
+
const models_1 = require("./models");
|
|
15
|
+
const api_1 = require("./ocra/api");
|
|
16
|
+
const InstanceController_1 = require("./instance/InstanceController");
|
|
17
|
+
const fsm_1 = require("./session/fsm");
|
|
18
|
+
const push_1 = require("./push");
|
|
19
|
+
const ClientEventFanout_1 = require("./calling/listeners/ClientEventFanout");
|
|
20
|
+
const CallReporter_1 = require("./calling/reporting/CallReporter");
|
|
21
|
+
const ApiClient_1 = require("./ocra/ApiClient");
|
|
22
|
+
const utils_1 = require("./utils");
|
|
23
|
+
const Features_1 = require("./features/Features");
|
|
24
|
+
const StorageFactory_1 = require("./storage/StorageFactory");
|
|
25
|
+
const IceServer_1 = require("./rtc/IceServer");
|
|
26
|
+
class DefaultSinchClient {
|
|
27
|
+
/**
|
|
28
|
+
* @param config -
|
|
29
|
+
* config.applicationKey - application unique key from Sinch portal
|
|
30
|
+
* config.userId - userId for whom instance is created
|
|
31
|
+
* [config.ttl] TODO: TTL param for setting lifetime of Ocra instance
|
|
32
|
+
*/
|
|
33
|
+
constructor(config) {
|
|
34
|
+
this.ServiceWorkerName = "sw.js";
|
|
35
|
+
this.isClientStarted = false;
|
|
36
|
+
this.useRelayIceCandidatesOnly = false;
|
|
37
|
+
this.isUsingManagedPush = false;
|
|
38
|
+
this.processExternalPushNotification = (json) => {
|
|
39
|
+
const payload = {
|
|
40
|
+
sinch: json,
|
|
41
|
+
name: "ForSmokeTests",
|
|
42
|
+
};
|
|
43
|
+
this.relayRemotePushNotification(payload);
|
|
44
|
+
};
|
|
45
|
+
this.onPush = (message) => {
|
|
46
|
+
this.relayRemotePushNotification(message.data);
|
|
47
|
+
};
|
|
48
|
+
this.clientEvent = new ClientEventFanout_1.ClientEventFanout(this);
|
|
49
|
+
this.features = Features_1.FeaturesFactory.create(StorageFactory_1.StorageFactory.createFeatureStorage());
|
|
50
|
+
if (!config || !config.applicationKey) {
|
|
51
|
+
throw new Error("Parameter appKey is required");
|
|
52
|
+
}
|
|
53
|
+
this.applicationKey = config.applicationKey;
|
|
54
|
+
this.userId = config.userId;
|
|
55
|
+
this.callerIdentifier = config.callerIdentifier;
|
|
56
|
+
this.apiClient = ApiClient_1.ApiClientFactory.create(new api_1.Configuration({
|
|
57
|
+
basePath: this.getBaseUrl(config.baseUrl),
|
|
58
|
+
fetchApi: config.fetchApi,
|
|
59
|
+
}));
|
|
60
|
+
this.instanceController = new InstanceController_1.InstanceController(this.applicationKey, this.userId, this.clientEvent, this.apiClient);
|
|
61
|
+
this.pushService = push_1.PushFactory.createPushService(this.userId, this.apiClient);
|
|
62
|
+
this.defaultCallClient = calling_1.CallClientFactory.create(this.userId, this.applicationKey, config.mediaManager);
|
|
63
|
+
this.onStartedAction = new Array();
|
|
64
|
+
this.addTurnListener = (0, utils_1.pipe)(IceServer_1.onTurnFeatureFlagChanged, this.features.addListener.bind(this.features));
|
|
65
|
+
}
|
|
66
|
+
set pushNotificationDisplayName(displayName) {
|
|
67
|
+
if (displayName && displayName.length > 255)
|
|
68
|
+
throw new fsm_1.ArgumentError("displayName must not exceed 255 bytes", (0, utils_1.nameof)(displayName));
|
|
69
|
+
this.pushService.pushNotificationDisplayName = displayName;
|
|
70
|
+
}
|
|
71
|
+
get pushNotificationDisplayName() {
|
|
72
|
+
return this.pushService.pushNotificationDisplayName;
|
|
73
|
+
}
|
|
74
|
+
setUseRelayIceCandidatesOnly(useRelayIceCandidatesOnly) {
|
|
75
|
+
this.useRelayIceCandidatesOnly = useRelayIceCandidatesOnly;
|
|
76
|
+
}
|
|
77
|
+
getBaseUrl(url) {
|
|
78
|
+
return ((!this.isUrl(url) ? "https://" : "") + url + DefaultSinchClient.OCRA_PATH);
|
|
79
|
+
}
|
|
80
|
+
isUrl(urlOrHost) {
|
|
81
|
+
return urlOrHost.startsWith("http://") || urlOrHost.startsWith("https://");
|
|
82
|
+
}
|
|
83
|
+
start(instanceConfig) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
try {
|
|
86
|
+
this.started(yield this.instanceController.start(), instanceConfig);
|
|
87
|
+
}
|
|
88
|
+
catch (ex) {
|
|
89
|
+
this.isClientStarted = false;
|
|
90
|
+
console.error(ex);
|
|
91
|
+
this.failed("Unable to create instance!");
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
setSupportManagedPush(serviceWorker) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
this.instanceController.toggleCapability(models_1.Capability.Push, true);
|
|
98
|
+
this.isUsingManagedPush = true;
|
|
99
|
+
this.pushWorker = push_1.PushFactory.createPushWorker(serviceWorker !== null && serviceWorker !== void 0 ? serviceWorker : this.ServiceWorkerName, this.pushService);
|
|
100
|
+
yield this.pushWorker.register();
|
|
101
|
+
this.pushWorker.addEventListener(this.onPush);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
disableManagedPushSupport() {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
var _a;
|
|
107
|
+
this.instanceController.toggleCapability(models_1.Capability.Push, false);
|
|
108
|
+
this.isUsingManagedPush = false;
|
|
109
|
+
yield ((_a = this.pushWorker) === null || _a === void 0 ? void 0 : _a.unregister());
|
|
110
|
+
this.pushWorker = undefined;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
failed(reason) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
this.clientEvent.onEvent({ eventType: "failed", context: reason });
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
setupPush(instance, applicationServerKey) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
if (!applicationServerKey)
|
|
121
|
+
throw new fsm_1.InvalidOperationError("Missing public VAPID key");
|
|
122
|
+
if (this.pushWorker) {
|
|
123
|
+
// todo: this key should be populated from the instanceConfig once the push backend is ready, for now fallback on hardcoded.
|
|
124
|
+
yield this.pushWorker.start(applicationServerKey, instance);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
createAndSetUpCallReporter(instance) {
|
|
129
|
+
return new CallReporter_1.CallReporter(this.userId, instance, this.apiClient);
|
|
130
|
+
}
|
|
131
|
+
started(instance, config) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
var _a;
|
|
134
|
+
try {
|
|
135
|
+
if (this.instanceController.authentication) {
|
|
136
|
+
const instanceConfig = config !== null && config !== void 0 ? config : (yield this.apiClient.getConfig({
|
|
137
|
+
instanceId: instance.id,
|
|
138
|
+
userId: this.userId,
|
|
139
|
+
}));
|
|
140
|
+
this.instanceConfigJson = JSON.stringify(instanceConfig);
|
|
141
|
+
this.setupConfigCheck(instance, instanceConfig);
|
|
142
|
+
this.instanceController.setUpdateInstanceTtlWindow(instanceConfig.updateInstanceTtlWindowDays);
|
|
143
|
+
this.apiClient.setUpdateInstanceTtlWindow(instanceConfig.updateInstanceTtlWindowDays);
|
|
144
|
+
yield this.instanceController.prolongInstanceIfNeeded();
|
|
145
|
+
this.addTurnListener(this.instanceController);
|
|
146
|
+
const fetchIceServers = (0, IceServer_1.createIceServerFetcher)(this.apiClient, this.userId, instance.id);
|
|
147
|
+
this.features.setUserInstance(this.userId, instance.id, this.applicationKey);
|
|
148
|
+
const callReporter = this.createAndSetUpCallReporter(instance);
|
|
149
|
+
if (this.features.shouldRefresh()) {
|
|
150
|
+
yield this.features.refresh(this.apiClient);
|
|
151
|
+
}
|
|
152
|
+
if (this.isUsingManagedPush) {
|
|
153
|
+
yield this.setupPush(instance, (_a = instanceConfig.pushConfig) === null || _a === void 0 ? void 0 : _a.w3cApplicationServerKey);
|
|
154
|
+
}
|
|
155
|
+
this.defaultCallClient.init(this, instanceConfig.rtcProfile, instanceConfig.rtcConfig, fetchIceServers, callReporter, this.pushService, this.useRelayIceCandidatesOnly, this.features, instance.id, this.callerIdentifier);
|
|
156
|
+
this.isClientStarted = true;
|
|
157
|
+
this.onStartedAction.splice(0).forEach((a) => a());
|
|
158
|
+
this.clientEvent.onEvent({ eventType: "started" });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
this.failed(error).catch(() => {
|
|
163
|
+
console.error(error);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
setupConfigCheck(instance, instanceConfig) {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
const configUpdater = () => __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
var _a;
|
|
172
|
+
const newInstanceConfig = yield this.apiClient.getConfig({
|
|
173
|
+
instanceId: instance.id,
|
|
174
|
+
userId: this.userId,
|
|
175
|
+
});
|
|
176
|
+
const newInstanceConfigJson = JSON.stringify(newInstanceConfig);
|
|
177
|
+
if (this.instanceConfigJson !== newInstanceConfigJson) {
|
|
178
|
+
this.clearInstanceConfigUpdateInterval();
|
|
179
|
+
// eslint-disable-next-line no-constant-condition
|
|
180
|
+
while (true) {
|
|
181
|
+
if (!((_a = this.defaultCallClient.getInstance()) === null || _a === void 0 ? void 0 : _a.hasActiveCall())) {
|
|
182
|
+
console.log("New instance config - restarting client");
|
|
183
|
+
this.terminate();
|
|
184
|
+
this.start(newInstanceConfig);
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
yield utils_1.PromiseHelper.sleep(1000);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
const interval = setInterval(configUpdater, instanceConfig.configRefreshIntervalMs);
|
|
192
|
+
this.instanceConfigUpdateInterval = (_b = (_a = interval.unref) === null || _a === void 0 ? void 0 : _a.call(interval)) !== null && _b !== void 0 ? _b : interval;
|
|
193
|
+
}
|
|
194
|
+
clearInstanceConfigUpdateInterval() {
|
|
195
|
+
if (this.instanceConfigUpdateInterval != null) {
|
|
196
|
+
clearInterval(this.instanceConfigUpdateInterval);
|
|
197
|
+
this.instanceConfigUpdateInterval = undefined;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
addListener(listener) {
|
|
201
|
+
this.clientEvent.addListener(listener);
|
|
202
|
+
}
|
|
203
|
+
removeListener(listener) {
|
|
204
|
+
this.clientEvent.removeListener(listener);
|
|
205
|
+
}
|
|
206
|
+
initiateCall(request) {
|
|
207
|
+
if (this.isClientStarted) {
|
|
208
|
+
return this.apiClient.initiateCall(request);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
throw new fsm_1.InvalidOperationError("Can not initiate a call before authentication");
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
get callClient() {
|
|
215
|
+
return this.defaultCallClient;
|
|
216
|
+
}
|
|
217
|
+
terminate() {
|
|
218
|
+
this.isClientStarted = false;
|
|
219
|
+
this.instanceController.terminate();
|
|
220
|
+
this.clearInstanceConfigUpdateInterval();
|
|
221
|
+
this.features.resetListeners();
|
|
222
|
+
this.clientEvent.onEvent({ eventType: "terminated" });
|
|
223
|
+
}
|
|
224
|
+
get localUserId() {
|
|
225
|
+
return this.userId;
|
|
226
|
+
}
|
|
227
|
+
isStarted() {
|
|
228
|
+
return this.isClientStarted;
|
|
229
|
+
}
|
|
230
|
+
relayRemotePushNotification(payload) {
|
|
231
|
+
const result = new push_1.DefaultNotificationResult(payload.sinch, payload.name);
|
|
232
|
+
if (result.isValid()) {
|
|
233
|
+
if (this.isStarted()) {
|
|
234
|
+
this.defaultCallClient.handleCallPushPayload(result);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
this.onStartedAction.push(() => this.defaultCallClient.handleCallPushPayload(result));
|
|
238
|
+
this.start();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return result;
|
|
242
|
+
}
|
|
243
|
+
showPushNotification(title, options) {
|
|
244
|
+
var _a;
|
|
245
|
+
(_a = this.pushWorker) === null || _a === void 0 ? void 0 : _a.showNotification(title, options);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
exports.DefaultSinchClient = DefaultSinchClient;
|
|
249
|
+
DefaultSinchClient.OCRA_PATH = "/ocra";
|
|
250
|
+
// Export as standalone to global scope
|
|
251
|
+
if (typeof window !== "undefined")
|
|
252
|
+
window.SinchClient = DefaultSinchClient;
|
|
253
|
+
//# sourceMappingURL=DefaultSinchClient.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MediaStreamFactory } from "./rtc/MediaStreamFactory";
|
|
2
|
+
import { SinchClient } from "./SinchClient";
|
|
3
|
+
import { SinchClientBuilder } from "./SinchClientBuilder";
|
|
4
|
+
export declare class DefaultSinchClientBuilder implements SinchClientBuilder {
|
|
5
|
+
private clientUserId?;
|
|
6
|
+
private clientApplicationKey?;
|
|
7
|
+
private clientEnvironmentHost?;
|
|
8
|
+
private clientCallerIdentifier?;
|
|
9
|
+
private clientVideoConstraints?;
|
|
10
|
+
private clientFetchApi?;
|
|
11
|
+
private clientMediaStreamFactory?;
|
|
12
|
+
userId(userId: string): SinchClientBuilder;
|
|
13
|
+
applicationKey(applicationKey: string): SinchClientBuilder;
|
|
14
|
+
environmentHost(environmentHost: string): SinchClientBuilder;
|
|
15
|
+
callerIdentifier(callerIdentifier: string): SinchClientBuilder;
|
|
16
|
+
fetchApi(fetchApi: (input: RequestInfo, init?: RequestInit) => Promise<Response>): SinchClientBuilder;
|
|
17
|
+
mediaStreamFactory(mediaStreamFactory: MediaStreamFactory): SinchClientBuilder;
|
|
18
|
+
videoConfiguration(videoConstraints: MediaTrackConstraints): SinchClientBuilder;
|
|
19
|
+
silentMediaStream(): SinchClientBuilder;
|
|
20
|
+
private getDefaultMediaStreamFactory;
|
|
21
|
+
build(): SinchClient;
|
|
22
|
+
}
|