@observertc/observer-js 1.0.0-beta.21 → 1.0.0-beta.22

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.d.mts CHANGED
@@ -12,7 +12,7 @@ type ExtensionStat = {
12
12
  /**
13
13
  * The payload of the extension stats the custom app provides
14
14
  */
15
- payload?: string;
15
+ payload?: Record<string, boolean | string | number>;
16
16
  };
17
17
  /**
18
18
  * A list of additional client events.
@@ -23,9 +23,9 @@ type ClientMetaData = {
23
23
  */
24
24
  type: string;
25
25
  /**
26
- * The value associated with the event, if applicable.
26
+ * The attributes of the meta data entry, if applicable.
27
27
  */
28
- payload?: string;
28
+ payload?: Record<string, boolean | string | number>;
29
29
  /**
30
30
  * The unique identifier of the peer connection for which the event was generated.
31
31
  */
@@ -52,15 +52,13 @@ type ClientIssue = {
52
52
  */
53
53
  type: string;
54
54
  /**
55
- * Identity of a **stateful** issue, shared by its raise entry and its `<type>-resolved`
56
- * companion, so a server can open an active issue on the raise and close it on the match
57
- * (client-monitor-js >= 4.6.0, `sendResolvedIssuesToServer`). One-shot issues have no key.
55
+ * Identifier of the related issue or resolution when it is provided.
58
56
  */
59
57
  key?: string;
60
58
  /**
61
- * The value associated with the event, if applicable.
59
+ * The attributes of the issue, if applicable.
62
60
  */
63
- payload?: string;
61
+ payload?: Record<string, boolean | string | number>;
64
62
  /**
65
63
  * The timestamp in epoch format when the event was generated.
66
64
  */
@@ -75,16 +73,16 @@ type ClientEvent = {
75
73
  */
76
74
  type: string;
77
75
  /**
78
- * The value associated with the event, if applicable.
76
+ * The attributes of the event, if applicable.
79
77
  */
80
- payload?: string;
78
+ payload?: Record<string, boolean | string | number>;
81
79
  /**
82
80
  * The timestamp in epoch format when the event was generated.
83
81
  */
84
82
  timestamp?: number;
85
83
  };
86
84
  /**
87
- * Certificates
85
+ * Certificate Stats
88
86
  */
89
87
  type CertificateStats = {
90
88
  /**
@@ -108,7 +106,7 @@ type CertificateStats = {
108
106
  */
109
107
  base64Certificate?: string;
110
108
  /**
111
- * The certificate ID of the issuer (nullable).
109
+ * The certificate ID of the issuer.
112
110
  */
113
111
  issuerCertificateId?: string;
114
112
  /**
@@ -125,7 +123,7 @@ type IceCandidatePairStats = {
125
123
  */
126
124
  id: string;
127
125
  /**
128
- * The timestamp of when the stats were recorded, in seconds.
126
+ * The timestamp of when the stats were recorded, in milliseconds.
129
127
  */
130
128
  timestamp: number;
131
129
  /**
@@ -140,7 +138,10 @@ type IceCandidatePairStats = {
140
138
  * The ID of the remote ICE candidate in this pair.
141
139
  */
142
140
  remoteCandidateId?: string;
143
- state?: 'new' | 'in-progress' | 'waiting' | 'failed' | 'succeeded' | 'cancelled' | 'inprogress';
141
+ /**
142
+ * The checklist state of this candidate pair. Values follow the W3C RTCStatsIceCandidatePairState enum (frozen, waiting, in-progress, failed, succeeded). Two further values are accepted for backward compatibility and are not part of the current spec: `new` (never standardised) and `cancelled` (removed from the spec after 2016).
143
+ */
144
+ state?: 'new' | 'frozen' | 'in-progress' | 'waiting' | 'failed' | 'succeeded' | 'cancelled' | 'inprogress';
144
145
  /**
145
146
  * Whether this candidate pair has been nominated.
146
147
  */
@@ -235,7 +236,7 @@ type IceCandidateStats = {
235
236
  */
236
237
  transportId?: string;
237
238
  /**
238
- * The IP address of the ICE candidate (nullable).
239
+ * The IP address of the ICE candidate.
239
240
  */
240
241
  address?: string;
241
242
  /**
@@ -364,7 +365,15 @@ type IceTransportStats = {
364
365
  */
365
366
  selectedCandidatePairChanges?: number;
366
367
  /**
367
- * Additional information attached to this stats
368
+ * Number of congestion control feedback (CCFB) messages sent on this transport.
369
+ */
370
+ ccfbMessagesSent?: number;
371
+ /**
372
+ * Number of congestion control feedback (CCFB) messages received on this transport.
373
+ */
374
+ ccfbMessagesReceived?: number;
375
+ /**
376
+ * Additional information attached to this stats.
368
377
  */
369
378
  attachments?: Record<string, unknown>;
370
379
  };
@@ -545,7 +554,7 @@ type MediaSourceStats = {
545
554
  attachments?: Record<string, unknown>;
546
555
  };
547
556
  /**
548
- * Remote Outbound RTPs
557
+ * Remote Outbound RTP Stats
549
558
  */
550
559
  type RemoteOutboundRtpStats = {
551
560
  /**
@@ -631,7 +640,24 @@ type QualityLimitationDurations = {
631
640
  other: number;
632
641
  };
633
642
  /**
634
- * Outbound RTPs
643
+ * Cumulative PSNR measurements for Y, U, V components.
644
+ */
645
+ type PsnrSum = {
646
+ /**
647
+ * PSNR value for the Y (luminance) component.
648
+ */
649
+ y: number;
650
+ /**
651
+ * PSNR value for the U (chrominance) component.
652
+ */
653
+ u: number;
654
+ /**
655
+ * PSNR value for the V (chrominance) component.
656
+ */
657
+ v: number;
658
+ };
659
+ /**
660
+ * Outbound RTP Stats
635
661
  */
636
662
  type OutboundRtpStats = {
637
663
  /**
@@ -683,6 +709,10 @@ type OutboundRtpStats = {
683
709
  */
684
710
  rid?: string;
685
711
  /**
712
+ * Index of the encoding in the encoding array.
713
+ */
714
+ encodingIndex?: number;
715
+ /**
686
716
  * The total number of header bytes sent on this stream.
687
717
  */
688
718
  headerBytesSent?: number;
@@ -739,6 +769,14 @@ type OutboundRtpStats = {
739
769
  */
740
770
  qpSum?: number;
741
771
  /**
772
+ * Cumulative PSNR measurements for Y, U, V components.
773
+ */
774
+ psnrSum?: PsnrSum;
775
+ /**
776
+ * Total number of PSNR measurements collected.
777
+ */
778
+ psnrMeasurements?: number;
779
+ /**
742
780
  * The total time spent encoding frames on this stream in seconds.
743
781
  */
744
782
  totalEncodeTime?: number;
@@ -747,10 +785,14 @@ type OutboundRtpStats = {
747
785
  */
748
786
  totalPacketSendDelay?: number;
749
787
  /**
750
- * The reason for any quality limitation on this stream.
788
+ * The reason for any quality limitation on this stream (e.g., 'cpu', 'bandwidth', 'other').
751
789
  */
752
790
  qualityLimitationReason?: string;
753
791
  /**
792
+ * The duration of quality limitation reasons categorized by type.
793
+ */
794
+ qualityLimitationDurations?: QualityLimitationDurations;
795
+ /**
754
796
  * The number of resolution changes due to quality limitations.
755
797
  */
756
798
  qualityLimitationResolutionChanges?: number;
@@ -771,7 +813,7 @@ type OutboundRtpStats = {
771
813
  */
772
814
  encoderImplementation?: string;
773
815
  /**
774
- * Indicates whether the encoder is power efficient.
816
+ * Indicates whether the encoder is power-efficient.
775
817
  */
776
818
  powerEfficientEncoder?: boolean;
777
819
  /**
@@ -783,16 +825,16 @@ type OutboundRtpStats = {
783
825
  */
784
826
  scalabilityMode?: string;
785
827
  /**
786
- * The duration of quality limitation reasons categorized by type.
828
+ * Number of packets sent with ECT(1) congestion marking.
787
829
  */
788
- qualityLimitationDurations?: QualityLimitationDurations;
830
+ packetsSentWithEct1?: number;
789
831
  /**
790
832
  * Additional information attached to this stats.
791
833
  */
792
834
  attachments?: Record<string, unknown>;
793
835
  };
794
836
  /**
795
- * Remote Inbound RTPs
837
+ * Remote Inbound RTP Stats
796
838
  */
797
839
  type RemoteInboundRtpStats = {
798
840
  /**
@@ -824,6 +866,22 @@ type RemoteInboundRtpStats = {
824
866
  */
825
867
  packetsReceived?: number;
826
868
  /**
869
+ * Total number of RTP packets received for this SSRC marked with the ECT(1) marking.
870
+ */
871
+ packetsReceivedWithEct1?: number;
872
+ /**
873
+ * Total number of RTP packets received for this SSRC marked with the CE marking.
874
+ */
875
+ packetsReceivedWithCe?: number;
876
+ /**
877
+ * Total number of RTP packets for which an RFC8888 report has been sent with a zero R bit.
878
+ */
879
+ packetsReportedAsLost?: number;
880
+ /**
881
+ * Total number of RTP packets reported as lost but later recovered in a subsequent RFC8888 report.
882
+ */
883
+ packetsReportedAsLostButRecovered?: number;
884
+ /**
827
885
  * The total number of packets lost on this stream.
828
886
  */
829
887
  packetsLost?: number;
@@ -852,12 +910,16 @@ type RemoteInboundRtpStats = {
852
910
  */
853
911
  roundTripTimeMeasurements?: number;
854
912
  /**
913
+ * Number of packets with ECT(1) marking that were bleached by a middlebox.
914
+ */
915
+ packetsWithBleachedEct1Marking?: number;
916
+ /**
855
917
  * Additional information attached to this stats
856
918
  */
857
919
  attachments?: Record<string, unknown>;
858
920
  };
859
921
  /**
860
- * Inbound RTPs
922
+ * Inbound RTP Stats
861
923
  */
862
924
  type InboundRtpStats = {
863
925
  /**
@@ -893,6 +955,22 @@ type InboundRtpStats = {
893
955
  */
894
956
  packetsReceived?: number;
895
957
  /**
958
+ * Total number of RTP packets received for this SSRC marked with the ECT(1) marking.
959
+ */
960
+ packetsReceivedWithEct1?: number;
961
+ /**
962
+ * Total number of RTP packets received for this SSRC marked with the CE marking.
963
+ */
964
+ packetsReceivedWithCe?: number;
965
+ /**
966
+ * Total number of RTP packets for which an RFC8888 report has been sent with a zero R bit.
967
+ */
968
+ packetsReportedAsLost?: number;
969
+ /**
970
+ * Total number of RTP packets reported as lost but later recovered in a subsequent RFC8888 report.
971
+ */
972
+ packetsReportedAsLostButRecovered?: number;
973
+ /**
896
974
  * Number of packets lost on the RTP stream.
897
975
  */
898
976
  packetsLost?: number;
@@ -901,7 +979,7 @@ type InboundRtpStats = {
901
979
  */
902
980
  jitter?: number;
903
981
  /**
904
- * The MediaStream ID of the RTP stream.
982
+ * The media stream identification tag from the SDP media section.
905
983
  */
906
984
  mid?: string;
907
985
  /**
@@ -997,15 +1075,15 @@ type InboundRtpStats = {
997
1075
  */
998
1076
  bytesReceived?: number;
999
1077
  /**
1000
- * Number of NACKs sent.
1078
+ * Number of NACKs received.
1001
1079
  */
1002
1080
  nackCount?: number;
1003
1081
  /**
1004
- * Number of Full Intra Requests sent.
1082
+ * Number of Full Intra Requests received.
1005
1083
  */
1006
1084
  firCount?: number;
1007
1085
  /**
1008
- * Number of Picture Loss Indications sent.
1086
+ * Number of Picture Loss Indications received.
1009
1087
  */
1010
1088
  pliCount?: number;
1011
1089
  /**
@@ -1183,10 +1261,14 @@ type OutboundTrackSample = {
1183
1261
  */
1184
1262
  kind: string;
1185
1263
  /**
1186
- * Calculated score for track (details should be added to attachments)
1264
+ * Calculated score for track (details should be added to scoreReasons)
1187
1265
  */
1188
1266
  score?: number;
1189
1267
  /**
1268
+ * Details for score calculation
1269
+ */
1270
+ scoreReasons?: string[];
1271
+ /**
1190
1272
  * Additional information attached to this stats
1191
1273
  */
1192
1274
  attachments?: Record<string, unknown>;
@@ -1208,16 +1290,20 @@ type InboundTrackSample = {
1208
1290
  */
1209
1291
  kind: string;
1210
1292
  /**
1211
- * Calculated score for track (details should be added to attachments)
1293
+ * Calculated score for track (details should be added to scoreReasons)
1212
1294
  */
1213
1295
  score?: number;
1214
1296
  /**
1297
+ * Details for score calculation
1298
+ */
1299
+ scoreReasons?: string[];
1300
+ /**
1215
1301
  * Additional information attached to this stats
1216
1302
  */
1217
1303
  attachments?: Record<string, unknown>;
1218
1304
  };
1219
1305
  /**
1220
- * docs
1306
+ * A sample containing statistics and metrics for a WebRTC peer connection
1221
1307
  */
1222
1308
  type PeerConnectionSample = {
1223
1309
  /**
@@ -1229,10 +1315,14 @@ type PeerConnectionSample = {
1229
1315
  */
1230
1316
  attachments?: Record<string, unknown>;
1231
1317
  /**
1232
- * Calculated score for peer connection (details should be added to attachments)
1318
+ * Calculated score for peer connection (details should be added to scoreReasons)
1233
1319
  */
1234
1320
  score?: number;
1235
1321
  /**
1322
+ * Details for score calculation
1323
+ */
1324
+ scoreReasons?: string[];
1325
+ /**
1236
1326
  * Inbound Track Stats items
1237
1327
  */
1238
1328
  inboundTracks?: InboundTrackSample[];
@@ -1245,19 +1335,19 @@ type PeerConnectionSample = {
1245
1335
  */
1246
1336
  codecs?: CodecStats[];
1247
1337
  /**
1248
- * Inbound RTPs
1338
+ * Inbound RTP Stats
1249
1339
  */
1250
1340
  inboundRtps?: InboundRtpStats[];
1251
1341
  /**
1252
- * Remote Inbound RTPs
1342
+ * Remote Inbound RTP Stats
1253
1343
  */
1254
1344
  remoteInboundRtps?: RemoteInboundRtpStats[];
1255
1345
  /**
1256
- * Outbound RTPs
1346
+ * Outbound RTP Stats
1257
1347
  */
1258
1348
  outboundRtps?: OutboundRtpStats[];
1259
1349
  /**
1260
- * Remote Outbound RTPs
1350
+ * Remote Outbound RTP Stats
1261
1351
  */
1262
1352
  remoteOutboundRtps?: RemoteOutboundRtpStats[];
1263
1353
  /**
@@ -1289,7 +1379,7 @@ type PeerConnectionSample = {
1289
1379
  */
1290
1380
  iceCandidatePairs?: IceCandidatePairStats[];
1291
1381
  /**
1292
- * Certificates
1382
+ * Certificate Stats
1293
1383
  */
1294
1384
  certificates?: CertificateStats[];
1295
1385
  };
@@ -1314,10 +1404,14 @@ type ClientSample = {
1314
1404
  */
1315
1405
  attachments?: Record<string, unknown>;
1316
1406
  /**
1317
- * Calculated score for client (details should be added to attachments)
1407
+ * Calculated score for client (details should be added to scoreReasons)
1318
1408
  */
1319
1409
  score?: number;
1320
1410
  /**
1411
+ * Details for score calculation
1412
+ */
1413
+ scoreReasons?: string[];
1414
+ /**
1321
1415
  * Samples taken PeerConnections
1322
1416
  */
1323
1417
  peerConnections?: PeerConnectionSample[];
@@ -2490,8 +2584,9 @@ declare function concludeObserverIssue(spread: ObserverIssueSpread): IssueConclu
2490
2584
  *
2491
2585
  * ### Why this is not `ClientIssue`
2492
2586
  *
2493
- * `ClientIssue` is a **wire** type: it arrives inside a `ClientSample`, so its `payload` has to be a
2494
- * string. Server-raised findings were reusing it, which forced every detector to `JSON.stringify` a
2587
+ * `ClientIssue` is a **wire** type: it arrives inside a `ClientSample`, so its `payload` is bound to
2588
+ * what the schema can carry — a record of primitives since schema 3.5.0, a JSON string on samples
2589
+ * from earlier clients. Server-raised findings were reusing it, which forced every detector to `JSON.stringify` a
2495
2590
  * perfectly good object on the way out and every handler to `JSON.parse` it back on the way in —
2496
2591
  * paying serialisation on a path where nothing is ever serialised, and losing type information in
2497
2592
  * both directions. These go straight to an in-process handler, so they carry the object.