@stream-io/video-client 0.0.35 → 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,25 @@
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
+
17
+ ### [0.0.36](https://github.com/GetStream/stream-video-js/compare/client0.0.35...client0.0.36) (2023-07-05)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * wait for connection ok for all API requests ([#752](https://github.com/GetStream/stream-video-js/issues/752)) ([82f441d](https://github.com/GetStream/stream-video-js/commit/82f441d5fb84ddc2c16fb97ca362e05fff78b4dd))
23
+
5
24
  ### [0.0.35](https://github.com/GetStream/stream-video-js/compare/client0.0.34...client0.0.35) (2023-07-05)
6
25
 
7
26
 
@@ -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
@@ -8488,7 +8463,6 @@ const registerRingingCallEventHandlers = (call) => {
8488
8463
  * @param data the data for the call.
8489
8464
  */
8490
8465
  const join = (httpClient, type, id, data) => __awaiter(void 0, void 0, void 0, function* () {
8491
- yield httpClient.connectionIdPromise;
8492
8466
  const joinCallResponse = yield doJoin(httpClient, type, id, data);
8493
8467
  const { call, credentials, members, own_capabilities } = joinCallResponse;
8494
8468
  return {
@@ -11484,7 +11458,10 @@ class StreamClient {
11484
11458
  if (this.waitForConnectPromise) {
11485
11459
  yield this.waitForConnectPromise;
11486
11460
  }
11487
- yield this.tokenManager.tokenReady();
11461
+ yield Promise.all([
11462
+ this.tokenManager.tokenReady(),
11463
+ this.connectionIdPromise,
11464
+ ]);
11488
11465
  }
11489
11466
  const requestConfig = this._enrichAxiosOptions(options);
11490
11467
  try {
@@ -11833,7 +11810,7 @@ class StreamClient {
11833
11810
  }
11834
11811
  getUserAgent() {
11835
11812
  return (this.userAgent ||
11836
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.34"}`);
11813
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.36"}`);
11837
11814
  }
11838
11815
  setUserAgent(userAgent) {
11839
11816
  this.userAgent = userAgent;
@@ -11952,15 +11929,13 @@ class StreamVideoClient {
11952
11929
  *
11953
11930
  * @param type the type of the call.
11954
11931
  * @param id the id of the call, if not provided a unique random value is used
11955
- * @param {boolean} [ringing] whether the call should be created in the ringing state.
11956
11932
  */
11957
- this.call = (type, id, ringing) => {
11933
+ this.call = (type, id) => {
11958
11934
  return new Call({
11959
11935
  streamClient: this.streamClient,
11960
11936
  id: id,
11961
11937
  type: type,
11962
11938
  clientStore: this.writeableStateStore,
11963
- ringing,
11964
11939
  });
11965
11940
  };
11966
11941
  /**
@@ -11977,8 +11952,6 @@ class StreamVideoClient {
11977
11952
  * @param data the query data.
11978
11953
  */
11979
11954
  this.queryCalls = (data) => __awaiter(this, void 0, void 0, function* () {
11980
- if (data.watch)
11981
- yield this.streamClient.connectionIdPromise;
11982
11955
  const response = yield this.streamClient.post('/calls', data);
11983
11956
  const calls = response.calls.map((c) => {
11984
11957
  const call = new Call({
@@ -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