@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.cjs.js
CHANGED
|
@@ -8360,6 +8360,9 @@ class StreamCall {
|
|
|
8360
8360
|
this.getOrCreate = (videoGetOrCreateCallRequest) => {
|
|
8361
8361
|
return this.apiClient.getOrCreateCall(Object.assign(Object.assign({}, this.baseRequest), { videoGetOrCreateCallRequest: videoGetOrCreateCallRequest !== null && videoGetOrCreateCallRequest !== void 0 ? videoGetOrCreateCallRequest : {} }));
|
|
8362
8362
|
};
|
|
8363
|
+
this.getSessionStatistics = (request) => {
|
|
8364
|
+
return this.apiClient.getCallStats(Object.assign(Object.assign({}, this.baseRequest), request));
|
|
8365
|
+
};
|
|
8363
8366
|
this.create = (getOrCreateCallRequest) => {
|
|
8364
8367
|
return this.getOrCreate(getOrCreateCallRequest);
|
|
8365
8368
|
};
|
|
@@ -8445,6 +8448,11 @@ class StreamVideoClient {
|
|
|
8445
8448
|
videoQueryCallsRequest: request !== null && request !== void 0 ? request : {},
|
|
8446
8449
|
});
|
|
8447
8450
|
};
|
|
8451
|
+
this.queryCallStatistics = (videoQueryCallStatsRequest) => {
|
|
8452
|
+
return this.apiClient.queryCallStats({
|
|
8453
|
+
videoQueryCallStatsRequest: videoQueryCallStatsRequest !== null && videoQueryCallStatsRequest !== void 0 ? videoQueryCallStatsRequest : {},
|
|
8454
|
+
});
|
|
8455
|
+
};
|
|
8448
8456
|
this.createCallType = (videoCreateCallTypeRequest) => {
|
|
8449
8457
|
return this.apiClient.createCallType({
|
|
8450
8458
|
videoCreateCallTypeRequest,
|
|
@@ -8737,7 +8745,7 @@ class StreamClient {
|
|
|
8737
8745
|
? 'https://chat.stream-io-api.com'
|
|
8738
8746
|
: 'https://video.stream-io-api.com'),
|
|
8739
8747
|
headers: {
|
|
8740
|
-
'X-Stream-Client': 'stream-node-' + "0.2.
|
|
8748
|
+
'X-Stream-Client': 'stream-node-' + "0.2.4",
|
|
8741
8749
|
},
|
|
8742
8750
|
middleware: [
|
|
8743
8751
|
{
|
|
@@ -8864,7 +8872,7 @@ class StreamClient {
|
|
|
8864
8872
|
* @param call_cids this parameter is deprecated use `createCallToken` for call tokens
|
|
8865
8873
|
* @returns
|
|
8866
8874
|
*/
|
|
8867
|
-
createToken(userID, exp = Math.round(
|
|
8875
|
+
createToken(userID, exp = Math.round(Date.now() / 1000) + 60 * 60, iat = Math.floor((Date.now() - 1000) / 1000), call_cids) {
|
|
8868
8876
|
const payload = {
|
|
8869
8877
|
user_id: userID,
|
|
8870
8878
|
exp,
|
|
@@ -8884,7 +8892,7 @@ class StreamClient {
|
|
|
8884
8892
|
* @param iat this is deprecated, the current date will be set internally
|
|
8885
8893
|
* @returns
|
|
8886
8894
|
*/
|
|
8887
|
-
createCallToken(userIdOrObject, call_cids, exp = Math.round(
|
|
8895
|
+
createCallToken(userIdOrObject, call_cids, exp = Math.round(Date.now() / 1000) + 60 * 60, iat = Math.floor((Date.now() - 1000) / 1000)) {
|
|
8888
8896
|
const payload = {
|
|
8889
8897
|
exp,
|
|
8890
8898
|
iat,
|