@cloudflare/realtimekit 1.2.2-staging.2 → 1.2.2-staging.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.es.js CHANGED
@@ -17114,7 +17114,7 @@ class jl extends Gf {
17114
17114
  );
17115
17115
  try {
17116
17116
  const e = this.trackEnabled;
17117
- yield this.setMediaTrack(
17117
+ this.disableTrack(), yield this.setMediaTrack(
17118
17118
  yield this.mediaInterface.getAudioTrack(
17119
17119
  !e,
17120
17120
  this.userSelectedDevice
@@ -17391,7 +17391,7 @@ class jc extends Gf {
17391
17391
  return;
17392
17392
  }
17393
17393
  try {
17394
- yield this.setMediaTrack(
17394
+ this.disableTrack(), yield this.setMediaTrack(
17395
17395
  yield this.mediaInterface.getVideoTrack(this.userSelectedDevice)
17396
17396
  );
17397
17397
  } catch (r) {
@@ -27686,7 +27686,9 @@ class Xv extends qt {
27686
27686
  }
27687
27687
  getConnectedMeetings() {
27688
27688
  return u(this, null, function* () {
27689
- return this.validateConnectedMeetingsAction(), yield n(this, Ps).getValue("connectedMeetingsSocketHandler").getConnectedRoomsDump();
27689
+ this.validateConnectedMeetingsAction(), this.logger.info("Getting connected meetings dump");
27690
+ const e = yield n(this, Ps).getValue("connectedMeetingsSocketHandler").getConnectedRoomsDump();
27691
+ return this.logger.info("Got connected meetings dump"), e;
27690
27692
  });
27691
27693
  }
27692
27694
  /**
@@ -27694,9 +27696,11 @@ class Xv extends qt {
27694
27696
  */
27695
27697
  createMeetings(e) {
27696
27698
  return u(this, null, function* () {
27697
- return this.validateConnectedMeetingsAction(), (yield n(this, Ps).getValue("connectedMeetingsSocketHandler").createConnectedRooms(
27699
+ this.validateConnectedMeetingsAction(), this.logger.info(`Creating connected meetings ${JSON.stringify(e)}`);
27700
+ const r = yield n(this, Ps).getValue("connectedMeetingsSocketHandler").createConnectedRooms(
27698
27701
  e
27699
- )).map((i) => ({
27702
+ );
27703
+ return this.logger.info(`Created connected meetings ${JSON.stringify(r)}`), r.map((i) => ({
27700
27704
  id: i.id,
27701
27705
  title: i.title
27702
27706
  }));
@@ -27707,9 +27711,9 @@ class Xv extends qt {
27707
27711
  */
27708
27712
  updateMeetings(e) {
27709
27713
  return u(this, null, function* () {
27710
- this.validateConnectedMeetingsAction(), yield n(this, Ps).getValue("connectedMeetingsSocketHandler").updateConnectedRooms(
27714
+ this.validateConnectedMeetingsAction(), this.logger.info(`Updating connected meetings ${JSON.stringify(e)}`), yield n(this, Ps).getValue("connectedMeetingsSocketHandler").updateConnectedRooms(
27711
27715
  e.map((r) => ({ meetingId: r.id, title: r.title }))
27712
- );
27716
+ ), this.logger.info(`Updated connected meetings ${JSON.stringify(e)}`);
27713
27717
  });
27714
27718
  }
27715
27719
  /**
@@ -27717,15 +27721,17 @@ class Xv extends qt {
27717
27721
  */
27718
27722
  deleteMeetings(e) {
27719
27723
  return u(this, null, function* () {
27720
- this.validateConnectedMeetingsAction();
27724
+ this.validateConnectedMeetingsAction(), this.logger.info(`Moving participants before deleting connected meetings ${JSON.stringify(e)}`);
27721
27725
  const r = this.meetings.map((a) => e.includes(a.id) && a.participants.length !== 0 ? this.moveParticipants(
27722
27726
  a.id,
27723
27727
  this.parentMeeting.id,
27724
27728
  a.participants.map((o) => o.id)
27725
27729
  ) : Promise.resolve());
27726
- return yield Promise.all(r), yield n(this, Ps).getValue("connectedMeetingsSocketHandler").disableConnectedRooms(
27730
+ this.logger.info(`Moved participants before deleting connected meetings ${JSON.stringify(e)}. Deleting now.`), yield Promise.all(r);
27731
+ const i = yield n(this, Ps).getValue("connectedMeetingsSocketHandler").disableConnectedRooms(
27727
27732
  e
27728
27733
  );
27734
+ return this.logger.info(`Deleted connected meetings ${JSON.stringify(e)}`), i;
27729
27735
  });
27730
27736
  }
27731
27737
  /**
@@ -27737,7 +27743,7 @@ class Xv extends qt {
27737
27743
  */
27738
27744
  moveParticipants(e, r, i) {
27739
27745
  return u(this, null, function* () {
27740
- this.validateConnectedMeetingsAction();
27746
+ this.validateConnectedMeetingsAction(), this.logger.info(`Moving connected meetings participants ${JSON.stringify(i)} from ${e} to ${r}`);
27741
27747
  const a = yield n(this, Ps).getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms(
27742
27748
  {
27743
27749
  sourceMeetingId: e,
@@ -27747,7 +27753,7 @@ class Xv extends qt {
27747
27753
  }))
27748
27754
  }
27749
27755
  );
27750
- return a.success && this.moveSuccessHandler(e, r, i), a;
27756
+ return a.success ? (this.logger.info(`Moved connected meetings participants ${JSON.stringify(i)} from ${e} to ${r}`), this.moveSuccessHandler(e, r, i)) : this.logger.error(`Failed to move connected meetings participants ${JSON.stringify(i)} from ${e} to ${r}`), a;
27751
27757
  });
27752
27758
  }
27753
27759
  /**
@@ -27755,7 +27761,7 @@ class Xv extends qt {
27755
27761
  */
27756
27762
  moveParticipantsWithCustomPreset(e, r, i) {
27757
27763
  return u(this, null, function* () {
27758
- this.validateConnectedMeetingsAction();
27764
+ this.validateConnectedMeetingsAction(), this.logger.info(`Moving connected meetings participants (custom preset) ${JSON.stringify(i)} from ${e} to ${r}`);
27759
27765
  const a = yield n(this, Ps).getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms(
27760
27766
  {
27761
27767
  sourceMeetingId: e,
@@ -27763,7 +27769,7 @@ class Xv extends qt {
27763
27769
  participants: i
27764
27770
  }
27765
27771
  );
27766
- return a.success && this.moveSuccessHandler(e, r, i.map((o) => o.id)), a;
27772
+ return a.success ? (this.logger.info(`Moved connected meetings participants (custom preset) ${JSON.stringify(i)} from ${e} to ${r}`), this.moveSuccessHandler(e, r, i.map((o) => o.id))) : this.logger.error(`Failed to move connected meetings participants (custom preset) ${JSON.stringify(i)} from ${e} to ${r}`), a;
27767
27773
  });
27768
27774
  }
27769
27775
  moveSuccessHandler(e, r, i) {
@@ -27857,8 +27863,9 @@ const Zv = (Jg = class {
27857
27863
  }
27858
27864
  // event handlers
27859
27865
  handleTransferPeer(s) {
27866
+ this.logger.info("Received backend request to switch connected meetings");
27860
27867
  const t = n(this, ge).getValue("connectedMeetingsSocketHandler").handleTransferPeerRaw(s);
27861
- return this.switchMeeting(t);
27868
+ return this.logger.info(`Honoring request to switch connected meetings. Going to ${t == null ? void 0 : t.meetingId}`), this.switchMeeting(t);
27862
27869
  }
27863
27870
  switchMeeting(e) {
27864
27871
  return u(this, arguments, function* ({
@@ -28412,7 +28419,7 @@ let ti = (Kg = class {
28412
28419
  video: !0
28413
28420
  };
28414
28421
  return a.setValue("options", e), a.setValue("peerId", t), a.setValue("modules", o), a.setValue("sdkName", "web-core"), a.setValue("meetingId", r), a.setValue("apiBase", i.apiBase), a.setValue("baseURI", i.baseURI), a.setValue("userId", i.participantId), a.setValue("organizationId", i.orgId), a.setValue("authToken", e.authToken), a.setValue("overrides", (d = e.overrides) != null ? d : {}), a.setValue("env", lw({ baseURI: i.baseURI })), a.setValue("defaults", c), a.setValue("onError", e.onError || (() => {
28415
- })), a.setValue("cachedUserDetails", Rs(e.cachedUserDetails)), a.setValue("sdkVersion", "1.2.2-staging.2"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new YO()), a;
28422
+ })), a.setValue("cachedUserDetails", Rs(e.cachedUserDetails)), a.setValue("sdkVersion", "1.2.2-staging.4"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new YO()), a;
28416
28423
  }
28417
28424
  join() {
28418
28425
  return u(this, null, function* () {
package/dist/index.es5.js CHANGED
@@ -16788,19 +16788,19 @@ var Pg = nc, _M = Object.defineProperty, OM = Object.getOwnPropertyDescriptor, W
16788
16788
  }
16789
16789
  throw this.logger.warn("AudioMediaHandler.setDevice Received non audio device"), new j("Non audio device received while setting device!", "1603");
16790
16790
  case 6:
16791
- return u.prev = 6, i = this.trackEnabled, u.t0 = this, u.next = 11, this.mediaInterface.getAudioTrack(!i, this.userSelectedDevice);
16792
- case 11:
16793
- return u.t1 = u.sent, u.next = 14, u.t0.setMediaTrack.call(u.t0, u.t1);
16794
- case 14:
16795
- u.next = 21;
16791
+ return u.prev = 6, i = this.trackEnabled, this.disableTrack(), u.t0 = this, u.next = 12, this.mediaInterface.getAudioTrack(!i, this.userSelectedDevice);
16792
+ case 12:
16793
+ return u.t1 = u.sent, u.next = 15, u.t0.setMediaTrack.call(u.t0, u.t1);
16794
+ case 15:
16795
+ u.next = 22;
16796
16796
  break;
16797
- case 16:
16798
- throw u.prev = 16, u.t2 = u.catch(6), this.logger.error("AudioMediaHandler.setDevice.error", { error: u.t2 }), this.disableTrack(), new j(u.t2.message, "1604");
16799
- case 21:
16797
+ case 17:
16798
+ throw u.prev = 17, u.t2 = u.catch(6), this.logger.error("AudioMediaHandler.setDevice.error", { error: u.t2 }), this.disableTrack(), new j(u.t2.message, "1604");
16799
+ case 22:
16800
16800
  case "end":
16801
16801
  return u.stop();
16802
16802
  }
16803
- }, n, this, [[6, 16]]);
16803
+ }, n, this, [[6, 17]]);
16804
16804
  }));
16805
16805
  function r(n) {
16806
16806
  return e.apply(this, arguments);
@@ -17222,19 +17222,19 @@ var DM = Cc, ka = /* @__PURE__ */ C("mediaInterface"), LM = /* @__PURE__ */ func
17222
17222
  }
17223
17223
  return this.logger.warn("VideoMediaHandler.setDevice Tried switching device with video disabled", { devices: [a] }), this.currentDevice = a, s.abrupt("return");
17224
17224
  case 10:
17225
- return s.prev = 10, s.t0 = this, s.next = 14, this.mediaInterface.getVideoTrack(this.userSelectedDevice);
17226
- case 14:
17227
- return s.t1 = s.sent, s.next = 17, s.t0.setMediaTrack.call(s.t0, s.t1);
17228
- case 17:
17229
- s.next = 24;
17225
+ return s.prev = 10, this.disableTrack(), s.t0 = this, s.next = 15, this.mediaInterface.getVideoTrack(this.userSelectedDevice);
17226
+ case 15:
17227
+ return s.t1 = s.sent, s.next = 18, s.t0.setMediaTrack.call(s.t0, s.t1);
17228
+ case 18:
17229
+ s.next = 25;
17230
17230
  break;
17231
- case 19:
17232
- throw s.prev = 19, s.t2 = s.catch(10), this.logger.error("VideoMediaHandler.setDevice.error", { error: s.t2 }), this.disableTrack(), new j("Failed to change device", "1600", this.logger);
17233
- case 24:
17231
+ case 20:
17232
+ throw s.prev = 20, s.t2 = s.catch(10), this.logger.error("VideoMediaHandler.setDevice.error", { error: s.t2 }), this.disableTrack(), new j("Failed to change device", "1600", this.logger);
17233
+ case 25:
17234
17234
  case "end":
17235
17235
  return s.stop();
17236
17236
  }
17237
- }, n, this, [[10, 19]]);
17237
+ }, n, this, [[10, 20]]);
17238
17238
  }));
17239
17239
  function r(n) {
17240
17240
  return e.apply(this, arguments);
@@ -29129,10 +29129,10 @@ var MD = /* @__PURE__ */ function() {
29129
29129
  for (; ; )
29130
29130
  switch (s.prev = s.next) {
29131
29131
  case 0:
29132
- return this.validateConnectedMeetingsAction(), s.next = 3, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").getConnectedRoomsDump();
29133
- case 3:
29134
- return a = s.sent, s.abrupt("return", a);
29135
- case 5:
29132
+ return this.validateConnectedMeetingsAction(), this.logger.info("Getting connected meetings dump"), s.next = 4, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").getConnectedRoomsDump();
29133
+ case 4:
29134
+ return a = s.sent, this.logger.info("Got connected meetings dump"), s.abrupt("return", a);
29135
+ case 7:
29136
29136
  case "end":
29137
29137
  return s.stop();
29138
29138
  }
@@ -29153,12 +29153,12 @@ var MD = /* @__PURE__ */ function() {
29153
29153
  for (; ; )
29154
29154
  switch (u.prev = u.next) {
29155
29155
  case 0:
29156
- return this.validateConnectedMeetingsAction(), u.next = 3, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").createConnectedRooms(a);
29157
- case 3:
29158
- return i = u.sent, u.abrupt("return", i.map(function(c) {
29156
+ return this.validateConnectedMeetingsAction(), this.logger.info("Creating connected meetings ".concat(JSON.stringify(a))), u.next = 4, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").createConnectedRooms(a);
29157
+ case 4:
29158
+ return i = u.sent, this.logger.info("Created connected meetings ".concat(JSON.stringify(i))), u.abrupt("return", i.map(function(c) {
29159
29159
  return { id: c.id, title: c.title };
29160
29160
  }));
29161
- case 5:
29161
+ case 7:
29162
29162
  case "end":
29163
29163
  return u.stop();
29164
29164
  }
@@ -29174,10 +29174,12 @@ var MD = /* @__PURE__ */ function() {
29174
29174
  for (; ; )
29175
29175
  switch (s.prev = s.next) {
29176
29176
  case 0:
29177
- return this.validateConnectedMeetingsAction(), s.next = 3, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").updateConnectedRooms(a.map(function(u) {
29177
+ return this.validateConnectedMeetingsAction(), this.logger.info("Updating connected meetings ".concat(JSON.stringify(a))), s.next = 4, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").updateConnectedRooms(a.map(function(u) {
29178
29178
  return { meetingId: u.id, title: u.title };
29179
29179
  }));
29180
- case 3:
29180
+ case 4:
29181
+ this.logger.info("Updated connected meetings ".concat(JSON.stringify(a)));
29182
+ case 5:
29181
29183
  case "end":
29182
29184
  return s.stop();
29183
29185
  }
@@ -29194,16 +29196,16 @@ var MD = /* @__PURE__ */ function() {
29194
29196
  for (; ; )
29195
29197
  switch (d.prev = d.next) {
29196
29198
  case 0:
29197
- return this.validateConnectedMeetingsAction(), s = this.meetings.map(function(p) {
29199
+ return this.validateConnectedMeetingsAction(), this.logger.info("Moving participants before deleting connected meetings ".concat(JSON.stringify(a))), s = this.meetings.map(function(p) {
29198
29200
  return a.includes(p.id) && p.participants.length !== 0 ? i.moveParticipants(p.id, i.parentMeeting.id, p.participants.map(function(v) {
29199
29201
  return v.id;
29200
29202
  })) : Promise.resolve();
29201
- }), d.next = 4, Promise.all(s);
29202
- case 4:
29203
- return d.next = 6, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").disableConnectedRooms(a);
29203
+ }), this.logger.info("Moved participants before deleting connected meetings ".concat(JSON.stringify(a), ". Deleting now.")), d.next = 6, Promise.all(s);
29204
29204
  case 6:
29205
- return u = d.sent, d.abrupt("return", u);
29205
+ return d.next = 8, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").disableConnectedRooms(a);
29206
29206
  case 8:
29207
+ return u = d.sent, this.logger.info("Deleted connected meetings ".concat(JSON.stringify(a))), d.abrupt("return", u);
29208
+ case 11:
29207
29209
  case "end":
29208
29210
  return d.stop();
29209
29211
  }
@@ -29220,12 +29222,12 @@ var MD = /* @__PURE__ */ function() {
29220
29222
  for (; ; )
29221
29223
  switch (d.prev = d.next) {
29222
29224
  case 0:
29223
- return this.validateConnectedMeetingsAction(), d.next = 3, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: a, destinationMeetingId: i, participants: s.map(function(p) {
29225
+ return this.validateConnectedMeetingsAction(), this.logger.info("Moving connected meetings participants ".concat(JSON.stringify(s), " from ").concat(a, " to ").concat(i)), d.next = 4, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: a, destinationMeetingId: i, participants: s.map(function(p) {
29224
29226
  return { id: p };
29225
29227
  }) });
29226
- case 3:
29227
- return u = d.sent, u.success && this.moveSuccessHandler(a, i, s), d.abrupt("return", u);
29228
- case 6:
29228
+ case 4:
29229
+ return u = d.sent, u.success ? (this.logger.info("Moved connected meetings participants ".concat(JSON.stringify(s), " from ").concat(a, " to ").concat(i)), this.moveSuccessHandler(a, i, s)) : this.logger.error("Failed to move connected meetings participants ".concat(JSON.stringify(s), " from ").concat(a, " to ").concat(i)), d.abrupt("return", u);
29230
+ case 7:
29229
29231
  case "end":
29230
29232
  return d.stop();
29231
29233
  }
@@ -29242,12 +29244,12 @@ var MD = /* @__PURE__ */ function() {
29242
29244
  for (; ; )
29243
29245
  switch (d.prev = d.next) {
29244
29246
  case 0:
29245
- return this.validateConnectedMeetingsAction(), d.next = 3, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: a, destinationMeetingId: i, participants: s });
29246
- case 3:
29247
- return u = d.sent, u.success && this.moveSuccessHandler(a, i, s.map(function(p) {
29247
+ return this.validateConnectedMeetingsAction(), this.logger.info("Moving connected meetings participants (custom preset) ".concat(JSON.stringify(s), " from ").concat(a, " to ").concat(i)), d.next = 4, l(this, lt)[lt].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: a, destinationMeetingId: i, participants: s });
29248
+ case 4:
29249
+ return u = d.sent, u.success ? (this.logger.info("Moved connected meetings participants (custom preset) ".concat(JSON.stringify(s), " from ").concat(a, " to ").concat(i)), this.moveSuccessHandler(a, i, s.map(function(p) {
29248
29250
  return p.id;
29249
- })), d.abrupt("return", u);
29250
- case 6:
29251
+ }))) : this.logger.error("Failed to move connected meetings participants (custom preset) ".concat(JSON.stringify(s), " from ").concat(a, " to ").concat(i)), d.abrupt("return", u);
29252
+ case 7:
29251
29253
  case "end":
29252
29254
  return d.stop();
29253
29255
  }
@@ -29319,8 +29321,9 @@ var LD = Object.defineProperty, $D = Object.getOwnPropertyDescriptor, Zp = funct
29319
29321
  }
29320
29322
  // event handlers
29321
29323
  }, { key: "handleTransferPeer", value: function(e) {
29324
+ this.logger.info("Received backend request to switch connected meetings");
29322
29325
  var r = l(this, he)[he].getValue("connectedMeetingsSocketHandler").handleTransferPeerRaw(e);
29323
- return this.switchMeeting(r);
29326
+ return this.logger.info("Honoring request to switch connected meetings. Going to ".concat(r == null ? void 0 : r.meetingId)), this.switchMeeting(r);
29324
29327
  } }, { key: "switchMeeting", value: function() {
29325
29328
  var t = m(/* @__PURE__ */ h().mark(function r(n) {
29326
29329
  var a, i, s, u, c, d, p, v, f;