@observertc/observer-js 0.41.3 → 0.41.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.
@@ -15,7 +15,7 @@ exports.ObservedClient = void 0;
15
15
  const events_1 = require("events");
16
16
  const ObservedPeerConnection_1 = require("./ObservedPeerConnection");
17
17
  const logger_1 = require("./common/logger");
18
- const callMetaReports_1 = require("./common/callMetaReports");
18
+ const CallMetaReports_1 = require("./common/CallMetaReports");
19
19
  // eslint-disable-next-line camelcase
20
20
  const utils_1 = require("./common/utils");
21
21
  const callEventReports_1 = require("./common/callEventReports");
@@ -227,8 +227,8 @@ class ObservedClient extends events_1.EventEmitter {
227
227
  ((_b = this._model.operationSystem) === null || _b === void 0 ? void 0 : _b.version) !== sample.os.version ||
228
228
  ((_c = this._model.operationSystem) === null || _c === void 0 ? void 0 : _c.versionName) !== sample.os.versionName)) {
229
229
  this._model.operationSystem = sample.os;
230
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
231
- type: callMetaReports_1.CallMetaType.OPERATION_SYSTEM,
230
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
231
+ type: CallMetaReports_1.CallMetaType.OPERATION_SYSTEM,
232
232
  payload: sample.os,
233
233
  }, this.userId, undefined, sample.timestamp);
234
234
  this.reports.addCallMetaReport(callMetaReport);
@@ -236,8 +236,8 @@ class ObservedClient extends events_1.EventEmitter {
236
236
  if (sample.engine && (((_d = this._model.engine) === null || _d === void 0 ? void 0 : _d.name) !== sample.engine.name ||
237
237
  ((_e = this._model.engine) === null || _e === void 0 ? void 0 : _e.version) !== sample.engine.version)) {
238
238
  this._model.engine = sample.engine;
239
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
240
- type: callMetaReports_1.CallMetaType.ENGINE,
239
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
240
+ type: CallMetaReports_1.CallMetaType.ENGINE,
241
241
  payload: sample.engine,
242
242
  }, this.userId, undefined, sample.timestamp);
243
243
  this.reports.addCallMetaReport(callMetaReport);
@@ -246,8 +246,8 @@ class ObservedClient extends events_1.EventEmitter {
246
246
  ((_g = this._model.platform) === null || _g === void 0 ? void 0 : _g.type) !== sample.platform.type ||
247
247
  ((_h = this._model.platform) === null || _h === void 0 ? void 0 : _h.vendor) !== sample.platform.vendor)) {
248
248
  this._model.platform = sample.platform;
249
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
250
- type: callMetaReports_1.CallMetaType.PLATFORM,
249
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
250
+ type: CallMetaReports_1.CallMetaType.PLATFORM,
251
251
  payload: sample.platform,
252
252
  }, this.userId, undefined, sample.timestamp);
253
253
  this.reports.addCallMetaReport(callMetaReport);
@@ -255,22 +255,22 @@ class ObservedClient extends events_1.EventEmitter {
255
255
  if (sample.browser && (((_j = this._model.browser) === null || _j === void 0 ? void 0 : _j.name) !== sample.browser.name ||
256
256
  ((_k = this._model.browser) === null || _k === void 0 ? void 0 : _k.version) !== sample.browser.version)) {
257
257
  this._model.browser = sample.browser;
258
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
259
- type: callMetaReports_1.CallMetaType.BROWSER,
258
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
259
+ type: CallMetaReports_1.CallMetaType.BROWSER,
260
260
  payload: sample.browser,
261
261
  }, this.userId, undefined, sample.timestamp);
262
262
  this.reports.addCallMetaReport(callMetaReport);
263
263
  }
264
264
  for (const mediaConstraint of (_l = sample.mediaConstraints) !== null && _l !== void 0 ? _l : []) {
265
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
266
- type: callMetaReports_1.CallMetaType.MEDIA_CONSTRAINT,
265
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
266
+ type: CallMetaReports_1.CallMetaType.MEDIA_CONSTRAINT,
267
267
  payload: mediaConstraint,
268
268
  }, this.userId, undefined, sample.timestamp);
269
269
  this.reports.addCallMetaReport(callMetaReport);
270
270
  }
271
271
  for (const localSDP of (_m = sample.localSDPs) !== null && _m !== void 0 ? _m : []) {
272
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
273
- type: callMetaReports_1.CallMetaType.LOCAL_SDP,
272
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
273
+ type: CallMetaReports_1.CallMetaType.LOCAL_SDP,
274
274
  payload: localSDP,
275
275
  }, this.userId, undefined, sample.timestamp);
276
276
  this.reports.addCallMetaReport(callMetaReport);
@@ -327,8 +327,8 @@ class ObservedClient extends events_1.EventEmitter {
327
327
  this.call.emit('callevent', Object.assign({ mediaUnitId: this.mediaUnitId, clientId: this.clientId, userId: this.userId, timestamp: timestamp !== null && timestamp !== void 0 ? timestamp : now }, callEvent));
328
328
  }
329
329
  for (const userMediaError of (_q = sample.userMediaErrors) !== null && _q !== void 0 ? _q : []) {
330
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
331
- type: callMetaReports_1.CallMetaType.USER_MEDIA_ERROR,
330
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
331
+ type: CallMetaReports_1.CallMetaType.USER_MEDIA_ERROR,
332
332
  payload: userMediaError,
333
333
  }, this.userId);
334
334
  this.reports.addCallMetaReport(callMetaReport);
@@ -336,38 +336,38 @@ class ObservedClient extends events_1.EventEmitter {
336
336
  this.emit('usermediaerror', userMediaError);
337
337
  }
338
338
  for (const certificate of (_r = sample.certificates) !== null && _r !== void 0 ? _r : []) {
339
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
340
- type: callMetaReports_1.CallMetaType.CERTIFICATE,
339
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
340
+ type: CallMetaReports_1.CallMetaType.CERTIFICATE,
341
341
  payload: certificate,
342
342
  }, this.userId);
343
343
  this.reports.addCallMetaReport(callMetaReport);
344
344
  }
345
345
  for (const codec of (_s = sample.codecs) !== null && _s !== void 0 ? _s : []) {
346
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
347
- type: callMetaReports_1.CallMetaType.CODEC,
346
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
347
+ type: CallMetaReports_1.CallMetaType.CODEC,
348
348
  payload: codec,
349
349
  }, this.userId);
350
350
  this.reports.addCallMetaReport(callMetaReport);
351
351
  codec.mimeType && this.codecs.push(codec.mimeType);
352
352
  }
353
353
  for (const iceServer of (_t = sample.iceServers) !== null && _t !== void 0 ? _t : []) {
354
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
355
- type: callMetaReports_1.CallMetaType.ICE_SERVER,
354
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
355
+ type: CallMetaReports_1.CallMetaType.ICE_SERVER,
356
356
  payload: iceServer,
357
357
  }, this.userId);
358
358
  this.reports.addCallMetaReport(callMetaReport);
359
359
  }
360
360
  for (const mediaDevice of (_u = sample.mediaDevices) !== null && _u !== void 0 ? _u : []) {
361
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
362
- type: callMetaReports_1.CallMetaType.MEDIA_DEVICE,
361
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
362
+ type: CallMetaReports_1.CallMetaType.MEDIA_DEVICE,
363
363
  payload: mediaDevice,
364
364
  }, this.userId);
365
365
  this.reports.addCallMetaReport(callMetaReport);
366
366
  mediaDevice.label && this.mediaDevices.push(mediaDevice.label);
367
367
  }
368
368
  for (const mediaSource of (_v = sample.mediaSources) !== null && _v !== void 0 ? _v : []) {
369
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
370
- type: callMetaReports_1.CallMetaType.MEDIA_SOURCE,
369
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.serviceId, this.mediaUnitId, this.roomId, this.callId, this.clientId, {
370
+ type: CallMetaReports_1.CallMetaType.MEDIA_SOURCE,
371
371
  payload: mediaSource,
372
372
  }, this.userId);
373
373
  this.reports.addCallMetaReport(callMetaReport);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ObservedICE = void 0;
4
4
  const events_1 = require("events");
5
- const callMetaReports_1 = require("./common/callMetaReports");
5
+ const CallMetaReports_1 = require("./common/CallMetaReports");
6
6
  class ObservedICE extends events_1.EventEmitter {
7
7
  static create(peerConnection) {
8
8
  return new ObservedICE(peerConnection);
@@ -63,8 +63,8 @@ class ObservedICE extends events_1.EventEmitter {
63
63
  const newCandidate = !this._localCandidates.has(candidate.id);
64
64
  this._localCandidates.set(candidate.id, candidate);
65
65
  if (newCandidate) {
66
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.peerConnection.client.serviceId, this.peerConnection.client.mediaUnitId, this.peerConnection.client.roomId, this.peerConnection.client.callId, this.peerConnection.client.clientId, {
67
- type: callMetaReports_1.CallMetaType.ICE_LOCAL_CANDIDATE,
66
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.peerConnection.client.serviceId, this.peerConnection.client.mediaUnitId, this.peerConnection.client.roomId, this.peerConnection.client.callId, this.peerConnection.client.clientId, {
67
+ type: CallMetaReports_1.CallMetaType.ICE_LOCAL_CANDIDATE,
68
68
  payload: candidate,
69
69
  }, this.peerConnection.client.userId, this.peerConnection.peerConnectionId, sampleTimestamp);
70
70
  this.reports.addCallMetaReport(callMetaReport);
@@ -77,8 +77,8 @@ class ObservedICE extends events_1.EventEmitter {
77
77
  const newCandidate = !this._remoteCandidates.has(candidate.id);
78
78
  this._remoteCandidates.set(candidate.id, candidate);
79
79
  if (newCandidate) {
80
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(this.peerConnection.client.serviceId, this.peerConnection.client.mediaUnitId, this.peerConnection.client.roomId, this.peerConnection.client.callId, this.peerConnection.client.clientId, {
81
- type: callMetaReports_1.CallMetaType.ICE_REMOTE_CANDIDATE,
80
+ const callMetaReport = (0, CallMetaReports_1.createCallMetaReport)(this.peerConnection.client.serviceId, this.peerConnection.client.mediaUnitId, this.peerConnection.client.roomId, this.peerConnection.client.callId, this.peerConnection.client.clientId, {
81
+ type: CallMetaReports_1.CallMetaType.ICE_REMOTE_CANDIDATE,
82
82
  payload: candidate,
83
83
  }, this.peerConnection.client.userId, this.peerConnection.peerConnectionId, sampleTimestamp);
84
84
  this.reports.addCallMetaReport(callMetaReport);
@@ -20,4 +20,32 @@ export declare enum CallEventType {
20
20
  SIGNALING_STATE_CHANGE = "SIGNALING_STATE_CHANGE",
21
21
  CLIENT_ISSUE = "CLIENT_ISSUE"
22
22
  }
23
+ export type CallEventReportTyoe = {
24
+ name: CallEventType.MEDIA_TRACK_ADDED;
25
+ attachment: MediaTrackAddedAttachment;
26
+ } | {
27
+ name: CallEventType.PEER_CONNECTION_STATE_CHANGED;
28
+ attachment: PeerConnectionStateChangedAttachment;
29
+ } | {
30
+ name: CallEventType.ICE_CONNECTION_STATE_CHANGED;
31
+ attachment: IceConnectionStateChangedAttachment;
32
+ } | {
33
+ name: CallEventType.ICE_GATHERING_STATE_CHANGED;
34
+ attachment: IceGatheringStateChangedAttachment;
35
+ };
36
+ export type MediaTrackAddedAttachment = {
37
+ kind?: 'audio' | 'video';
38
+ direction?: 'inbound' | 'outbound';
39
+ sfuStreamId?: string;
40
+ sfuSinkId?: string;
41
+ };
42
+ export type PeerConnectionStateChangedAttachment = {
43
+ iceConnectionState?: 'closed' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'new';
44
+ };
45
+ export type IceConnectionStateChangedAttachment = {
46
+ iceConnectionState?: 'new' | 'connected' | 'disconnected' | 'failed' | 'closed' | 'checking' | 'completed';
47
+ };
48
+ export type IceGatheringStateChangedAttachment = {
49
+ iceGatheringState?: 'new' | 'gathering' | 'complete';
50
+ };
23
51
  //# sourceMappingURL=CallEventType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CallEventType.d.ts","sourceRoot":"","sources":["../../src/common/CallEventType.ts"],"names":[],"mappings":"AACA,oBAAY,aAAa;IACxB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,sBAAsB,2BAA2B;IACjD,sBAAsB,2BAA2B;IACjD,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;IAC3C,mBAAmB,wBAAwB;IAC3C,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;IAC3C,2BAA2B,gCAAgC;IAC3D,6BAA6B,kCAAkC;IAC/D,4BAA4B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,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG;IAClD,kBAAkB,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,YAAY,GAAG,cAAc,GAAG,QAAQ,GAAG,KAAK,CAAC;CAC/F,CAAA;AAED,MAAM,MAAM,mCAAmC,GAAG;IACjD,kBAAkB,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;CAC3G,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAChD,iBAAiB,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;CACrD,CAAA"}
@@ -60,4 +60,4 @@ export type CallMetaReportType = {
60
60
  payload: Browser;
61
61
  };
62
62
  export declare function createCallMetaReport(serviceId: string, mediaUnitId: string, roomId: string, callId: string, clientId: string, reportType: CallMetaReportType, userId?: string, peerConnectionId?: string, timestamp?: number): CallMetaReport;
63
- //# sourceMappingURL=callMetaReports.d.ts.map
63
+ //# sourceMappingURL=CallMetaReports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"callMetaReports.d.ts","sourceRoot":"","sources":["../../src/common/callMetaReports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EACN,OAAO,EACP,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,eAAe,EACf,eAAe,EACf,QAAQ,EACR,MAAM,+BAA+B,CAAC;AAGvC,oBAAY,YAAY;IACvB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,UAAU,eAAe;IACzB,gBAAgB,qBAAqB;IACrC,YAAY,iBAAiB;IAC7B,YAAY,iBAAiB;IAC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,EAAE,MAAM,CAAC;CAChB,GAAG;IACH,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC;AAEH,wBAAgB,oBAAoB,CACnC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,kBAAkB,EAC9B,MAAM,CAAC,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,MAAM,EACzB,SAAS,CAAC,EAAE,MAAM,kBAelB"}
1
+ {"version":3,"file":"CallMetaReports.d.ts","sourceRoot":"","sources":["../../src/common/CallMetaReports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EACN,OAAO,EACP,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,eAAe,EACf,eAAe,EACf,QAAQ,EACR,MAAM,+BAA+B,CAAC;AAGvC,oBAAY,YAAY;IACvB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,UAAU,eAAe;IACzB,gBAAgB,qBAAqB;IACrC,YAAY,iBAAiB;IAC7B,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,SAAS,cAAc;IAEvB,gBAAgB,qBAAqB;IACrC,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACnB;AAED,MAAM,MAAM,kBAAkB,GAC3B;IACD,IAAI,EAAE,YAAY,CAAC,WAAW,CAAC;IAC/B,OAAO,EAAE,WAAW,CAAC;CACrB,GAAG;IACH,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC;IACzB,OAAO,EAAE,eAAe,CAAC;CACzB,GAAG;IACH,IAAI,EAAE,YAAY,CAAC,mBAAmB,CA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,EAAE,MAAM,kBAelB"}
package/lib/index.d.ts CHANGED
@@ -15,8 +15,8 @@ export type { CallSummary, ClientSummary, ClientIssue } from './monitors/CallSum
15
15
  export type { ObserverSinkContext } from './common/types';
16
16
  export type { SfuServerMonitorMetricsRecord } from './monitors/SfuServerMonitor';
17
17
  export type { TurnUsageMonitorEvents, TurnUsageMonitor, TurnStats, TurnUsage } from './monitors/TurnUsageMonitor';
18
- export { CallEventType } from './common/CallEventType';
19
- export { CallMetaType, CallMetaReportType } from './common/callMetaReports';
18
+ export { CallEventType, CallEventReportTyoe } from './common/CallEventType';
19
+ export { CallMetaType, CallMetaReportType } from './common/CallMetaReports';
20
20
  import { Observer, ObserverConfig } from './Observer';
21
21
  export declare function createObserver(config?: Partial<ObserverConfig>): Observer;
22
22
  import { LogLevel, Logger } from './common/logger';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAE9D,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAExD,YAAY,EACX,OAAO,EACP,YAAY,EACZ,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,WAAW,GACX,MAAM,+BAA+B,CAAC;AAEvC,YAAY,EACX,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACr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,MAAM,kBAAkB,CAAC;AAC5E,YAAY,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAClI,YAAY,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAC1H,YAAY,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC9H,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,YAAY,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACjF,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAClH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACtD,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,YAE9D;AAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAA8B,MAAM,iBAAiB,CAAC;AAC/E,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAG3D"}
package/lib/index.js CHANGED
@@ -30,8 +30,8 @@ exports.SampleSchema = __importStar(require("@observertc/sample-schemas-js"));
30
30
  exports.ReportSchema = __importStar(require("@observertc/report-schemas-js"));
31
31
  var CallEventType_1 = require("./common/CallEventType");
32
32
  Object.defineProperty(exports, "CallEventType", { enumerable: true, get: function () { return CallEventType_1.CallEventType; } });
33
- var callMetaReports_1 = require("./common/callMetaReports");
34
- Object.defineProperty(exports, "CallMetaType", { enumerable: true, get: function () { return callMetaReports_1.CallMetaType; } });
33
+ var CallMetaReports_1 = require("./common/CallMetaReports");
34
+ Object.defineProperty(exports, "CallMetaType", { enumerable: true, get: function () { return CallMetaReports_1.CallMetaType; } });
35
35
  const Observer_2 = require("./Observer");
36
36
  function createObserver(config) {
37
37
  return Observer_2.Observer.create(config !== null && config !== void 0 ? config : {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@observertc/observer-js",
3
- "version": "0.41.3",
3
+ "version": "0.41.4",
4
4
  "description": "Server Side NodeJS Library for processing ObserveRTC Samples",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -3,7 +3,7 @@ import { ObservedCall } from './ObservedCall';
3
3
  import { EventEmitter } from 'events';
4
4
  import { ObservedPeerConnection } from './ObservedPeerConnection';
5
5
  import { createLogger } from './common/logger';
6
- import { CallMetaType, createCallMetaReport } from './common/callMetaReports';
6
+ import { CallMetaType, createCallMetaReport } from './common/CallMetaReports';
7
7
  // eslint-disable-next-line camelcase
8
8
  import { PartialBy, isValidUuid } from './common/utils';
9
9
  import { createClientLeftEventReport } from './common/callEventReports';
@@ -2,7 +2,7 @@ import { IceCandidatePair, IceLocalCandidate, IceRemoteCandidate } from '@observ
2
2
  import { EventEmitter } from 'events';
3
3
  import { ObservedPeerConnection } from './ObservedPeerConnection';
4
4
  import { IceCandidatePairReport } from '@observertc/report-schemas-js';
5
- import { CallMetaType, createCallMetaReport } from './common/callMetaReports';
5
+ import { CallMetaType, createCallMetaReport } from './common/CallMetaReports';
6
6
 
7
7
  export type ObservedICEEvents = {
8
8
  update: [{
@@ -21,3 +21,36 @@ export enum CallEventType {
21
21
  SIGNALING_STATE_CHANGE = 'SIGNALING_STATE_CHANGE',
22
22
  CLIENT_ISSUE = 'CLIENT_ISSUE',
23
23
  }
24
+
25
+ export type CallEventReportTyoe = {
26
+ name: CallEventType.MEDIA_TRACK_ADDED,
27
+ attachment: MediaTrackAddedAttachment,
28
+ } | {
29
+ name: CallEventType.PEER_CONNECTION_STATE_CHANGED,
30
+ attachment: PeerConnectionStateChangedAttachment,
31
+ } | {
32
+ name: CallEventType.ICE_CONNECTION_STATE_CHANGED,
33
+ attachment: IceConnectionStateChangedAttachment,
34
+ } | {
35
+ name: CallEventType.ICE_GATHERING_STATE_CHANGED,
36
+ attachment: IceGatheringStateChangedAttachment,
37
+ }
38
+
39
+ export type MediaTrackAddedAttachment = {
40
+ kind?: 'audio' | 'video',
41
+ direction?: 'inbound' | 'outbound',
42
+ sfuStreamId?: string,
43
+ sfuSinkId?: string,
44
+ }
45
+
46
+ export type PeerConnectionStateChangedAttachment = {
47
+ iceConnectionState?: 'closed' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'new',
48
+ }
49
+
50
+ export type IceConnectionStateChangedAttachment = {
51
+ iceConnectionState?: 'new' | 'connected' | 'disconnected' | 'failed' | 'closed' | 'checking' | 'completed',
52
+ }
53
+
54
+ export type IceGatheringStateChangedAttachment = {
55
+ iceGatheringState?: 'new' | 'gathering' | 'complete',
56
+ }
package/src/index.ts CHANGED
@@ -65,8 +65,8 @@ export type { CallSummary, ClientSummary, ClientIssue } from './monitors/CallSum
65
65
  export type { ObserverSinkContext } from './common/types';
66
66
  export type { SfuServerMonitorMetricsRecord } from './monitors/SfuServerMonitor';
67
67
  export type { TurnUsageMonitorEvents, TurnUsageMonitor, TurnStats, TurnUsage } from './monitors/TurnUsageMonitor';
68
- export { CallEventType } from './common/CallEventType';
69
- export { CallMetaType, CallMetaReportType } from './common/callMetaReports';
68
+ export { CallEventType, CallEventReportTyoe } from './common/CallEventType';
69
+ export { CallMetaType, CallMetaReportType } from './common/CallMetaReports';
70
70
 
71
71
  import { Observer, ObserverConfig } from './Observer';
72
72
  export function createObserver(config?: Partial<ObserverConfig>) {