@stream-io/video-client 0.0.36 → 0.0.37

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.0.37](https://github.com/GetStream/stream-video-js/compare/client0.0.36...client0.0.37) (2023-07-06)
6
+
7
+
8
+ ### Features
9
+
10
+ * Remove ringing flag from call client ([#755](https://github.com/GetStream/stream-video-js/issues/755)) ([b78c605](https://github.com/GetStream/stream-video-js/commit/b78c60500e06b39fb4dce623bde6f7b10acdd8c1)), closes [/github.com/GetStream/stream-video-android/blob/develop/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/VideoPushDelegate.kt#L82](https://github.com/GetStream//github.com/GetStream/stream-video-android/blob/develop/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/VideoPushDelegate.kt/issues/L82)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * restore CallUserMuted event ([#759](https://github.com/GetStream/stream-video-js/issues/759)) ([caf43bb](https://github.com/GetStream/stream-video-js/commit/caf43bb0a8246aeb9c94ea2e0cc3d32e9a43fef1))
16
+
5
17
  ### [0.0.36](https://github.com/GetStream/stream-video-js/compare/client0.0.35...client0.0.36) (2023-07-05)
6
18
 
7
19
 
@@ -14,39 +14,14 @@ import { fromByteArray } from 'base64-js';
14
14
  /**
15
15
  * @export
16
16
  */
17
- const APIErrorCodeEnum = {
18
- INTERNAL_ERROR: 'internal-error',
19
- ACCESS_KEY_ERROR: 'access-key-error',
20
- INPUT_ERROR: 'input-error',
21
- AUTH_FAILED: 'auth-failed',
22
- DUPLICATE_USERNAME: 'duplicate-username',
23
- RATE_LIMITED: 'rate-limited',
24
- NOT_FOUND: 'not-found',
25
- NOT_ALLOWED: 'not-allowed',
26
- EVENT_NOT_SUPPORTED: 'event-not-supported',
27
- CHANNEL_FEATURE_NOT_SUPPORTED: 'channel-feature-not-supported',
28
- MESSAGE_TOO_LONG: 'message-too-long',
29
- MULTIPLE_NESTING_LEVEL: 'multiple-nesting-level',
30
- PAYLOAD_TOO_BIG: 'payload-too-big',
31
- EXPIRED_TOKEN: 'expired-token',
32
- TOKEN_NOT_VALID_YET: 'token-not-valid-yet',
33
- TOKEN_USED_BEFORE_IAT: 'token-used-before-iat',
34
- INVALID_TOKEN_SIGNATURE: 'invalid-token-signature',
35
- CUSTOM_COMMAND_ENDPOINT_MISSING: 'custom-command-endpoint-missing',
36
- CUSTOM_COMMAND_ENDPOINTCALL_ERROR: 'custom-command-endpoint=call-error',
37
- CONNECTION_ID_NOT_FOUND: 'connection-id-not-found',
38
- COOL_DOWN: 'cool-down',
39
- QUERY_CHANNEL_PERMISSIONS_MISMATCH: 'query-channel-permissions-mismatch',
40
- TOO_MANY_CONNECTIONS: 'too-many-connections',
41
- NOT_SUPPORTED_IN_PUSH_V1: 'not-supported-in-push-v1',
42
- MODERATION_FAILED: 'moderation-failed',
43
- VIDEO_PROVIDER_NOT_CONFIGURED: 'video-provider-not-configured',
44
- VIDEO_INVALID_CALL_ID: 'video-invalid-call-id',
45
- VIDEO_CREATE_CALL_FAILED: 'video-create-call-failed',
46
- APP_SUSPENDED: 'app-suspended',
47
- VIDEO_NO_DATACENTERS_AVAILABLE: 'video-no-datacenters-available',
48
- VIDEO_JOIN_CALL_FAILURE: 'video-join-call-failure',
49
- QUERY_CALLS_PERMISSIONS_MISMATCH: 'query-calls-permissions-mismatch',
17
+ const AudioSettingsDefaultDeviceEnum = {
18
+ SPEAKER: 'speaker',
19
+ };
20
+ /**
21
+ * @export
22
+ */
23
+ const AudioSettingsRequestDefaultDeviceEnum = {
24
+ SPEAKER: 'speaker',
50
25
  };
51
26
  /**
52
27
  * @export
@@ -11835,7 +11810,7 @@ class StreamClient {
11835
11810
  }
11836
11811
  getUserAgent() {
11837
11812
  return (this.userAgent ||
11838
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.35"}`);
11813
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.36"}`);
11839
11814
  }
11840
11815
  setUserAgent(userAgent) {
11841
11816
  this.userAgent = userAgent;
@@ -11954,15 +11929,13 @@ class StreamVideoClient {
11954
11929
  *
11955
11930
  * @param type the type of the call.
11956
11931
  * @param id the id of the call, if not provided a unique random value is used
11957
- * @param {boolean} [ringing] whether the call should be created in the ringing state.
11958
11932
  */
11959
- this.call = (type, id, ringing) => {
11933
+ this.call = (type, id) => {
11960
11934
  return new Call({
11961
11935
  streamClient: this.streamClient,
11962
11936
  id: id,
11963
11937
  type: type,
11964
11938
  clientStore: this.writeableStateStore,
11965
- ringing,
11966
11939
  });
11967
11940
  };
11968
11941
  /**
@@ -12051,6 +12024,29 @@ class StreamVideoClient {
12051
12024
  this.removeDevice = (id, userID) => __awaiter(this, void 0, void 0, function* () {
12052
12025
  return yield this.streamClient.delete('/devices', Object.assign({ id }, (userID ? { user_id: userID } : {})));
12053
12026
  });
12027
+ /**
12028
+ * A callback that can be used to create ringing calls from push notifications. If the call already exists, it will do nothing.
12029
+ * @param call_cid
12030
+ * @returns
12031
+ */
12032
+ this.onRingingCall = (call_cid) => __awaiter(this, void 0, void 0, function* () {
12033
+ // if we find the call and is already ringing, we don't need to create a new call
12034
+ // as client would have received the call.ring state because the app had WS alive when receiving push notifications
12035
+ let call = this.readOnlyStateStore.calls.find((c) => c.cid === call_cid && c.ringing);
12036
+ if (!call) {
12037
+ // if not it means that WS is not alive when receiving the push notifications and we need to fetch the call
12038
+ const [callType, callId] = call_cid.split(':');
12039
+ call = new Call({
12040
+ streamClient: this.streamClient,
12041
+ type: callType,
12042
+ id: callId,
12043
+ clientStore: this.writeableStateStore,
12044
+ ringing: true,
12045
+ });
12046
+ yield call.get();
12047
+ }
12048
+ return call;
12049
+ });
12054
12050
  /**
12055
12051
  * Connects the given anonymous user to the client.
12056
12052
  *
@@ -12560,5 +12556,5 @@ var browsers = /*#__PURE__*/Object.freeze({
12560
12556
  isSafari: isSafari
12561
12557
  });
12562
12558
 
12563
- export { APIErrorCodeEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CreateDeviceRequestPushProviderEnum, DebounceType, ErrorFromResponse, OwnCapability, RecordSettingsModeEnum, RecordSettingsQualityEnum, RecordSettingsRequestModeEnum, RecordSettingsRequestQualityEnum, rxUtils as RxUtils, events as SfuEvents, models as SfuModels, StreamSfuClient, StreamVideoClient, StreamVideoReadOnlyStateStore, StreamVideoWriteableStateStore, TranscriptionSettingsModeEnum, TranscriptionSettingsRequestModeEnum, VideoSettingsCameraFacingEnum, VideoSettingsRequestCameraFacingEnum, ViewportTracker, VisibilityState, checkIfAudioOutputChangeSupported, combineComparators, conditional, createSoundDetector, defaultSortPreset, descending, disposeOfMediaStream, dominantSpeaker, getAudioDevices, getAudioOutputDevices, getAudioStream, getClientDetails, getDeviceInfo, getLogger, getOSInfo, getScreenShareStream, getSdkInfo, getVideoDevices, getVideoStream, isStreamVideoLocalParticipant, livestreamOrAudioRoomSortPreset, logLevels, logToConsole, name, noopComparator, pinned, publishingAudio, publishingVideo, reactionType, role, screenSharing, setDeviceInfo, setLogLevel, setLogger, setOSInfo, setSdkInfo, speakerLayoutSortPreset, speaking, watchForAddedDefaultAudioDevice, watchForAddedDefaultAudioOutputDevice, watchForAddedDefaultVideoDevice, watchForDisconnectedAudioDevice, watchForDisconnectedAudioOutputDevice, watchForDisconnectedVideoDevice };
12559
+ export { AudioSettingsDefaultDeviceEnum, AudioSettingsRequestDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CreateDeviceRequestPushProviderEnum, DebounceType, ErrorFromResponse, OwnCapability, RecordSettingsModeEnum, RecordSettingsQualityEnum, RecordSettingsRequestModeEnum, RecordSettingsRequestQualityEnum, rxUtils as RxUtils, events as SfuEvents, models as SfuModels, StreamSfuClient, StreamVideoClient, StreamVideoReadOnlyStateStore, StreamVideoWriteableStateStore, TranscriptionSettingsModeEnum, TranscriptionSettingsRequestModeEnum, VideoSettingsCameraFacingEnum, VideoSettingsRequestCameraFacingEnum, ViewportTracker, VisibilityState, checkIfAudioOutputChangeSupported, combineComparators, conditional, createSoundDetector, defaultSortPreset, descending, disposeOfMediaStream, dominantSpeaker, getAudioDevices, getAudioOutputDevices, getAudioStream, getClientDetails, getDeviceInfo, getLogger, getOSInfo, getScreenShareStream, getSdkInfo, getVideoDevices, getVideoStream, isStreamVideoLocalParticipant, livestreamOrAudioRoomSortPreset, logLevels, logToConsole, name, noopComparator, pinned, publishingAudio, publishingVideo, reactionType, role, screenSharing, setDeviceInfo, setLogLevel, setLogger, setOSInfo, setSdkInfo, speakerLayoutSortPreset, speaking, watchForAddedDefaultAudioDevice, watchForAddedDefaultAudioOutputDevice, watchForAddedDefaultVideoDevice, watchForDisconnectedAudioDevice, watchForDisconnectedAudioOutputDevice, watchForDisconnectedVideoDevice };
12564
12560
  //# sourceMappingURL=index.browser.es.js.map