@stream-io/video-client 1.11.15 → 1.12.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.
@@ -1,7 +1,7 @@
1
1
  import { Call } from './Call';
2
2
  import { StreamClient } from './coordinator/connection/client';
3
3
  import { StreamVideoReadOnlyStateStore, StreamVideoWriteableStateStore } from './store';
4
- import type { ConnectedEvent, CreateDeviceRequest, CreateGuestRequest, CreateGuestResponse, GetEdgesResponse, ListDevicesResponse, QueryCallsRequest, QueryCallStatsRequest, QueryCallStatsResponse } from './gen/coordinator';
4
+ import type { ConnectedEvent, CreateDeviceRequest, CreateGuestRequest, CreateGuestResponse, GetEdgesResponse, ListDevicesResponse, QueryAggregateCallStatsRequest, QueryAggregateCallStatsResponse, QueryCallsRequest, QueryCallStatsRequest, QueryCallStatsResponse } from './gen/coordinator';
5
5
  import { AllClientEvents, ClientEventListener, Logger, LogLevel, StreamClientOptions, TokenOrProvider, TokenProvider, User, UserWithId } from './coordinator/connection/types';
6
6
  /**
7
7
  * A `StreamVideoClient` instance lets you communicate with our API, and authenticate users.
@@ -111,6 +111,13 @@ export declare class StreamVideoClient {
111
111
  * @returns List with summary of available call reports matching the condition.
112
112
  */
113
113
  queryCallStats: (data?: QueryCallStatsRequest) => Promise<QueryCallStatsResponse>;
114
+ /**
115
+ * Retrieve the list of available reports aggregated from the call stats.
116
+ *
117
+ * @param data Specify filter conditions like from and to (within last 30 days) and the report types
118
+ * @returns Requested reports with (mostly) raw daily data for each report type requested
119
+ */
120
+ queryAggregateCallStats: (data?: QueryAggregateCallStatsRequest) => Promise<QueryAggregateCallStatsResponse>;
114
121
  /**
115
122
  * Returns a list of available data centers available for hosting calls.
116
123
  */
@@ -1,3 +1,4 @@
1
+ import type { Bound, DailyAggregateCallStatsResponse } from '../shims';
1
2
  /**
2
3
  *
3
4
  * @export
@@ -481,6 +482,32 @@ export interface CallDeletedEvent {
481
482
  */
482
483
  type: string;
483
484
  }
485
+ /**
486
+ *
487
+ * @export
488
+ * @interface CallDurationReportResponse
489
+ */
490
+ export interface CallDurationReportResponse {
491
+ /**
492
+ *
493
+ * @type {Array<DailyAggregateCallStatsResponse<CallDurationReport>>}
494
+ * @memberof CallDurationReportResponse
495
+ */
496
+ daily: Array<DailyAggregateCallStatsResponse<CallDurationReport>>;
497
+ }
498
+ /**
499
+ *
500
+ * @export
501
+ * @interface CallDurationReport
502
+ */
503
+ export interface CallDurationReport {
504
+ /**
505
+ *
506
+ * @type {Array<ReportByHistogramBucket>}
507
+ * @memberof CallDurationReport
508
+ */
509
+ histogram: Array<ReportByHistogramBucket>;
510
+ }
484
511
  /**
485
512
  * This event is sent when a call is mark as ended for all its participants. Clients receiving this event should leave the call screen
486
513
  * @export
@@ -971,6 +998,32 @@ export interface CallParticipantResponse {
971
998
  */
972
999
  user_session_id: string;
973
1000
  }
1001
+ /**
1002
+ *
1003
+ * @export
1004
+ * @interface CallParticipantCountReportResponse
1005
+ */
1006
+ export interface CallParticipantCountReportResponse {
1007
+ /**
1008
+ *
1009
+ * @type {Array<DailyAggregateCallStatsResponse<CallParticipantCountReport>>}
1010
+ * @memberof CallParticipantCountReportResponse
1011
+ */
1012
+ daily: Array<DailyAggregateCallStatsResponse<CallParticipantCountReport>>;
1013
+ }
1014
+ /**
1015
+ *
1016
+ * @export
1017
+ * @interface CallParticipantCountReport
1018
+ */
1019
+ export interface CallParticipantCountReport {
1020
+ /**
1021
+ *
1022
+ * @type {Array<ReportByHistogramBucket>}
1023
+ * @memberof CallParticipantCountReport
1024
+ */
1025
+ histogram: Array<ReportByHistogramBucket>;
1026
+ }
974
1027
  /**
975
1028
  * This event is sent when a reaction is sent in a call, clients should use this to show the reaction in the call screen
976
1029
  * @export
@@ -1843,6 +1896,32 @@ export interface CallSettingsResponse {
1843
1896
  */
1844
1897
  video: VideoSettingsResponse;
1845
1898
  }
1899
+ /**
1900
+ *
1901
+ * @export
1902
+ * @interface CallsPerDayReportResponse
1903
+ */
1904
+ export interface CallsPerDayReportResponse {
1905
+ /**
1906
+ *
1907
+ * @type {Array<DailyAggregateCallStatsResponse<CallsPerDayReport>>}
1908
+ * @memberof CallsPerDayReportResponse
1909
+ */
1910
+ daily: Array<DailyAggregateCallStatsResponse<CallsPerDayReport>>;
1911
+ }
1912
+ /**
1913
+ *
1914
+ * @export
1915
+ * @interface CallsPerDayReport
1916
+ */
1917
+ export interface CallsPerDayReport {
1918
+ /**
1919
+ *
1920
+ * @type {number}
1921
+ * @memberof CallsPerDayReport
1922
+ */
1923
+ count: number;
1924
+ }
1846
1925
  /**
1847
1926
  *
1848
1927
  * @export
@@ -3432,6 +3511,12 @@ export interface GetCallResponse {
3432
3511
  * @interface GetCallStatsResponse
3433
3512
  */
3434
3513
  export interface GetCallStatsResponse {
3514
+ /**
3515
+ *
3516
+ * @type {number}
3517
+ * @memberof GetCallStatsResponse
3518
+ */
3519
+ average_connection_time?: number;
3435
3520
  /**
3436
3521
  *
3437
3522
  * @type {number}
@@ -4229,6 +4314,37 @@ export interface MuteUsersResponse {
4229
4314
  */
4230
4315
  duration: string;
4231
4316
  }
4317
+ /**
4318
+ *
4319
+ * @export
4320
+ * @interface NetworkMetricsReportResponse
4321
+ */
4322
+ export interface NetworkMetricsReportResponse {
4323
+ /**
4324
+ *
4325
+ * @type {number}
4326
+ * @memberof NetworkMetricsReportResponse
4327
+ */
4328
+ average_connection_time?: number;
4329
+ /**
4330
+ *
4331
+ * @type {number}
4332
+ * @memberof NetworkMetricsReportResponse
4333
+ */
4334
+ average_jitter?: number;
4335
+ /**
4336
+ *
4337
+ * @type {number}
4338
+ * @memberof NetworkMetricsReportResponse
4339
+ */
4340
+ average_latency?: number;
4341
+ /**
4342
+ *
4343
+ * @type {number}
4344
+ * @memberof NetworkMetricsReportResponse
4345
+ */
4346
+ average_time_to_reconnect?: number;
4347
+ }
4232
4348
  /**
4233
4349
  *
4234
4350
  * @export
@@ -4678,6 +4794,27 @@ export interface PermissionRequestEvent {
4678
4794
  */
4679
4795
  user: UserResponse;
4680
4796
  }
4797
+ /**
4798
+ *
4799
+ * @export
4800
+ * @interface PerSDKUsageReport
4801
+ */
4802
+ export interface PerSDKUsageReport {
4803
+ /**
4804
+ *
4805
+ * @type {{ [key: string]: number; }}
4806
+ * @memberof PerSDKUsageReport
4807
+ */
4808
+ by_version: {
4809
+ [key: string]: number;
4810
+ };
4811
+ /**
4812
+ *
4813
+ * @type {number}
4814
+ * @memberof PerSDKUsageReport
4815
+ */
4816
+ total: number;
4817
+ }
4681
4818
  /**
4682
4819
  *
4683
4820
  * @export
@@ -4830,6 +4967,112 @@ export interface PushNotificationSettingsResponse {
4830
4967
  */
4831
4968
  disabled_until?: string;
4832
4969
  }
4970
+ /**
4971
+ *
4972
+ * @export
4973
+ * @interface QualityScoreReportResponse
4974
+ */
4975
+ export interface QualityScoreReportResponse {
4976
+ /**
4977
+ *
4978
+ * @type {Array<DailyAggregateCallStatsResponse<QualityScoreReport>>}
4979
+ * @memberof QualityScoreReportResponse
4980
+ */
4981
+ daily: Array<DailyAggregateCallStatsResponse<QualityScoreReport>>;
4982
+ }
4983
+ /**
4984
+ *
4985
+ * @export
4986
+ * @interface QualityScoreReport
4987
+ */
4988
+ export interface QualityScoreReport {
4989
+ /**
4990
+ *
4991
+ * @type {Array<ReportByHistogramBucket>}
4992
+ * @memberof QualityScoreReport
4993
+ */
4994
+ histogram: Array<ReportByHistogramBucket>;
4995
+ }
4996
+ /**
4997
+ *
4998
+ * @export
4999
+ * @interface QueryAggregateCallStatsRequest
5000
+ */
5001
+ export interface QueryAggregateCallStatsRequest {
5002
+ /**
5003
+ *
5004
+ * @type {string}
5005
+ * @memberof QueryAggregateCallStatsRequest
5006
+ */
5007
+ from?: string;
5008
+ /**
5009
+ *
5010
+ * @type {Array<string>}
5011
+ * @memberof QueryAggregateCallStatsRequest
5012
+ */
5013
+ report_types?: Array<string>;
5014
+ /**
5015
+ *
5016
+ * @type {string}
5017
+ * @memberof QueryAggregateCallStatsRequest
5018
+ */
5019
+ to?: string;
5020
+ }
5021
+ /**
5022
+ * Basic response information
5023
+ * @export
5024
+ * @interface QueryAggregateCallStatsResponse
5025
+ */
5026
+ export interface QueryAggregateCallStatsResponse {
5027
+ /**
5028
+ *
5029
+ * @type {CallDurationReportResponse}
5030
+ * @memberof QueryAggregateCallStatsResponse
5031
+ */
5032
+ call_duration_report?: CallDurationReportResponse;
5033
+ /**
5034
+ *
5035
+ * @type {CallParticipantCountReportResponse}
5036
+ * @memberof QueryAggregateCallStatsResponse
5037
+ */
5038
+ call_participant_count_report?: CallParticipantCountReportResponse;
5039
+ /**
5040
+ *
5041
+ * @type {CallsPerDayReportResponse}
5042
+ * @memberof QueryAggregateCallStatsResponse
5043
+ */
5044
+ calls_per_day_report?: CallsPerDayReportResponse;
5045
+ /**
5046
+ * Duration of the request in milliseconds
5047
+ * @type {string}
5048
+ * @memberof QueryAggregateCallStatsResponse
5049
+ */
5050
+ duration: string;
5051
+ /**
5052
+ *
5053
+ * @type {NetworkMetricsReportResponse}
5054
+ * @memberof QueryAggregateCallStatsResponse
5055
+ */
5056
+ network_metrics_report?: NetworkMetricsReportResponse;
5057
+ /**
5058
+ *
5059
+ * @type {QualityScoreReportResponse}
5060
+ * @memberof QueryAggregateCallStatsResponse
5061
+ */
5062
+ quality_score_report?: QualityScoreReportResponse;
5063
+ /**
5064
+ *
5065
+ * @type {SDKUsageReportResponse}
5066
+ * @memberof QueryAggregateCallStatsResponse
5067
+ */
5068
+ sdk_usage_report?: SDKUsageReportResponse;
5069
+ /**
5070
+ *
5071
+ * @type {UserFeedbackReportResponse}
5072
+ * @memberof QueryAggregateCallStatsResponse
5073
+ */
5074
+ user_feedback_report?: UserFeedbackReportResponse;
5075
+ }
4833
5076
  /**
4834
5077
  *
4835
5078
  * @export
@@ -5218,6 +5461,49 @@ export interface RejectCallResponse {
5218
5461
  */
5219
5462
  duration: string;
5220
5463
  }
5464
+ /**
5465
+ *
5466
+ * @export
5467
+ * @interface ReportByHistogramBucket
5468
+ */
5469
+ export interface ReportByHistogramBucket {
5470
+ /**
5471
+ *
5472
+ * @type {string}
5473
+ * @memberof ReportByHistogramBucket
5474
+ */
5475
+ category: string;
5476
+ /**
5477
+ *
5478
+ * @type {number}
5479
+ * @memberof ReportByHistogramBucket
5480
+ */
5481
+ count: number;
5482
+ /**
5483
+ *
5484
+ * @type {Bound}
5485
+ * @memberof ReportByHistogramBucket
5486
+ */
5487
+ lower_bound?: Bound;
5488
+ /**
5489
+ *
5490
+ * @type {number}
5491
+ * @memberof ReportByHistogramBucket
5492
+ */
5493
+ mean: number;
5494
+ /**
5495
+ *
5496
+ * @type {number}
5497
+ * @memberof ReportByHistogramBucket
5498
+ */
5499
+ sum: number;
5500
+ /**
5501
+ *
5502
+ * @type {Bound}
5503
+ * @memberof ReportByHistogramBucket
5504
+ */
5505
+ upper_bound?: Bound;
5506
+ }
5221
5507
  /**
5222
5508
  *
5223
5509
  * @export
@@ -5413,6 +5699,34 @@ export interface ScreensharingSettingsResponse {
5413
5699
  */
5414
5700
  target_resolution?: TargetResolution;
5415
5701
  }
5702
+ /**
5703
+ *
5704
+ * @export
5705
+ * @interface SDKUsageReportResponse
5706
+ */
5707
+ export interface SDKUsageReportResponse {
5708
+ /**
5709
+ *
5710
+ * @type {Array<DailyAggregateCallStatsResponse<SDKUsageReport>>}
5711
+ * @memberof SDKUsageReportResponse
5712
+ */
5713
+ daily: Array<DailyAggregateCallStatsResponse<SDKUsageReport>>;
5714
+ }
5715
+ /**
5716
+ *
5717
+ * @export
5718
+ * @interface SDKUsageReport
5719
+ */
5720
+ export interface SDKUsageReport {
5721
+ /**
5722
+ *
5723
+ * @type {{ [key: string]: PerSDKUsageReport; }}
5724
+ * @memberof SDKUsageReport
5725
+ */
5726
+ per_sdk_usage: {
5727
+ [key: string]: PerSDKUsageReport;
5728
+ };
5729
+ }
5416
5730
  /**
5417
5731
  *
5418
5732
  * @export
@@ -6282,6 +6596,40 @@ export interface UserDeletedEvent {
6282
6596
  */
6283
6597
  user?: UserObject;
6284
6598
  }
6599
+ /**
6600
+ *
6601
+ * @export
6602
+ * @interface UserFeedbackReportResponse
6603
+ */
6604
+ export interface UserFeedbackReportResponse {
6605
+ /**
6606
+ *
6607
+ * @type {Array<DailyAggregateCallStatsResponse<UserFeedbackReport>>}
6608
+ * @memberof UserFeedbackReportResponse
6609
+ */
6610
+ daily: Array<DailyAggregateCallStatsResponse<UserFeedbackReport>>;
6611
+ }
6612
+ /**
6613
+ *
6614
+ * @export
6615
+ * @interface UserFeedbackReport
6616
+ */
6617
+ export interface UserFeedbackReport {
6618
+ /**
6619
+ *
6620
+ * @type {{ [key: string]: number; }}
6621
+ * @memberof UserFeedbackReport
6622
+ */
6623
+ count_by_rating: {
6624
+ [key: string]: number;
6625
+ };
6626
+ /**
6627
+ *
6628
+ * @type {number}
6629
+ * @memberof UserFeedbackReport
6630
+ */
6631
+ unreported_count: number;
6632
+ }
6285
6633
  /**
6286
6634
  *
6287
6635
  * @export
@@ -6755,6 +7103,12 @@ export interface UserResponse {
6755
7103
  * @interface UserSessionStats
6756
7104
  */
6757
7105
  export interface UserSessionStats {
7106
+ /**
7107
+ *
7108
+ * @type {number}
7109
+ * @memberof UserSessionStats
7110
+ */
7111
+ average_connection_time?: number;
6758
7112
  /**
6759
7113
  *
6760
7114
  * @type {string}
@@ -1,3 +1,41 @@
1
1
  import type { TargetResolution } from './coordinator';
2
2
  export type TargetResolutionRequest = TargetResolution;
3
3
  export type TargetResolutionResponse = Required<TargetResolution>;
4
+ /**
5
+ *
6
+ * @export
7
+ * @interface Bound
8
+ */
9
+ export interface Bound {
10
+ /**
11
+ *
12
+ * @type {boolean}
13
+ * @memberof Bound
14
+ */
15
+ inclusive: boolean;
16
+ /**
17
+ *
18
+ * @type {number}
19
+ * @memberof Bound
20
+ */
21
+ value: number;
22
+ }
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface DailyAggregateCallStatsResponse
27
+ */
28
+ export interface DailyAggregateCallStatsResponse<T = any> {
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof DailyAggregateCallStatsResponse<T>
33
+ */
34
+ date: string;
35
+ /**
36
+ *
37
+ * @type {T}
38
+ * @memberof DailyAggregateCallStatsResponse<T>
39
+ */
40
+ report: T;
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "1.11.15",
3
+ "version": "1.12.1",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
package/src/Call.ts CHANGED
@@ -615,8 +615,12 @@ export class Call {
615
615
  }
616
616
  // update the call state with the latest event data
617
617
  this.state.updateFromCallResponse(event.call);
618
- this.ringingSubject.next(true);
619
618
  this.watching = true;
619
+ this.ringingSubject.next(true);
620
+ // we remove the instance from the calls list to enable the following filter in useCalls hook
621
+ // const calls = useCalls().filter((c) => c.ringing);
622
+ const calls = this.clientStore.calls.filter((c) => c.cid !== this.cid);
623
+ this.clientStore.setCalls([this, ...calls]);
620
624
  await this.applyDeviceConfig(false);
621
625
  };
622
626
 
@@ -11,6 +11,8 @@ import type {
11
11
  CreateGuestResponse,
12
12
  GetEdgesResponse,
13
13
  ListDevicesResponse,
14
+ QueryAggregateCallStatsRequest,
15
+ QueryAggregateCallStatsResponse,
14
16
  QueryCallsRequest,
15
17
  QueryCallsResponse,
16
18
  QueryCallStatsRequest,
@@ -439,6 +441,21 @@ export class StreamVideoClient {
439
441
  >(`/call/stats`, data);
440
442
  };
441
443
 
444
+ /**
445
+ * Retrieve the list of available reports aggregated from the call stats.
446
+ *
447
+ * @param data Specify filter conditions like from and to (within last 30 days) and the report types
448
+ * @returns Requested reports with (mostly) raw daily data for each report type requested
449
+ */
450
+ queryAggregateCallStats = async (
451
+ data: QueryAggregateCallStatsRequest = {},
452
+ ) => {
453
+ return this.streamClient.post<
454
+ QueryAggregateCallStatsResponse,
455
+ QueryAggregateCallStatsRequest
456
+ >(`/stats`, data);
457
+ };
458
+
442
459
  /**
443
460
  * Returns a list of available data centers available for hosting calls.
444
461
  */