@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.
@@ -47246,14 +47246,68 @@
47246
47246
  return Unit_getInstance();
47247
47247
  };
47248
47248
  }
47249
- function VoiceAPIImpl$answerCall$lambda$lambda($callback) {
47249
+ function VoiceAPIImpl$answerCall$lambda$lambda$lambda$lambda(this$0, $legIdOrErr, $callback, $cancel) {
47250
+ return function () {
47251
+ var tmp0_safe_receiver = this$0.p2p_1.h2g(getKClass(CallReducer));
47252
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.t2p_1;
47253
+ var call = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.g2($legIdOrErr);
47254
+ var tmp2_safe_receiver = call;
47255
+ var tmp3_subject = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.l2p_1;
47256
+ var tmp0 = tmp3_subject == null ? -1 : tmp3_subject.e4_1;
47257
+ switch (tmp0) {
47258
+ case -1:
47259
+ // Inline function 'kotlin.let' call
47260
+ $callback(Companion_getInstance_107().b2g(InternalError_NoInviteFound_getInstance()));
47261
+ // Inline function 'com.vonage.clientcore.core.api.VoiceAPIImpl.answerCall.<anonymous>.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
47262
+ var tmp0_safe_receiver_0 = $cancel._v;
47263
+ tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0();
47264
+
47265
+ Unit_getInstance();
47266
+ break;
47267
+ case 3:
47268
+ // Inline function 'kotlin.also' call
47269
+ var tmp4_safe_receiver = $cancel._v;
47270
+ tmp4_safe_receiver == null ? null : tmp4_safe_receiver();
47271
+ // Inline function 'kotlin.contracts.contract' call
47272
+ // Inline function 'com.vonage.clientcore.core.api.VoiceAPIImpl.answerCall.<anonymous>.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
47273
+ $callback(null);
47274
+
47275
+ Unit_getInstance();
47276
+ break;
47277
+ case 5:
47278
+ case 6:
47279
+ // Inline function 'kotlin.also' call
47280
+ var tmp5_safe_receiver = $cancel._v;
47281
+ tmp5_safe_receiver == null ? null : tmp5_safe_receiver();
47282
+ // Inline function 'kotlin.contracts.contract' call
47283
+ // Inline function 'com.vonage.clientcore.core.api.VoiceAPIImpl.answerCall.<anonymous>.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
47284
+ $callback(Companion_getInstance_107().b2g(InternalError_InboundCallFailed_getInstance()));
47285
+
47286
+ Unit_getInstance();
47287
+ break;
47288
+ default:
47289
+ Unit_getInstance();
47290
+ break;
47291
+ }
47292
+ return Unit_getInstance();
47293
+ };
47294
+ }
47295
+ function VoiceAPIImpl$answerCall$lambda$lambda$lambda(this$0, $legIdOrErr, $callback, $cancel) {
47296
+ return function () {
47297
+ return new StoredSubscription(VoiceAPIImpl$answerCall$lambda$lambda$lambda$lambda(this$0, $legIdOrErr, $callback, $cancel));
47298
+ };
47299
+ }
47300
+ function VoiceAPIImpl$answerCall$lambda$lambda($callback, this$0) {
47250
47301
  return function (legIdOrErr) {
47251
47302
  var tmp0_subject = legIdOrErr;
47252
47303
  if (tmp0_subject instanceof Exception) {
47253
47304
  $callback(Companion_getInstance_107().g2g(InternalError_InboundCallFailed_getInstance(), legIdOrErr.message, legIdOrErr.cause));
47254
47305
  } else {
47255
47306
  if (!(tmp0_subject == null) ? typeof tmp0_subject === 'string' : false) {
47256
- $callback(null);
47307
+ var cancel = {_v: null};
47308
+ var tmp_0 = getKClass(CallReducer);
47309
+ cancel._v = this$0.p2p_1.l2k(tmp_0, VoiceAPIImpl$answerCall$lambda$lambda$lambda(this$0, legIdOrErr, $callback, cancel));
47310
+ Unit_getInstance();
47257
47311
  } else {
47258
47312
  $callback(Companion_getInstance_107().h2j());
47259
47313
  }
@@ -47268,7 +47322,7 @@
47268
47322
  $callback(Companion_getInstance_107().b2g(it));
47269
47323
  } else {
47270
47324
  var tmp_0 = new SetupInboundCall($callId, $invite.a2q_1, $invite.z2p_1, $invite.x2p_1, ensureNotNull($invite.b2q_1), null);
47271
- this$0.p2p_1.c1d(new Action(tmp_0, ActionMeta_init_$Create$(null, null, VoiceAPIImpl$answerCall$lambda$lambda($callback), 3, null)));
47325
+ this$0.p2p_1.c1d(new Action(tmp_0, ActionMeta_init_$Create$(null, null, VoiceAPIImpl$answerCall$lambda$lambda($callback, this$0), 3, null)));
47272
47326
  Unit_getInstance();
47273
47327
  }
47274
47328
  return Unit_getInstance();
@@ -56301,100 +56355,105 @@
56301
56355
  InviteReducer.prototype.h33 = function (action, state) {
56302
56356
  var tmp0_subject = action.p1d_1;
56303
56357
  var tmp;
56304
- if (tmp0_subject instanceof SessionSuccessEvent) {
56305
- tmp = state.y30(action.p1d_1);
56358
+ if (tmp0_subject instanceof ErrorReport) {
56359
+ var tmp1_elvis_lhs = action.q1d_1.n1d_1;
56360
+ tmp = state.s32(action.p1d_1, tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs);
56306
56361
  } else {
56307
- if (tmp0_subject instanceof MemberInvitedEvent) {
56308
- var tmp_0;
56309
- if (!(action.p1d_1.n1y_1.b1z_1.m2j_1 == null)) {
56310
- tmp_0 = state.p30(action.p1d_1);
56311
- } else {
56312
- tmp_0 = null;
56313
- }
56314
- tmp = tmp_0;
56362
+ if (tmp0_subject instanceof SessionSuccessEvent) {
56363
+ tmp = state.y30(action.p1d_1);
56315
56364
  } else {
56316
- if (tmp0_subject instanceof PushMemberInvitedEvent) {
56317
- var tmp_1;
56318
- if (!(action.p1d_1.w23_1.b1z_1.m2j_1 == null)) {
56319
- tmp_1 = state.j33(action.p1d_1);
56365
+ if (tmp0_subject instanceof MemberInvitedEvent) {
56366
+ var tmp_0;
56367
+ if (!(action.p1d_1.n1y_1.b1z_1.m2j_1 == null)) {
56368
+ tmp_0 = state.p30(action.p1d_1);
56320
56369
  } else {
56321
- tmp_1 = null;
56370
+ tmp_0 = null;
56322
56371
  }
56323
- tmp = tmp_1;
56372
+ tmp = tmp_0;
56324
56373
  } else {
56325
- if (tmp0_subject instanceof MemberJoinedEvent) {
56326
- var tmp_2;
56327
- if (!(action.p1d_1.h1z_1.r1z_1.m2j_1 == null)) {
56328
- tmp_2 = state.o30(action.p1d_1);
56374
+ if (tmp0_subject instanceof PushMemberInvitedEvent) {
56375
+ var tmp_1;
56376
+ if (!(action.p1d_1.w23_1.b1z_1.m2j_1 == null)) {
56377
+ tmp_1 = state.j33(action.p1d_1);
56329
56378
  } else {
56330
- tmp_2 = null;
56379
+ tmp_1 = null;
56331
56380
  }
56332
- tmp = tmp_2;
56381
+ tmp = tmp_1;
56333
56382
  } else {
56334
- if (tmp0_subject instanceof MemberLeftEvent) {
56335
- var id = action.p1d_1.v1z_1.g20_1.m2j_1;
56336
- var tmp1_safe_receiver = id;
56337
- var tmp_3;
56338
- if (tmp1_safe_receiver == null) {
56339
- tmp_3 = null;
56383
+ if (tmp0_subject instanceof MemberJoinedEvent) {
56384
+ var tmp_2;
56385
+ if (!(action.p1d_1.h1z_1.r1z_1.m2j_1 == null)) {
56386
+ tmp_2 = state.o30(action.p1d_1);
56340
56387
  } else {
56341
- var tmp$ret$1;
56342
- // Inline function 'kotlin.let' call
56343
- // Inline function 'kotlin.contracts.contract' call
56344
- var tmp$ret$0;
56345
- // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56346
- tmp$ret$0 = state.f32(action.p1d_1, tmp1_safe_receiver);
56347
- tmp$ret$1 = tmp$ret$0;
56348
- tmp_3 = tmp$ret$1;
56388
+ tmp_2 = null;
56349
56389
  }
56350
- tmp = tmp_3;
56390
+ tmp = tmp_2;
56351
56391
  } else {
56352
- if (tmp0_subject instanceof RTCHangupEvent) {
56353
- var id_0 = action.p1d_1.d23_1.f1y_1.m2j_1;
56354
- var tmp2_safe_receiver = id_0;
56355
- var tmp_4;
56392
+ if (tmp0_subject instanceof MemberLeftEvent) {
56393
+ var id = action.p1d_1.v1z_1.g20_1.m2j_1;
56394
+ var tmp2_safe_receiver = id;
56395
+ var tmp_3;
56356
56396
  if (tmp2_safe_receiver == null) {
56357
- tmp_4 = null;
56397
+ tmp_3 = null;
56358
56398
  } else {
56359
- var tmp$ret$3;
56399
+ var tmp$ret$1;
56360
56400
  // Inline function 'kotlin.let' call
56361
56401
  // Inline function 'kotlin.contracts.contract' call
56362
- var tmp$ret$2;
56402
+ var tmp$ret$0;
56363
56403
  // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56364
- tmp$ret$2 = state.c32(action.p1d_1, tmp2_safe_receiver);
56365
- tmp$ret$3 = tmp$ret$2;
56366
- tmp_4 = tmp$ret$3;
56404
+ tmp$ret$0 = state.f32(action.p1d_1, tmp2_safe_receiver);
56405
+ tmp$ret$1 = tmp$ret$0;
56406
+ tmp_3 = tmp$ret$1;
56367
56407
  }
56368
- tmp = tmp_4;
56408
+ tmp = tmp_3;
56369
56409
  } else {
56370
- if (tmp0_subject instanceof InviteCleanup) {
56371
- var tmp$ret$5;
56372
- // Inline function 'kotlin.let' call
56373
- state.i33(action.p1d_1, action.p1d_1.g2s_1);
56374
- // Inline function 'kotlin.contracts.contract' call
56375
- var tmp$ret$4;
56376
- // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56377
- tmp$ret$4 = null;
56378
- tmp$ret$5 = tmp$ret$4;
56379
- tmp = tmp$ret$5;
56410
+ if (tmp0_subject instanceof RTCHangupEvent) {
56411
+ var id_0 = action.p1d_1.d23_1.f1y_1.m2j_1;
56412
+ var tmp3_safe_receiver = id_0;
56413
+ var tmp_4;
56414
+ if (tmp3_safe_receiver == null) {
56415
+ tmp_4 = null;
56416
+ } else {
56417
+ var tmp$ret$3;
56418
+ // Inline function 'kotlin.let' call
56419
+ // Inline function 'kotlin.contracts.contract' call
56420
+ var tmp$ret$2;
56421
+ // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56422
+ tmp$ret$2 = state.c32(action.p1d_1, tmp3_safe_receiver);
56423
+ tmp$ret$3 = tmp$ret$2;
56424
+ tmp_4 = tmp$ret$3;
56425
+ }
56426
+ tmp = tmp_4;
56380
56427
  } else {
56381
- if (isInterface(tmp0_subject, ApiRequest)) {
56382
- var tmp3_elvis_lhs = action.q1d_1.n1d_1;
56383
- var callId = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
56384
- var tmp4_subject = action.p1d_1;
56385
- var tmp_5;
56386
- if (tmp4_subject instanceof MemberKickRequest) {
56387
- tmp_5 = state.z31(action.p1d_1, callId, action.q1d_1.m1d_1);
56388
- } else {
56389
- if (tmp4_subject instanceof MemberJoinRequest) {
56390
- tmp_5 = state.y31(action.p1d_1, callId, action.q1d_1.m1d_1);
56428
+ if (tmp0_subject instanceof InviteCleanup) {
56429
+ var tmp$ret$5;
56430
+ // Inline function 'kotlin.let' call
56431
+ state.i33(action.p1d_1, action.p1d_1.g2s_1);
56432
+ // Inline function 'kotlin.contracts.contract' call
56433
+ var tmp$ret$4;
56434
+ // Inline function 'com.vonage.clientcore.core.reducers.call.InviteReducer.reduce.<anonymous>' call
56435
+ tmp$ret$4 = null;
56436
+ tmp$ret$5 = tmp$ret$4;
56437
+ tmp = tmp$ret$5;
56438
+ } else {
56439
+ if (isInterface(tmp0_subject, ApiRequest)) {
56440
+ var tmp4_elvis_lhs = action.q1d_1.n1d_1;
56441
+ var callId = tmp4_elvis_lhs == null ? '' : tmp4_elvis_lhs;
56442
+ var tmp5_subject = action.p1d_1;
56443
+ var tmp_5;
56444
+ if (tmp5_subject instanceof MemberKickRequest) {
56445
+ tmp_5 = state.z31(action.p1d_1, callId, action.q1d_1.m1d_1);
56391
56446
  } else {
56392
- tmp_5 = null;
56447
+ if (tmp5_subject instanceof MemberJoinRequest) {
56448
+ tmp_5 = state.y31(action.p1d_1, callId, action.q1d_1.m1d_1);
56449
+ } else {
56450
+ tmp_5 = null;
56451
+ }
56393
56452
  }
56453
+ tmp = tmp_5;
56454
+ } else {
56455
+ tmp = null;
56394
56456
  }
56395
- tmp = tmp_5;
56396
- } else {
56397
- tmp = null;
56398
56457
  }
56399
56458
  }
56400
56459
  }
@@ -56508,6 +56567,22 @@
56508
56567
  return Unit_getInstance();
56509
56568
  };
56510
56569
  }
56570
+ function InviteState$update$lambda_6($action) {
56571
+ return function ($this$modify) {
56572
+ var tmp_0;
56573
+ var tmp_1 = $this$modify.c2q_1;
56574
+ if (tmp_1 instanceof Pending) {
56575
+ tmp_0 = $this$modify.c2q_1.k2q() === $action.s1d_1;
56576
+ } else {
56577
+ tmp_0 = false;
56578
+ }
56579
+ if (tmp_0) {
56580
+ $this$modify.c2q_1 = toFailed($this$modify.c2q_1, $action.r1d_1);
56581
+ Unit_getInstance();
56582
+ }
56583
+ return Unit_getInstance();
56584
+ };
56585
+ }
56511
56586
  function InviteState(invites, currentUserId) {
56512
56587
  this.l2q_1 = invites;
56513
56588
  this.m2q_1 = currentUserId;
@@ -56571,6 +56646,9 @@
56571
56646
  tmp$ret$0 = this;
56572
56647
  return tmp$ret$0;
56573
56648
  };
56649
+ InviteState.prototype.s32 = function (action, callId) {
56650
+ return modify(this, callId, InviteState$update$lambda_6(action));
56651
+ };
56574
56652
  InviteState.prototype.l33 = function (invites, currentUserId) {
56575
56653
  return new InviteState(invites, currentUserId);
56576
56654
  };
@@ -66801,6 +66879,10 @@
66801
66879
  let error;
66802
66880
  try {
66803
66881
  const pc = yield this.getNewPC();
66882
+ pc.onconnectionstatechange = () => {
66883
+ var _a;
66884
+ (_a = this.delegate) === null || _a === void 0 ? void 0 : _a.onConnectionChange(rtcId, pc.connectionState);
66885
+ };
66804
66886
  this.pcs.set(rtcId, pc);
66805
66887
  sdp = yield createAnswer(pc, offerSDP);
66806
66888
  }