@stream-io/video-client 0.7.0 → 0.7.2

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,20 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.7.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.1...@stream-io/video-client-0.7.2) (2024-04-16)
6
+
7
+
8
+ ### Features
9
+
10
+ * update coordinator models ([#1317](https://github.com/GetStream/stream-video-js/issues/1317)) ([cdbee74](https://github.com/GetStream/stream-video-js/commit/cdbee747f1730f6965315e7c9ea9426287ff0cfd))
11
+
12
+ ### [0.7.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.0...@stream-io/video-client-0.7.1) (2024-04-09)
13
+
14
+
15
+ ### Features
16
+
17
+ * user feedback ([#1310](https://github.com/GetStream/stream-video-js/issues/1310)) ([256b775](https://github.com/GetStream/stream-video-js/commit/256b7756e89b261e0efa37952611139bf94a641e))
18
+
5
19
  ## [0.7.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.6.10...@stream-io/video-client-0.7.0) (2024-04-09)
6
20
 
7
21
 
@@ -9239,6 +9239,22 @@ const flatten$1 = (report) => {
9239
9239
  });
9240
9240
  return stats;
9241
9241
  };
9242
+ const getSdkSignature = (clientDetails) => {
9243
+ const { sdk, ...platform } = clientDetails;
9244
+ const sdkName = sdk && sdk.type === SdkType.REACT
9245
+ ? 'stream-react'
9246
+ : sdk && sdk.type === SdkType.REACT_NATIVE
9247
+ ? 'stream-react-native'
9248
+ : 'stream-js';
9249
+ const sdkVersion = sdk
9250
+ ? `${sdk.major}.${sdk.minor}.${sdk.patch}`
9251
+ : '0.0.0-development';
9252
+ return {
9253
+ sdkName,
9254
+ sdkVersion,
9255
+ ...platform,
9256
+ };
9257
+ };
9242
9258
 
9243
9259
  /**
9244
9260
  * Creates a new StatsReporter instance that collects metrics about the ongoing call and reports them to the state store
@@ -12590,6 +12606,37 @@ class Call {
12590
12606
  const endpoint = `${this.streamClientBasePath}/stats/${callSessionID}`;
12591
12607
  return this.streamClient.get(endpoint);
12592
12608
  };
12609
+ /**
12610
+ * Submit user feedback for the call
12611
+ *
12612
+ * @param rating Rating between 1 and 5 denoting the experience of the user in the call
12613
+ * @param reason The reason/description for the rating
12614
+ * @param custom Custom data
12615
+ * @returns
12616
+ */
12617
+ this.submitFeedback = async (rating, { reason, custom, } = {}) => {
12618
+ if (rating < 1 || rating > 5) {
12619
+ throw new Error('Rating must be between 1 and 5');
12620
+ }
12621
+ const userSessionId = this.sfuClient?.sessionId;
12622
+ const callSessionId = this.state.session?.id;
12623
+ if (!callSessionId || !userSessionId) {
12624
+ throw new Error('Feedback can be submitted only in the context of a call session');
12625
+ }
12626
+ const { sdkName, sdkVersion, ...platform } = getSdkSignature(getClientDetails());
12627
+ const endpoint = `${this.streamClientBasePath}/feedback/${callSessionId}`;
12628
+ return this.streamClient.post(endpoint, {
12629
+ rating,
12630
+ reason,
12631
+ user_session_id: userSessionId,
12632
+ sdk: sdkName,
12633
+ sdk_version: sdkVersion,
12634
+ custom: {
12635
+ ...custom,
12636
+ 'x-stream-platform-data': platform,
12637
+ },
12638
+ });
12639
+ };
12593
12640
  /**
12594
12641
  * Sends a custom event to all call participants.
12595
12642
  *
@@ -14414,7 +14461,7 @@ class StreamClient {
14414
14461
  });
14415
14462
  };
14416
14463
  this.getUserAgent = () => {
14417
- const version = "0.7.0" ;
14464
+ const version = "0.7.2" ;
14418
14465
  return (this.userAgent ||
14419
14466
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14420
14467
  };