@wazo/sdk 0.37.38 → 0.37.39

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 (65) hide show
  1. package/dist/wazo-sdk.js +2 -2
  2. package/esm/__tests__/api-client.test.js +9 -0
  3. package/esm/__tests__/web-rtc-client.test.js +9 -0
  4. package/esm/api/auth.js +2 -0
  5. package/esm/api-client.js +9 -0
  6. package/esm/checker/Checker.js +9 -0
  7. package/esm/checker/checks/aor.js +9 -0
  8. package/esm/checker/checks/api.js +9 -0
  9. package/esm/checker/checks/index.js +9 -0
  10. package/esm/checker/checks/webrtc-transport.js +9 -0
  11. package/esm/checker/checks/webrtc.js +9 -0
  12. package/esm/domain/AdHocAPIConference.js +9 -0
  13. package/esm/domain/Features.js +9 -0
  14. package/esm/domain/Phone/CTIPhone.js +9 -0
  15. package/esm/index.js +16 -0
  16. package/esm/service/CallApi.js +9 -0
  17. package/esm/service/getApiClient.js +9 -0
  18. package/esm/simple/Auth.js +16 -0
  19. package/esm/simple/Configuration.js +16 -0
  20. package/esm/simple/Directory.js +9 -0
  21. package/esm/simple/Phone.js +16 -0
  22. package/esm/simple/index.js +16 -0
  23. package/esm/simple/room/LocalParticipant.js +16 -0
  24. package/esm/simple/room/Participant.js +16 -0
  25. package/esm/simple/room/RemoteParticipant.js +16 -0
  26. package/esm/simple/room/Room.js +16 -0
  27. package/esm/simple/room/SipRoom.js +16 -0
  28. package/esm/simple/room/Stream.js +16 -0
  29. package/esm/simple/room/__tests__/RemoteParticipant.test.js +16 -0
  30. package/esm/simple/utils.js +16 -0
  31. package/esm/web-rtc-client.js +9 -0
  32. package/lib/__tests__/api-client.test.js +9 -0
  33. package/lib/__tests__/web-rtc-client.test.js +9 -0
  34. package/lib/api/auth.js +2 -0
  35. package/lib/api-client.js +9 -0
  36. package/lib/checker/Checker.js +9 -0
  37. package/lib/checker/checks/aor.js +9 -0
  38. package/lib/checker/checks/api.js +9 -0
  39. package/lib/checker/checks/index.js +9 -0
  40. package/lib/checker/checks/webrtc-transport.js +9 -0
  41. package/lib/checker/checks/webrtc.js +9 -0
  42. package/lib/domain/AdHocAPIConference.js +9 -0
  43. package/lib/domain/Features.js +9 -0
  44. package/lib/domain/Phone/CTIPhone.js +9 -0
  45. package/lib/index.js +16 -0
  46. package/lib/service/CallApi.js +9 -0
  47. package/lib/service/getApiClient.js +9 -0
  48. package/lib/simple/Auth.js +16 -0
  49. package/lib/simple/Configuration.js +16 -0
  50. package/lib/simple/Directory.js +9 -0
  51. package/lib/simple/Phone.js +16 -0
  52. package/lib/simple/index.js +16 -0
  53. package/lib/simple/room/LocalParticipant.js +16 -0
  54. package/lib/simple/room/Participant.js +16 -0
  55. package/lib/simple/room/RemoteParticipant.js +16 -0
  56. package/lib/simple/room/Room.js +16 -0
  57. package/lib/simple/room/SipRoom.js +16 -0
  58. package/lib/simple/room/Stream.js +16 -0
  59. package/lib/simple/room/__tests__/RemoteParticipant.test.js +16 -0
  60. package/lib/simple/utils.js +16 -0
  61. package/lib/web-rtc-client.js +9 -0
  62. package/package.json +1 -1
  63. package/src/api/auth.js +2 -0
  64. package/src/api-client.js +7 -0
  65. package/src/simple/Auth.js +7 -0
@@ -2268,12 +2268,14 @@ var authMethods = (client , baseUrl ) => ({
2268
2268
  backend ,
2269
2269
  expiration ,
2270
2270
  isMobile = false,
2271
+ tenantId ,
2271
2272
  ) => {
2272
2273
  const body = {
2273
2274
  backend: backend || DEFAULT_BACKEND_USER,
2274
2275
  expiration: expiration || DETAULT_EXPIRATION,
2275
2276
  refresh_token: refreshToken,
2276
2277
  client_id: client.clientId,
2278
+ tenant_id: tenantId,
2277
2279
  };
2278
2280
 
2279
2281
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5690,6 +5699,13 @@ class Auth {
5690
5699
  expiration: this.expiration,
5691
5700
  mobile: this.mobile,
5692
5701
  });
5702
+
5703
+ if (backend) {
5704
+ getApiClient().setRefreshBackend(backend);
5705
+ }
5706
+
5707
+ getApiClient().setRefreshTenantId(tenantId);
5708
+
5693
5709
  return this._onAuthenticated(rawSession);
5694
5710
  }
5695
5711
 
@@ -2294,12 +2294,14 @@ var authMethods = (client , baseUrl ) => ({
2294
2294
  backend ,
2295
2295
  expiration ,
2296
2296
  isMobile = false,
2297
+ tenantId ,
2297
2298
  ) => {
2298
2299
  const body = {
2299
2300
  backend: backend || DEFAULT_BACKEND_USER,
2300
2301
  expiration: expiration || DETAULT_EXPIRATION,
2301
2302
  refresh_token: refreshToken,
2302
2303
  client_id: client.clientId,
2304
+ tenant_id: tenantId,
2303
2305
  };
2304
2306
 
2305
2307
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5690,6 +5699,13 @@ class Auth {
5690
5699
  expiration: this.expiration,
5691
5700
  mobile: this.mobile,
5692
5701
  });
5702
+
5703
+ if (backend) {
5704
+ getApiClient().setRefreshBackend(backend);
5705
+ }
5706
+
5707
+ getApiClient().setRefreshTenantId(tenantId);
5708
+
5693
5709
  return this._onAuthenticated(rawSession);
5694
5710
  }
5695
5711
 
@@ -2294,12 +2294,14 @@ var authMethods = (client , baseUrl ) => ({
2294
2294
  backend ,
2295
2295
  expiration ,
2296
2296
  isMobile = false,
2297
+ tenantId ,
2297
2298
  ) => {
2298
2299
  const body = {
2299
2300
  backend: backend || DEFAULT_BACKEND_USER,
2300
2301
  expiration: expiration || DETAULT_EXPIRATION,
2301
2302
  refresh_token: refreshToken,
2302
2303
  client_id: client.clientId,
2304
+ tenant_id: tenantId,
2303
2305
  };
2304
2306
 
2305
2307
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5690,6 +5699,13 @@ class Auth {
5690
5699
  expiration: this.expiration,
5691
5700
  mobile: this.mobile,
5692
5701
  });
5702
+
5703
+ if (backend) {
5704
+ getApiClient().setRefreshBackend(backend);
5705
+ }
5706
+
5707
+ getApiClient().setRefreshTenantId(tenantId);
5708
+
5693
5709
  return this._onAuthenticated(rawSession);
5694
5710
  }
5695
5711
 
@@ -2268,12 +2268,14 @@ var authMethods = (client , baseUrl ) => ({
2268
2268
  backend ,
2269
2269
  expiration ,
2270
2270
  isMobile = false,
2271
+ tenantId ,
2271
2272
  ) => {
2272
2273
  const body = {
2273
2274
  backend: backend || DEFAULT_BACKEND_USER,
2274
2275
  expiration: expiration || DETAULT_EXPIRATION,
2275
2276
  refresh_token: refreshToken,
2276
2277
  client_id: client.clientId,
2278
+ tenant_id: tenantId,
2277
2279
  };
2278
2280
 
2279
2281
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5690,6 +5699,13 @@ class Auth {
5690
5699
  expiration: this.expiration,
5691
5700
  mobile: this.mobile,
5692
5701
  });
5702
+
5703
+ if (backend) {
5704
+ getApiClient().setRefreshBackend(backend);
5705
+ }
5706
+
5707
+ getApiClient().setRefreshTenantId(tenantId);
5708
+
5693
5709
  return this._onAuthenticated(rawSession);
5694
5710
  }
5695
5711
 
@@ -2270,12 +2270,14 @@ var authMethods = (client , baseUrl ) => ({
2270
2270
  backend ,
2271
2271
  expiration ,
2272
2272
  isMobile = false,
2273
+ tenantId ,
2273
2274
  ) => {
2274
2275
  const body = {
2275
2276
  backend: backend || DEFAULT_BACKEND_USER,
2276
2277
  expiration: expiration || DETAULT_EXPIRATION,
2277
2278
  refresh_token: refreshToken,
2278
2279
  client_id: client.clientId,
2280
+ tenant_id: tenantId,
2279
2281
  };
2280
2282
 
2281
2283
  const headers = {
@@ -5427,6 +5429,7 @@ class ApiClient {
5427
5429
 
5428
5430
 
5429
5431
 
5432
+
5430
5433
 
5431
5434
 
5432
5435
 
@@ -5467,6 +5470,7 @@ class ApiClient {
5467
5470
  logger$a.info('refresh token callback called', {
5468
5471
  refreshToken: this.refreshToken,
5469
5472
  refreshBackend: this.refreshBackend,
5473
+ refreshTenantId: this.refreshTenantId,
5470
5474
  refreshExpiration: this.refreshExpiration,
5471
5475
  isMobile: this.isMobile,
5472
5476
  });
@@ -5480,6 +5484,7 @@ class ApiClient {
5480
5484
  this.refreshBackend,
5481
5485
  this.refreshExpiration,
5482
5486
  this.isMobile,
5487
+ this.refreshTenantId,
5483
5488
  );
5484
5489
 
5485
5490
  logger$a.info('token refreshed', { token: session.token });
@@ -5521,6 +5526,10 @@ class ApiClient {
5521
5526
  this.refreshBackend = refreshBackend;
5522
5527
  }
5523
5528
 
5529
+ setRefreshTenantId(tenantId ) {
5530
+ this.refreshTenantId = tenantId;
5531
+ }
5532
+
5524
5533
  setIsMobile(isMobile ) {
5525
5534
  this.isMobile = isMobile;
5526
5535
  }
@@ -5692,6 +5701,13 @@ class Auth {
5692
5701
  expiration: this.expiration,
5693
5702
  mobile: this.mobile,
5694
5703
  });
5704
+
5705
+ if (backend) {
5706
+ getApiClient().setRefreshBackend(backend);
5707
+ }
5708
+
5709
+ getApiClient().setRefreshTenantId(tenantId);
5710
+
5695
5711
  return this._onAuthenticated(rawSession);
5696
5712
  }
5697
5713
 
@@ -2268,12 +2268,14 @@ var authMethods = (client , baseUrl ) => ({
2268
2268
  backend ,
2269
2269
  expiration ,
2270
2270
  isMobile = false,
2271
+ tenantId ,
2271
2272
  ) => {
2272
2273
  const body = {
2273
2274
  backend: backend || DEFAULT_BACKEND_USER,
2274
2275
  expiration: expiration || DETAULT_EXPIRATION,
2275
2276
  refresh_token: refreshToken,
2276
2277
  client_id: client.clientId,
2278
+ tenant_id: tenantId,
2277
2279
  };
2278
2280
 
2279
2281
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5690,6 +5699,13 @@ class Auth {
5690
5699
  expiration: this.expiration,
5691
5700
  mobile: this.mobile,
5692
5701
  });
5702
+
5703
+ if (backend) {
5704
+ getApiClient().setRefreshBackend(backend);
5705
+ }
5706
+
5707
+ getApiClient().setRefreshTenantId(tenantId);
5708
+
5693
5709
  return this._onAuthenticated(rawSession);
5694
5710
  }
5695
5711
 
@@ -2268,12 +2268,14 @@ var authMethods = (client , baseUrl ) => ({
2268
2268
  backend ,
2269
2269
  expiration ,
2270
2270
  isMobile = false,
2271
+ tenantId ,
2271
2272
  ) => {
2272
2273
  const body = {
2273
2274
  backend: backend || DEFAULT_BACKEND_USER,
2274
2275
  expiration: expiration || DETAULT_EXPIRATION,
2275
2276
  refresh_token: refreshToken,
2276
2277
  client_id: client.clientId,
2278
+ tenant_id: tenantId,
2277
2279
  };
2278
2280
 
2279
2281
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5690,6 +5699,13 @@ class Auth {
5690
5699
  expiration: this.expiration,
5691
5700
  mobile: this.mobile,
5692
5701
  });
5702
+
5703
+ if (backend) {
5704
+ getApiClient().setRefreshBackend(backend);
5705
+ }
5706
+
5707
+ getApiClient().setRefreshTenantId(tenantId);
5708
+
5693
5709
  return this._onAuthenticated(rawSession);
5694
5710
  }
5695
5711
 
@@ -2268,12 +2268,14 @@ var authMethods = (client , baseUrl ) => ({
2268
2268
  backend ,
2269
2269
  expiration ,
2270
2270
  isMobile = false,
2271
+ tenantId ,
2271
2272
  ) => {
2272
2273
  const body = {
2273
2274
  backend: backend || DEFAULT_BACKEND_USER,
2274
2275
  expiration: expiration || DETAULT_EXPIRATION,
2275
2276
  refresh_token: refreshToken,
2276
2277
  client_id: client.clientId,
2278
+ tenant_id: tenantId,
2277
2279
  };
2278
2280
 
2279
2281
  const headers = {
@@ -5425,6 +5427,7 @@ class ApiClient {
5425
5427
 
5426
5428
 
5427
5429
 
5430
+
5428
5431
 
5429
5432
 
5430
5433
 
@@ -5465,6 +5468,7 @@ class ApiClient {
5465
5468
  logger$a.info('refresh token callback called', {
5466
5469
  refreshToken: this.refreshToken,
5467
5470
  refreshBackend: this.refreshBackend,
5471
+ refreshTenantId: this.refreshTenantId,
5468
5472
  refreshExpiration: this.refreshExpiration,
5469
5473
  isMobile: this.isMobile,
5470
5474
  });
@@ -5478,6 +5482,7 @@ class ApiClient {
5478
5482
  this.refreshBackend,
5479
5483
  this.refreshExpiration,
5480
5484
  this.isMobile,
5485
+ this.refreshTenantId,
5481
5486
  );
5482
5487
 
5483
5488
  logger$a.info('token refreshed', { token: session.token });
@@ -5519,6 +5524,10 @@ class ApiClient {
5519
5524
  this.refreshBackend = refreshBackend;
5520
5525
  }
5521
5526
 
5527
+ setRefreshTenantId(tenantId ) {
5528
+ this.refreshTenantId = tenantId;
5529
+ }
5530
+
5522
5531
  setIsMobile(isMobile ) {
5523
5532
  this.isMobile = isMobile;
5524
5533
  }
@@ -5690,6 +5699,13 @@ class Auth {
5690
5699
  expiration: this.expiration,
5691
5700
  mobile: this.mobile,
5692
5701
  });
5702
+
5703
+ if (backend) {
5704
+ getApiClient().setRefreshBackend(backend);
5705
+ }
5706
+
5707
+ getApiClient().setRefreshTenantId(tenantId);
5708
+
5693
5709
  return this._onAuthenticated(rawSession);
5694
5710
  }
5695
5711
 
@@ -2270,12 +2270,14 @@ var authMethods = (client , baseUrl ) => ({
2270
2270
  backend ,
2271
2271
  expiration ,
2272
2272
  isMobile = false,
2273
+ tenantId ,
2273
2274
  ) => {
2274
2275
  const body = {
2275
2276
  backend: backend || DEFAULT_BACKEND_USER,
2276
2277
  expiration: expiration || DETAULT_EXPIRATION,
2277
2278
  refresh_token: refreshToken,
2278
2279
  client_id: client.clientId,
2280
+ tenant_id: tenantId,
2279
2281
  };
2280
2282
 
2281
2283
  const headers = {
@@ -5427,6 +5429,7 @@ class ApiClient {
5427
5429
 
5428
5430
 
5429
5431
 
5432
+
5430
5433
 
5431
5434
 
5432
5435
 
@@ -5467,6 +5470,7 @@ class ApiClient {
5467
5470
  logger$a.info('refresh token callback called', {
5468
5471
  refreshToken: this.refreshToken,
5469
5472
  refreshBackend: this.refreshBackend,
5473
+ refreshTenantId: this.refreshTenantId,
5470
5474
  refreshExpiration: this.refreshExpiration,
5471
5475
  isMobile: this.isMobile,
5472
5476
  });
@@ -5480,6 +5484,7 @@ class ApiClient {
5480
5484
  this.refreshBackend,
5481
5485
  this.refreshExpiration,
5482
5486
  this.isMobile,
5487
+ this.refreshTenantId,
5483
5488
  );
5484
5489
 
5485
5490
  logger$a.info('token refreshed', { token: session.token });
@@ -5521,6 +5526,10 @@ class ApiClient {
5521
5526
  this.refreshBackend = refreshBackend;
5522
5527
  }
5523
5528
 
5529
+ setRefreshTenantId(tenantId ) {
5530
+ this.refreshTenantId = tenantId;
5531
+ }
5532
+
5524
5533
  setIsMobile(isMobile ) {
5525
5534
  this.isMobile = isMobile;
5526
5535
  }
@@ -5692,6 +5701,13 @@ class Auth {
5692
5701
  expiration: this.expiration,
5693
5702
  mobile: this.mobile,
5694
5703
  });
5704
+
5705
+ if (backend) {
5706
+ getApiClient().setRefreshBackend(backend);
5707
+ }
5708
+
5709
+ getApiClient().setRefreshTenantId(tenantId);
5710
+
5695
5711
  return this._onAuthenticated(rawSession);
5696
5712
  }
5697
5713
 
@@ -2797,12 +2797,14 @@ var authMethods = (client , baseUrl ) => ({
2797
2797
  backend ,
2798
2798
  expiration ,
2799
2799
  isMobile = false,
2800
+ tenantId ,
2800
2801
  ) => {
2801
2802
  const body = {
2802
2803
  backend: backend || DEFAULT_BACKEND_USER,
2803
2804
  expiration: expiration || DETAULT_EXPIRATION,
2804
2805
  refresh_token: refreshToken,
2805
2806
  client_id: client.clientId,
2807
+ tenant_id: tenantId,
2806
2808
  };
2807
2809
 
2808
2810
  const headers = {
@@ -5140,6 +5142,7 @@ class ApiClient {
5140
5142
 
5141
5143
 
5142
5144
 
5145
+
5143
5146
 
5144
5147
 
5145
5148
 
@@ -5180,6 +5183,7 @@ class ApiClient {
5180
5183
  logger$1.info('refresh token callback called', {
5181
5184
  refreshToken: this.refreshToken,
5182
5185
  refreshBackend: this.refreshBackend,
5186
+ refreshTenantId: this.refreshTenantId,
5183
5187
  refreshExpiration: this.refreshExpiration,
5184
5188
  isMobile: this.isMobile,
5185
5189
  });
@@ -5193,6 +5197,7 @@ class ApiClient {
5193
5197
  this.refreshBackend,
5194
5198
  this.refreshExpiration,
5195
5199
  this.isMobile,
5200
+ this.refreshTenantId,
5196
5201
  );
5197
5202
 
5198
5203
  logger$1.info('token refreshed', { token: session.token });
@@ -5234,6 +5239,10 @@ class ApiClient {
5234
5239
  this.refreshBackend = refreshBackend;
5235
5240
  }
5236
5241
 
5242
+ setRefreshTenantId(tenantId ) {
5243
+ this.refreshTenantId = tenantId;
5244
+ }
5245
+
5237
5246
  setIsMobile(isMobile ) {
5238
5247
  this.isMobile = isMobile;
5239
5248
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wazo/sdk",
3
- "version": "0.37.38",
3
+ "version": "0.37.39",
4
4
  "description": "Wazo's JavaScript Software Development Kit.",
5
5
  "main": "dist/wazo-sdk.js",
6
6
  "author": "Wazo (http://wazo.io)",
package/src/api/auth.js CHANGED
@@ -67,12 +67,14 @@ export default (client: ApiRequester, baseUrl: string) => ({
67
67
  backend: string,
68
68
  expiration: number,
69
69
  isMobile: boolean = false,
70
+ tenantId: ?string,
70
71
  ): Promise<?Session> => {
71
72
  const body: Object = {
72
73
  backend: backend || DEFAULT_BACKEND_USER,
73
74
  expiration: expiration || DETAULT_EXPIRATION,
74
75
  refresh_token: refreshToken,
75
76
  client_id: client.clientId,
77
+ tenant_id: tenantId,
76
78
  };
77
79
 
78
80
  const headers: Object = {
package/src/api-client.js CHANGED
@@ -55,6 +55,7 @@ export default class ApiClient {
55
55
  onRefreshToken: ?Function;
56
56
  refreshExpiration: ?number;
57
57
  refreshBackend: ?string;
58
+ refreshTenantId: ?string;
58
59
  isMobile: boolean;
59
60
  fetchOptions: Object;
60
61
 
@@ -95,6 +96,7 @@ export default class ApiClient {
95
96
  logger.info('refresh token callback called', {
96
97
  refreshToken: this.refreshToken,
97
98
  refreshBackend: this.refreshBackend,
99
+ refreshTenantId: this.refreshTenantId,
98
100
  refreshExpiration: this.refreshExpiration,
99
101
  isMobile: this.isMobile,
100
102
  });
@@ -108,6 +110,7 @@ export default class ApiClient {
108
110
  this.refreshBackend,
109
111
  this.refreshExpiration,
110
112
  this.isMobile,
113
+ this.refreshTenantId,
111
114
  );
112
115
 
113
116
  logger.info('token refreshed', { token: session.token });
@@ -149,6 +152,10 @@ export default class ApiClient {
149
152
  this.refreshBackend = refreshBackend;
150
153
  }
151
154
 
155
+ setRefreshTenantId(tenantId: ?string) {
156
+ this.refreshTenantId = tenantId;
157
+ }
158
+
152
159
  setIsMobile(isMobile: boolean) {
153
160
  this.isMobile = isMobile;
154
161
  }
@@ -87,6 +87,13 @@ class Auth {
87
87
  expiration: this.expiration,
88
88
  mobile: this.mobile,
89
89
  });
90
+
91
+ if (backend) {
92
+ getApiClient().setRefreshBackend(backend);
93
+ }
94
+
95
+ getApiClient().setRefreshTenantId(tenantId);
96
+
90
97
  return this._onAuthenticated(rawSession);
91
98
  }
92
99