@vonage/client-sdk 1.0.1-alpha.3 → 1.0.1-alpha.5

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.
@@ -47240,14 +47240,68 @@ function requireClientsdkClientcore () {
47240
47240
  return Unit_getInstance();
47241
47241
  };
47242
47242
  }
47243
- function VoiceAPIImpl$answerCall$lambda$lambda($callback) {
47243
+ function VoiceAPIImpl$answerCall$lambda$lambda$lambda$lambda(this$0, $legIdOrErr, $callback, $cancel) {
47244
+ return function () {
47245
+ var tmp0_safe_receiver = this$0.p2p_1.h2g(getKClass(CallReducer));
47246
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.t2p_1;
47247
+ var call = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.g2($legIdOrErr);
47248
+ var tmp2_safe_receiver = call;
47249
+ var tmp3_subject = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.l2p_1;
47250
+ var tmp0 = tmp3_subject == null ? -1 : tmp3_subject.e4_1;
47251
+ switch (tmp0) {
47252
+ case -1:
47253
+ // Inline function 'kotlin.let' call
47254
+ $callback(Companion_getInstance_107().b2g(InternalError_NoInviteFound_getInstance()));
47255
+ // Inline function 'com.vonage.clientcore.core.api.VoiceAPIImpl.answerCall.<anonymous>.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
47256
+ var tmp0_safe_receiver_0 = $cancel._v;
47257
+ tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0();
47258
+
47259
+ Unit_getInstance();
47260
+ break;
47261
+ case 3:
47262
+ // Inline function 'kotlin.also' call
47263
+ var tmp4_safe_receiver = $cancel._v;
47264
+ tmp4_safe_receiver == null ? null : tmp4_safe_receiver();
47265
+ // Inline function 'kotlin.contracts.contract' call
47266
+ // Inline function 'com.vonage.clientcore.core.api.VoiceAPIImpl.answerCall.<anonymous>.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
47267
+ $callback(null);
47268
+
47269
+ Unit_getInstance();
47270
+ break;
47271
+ case 5:
47272
+ case 6:
47273
+ // Inline function 'kotlin.also' call
47274
+ var tmp5_safe_receiver = $cancel._v;
47275
+ tmp5_safe_receiver == null ? null : tmp5_safe_receiver();
47276
+ // Inline function 'kotlin.contracts.contract' call
47277
+ // Inline function 'com.vonage.clientcore.core.api.VoiceAPIImpl.answerCall.<anonymous>.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
47278
+ $callback(Companion_getInstance_107().b2g(InternalError_InboundCallFailed_getInstance()));
47279
+
47280
+ Unit_getInstance();
47281
+ break;
47282
+ default:
47283
+ Unit_getInstance();
47284
+ break;
47285
+ }
47286
+ return Unit_getInstance();
47287
+ };
47288
+ }
47289
+ function VoiceAPIImpl$answerCall$lambda$lambda$lambda(this$0, $legIdOrErr, $callback, $cancel) {
47290
+ return function () {
47291
+ return new StoredSubscription(VoiceAPIImpl$answerCall$lambda$lambda$lambda$lambda(this$0, $legIdOrErr, $callback, $cancel));
47292
+ };
47293
+ }
47294
+ function VoiceAPIImpl$answerCall$lambda$lambda($callback, this$0) {
47244
47295
  return function (legIdOrErr) {
47245
47296
  var tmp0_subject = legIdOrErr;
47246
47297
  if (tmp0_subject instanceof Exception) {
47247
47298
  $callback(Companion_getInstance_107().g2g(InternalError_InboundCallFailed_getInstance(), legIdOrErr.message, legIdOrErr.cause));
47248
47299
  } else {
47249
47300
  if (!(tmp0_subject == null) ? typeof tmp0_subject === 'string' : false) {
47250
- $callback(null);
47301
+ var cancel = {_v: null};
47302
+ var tmp_0 = getKClass(CallReducer);
47303
+ cancel._v = this$0.p2p_1.l2k(tmp_0, VoiceAPIImpl$answerCall$lambda$lambda$lambda(this$0, legIdOrErr, $callback, cancel));
47304
+ Unit_getInstance();
47251
47305
  } else {
47252
47306
  $callback(Companion_getInstance_107().h2j());
47253
47307
  }
@@ -47262,7 +47316,7 @@ function requireClientsdkClientcore () {
47262
47316
  $callback(Companion_getInstance_107().b2g(it));
47263
47317
  } else {
47264
47318
  var tmp_0 = new SetupInboundCall($callId, $invite.a2q_1, $invite.z2p_1, $invite.x2p_1, ensureNotNull($invite.b2q_1), null);
47265
- this$0.p2p_1.c1d(new Action(tmp_0, ActionMeta_init_$Create$(null, null, VoiceAPIImpl$answerCall$lambda$lambda($callback), 3, null)));
47319
+ this$0.p2p_1.c1d(new Action(tmp_0, ActionMeta_init_$Create$(null, null, VoiceAPIImpl$answerCall$lambda$lambda($callback, this$0), 3, null)));
47266
47320
  Unit_getInstance();
47267
47321
  }
47268
47322
  return Unit_getInstance();
@@ -56295,100 +56349,105 @@ function requireClientsdkClientcore () {
56295
56349
  InviteReducer.prototype.h33 = function (action, state) {
56296
56350
  var tmp0_subject = action.p1d_1;
56297
56351
  var tmp;
56298
- if (tmp0_subject instanceof SessionSuccessEvent) {
56299
- tmp = state.y30(action.p1d_1);
56352
+ if (tmp0_subject instanceof ErrorReport) {
56353
+ var tmp1_elvis_lhs = action.q1d_1.n1d_1;
56354
+ tmp = state.s32(action.p1d_1, tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs);
56300
56355
  } else {
56301
- if (tmp0_subject instanceof MemberInvitedEvent) {
56302
- var tmp_0;
56303
- if (!(action.p1d_1.n1y_1.b1z_1.m2j_1 == null)) {
56304
- tmp_0 = state.p30(action.p1d_1);
56305
- } else {
56306
- tmp_0 = null;
56307
- }
56308
- tmp = tmp_0;
56356
+ if (tmp0_subject instanceof SessionSuccessEvent) {
56357
+ tmp = state.y30(action.p1d_1);
56309
56358
  } else {
56310
- if (tmp0_subject instanceof PushMemberInvitedEvent) {
56311
- var tmp_1;
56312
- if (!(action.p1d_1.w23_1.b1z_1.m2j_1 == null)) {
56313
- tmp_1 = state.j33(action.p1d_1);
56359
+ if (tmp0_subject instanceof MemberInvitedEvent) {
56360
+ var tmp_0;
56361
+ if (!(action.p1d_1.n1y_1.b1z_1.m2j_1 == null)) {
56362
+ tmp_0 = state.p30(action.p1d_1);
56314
56363
  } else {
56315
- tmp_1 = null;
56364
+ tmp_0 = null;
56316
56365
  }
56317
- tmp = tmp_1;
56366
+ tmp = tmp_0;
56318
56367
  } else {
56319
- if (tmp0_subject instanceof MemberJoinedEvent) {
56320
- var tmp_2;
56321
- if (!(action.p1d_1.h1z_1.r1z_1.m2j_1 == null)) {
56322
- tmp_2 = state.o30(action.p1d_1);
56368
+ if (tmp0_subject instanceof PushMemberInvitedEvent) {
56369
+ var tmp_1;
56370
+ if (!(action.p1d_1.w23_1.b1z_1.m2j_1 == null)) {
56371
+ tmp_1 = state.j33(action.p1d_1);
56323
56372
  } else {
56324
- tmp_2 = null;
56373
+ tmp_1 = null;
56325
56374
  }
56326
- tmp = tmp_2;
56375
+ tmp = tmp_1;
56327
56376
  } else {
56328
- if (tmp0_subject instanceof MemberLeftEvent) {
56329
- var id = action.p1d_1.v1z_1.g20_1.m2j_1;
56330
- var tmp1_safe_receiver = id;
56331
- var tmp_3;
56332
- if (tmp1_safe_receiver == null) {
56333
- tmp_3 = null;
56377
+ if (tmp0_subject instanceof MemberJoinedEvent) {
56378
+ var tmp_2;
56379
+ if (!(action.p1d_1.h1z_1.r1z_1.m2j_1 == null)) {
56380
+ tmp_2 = state.o30(action.p1d_1);
56334
56381
  } else {
56335
- var tmp$ret$1;
56336
- // Inline function 'kotlin.let' call
56337
- // Inline function 'kotlin.contracts.contract' call
56338
- var tmp$ret$0;
56339
- // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56340
- tmp$ret$0 = state.f32(action.p1d_1, tmp1_safe_receiver);
56341
- tmp$ret$1 = tmp$ret$0;
56342
- tmp_3 = tmp$ret$1;
56382
+ tmp_2 = null;
56343
56383
  }
56344
- tmp = tmp_3;
56384
+ tmp = tmp_2;
56345
56385
  } else {
56346
- if (tmp0_subject instanceof RTCHangupEvent) {
56347
- var id_0 = action.p1d_1.d23_1.f1y_1.m2j_1;
56348
- var tmp2_safe_receiver = id_0;
56349
- var tmp_4;
56386
+ if (tmp0_subject instanceof MemberLeftEvent) {
56387
+ var id = action.p1d_1.v1z_1.g20_1.m2j_1;
56388
+ var tmp2_safe_receiver = id;
56389
+ var tmp_3;
56350
56390
  if (tmp2_safe_receiver == null) {
56351
- tmp_4 = null;
56391
+ tmp_3 = null;
56352
56392
  } else {
56353
- var tmp$ret$3;
56393
+ var tmp$ret$1;
56354
56394
  // Inline function 'kotlin.let' call
56355
56395
  // Inline function 'kotlin.contracts.contract' call
56356
- var tmp$ret$2;
56396
+ var tmp$ret$0;
56357
56397
  // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56358
- tmp$ret$2 = state.c32(action.p1d_1, tmp2_safe_receiver);
56359
- tmp$ret$3 = tmp$ret$2;
56360
- tmp_4 = tmp$ret$3;
56398
+ tmp$ret$0 = state.f32(action.p1d_1, tmp2_safe_receiver);
56399
+ tmp$ret$1 = tmp$ret$0;
56400
+ tmp_3 = tmp$ret$1;
56361
56401
  }
56362
- tmp = tmp_4;
56402
+ tmp = tmp_3;
56363
56403
  } else {
56364
- if (tmp0_subject instanceof InviteCleanup) {
56365
- var tmp$ret$5;
56366
- // Inline function 'kotlin.let' call
56367
- state.i33(action.p1d_1, action.p1d_1.g2s_1);
56368
- // Inline function 'kotlin.contracts.contract' call
56369
- var tmp$ret$4;
56370
- // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56371
- tmp$ret$4 = null;
56372
- tmp$ret$5 = tmp$ret$4;
56373
- tmp = tmp$ret$5;
56404
+ if (tmp0_subject instanceof RTCHangupEvent) {
56405
+ var id_0 = action.p1d_1.d23_1.f1y_1.m2j_1;
56406
+ var tmp3_safe_receiver = id_0;
56407
+ var tmp_4;
56408
+ if (tmp3_safe_receiver == null) {
56409
+ tmp_4 = null;
56410
+ } else {
56411
+ var tmp$ret$3;
56412
+ // Inline function 'kotlin.let' call
56413
+ // Inline function 'kotlin.contracts.contract' call
56414
+ var tmp$ret$2;
56415
+ // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56416
+ tmp$ret$2 = state.c32(action.p1d_1, tmp3_safe_receiver);
56417
+ tmp$ret$3 = tmp$ret$2;
56418
+ tmp_4 = tmp$ret$3;
56419
+ }
56420
+ tmp = tmp_4;
56374
56421
  } else {
56375
- if (isInterface(tmp0_subject, ApiRequest)) {
56376
- var tmp3_elvis_lhs = action.q1d_1.n1d_1;
56377
- var callId = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
56378
- var tmp4_subject = action.p1d_1;
56379
- var tmp_5;
56380
- if (tmp4_subject instanceof MemberKickRequest) {
56381
- tmp_5 = state.z31(action.p1d_1, callId, action.q1d_1.m1d_1);
56382
- } else {
56383
- if (tmp4_subject instanceof MemberJoinRequest) {
56384
- tmp_5 = state.y31(action.p1d_1, callId, action.q1d_1.m1d_1);
56422
+ if (tmp0_subject instanceof InviteCleanup) {
56423
+ var tmp$ret$5;
56424
+ // Inline function 'kotlin.let' call
56425
+ state.i33(action.p1d_1, action.p1d_1.g2s_1);
56426
+ // Inline function 'kotlin.contracts.contract' call
56427
+ var tmp$ret$4;
56428
+ // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56429
+ tmp$ret$4 = null;
56430
+ tmp$ret$5 = tmp$ret$4;
56431
+ tmp = tmp$ret$5;
56432
+ } else {
56433
+ if (isInterface(tmp0_subject, ApiRequest)) {
56434
+ var tmp4_elvis_lhs = action.q1d_1.n1d_1;
56435
+ var callId = tmp4_elvis_lhs == null ? '' : tmp4_elvis_lhs;
56436
+ var tmp5_subject = action.p1d_1;
56437
+ var tmp_5;
56438
+ if (tmp5_subject instanceof MemberKickRequest) {
56439
+ tmp_5 = state.z31(action.p1d_1, callId, action.q1d_1.m1d_1);
56385
56440
  } else {
56386
- tmp_5 = null;
56441
+ if (tmp5_subject instanceof MemberJoinRequest) {
56442
+ tmp_5 = state.y31(action.p1d_1, callId, action.q1d_1.m1d_1);
56443
+ } else {
56444
+ tmp_5 = null;
56445
+ }
56387
56446
  }
56447
+ tmp = tmp_5;
56448
+ } else {
56449
+ tmp = null;
56388
56450
  }
56389
- tmp = tmp_5;
56390
- } else {
56391
- tmp = null;
56392
56451
  }
56393
56452
  }
56394
56453
  }
@@ -56502,6 +56561,22 @@ function requireClientsdkClientcore () {
56502
56561
  return Unit_getInstance();
56503
56562
  };
56504
56563
  }
56564
+ function InviteState$update$lambda_6($action) {
56565
+ return function ($this$modify) {
56566
+ var tmp_0;
56567
+ var tmp_1 = $this$modify.c2q_1;
56568
+ if (tmp_1 instanceof Pending) {
56569
+ tmp_0 = $this$modify.c2q_1.k2q() === $action.s1d_1;
56570
+ } else {
56571
+ tmp_0 = false;
56572
+ }
56573
+ if (tmp_0) {
56574
+ $this$modify.c2q_1 = toFailed($this$modify.c2q_1, $action.r1d_1);
56575
+ Unit_getInstance();
56576
+ }
56577
+ return Unit_getInstance();
56578
+ };
56579
+ }
56505
56580
  function InviteState(invites, currentUserId) {
56506
56581
  this.l2q_1 = invites;
56507
56582
  this.m2q_1 = currentUserId;
@@ -56565,6 +56640,9 @@ function requireClientsdkClientcore () {
56565
56640
  tmp$ret$0 = this;
56566
56641
  return tmp$ret$0;
56567
56642
  };
56643
+ InviteState.prototype.s32 = function (action, callId) {
56644
+ return modify(this, callId, InviteState$update$lambda_6(action));
56645
+ };
56568
56646
  InviteState.prototype.l33 = function (invites, currentUserId) {
56569
56647
  return new InviteState(invites, currentUserId);
56570
56648
  };
@@ -66795,6 +66873,10 @@ class MediaClient {
66795
66873
  let error;
66796
66874
  try {
66797
66875
  const pc = yield this.getNewPC();
66876
+ pc.onconnectionstatechange = () => {
66877
+ var _a;
66878
+ (_a = this.delegate) === null || _a === void 0 ? void 0 : _a.onConnectionChange(rtcId, pc.connectionState);
66879
+ };
66798
66880
  this.pcs.set(rtcId, pc);
66799
66881
  sdp = yield createAnswer(pc, offerSDP);
66800
66882
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/client-sdk",
3
- "version": "1.0.1-alpha.3",
3
+ "version": "1.0.1-alpha.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "dist/client/index.mjs",