@observertc/observer-js 0.30.1-beta → 0.30.3-beta

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.
Files changed (39) hide show
  1. package/lib/ObservedClient.d.ts +15 -6
  2. package/lib/ObservedClient.d.ts.map +1 -1
  3. package/lib/ObservedClient.js +146 -73
  4. package/lib/ObservedICE.d.ts +47 -0
  5. package/lib/ObservedICE.d.ts.map +1 -0
  6. package/lib/ObservedICE.js +105 -0
  7. package/lib/ObservedInboundTrack.d.ts +29 -1
  8. package/lib/ObservedInboundTrack.d.ts.map +1 -1
  9. package/lib/ObservedInboundTrack.js +78 -8
  10. package/lib/ObservedOutboundTrack.d.ts +20 -3
  11. package/lib/ObservedOutboundTrack.d.ts.map +1 -1
  12. package/lib/ObservedOutboundTrack.js +53 -9
  13. package/lib/ObservedPeerConnection.d.ts +47 -1
  14. package/lib/ObservedPeerConnection.d.ts.map +1 -1
  15. package/lib/ObservedPeerConnection.js +155 -0
  16. package/lib/common/CallEventType.d.ts +22 -0
  17. package/lib/common/CallEventType.d.ts.map +1 -0
  18. package/lib/common/CallEventType.js +26 -0
  19. package/lib/common/callEventReports.d.ts +0 -10
  20. package/lib/common/callEventReports.d.ts.map +1 -1
  21. package/lib/common/callEventReports.js +10 -21
  22. package/lib/models/Models.d.ts +3 -70
  23. package/lib/models/Models.d.ts.map +1 -1
  24. package/lib/models/Models.js +2 -72
  25. package/lib/models/samples_pb.js +1 -1
  26. package/package.json +1 -1
  27. package/src/ObservedClient.ts +146 -89
  28. package/src/ObservedICE.ts +176 -0
  29. package/src/ObservedInboundTrack.ts +97 -3
  30. package/src/ObservedOutboundTrack.ts +70 -9
  31. package/src/ObservedPeerConnection.ts +205 -1
  32. package/src/common/CallEventType.ts +23 -0
  33. package/src/common/callEventReports.ts +1 -11
  34. package/src/models/Models.ts +4 -113
  35. package/src/models/samples_pb.ts +1 -1
  36. package/lib/common/ReportsCollector.d.ts +0 -23
  37. package/lib/common/ReportsCollector.d.ts.map +0 -1
  38. package/lib/common/ReportsCollector.js +0 -26
  39. package/src/common/ReportsCollector.ts +0 -71
@@ -1,11 +1,11 @@
1
- // @generated by protoc-gen-es v1.1.1 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v1.7.2 with parameter "target=ts"
2
2
  // @generated from file models.proto (package org.observertc.observer.models, syntax proto2)
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
5
 
6
6
  import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
7
7
  import { Message, proto2 } from "@bufbuild/protobuf";
8
- import { Samples_ClientSample_Browser, Samples_ClientSample_Engine, Samples_ClientSample_IceCandidatePair, Samples_ClientSample_IceLocalCandidate, Samples_ClientSample_IceRemoteCandidate, Samples_ClientSample_InboundAudioTrack, Samples_ClientSample_InboundVideoTrack, Samples_ClientSample_OperationSystem, Samples_ClientSample_OutboundAudioTrack, Samples_ClientSample_OutboundVideoTrack, Samples_ClientSample_PeerConnectionTransport, Samples_ClientSample_Platform } from "./samples_pb";
8
+ import { Samples_ClientSample_Browser, Samples_ClientSample_Engine, Samples_ClientSample_OperationSystem, Samples_ClientSample_Platform } from "./samples_pb";
9
9
 
10
10
  /**
11
11
  * @generated from message org.observertc.observer.models.Call
@@ -68,49 +68,6 @@ export class Call extends Message<Call> {
68
68
  }
69
69
  }
70
70
 
71
- /**
72
- * @generated from message org.observertc.observer.models.ClientCoordinate
73
- */
74
- export class ClientCoordinate extends Message<ClientCoordinate> {
75
- /**
76
- * @generated from field: required float latitude = 1;
77
- */
78
- latitude?: number;
79
-
80
- /**
81
- * @generated from field: required float longitude = 2;
82
- */
83
- longitude?: number;
84
-
85
- constructor(data?: PartialMessage<ClientCoordinate>) {
86
- super();
87
- proto2.util.initPartial(data, this);
88
- }
89
-
90
- static readonly runtime: typeof proto2 = proto2;
91
- static readonly typeName = "org.observertc.observer.models.ClientCoordinate";
92
- static readonly fields: FieldList = proto2.util.newFieldList(() => [
93
- { no: 1, name: "latitude", kind: "scalar", T: 2 /* ScalarType.FLOAT */ },
94
- { no: 2, name: "longitude", kind: "scalar", T: 2 /* ScalarType.FLOAT */ },
95
- ]);
96
-
97
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ClientCoordinate {
98
- return new ClientCoordinate().fromBinary(bytes, options);
99
- }
100
-
101
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ClientCoordinate {
102
- return new ClientCoordinate().fromJson(jsonValue, options);
103
- }
104
-
105
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ClientCoordinate {
106
- return new ClientCoordinate().fromJsonString(jsonString, options);
107
- }
108
-
109
- static equals(a: ClientCoordinate | PlainMessage<ClientCoordinate> | undefined, b: ClientCoordinate | PlainMessage<ClientCoordinate> | undefined): boolean {
110
- return proto2.util.equals(ClientCoordinate, a, b);
111
- }
112
- }
113
-
114
71
  /**
115
72
  * @generated from message org.observertc.observer.models.Client
116
73
  */
@@ -190,19 +147,6 @@ export class Client extends Message<Client> {
190
147
  */
191
148
  engine?: Samples_ClientSample_Engine;
192
149
 
193
- /**
194
- * message Stats {
195
- * optional double maxRttInS = 1;
196
- * optional double minRttInS = 2;
197
- * optional string location = 3;
198
- * }
199
- *
200
- * optional Stats stats = 13;
201
- *
202
- * @generated from field: optional org.observertc.observer.models.ClientCoordinate coordinates = 16;
203
- */
204
- coordinates?: ClientCoordinate;
205
-
206
150
  constructor(data?: PartialMessage<Client>) {
207
151
  super();
208
152
  proto2.util.initPartial(data, this);
@@ -226,7 +170,6 @@ export class Client extends Message<Client> {
226
170
  { no: 13, name: "operationSystem", kind: "message", T: Samples_ClientSample_OperationSystem, opt: true },
227
171
  { no: 14, name: "platform", kind: "message", T: Samples_ClientSample_Platform, opt: true },
228
172
  { no: 15, name: "engine", kind: "message", T: Samples_ClientSample_Engine, opt: true },
229
- { no: 16, name: "coordinates", kind: "message", T: ClientCoordinate, opt: true },
230
173
  ]);
231
174
 
232
175
  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Client {
@@ -310,26 +253,6 @@ export class PeerConnection extends Message<PeerConnection> {
310
253
  */
311
254
  outboundTrackIds: string[] = [];
312
255
 
313
- /**
314
- * @generated from field: repeated org.observertc.schemas.protobuf.Samples.ClientSample.IceLocalCandidate icelocalCandidates = 13;
315
- */
316
- icelocalCandidates: Samples_ClientSample_IceLocalCandidate[] = [];
317
-
318
- /**
319
- * @generated from field: repeated org.observertc.schemas.protobuf.Samples.ClientSample.IceRemoteCandidate iceRemoteCandidates = 14;
320
- */
321
- iceRemoteCandidates: Samples_ClientSample_IceRemoteCandidate[] = [];
322
-
323
- /**
324
- * @generated from field: repeated org.observertc.schemas.protobuf.Samples.ClientSample.IceCandidatePair iceCandidatePairs = 15;
325
- */
326
- iceCandidatePairs: Samples_ClientSample_IceCandidatePair[] = [];
327
-
328
- /**
329
- * @generated from field: repeated org.observertc.schemas.protobuf.Samples.ClientSample.PeerConnectionTransport transports = 16;
330
- */
331
- transports: Samples_ClientSample_PeerConnectionTransport[] = [];
332
-
333
256
  /**
334
257
  * @generated from field: optional uint64 touched = 17;
335
258
  */
@@ -355,10 +278,6 @@ export class PeerConnection extends Message<PeerConnection> {
355
278
  { no: 10, name: "label", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
356
279
  { no: 11, name: "inboundTrackIds", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
357
280
  { no: 12, name: "outboundTrackIds", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
358
- { no: 13, name: "icelocalCandidates", kind: "message", T: Samples_ClientSample_IceLocalCandidate, repeated: true },
359
- { no: 14, name: "iceRemoteCandidates", kind: "message", T: Samples_ClientSample_IceRemoteCandidate, repeated: true },
360
- { no: 15, name: "iceCandidatePairs", kind: "message", T: Samples_ClientSample_IceCandidatePair, repeated: true },
361
- { no: 16, name: "transports", kind: "message", T: Samples_ClientSample_PeerConnectionTransport, repeated: true },
362
281
  { no: 17, name: "touched", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
363
282
  ]);
364
283
 
@@ -389,15 +308,12 @@ export class InboundTrackVideoStats extends Message<InboundTrackVideoStats> {
389
308
  ssrc?: number;
390
309
 
391
310
  /**
311
+ * optional org.observertc.schemas.protobuf.Samples.ClientSample.InboundVideoTrack sample = 4;
312
+ *
392
313
  * @generated from field: optional float fps = 2;
393
314
  */
394
315
  fps?: number;
395
316
 
396
- /**
397
- * @generated from field: optional org.observertc.schemas.protobuf.Samples.ClientSample.InboundVideoTrack sample = 4;
398
- */
399
- sample?: Samples_ClientSample_InboundVideoTrack;
400
-
401
317
  constructor(data?: PartialMessage<InboundTrackVideoStats>) {
402
318
  super();
403
319
  proto2.util.initPartial(data, this);
@@ -408,7 +324,6 @@ export class InboundTrackVideoStats extends Message<InboundTrackVideoStats> {
408
324
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
409
325
  { no: 1, name: "ssrc", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
410
326
  { no: 2, name: "fps", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true },
411
- { no: 4, name: "sample", kind: "message", T: Samples_ClientSample_InboundVideoTrack, opt: true },
412
327
  ]);
413
328
 
414
329
  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): InboundTrackVideoStats {
@@ -551,16 +466,6 @@ export class InboundTrack extends Message<InboundTrack> {
551
466
  */
552
467
  ssrc: bigint[] = [];
553
468
 
554
- /**
555
- * @generated from field: repeated org.observertc.schemas.protobuf.Samples.ClientSample.InboundAudioTrack audioStats = 15;
556
- */
557
- audioStats: Samples_ClientSample_InboundAudioTrack[] = [];
558
-
559
- /**
560
- * @generated from field: repeated org.observertc.schemas.protobuf.Samples.ClientSample.InboundVideoTrack videoStats = 16;
561
- */
562
- videoStats: Samples_ClientSample_InboundVideoTrack[] = [];
563
-
564
469
  /**
565
470
  * @generated from field: optional uint64 touched = 17;
566
471
  */
@@ -588,8 +493,6 @@ export class InboundTrack extends Message<InboundTrack> {
588
493
  { no: 12, name: "sfuSinkId", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
589
494
  { no: 13, name: "sfuStreamId", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
590
495
  { no: 14, name: "ssrc", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true },
591
- { no: 15, name: "audioStats", kind: "message", T: Samples_ClientSample_InboundAudioTrack, repeated: true },
592
- { no: 16, name: "videoStats", kind: "message", T: Samples_ClientSample_InboundVideoTrack, repeated: true },
593
496
  { no: 17, name: "touched", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
594
497
  ]);
595
498
 
@@ -679,16 +582,6 @@ export class OutboundTrack extends Message<OutboundTrack> {
679
582
  */
680
583
  ssrc: bigint[] = [];
681
584
 
682
- /**
683
- * @generated from field: repeated org.observertc.schemas.protobuf.Samples.ClientSample.OutboundAudioTrack audioStats = 14;
684
- */
685
- audioStats: Samples_ClientSample_OutboundAudioTrack[] = [];
686
-
687
- /**
688
- * @generated from field: repeated org.observertc.schemas.protobuf.Samples.ClientSample.OutboundVideoTrack videoStats = 15;
689
- */
690
- videoStats: Samples_ClientSample_OutboundVideoTrack[] = [];
691
-
692
585
  /**
693
586
  * @generated from field: optional uint64 touched = 16;
694
587
  */
@@ -715,8 +608,6 @@ export class OutboundTrack extends Message<OutboundTrack> {
715
608
  { no: 11, name: "marker", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
716
609
  { no: 12, name: "sfuStreamId", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
717
610
  { no: 13, name: "ssrc", kind: "scalar", T: 3 /* ScalarType.INT64 */, repeated: true },
718
- { no: 14, name: "audioStats", kind: "message", T: Samples_ClientSample_OutboundAudioTrack, repeated: true },
719
- { no: 15, name: "videoStats", kind: "message", T: Samples_ClientSample_OutboundVideoTrack, repeated: true },
720
611
  { no: 16, name: "touched", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
721
612
  ]);
722
613
 
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v1.1.1 with parameter "target=ts"
1
+ // @generated by protoc-gen-es v1.7.2 with parameter "target=ts"
2
2
  // @generated from file samples.proto (package org.observertc.schemas.protobuf, syntax proto2)
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
@@ -1,23 +0,0 @@
1
- import { CallEventReport, CallMetaReport, ClientDataChannelReport, ClientExtensionReport, IceCandidatePairReport, InboundAudioTrackReport, InboundVideoTrackReport, ObserverEventReport, OutboundAudioTrackReport, OutboundVideoTrackReport, PeerConnectionTransportReport, SfuEventReport, SfuExtensionReport, SfuInboundRtpPadReport, SfuMetaReport, SfuOutboundRtpPadReport, SfuSctpStreamReport, SFUTransportReport } from '@observertc/report-schemas-js';
2
- export type ObservedReports = ReturnType<typeof createObservedReports>;
3
- export declare function createObservedReports(): {
4
- callEventReports: CallEventReport[];
5
- callMetaReports: CallMetaReport[];
6
- clientDataChannelReports: ClientDataChannelReport[];
7
- clientExtensionReports: ClientExtensionReport[];
8
- iceCandidatePairReports: IceCandidatePairReport[];
9
- inboundAudioTrackReports: InboundAudioTrackReport[];
10
- inboundVideoTrackReports: InboundVideoTrackReport[];
11
- observerEventReports: ObserverEventReport[];
12
- outboundAudioTrackReports: OutboundAudioTrackReport[];
13
- outboundVideoTrackReports: OutboundVideoTrackReport[];
14
- peerConnectionTransportReports: PeerConnectionTransportReport[];
15
- sfuEventReports: SfuEventReport[];
16
- sfuExtensionReports: SfuExtensionReport[];
17
- sfuInboundRtpPadReports: SfuInboundRtpPadReport[];
18
- sfuMetaReports: SfuMetaReport[];
19
- sfuOutboundRtpPadReports: SfuOutboundRtpPadReport[];
20
- sfuSctpStreamReports: SfuSctpStreamReport[];
21
- sfuTransportReports: SFUTransportReport[];
22
- };
23
- //# sourceMappingURL=ReportsCollector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReportsCollector.d.ts","sourceRoot":"","sources":["../../src/common/ReportsCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,+BAA+B,CAAC;AA4BvC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,wBAAgB,qBAAqB;;;;;;;;;;;;;;;;;;;EAqBpC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createObservedReports = void 0;
4
- function createObservedReports() {
5
- return {
6
- callEventReports: [],
7
- callMetaReports: [],
8
- clientDataChannelReports: [],
9
- clientExtensionReports: [],
10
- iceCandidatePairReports: [],
11
- inboundAudioTrackReports: [],
12
- inboundVideoTrackReports: [],
13
- observerEventReports: [],
14
- outboundAudioTrackReports: [],
15
- outboundVideoTrackReports: [],
16
- peerConnectionTransportReports: [],
17
- sfuEventReports: [],
18
- sfuExtensionReports: [],
19
- sfuInboundRtpPadReports: [],
20
- sfuMetaReports: [],
21
- sfuOutboundRtpPadReports: [],
22
- sfuSctpStreamReports: [],
23
- sfuTransportReports: [],
24
- };
25
- }
26
- exports.createObservedReports = createObservedReports;
@@ -1,71 +0,0 @@
1
- import {
2
- CallEventReport,
3
- CallMetaReport,
4
- ClientDataChannelReport,
5
- ClientExtensionReport,
6
- IceCandidatePairReport,
7
- InboundAudioTrackReport,
8
- InboundVideoTrackReport,
9
- ObserverEventReport,
10
- OutboundAudioTrackReport,
11
- OutboundVideoTrackReport,
12
- PeerConnectionTransportReport,
13
- SfuEventReport,
14
- SfuExtensionReport,
15
- SfuInboundRtpPadReport,
16
- SfuMetaReport,
17
- SfuOutboundRtpPadReport,
18
- SfuSctpStreamReport,
19
- SFUTransportReport,
20
- } from '@observertc/report-schemas-js';
21
-
22
- // export interface ReportsCollector {
23
- // addCallEventReport(report: CallEventReport): void;
24
- // addCallMetaReport(report: CallMetaReport): void;
25
- // addClientDataChannelReport(report: ClientDataChannelReport): void;
26
- // addClientExtensionReport(report: ClientExtensionReport): void;
27
- // addIceCandidatePairReport(report: IceCandidatePairReport): void;
28
- // addInboundAudioTrackReport(report: InboundAudioTrackReport): void;
29
- // addInboundVideoTrackReport(report: InboundVideoTrackReport): void;
30
- // addPeerConnectionTransportReports(report: PeerConnectionTransportReport): void;
31
- // addObserverEventReport(report: ObserverEventReport): void;
32
- // addOutboundAudioTrackReport(report: OutboundAudioTrackReport): void;
33
- // addOutboundVideoTrackReport(report: OutboundVideoTrackReport): void;
34
- // addSfuEventReport(report: SfuEventReport): void;
35
- // addSfuExtensionReport(report: SfuExtensionReport): void;
36
- // addSfuInboundRtpPadReport(report: SfuInboundRtpPadReport): void;
37
- // addSfuOutboundRtpPadReport(report: SfuOutboundRtpPadReport): void;
38
- // addSfuSctpStreamReport(report: SfuSctpStreamReport): void;
39
- // addSfuTransportReport(report: SFUTransportReport): void;
40
- // addSfuMetaReport(report: SfuMetaReport): void;
41
-
42
- // getCallEventReports(): CallEventReport[];
43
- // getClientExtensionReports(): ClientExtensionReport[];
44
- // getSfuEventReports(): SfuEventReport[];
45
- // getSfuExtensionReports(): SfuExtensionReport[];
46
- // }
47
-
48
- export type ObservedReports = ReturnType<typeof createObservedReports>;
49
-
50
- export function createObservedReports() {
51
- return {
52
- callEventReports: [] as CallEventReport[],
53
- callMetaReports: [] as CallMetaReport[],
54
- clientDataChannelReports: [] as ClientDataChannelReport[],
55
- clientExtensionReports: [] as ClientExtensionReport[],
56
- iceCandidatePairReports: [] as IceCandidatePairReport[],
57
- inboundAudioTrackReports: [] as InboundAudioTrackReport[],
58
- inboundVideoTrackReports: [] as InboundVideoTrackReport[],
59
- observerEventReports: [] as ObserverEventReport[],
60
- outboundAudioTrackReports: [] as OutboundAudioTrackReport[],
61
- outboundVideoTrackReports: [] as OutboundVideoTrackReport[],
62
- peerConnectionTransportReports: [] as PeerConnectionTransportReport[],
63
- sfuEventReports: [] as SfuEventReport[],
64
- sfuExtensionReports: [] as SfuExtensionReport[],
65
- sfuInboundRtpPadReports: [] as SfuInboundRtpPadReport[],
66
- sfuMetaReports: [] as SfuMetaReport[],
67
- sfuOutboundRtpPadReports: [] as SfuOutboundRtpPadReport[],
68
- sfuSctpStreamReports: [] as SfuSctpStreamReport[],
69
- sfuTransportReports: [] as SFUTransportReport[],
70
- };
71
- }