@stream-io/node-sdk 0.2.2 → 0.2.4
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/dist/index.cjs.js +11 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11 -3
- package/dist/index.es.js.map +1 -1
- package/dist/src/StreamCall.d.ts +2 -1
- package/dist/src/StreamVideoClient.d.ts +2 -1
- package/package.json +1 -1
- package/src/StreamCall.ts +5 -0
- package/src/StreamClient.ts +4 -4
- package/src/StreamVideoClient.ts +9 -0
package/dist/index.es.js
CHANGED
|
@@ -8358,6 +8358,9 @@ class StreamCall {
|
|
|
8358
8358
|
this.getOrCreate = (videoGetOrCreateCallRequest) => {
|
|
8359
8359
|
return this.apiClient.getOrCreateCall(Object.assign(Object.assign({}, this.baseRequest), { videoGetOrCreateCallRequest: videoGetOrCreateCallRequest !== null && videoGetOrCreateCallRequest !== void 0 ? videoGetOrCreateCallRequest : {} }));
|
|
8360
8360
|
};
|
|
8361
|
+
this.getSessionStatistics = (request) => {
|
|
8362
|
+
return this.apiClient.getCallStats(Object.assign(Object.assign({}, this.baseRequest), request));
|
|
8363
|
+
};
|
|
8361
8364
|
this.create = (getOrCreateCallRequest) => {
|
|
8362
8365
|
return this.getOrCreate(getOrCreateCallRequest);
|
|
8363
8366
|
};
|
|
@@ -8443,6 +8446,11 @@ class StreamVideoClient {
|
|
|
8443
8446
|
videoQueryCallsRequest: request !== null && request !== void 0 ? request : {},
|
|
8444
8447
|
});
|
|
8445
8448
|
};
|
|
8449
|
+
this.queryCallStatistics = (videoQueryCallStatsRequest) => {
|
|
8450
|
+
return this.apiClient.queryCallStats({
|
|
8451
|
+
videoQueryCallStatsRequest: videoQueryCallStatsRequest !== null && videoQueryCallStatsRequest !== void 0 ? videoQueryCallStatsRequest : {},
|
|
8452
|
+
});
|
|
8453
|
+
};
|
|
8446
8454
|
this.createCallType = (videoCreateCallTypeRequest) => {
|
|
8447
8455
|
return this.apiClient.createCallType({
|
|
8448
8456
|
videoCreateCallTypeRequest,
|
|
@@ -8735,7 +8743,7 @@ class StreamClient {
|
|
|
8735
8743
|
? 'https://chat.stream-io-api.com'
|
|
8736
8744
|
: 'https://video.stream-io-api.com'),
|
|
8737
8745
|
headers: {
|
|
8738
|
-
'X-Stream-Client': 'stream-node-' + "0.2.
|
|
8746
|
+
'X-Stream-Client': 'stream-node-' + "0.2.4",
|
|
8739
8747
|
},
|
|
8740
8748
|
middleware: [
|
|
8741
8749
|
{
|
|
@@ -8862,7 +8870,7 @@ class StreamClient {
|
|
|
8862
8870
|
* @param call_cids this parameter is deprecated use `createCallToken` for call tokens
|
|
8863
8871
|
* @returns
|
|
8864
8872
|
*/
|
|
8865
|
-
createToken(userID, exp = Math.round(
|
|
8873
|
+
createToken(userID, exp = Math.round(Date.now() / 1000) + 60 * 60, iat = Math.floor((Date.now() - 1000) / 1000), call_cids) {
|
|
8866
8874
|
const payload = {
|
|
8867
8875
|
user_id: userID,
|
|
8868
8876
|
exp,
|
|
@@ -8882,7 +8890,7 @@ class StreamClient {
|
|
|
8882
8890
|
* @param iat this is deprecated, the current date will be set internally
|
|
8883
8891
|
* @returns
|
|
8884
8892
|
*/
|
|
8885
|
-
createCallToken(userIdOrObject, call_cids, exp = Math.round(
|
|
8893
|
+
createCallToken(userIdOrObject, call_cids, exp = Math.round(Date.now() / 1000) + 60 * 60, iat = Math.floor((Date.now() - 1000) / 1000)) {
|
|
8886
8894
|
const payload = {
|
|
8887
8895
|
exp,
|
|
8888
8896
|
iat,
|