@stream-io/video-client 0.7.0 → 0.7.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/CHANGELOG.md +7 -0
- package/dist/index.browser.es.js +48 -1
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +48 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +48 -1
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +13 -1
- package/dist/src/gen/coordinator/index.d.ts +58 -0
- package/dist/src/stats/utils.d.ts +11 -0
- package/package.json +1 -1
- package/src/Call.ts +53 -0
- package/src/gen/coordinator/index.ts +58 -0
- package/src/stats/utils.ts +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [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)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* user feedback ([#1310](https://github.com/GetStream/stream-video-js/issues/1310)) ([256b775](https://github.com/GetStream/stream-video-js/commit/256b7756e89b261e0efa37952611139bf94a641e))
|
|
11
|
+
|
|
5
12
|
## [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
13
|
|
|
7
14
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -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.
|
|
14464
|
+
const version = "0.7.1" ;
|
|
14418
14465
|
return (this.userAgent ||
|
|
14419
14466
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
14420
14467
|
};
|