@wazo/sdk 0.37.36 → 0.37.37

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/esm/api/auth.js CHANGED
@@ -946,6 +946,7 @@ class Session {
946
946
  /* */
947
947
 
948
948
  const DEFAULT_BACKEND_USER = 'wazo_user';
949
+ const BACKEND_LDAP_USER = 'ldap_user';
949
950
  const DETAULT_EXPIRATION = 3600;
950
951
 
951
952
  var auth = (client , baseUrl ) => ({
@@ -1190,4 +1191,4 @@ var auth = (client , baseUrl ) => ({
1190
1191
  });
1191
1192
 
1192
1193
  export default auth;
1193
- export { DETAULT_EXPIRATION };
1194
+ export { BACKEND_LDAP_USER, DEFAULT_BACKEND_USER, DETAULT_EXPIRATION };
package/esm/index.js CHANGED
@@ -2209,6 +2209,7 @@ class Session {
2209
2209
  /* */
2210
2210
 
2211
2211
  const DEFAULT_BACKEND_USER = 'wazo_user';
2212
+ const BACKEND_LDAP_USER = 'ldap_user';
2212
2213
  const DETAULT_EXPIRATION = 3600;
2213
2214
 
2214
2215
  var authMethods = (client , baseUrl ) => ({
@@ -11696,6 +11697,7 @@ const getCallableNumber = (number , country ) => {
11696
11697
 
11697
11698
  class InvalidSubscription extends Error {}
11698
11699
  class InvalidAuthorization extends Error {}
11700
+ class NoTenantIdError extends Error {}
11699
11701
 
11700
11702
  const logger$5 = IssueReporter$1.loggerFor('simple-auth');
11701
11703
 
@@ -11709,11 +11711,15 @@ class Auth {
11709
11711
 
11710
11712
 
11711
11713
 
11714
+
11715
+
11712
11716
 
11713
11717
  constructor() {
11714
11718
  this.expiration = DETAULT_EXPIRATION;
11715
11719
  this.authenticated = false;
11716
11720
  this.minSubscriptionType = null;
11721
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
11722
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
11717
11723
  }
11718
11724
 
11719
11725
  init(clientId ,
@@ -11746,12 +11752,18 @@ class Auth {
11746
11752
  setFetchOptions(options);
11747
11753
  }
11748
11754
 
11749
- async logIn(username , password ) {
11755
+ async logIn(username , password , backend , tenantId ) {
11756
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
11757
+ throw new NoTenantIdError('No tenant id');
11758
+ }
11759
+
11750
11760
  this.authenticated = false;
11751
11761
  this.session = null;
11752
11762
  const rawSession = await getApiClient().auth.logIn({
11753
11763
  username,
11754
11764
  password,
11765
+ backend,
11766
+ tenantId,
11755
11767
  expiration: this.expiration,
11756
11768
  mobile: this.mobile,
11757
11769
  });
@@ -14081,6 +14093,7 @@ const Wazo = {
14081
14093
  InvalidAuthorization,
14082
14094
  CanceledCallError,
14083
14095
  SFUNotAvailableError,
14096
+ NoTenantIdError,
14084
14097
  };
14085
14098
 
14086
14099
  if (window) {
@@ -2208,6 +2208,7 @@ class ApiRequester {
2208
2208
  /* */
2209
2209
 
2210
2210
  const DEFAULT_BACKEND_USER = 'wazo_user';
2211
+ const BACKEND_LDAP_USER = 'ldap_user';
2211
2212
  const DETAULT_EXPIRATION = 3600;
2212
2213
 
2213
2214
  var authMethods = (client , baseUrl ) => ({
@@ -13679,6 +13680,7 @@ const Wazo = {
13679
13680
  InvalidAuthorization,
13680
13681
  CanceledCallError,
13681
13682
  SFUNotAvailableError,
13683
+ NoTenantIdError,
13682
13684
  };
13683
13685
 
13684
13686
  if (window) {
@@ -13692,6 +13694,7 @@ if (global) {
13692
13694
 
13693
13695
  class InvalidSubscription extends Error {}
13694
13696
  class InvalidAuthorization extends Error {}
13697
+ class NoTenantIdError extends Error {}
13695
13698
 
13696
13699
  const logger = IssueReporter$1.loggerFor('simple-auth');
13697
13700
 
@@ -13705,11 +13708,15 @@ class Auth {
13705
13708
 
13706
13709
 
13707
13710
 
13711
+
13712
+
13708
13713
 
13709
13714
  constructor() {
13710
13715
  this.expiration = DETAULT_EXPIRATION;
13711
13716
  this.authenticated = false;
13712
13717
  this.minSubscriptionType = null;
13718
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
13719
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
13713
13720
  }
13714
13721
 
13715
13722
  init(clientId ,
@@ -13742,12 +13749,18 @@ class Auth {
13742
13749
  setFetchOptions(options);
13743
13750
  }
13744
13751
 
13745
- async logIn(username , password ) {
13752
+ async logIn(username , password , backend , tenantId ) {
13753
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
13754
+ throw new NoTenantIdError('No tenant id');
13755
+ }
13756
+
13746
13757
  this.authenticated = false;
13747
13758
  this.session = null;
13748
13759
  const rawSession = await getApiClient().auth.logIn({
13749
13760
  username,
13750
13761
  password,
13762
+ backend,
13763
+ tenantId,
13751
13764
  expiration: this.expiration,
13752
13765
  mobile: this.mobile,
13753
13766
  });
@@ -13953,4 +13966,4 @@ if (!global.wazoAuthInstance) {
13953
13966
  var Auth$1 = global.wazoAuthInstance;
13954
13967
 
13955
13968
  export default Auth$1;
13956
- export { InvalidAuthorization, InvalidSubscription };
13969
+ export { InvalidAuthorization, InvalidSubscription, NoTenantIdError };
@@ -2208,6 +2208,7 @@ class ApiRequester {
2208
2208
  /* */
2209
2209
 
2210
2210
  const DEFAULT_BACKEND_USER = 'wazo_user';
2211
+ const BACKEND_LDAP_USER = 'ldap_user';
2211
2212
  const DETAULT_EXPIRATION = 3600;
2212
2213
 
2213
2214
  var authMethods = (client , baseUrl ) => ({
@@ -13662,6 +13663,7 @@ const Wazo = {
13662
13663
  InvalidAuthorization,
13663
13664
  CanceledCallError,
13664
13665
  SFUNotAvailableError,
13666
+ NoTenantIdError,
13665
13667
  };
13666
13668
 
13667
13669
  if (window) {
@@ -13675,6 +13677,7 @@ if (global) {
13675
13677
 
13676
13678
  class InvalidSubscription extends Error {}
13677
13679
  class InvalidAuthorization extends Error {}
13680
+ class NoTenantIdError extends Error {}
13678
13681
 
13679
13682
  const logger = IssueReporter$1.loggerFor('simple-auth');
13680
13683
 
@@ -13688,11 +13691,15 @@ class Auth {
13688
13691
 
13689
13692
 
13690
13693
 
13694
+
13695
+
13691
13696
 
13692
13697
  constructor() {
13693
13698
  this.expiration = DETAULT_EXPIRATION;
13694
13699
  this.authenticated = false;
13695
13700
  this.minSubscriptionType = null;
13701
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
13702
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
13696
13703
  }
13697
13704
 
13698
13705
  init(clientId ,
@@ -13725,12 +13732,18 @@ class Auth {
13725
13732
  setFetchOptions(options);
13726
13733
  }
13727
13734
 
13728
- async logIn(username , password ) {
13735
+ async logIn(username , password , backend , tenantId ) {
13736
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
13737
+ throw new NoTenantIdError('No tenant id');
13738
+ }
13739
+
13729
13740
  this.authenticated = false;
13730
13741
  this.session = null;
13731
13742
  const rawSession = await getApiClient().auth.logIn({
13732
13743
  username,
13733
13744
  password,
13745
+ backend,
13746
+ tenantId,
13734
13747
  expiration: this.expiration,
13735
13748
  mobile: this.mobile,
13736
13749
  });
@@ -2811,6 +2811,7 @@ class Session {
2811
2811
  /* */
2812
2812
 
2813
2813
  const DEFAULT_BACKEND_USER = 'wazo_user';
2814
+ const BACKEND_LDAP_USER = 'ldap_user';
2814
2815
  const DETAULT_EXPIRATION = 3600;
2815
2816
 
2816
2817
  var authMethods = (client , baseUrl ) => ({
@@ -10377,6 +10378,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
10377
10378
 
10378
10379
  class InvalidSubscription extends Error {}
10379
10380
  class InvalidAuthorization extends Error {}
10381
+ class NoTenantIdError extends Error {}
10380
10382
 
10381
10383
  const logger$7 = IssueReporter$1.loggerFor('simple-auth');
10382
10384
 
@@ -10390,11 +10392,15 @@ class Auth {
10390
10392
 
10391
10393
 
10392
10394
 
10395
+
10396
+
10393
10397
 
10394
10398
  constructor() {
10395
10399
  this.expiration = DETAULT_EXPIRATION;
10396
10400
  this.authenticated = false;
10397
10401
  this.minSubscriptionType = null;
10402
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
10403
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
10398
10404
  }
10399
10405
 
10400
10406
  init(clientId ,
@@ -10427,12 +10433,18 @@ class Auth {
10427
10433
  setFetchOptions(options);
10428
10434
  }
10429
10435
 
10430
- async logIn(username , password ) {
10436
+ async logIn(username , password , backend , tenantId ) {
10437
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
10438
+ throw new NoTenantIdError('No tenant id');
10439
+ }
10440
+
10431
10441
  this.authenticated = false;
10432
10442
  this.session = null;
10433
10443
  const rawSession = await getApiClient().auth.logIn({
10434
10444
  username,
10435
10445
  password,
10446
+ backend,
10447
+ tenantId,
10436
10448
  expiration: this.expiration,
10437
10449
  mobile: this.mobile,
10438
10450
  });
@@ -13533,6 +13545,7 @@ const Wazo = {
13533
13545
  InvalidAuthorization,
13534
13546
  CanceledCallError,
13535
13547
  SFUNotAvailableError,
13548
+ NoTenantIdError,
13536
13549
  };
13537
13550
 
13538
13551
  if (window) {
@@ -2208,6 +2208,7 @@ class ApiRequester {
2208
2208
  /* */
2209
2209
 
2210
2210
  const DEFAULT_BACKEND_USER = 'wazo_user';
2211
+ const BACKEND_LDAP_USER = 'ldap_user';
2211
2212
  const DETAULT_EXPIRATION = 3600;
2212
2213
 
2213
2214
  var authMethods = (client , baseUrl ) => ({
@@ -5609,6 +5610,7 @@ var getApiClient = (forServer ) => {
5609
5610
 
5610
5611
  class InvalidSubscription extends Error {}
5611
5612
  class InvalidAuthorization extends Error {}
5613
+ class NoTenantIdError extends Error {}
5612
5614
 
5613
5615
  const logger$9 = IssueReporter$1.loggerFor('simple-auth');
5614
5616
 
@@ -5622,11 +5624,15 @@ class Auth {
5622
5624
 
5623
5625
 
5624
5626
 
5627
+
5628
+
5625
5629
 
5626
5630
  constructor() {
5627
5631
  this.expiration = DETAULT_EXPIRATION;
5628
5632
  this.authenticated = false;
5629
5633
  this.minSubscriptionType = null;
5634
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
5635
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
5630
5636
  }
5631
5637
 
5632
5638
  init(clientId ,
@@ -5659,12 +5665,18 @@ class Auth {
5659
5665
  setFetchOptions(options);
5660
5666
  }
5661
5667
 
5662
- async logIn(username , password ) {
5668
+ async logIn(username , password , backend , tenantId ) {
5669
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
5670
+ throw new NoTenantIdError('No tenant id');
5671
+ }
5672
+
5663
5673
  this.authenticated = false;
5664
5674
  this.session = null;
5665
5675
  const rawSession = await getApiClient().auth.logIn({
5666
5676
  username,
5667
5677
  password,
5678
+ backend,
5679
+ tenantId,
5668
5680
  expiration: this.expiration,
5669
5681
  mobile: this.mobile,
5670
5682
  });
@@ -13943,6 +13955,7 @@ const Wazo = {
13943
13955
  InvalidAuthorization,
13944
13956
  CanceledCallError,
13945
13957
  SFUNotAvailableError,
13958
+ NoTenantIdError,
13946
13959
  };
13947
13960
 
13948
13961
  if (window) {
@@ -2234,6 +2234,7 @@ class Session {
2234
2234
  /* */
2235
2235
 
2236
2236
  const DEFAULT_BACKEND_USER = 'wazo_user';
2237
+ const BACKEND_LDAP_USER = 'ldap_user';
2237
2238
  const DETAULT_EXPIRATION = 3600;
2238
2239
 
2239
2240
  var authMethods = (client , baseUrl ) => ({
@@ -5609,6 +5610,7 @@ var getApiClient = (forServer ) => {
5609
5610
 
5610
5611
  class InvalidSubscription extends Error {}
5611
5612
  class InvalidAuthorization extends Error {}
5613
+ class NoTenantIdError extends Error {}
5612
5614
 
5613
5615
  const logger$9 = IssueReporter$1.loggerFor('simple-auth');
5614
5616
 
@@ -5622,11 +5624,15 @@ class Auth {
5622
5624
 
5623
5625
 
5624
5626
 
5627
+
5628
+
5625
5629
 
5626
5630
  constructor() {
5627
5631
  this.expiration = DETAULT_EXPIRATION;
5628
5632
  this.authenticated = false;
5629
5633
  this.minSubscriptionType = null;
5634
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
5635
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
5630
5636
  }
5631
5637
 
5632
5638
  init(clientId ,
@@ -5659,12 +5665,18 @@ class Auth {
5659
5665
  setFetchOptions(options);
5660
5666
  }
5661
5667
 
5662
- async logIn(username , password ) {
5668
+ async logIn(username , password , backend , tenantId ) {
5669
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
5670
+ throw new NoTenantIdError('No tenant id');
5671
+ }
5672
+
5663
5673
  this.authenticated = false;
5664
5674
  this.session = null;
5665
5675
  const rawSession = await getApiClient().auth.logIn({
5666
5676
  username,
5667
5677
  password,
5678
+ backend,
5679
+ tenantId,
5668
5680
  expiration: this.expiration,
5669
5681
  mobile: this.mobile,
5670
5682
  });
@@ -12812,6 +12824,7 @@ const Wazo = {
12812
12824
  InvalidAuthorization,
12813
12825
  CanceledCallError,
12814
12826
  SFUNotAvailableError,
12827
+ NoTenantIdError,
12815
12828
  };
12816
12829
 
12817
12830
  if (window) {
@@ -2234,6 +2234,7 @@ class Session {
2234
2234
  /* */
2235
2235
 
2236
2236
  const DEFAULT_BACKEND_USER = 'wazo_user';
2237
+ const BACKEND_LDAP_USER = 'ldap_user';
2237
2238
  const DETAULT_EXPIRATION = 3600;
2238
2239
 
2239
2240
  var authMethods = (client , baseUrl ) => ({
@@ -5609,6 +5610,7 @@ var getApiClient = (forServer ) => {
5609
5610
 
5610
5611
  class InvalidSubscription extends Error {}
5611
5612
  class InvalidAuthorization extends Error {}
5613
+ class NoTenantIdError extends Error {}
5612
5614
 
5613
5615
  const logger$9 = IssueReporter$1.loggerFor('simple-auth');
5614
5616
 
@@ -5622,11 +5624,15 @@ class Auth {
5622
5624
 
5623
5625
 
5624
5626
 
5627
+
5628
+
5625
5629
 
5626
5630
  constructor() {
5627
5631
  this.expiration = DETAULT_EXPIRATION;
5628
5632
  this.authenticated = false;
5629
5633
  this.minSubscriptionType = null;
5634
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
5635
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
5630
5636
  }
5631
5637
 
5632
5638
  init(clientId ,
@@ -5659,12 +5665,18 @@ class Auth {
5659
5665
  setFetchOptions(options);
5660
5666
  }
5661
5667
 
5662
- async logIn(username , password ) {
5668
+ async logIn(username , password , backend , tenantId ) {
5669
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
5670
+ throw new NoTenantIdError('No tenant id');
5671
+ }
5672
+
5663
5673
  this.authenticated = false;
5664
5674
  this.session = null;
5665
5675
  const rawSession = await getApiClient().auth.logIn({
5666
5676
  username,
5667
5677
  password,
5678
+ backend,
5679
+ tenantId,
5668
5680
  expiration: this.expiration,
5669
5681
  mobile: this.mobile,
5670
5682
  });
@@ -12817,6 +12829,7 @@ const Wazo = {
12817
12829
  InvalidAuthorization,
12818
12830
  CanceledCallError,
12819
12831
  SFUNotAvailableError,
12832
+ NoTenantIdError,
12820
12833
  };
12821
12834
 
12822
12835
  if (window) {
@@ -2208,6 +2208,7 @@ class Session {
2208
2208
  /* */
2209
2209
 
2210
2210
  const DEFAULT_BACKEND_USER = 'wazo_user';
2211
+ const BACKEND_LDAP_USER = 'ldap_user';
2211
2212
  const DETAULT_EXPIRATION = 3600;
2212
2213
 
2213
2214
  var authMethods = (client , baseUrl ) => ({
@@ -5609,6 +5610,7 @@ var getApiClient = (forServer ) => {
5609
5610
 
5610
5611
  class InvalidSubscription extends Error {}
5611
5612
  class InvalidAuthorization extends Error {}
5613
+ class NoTenantIdError extends Error {}
5612
5614
 
5613
5615
  const logger$9 = IssueReporter$1.loggerFor('simple-auth');
5614
5616
 
@@ -5622,11 +5624,15 @@ class Auth {
5622
5624
 
5623
5625
 
5624
5626
 
5627
+
5628
+
5625
5629
 
5626
5630
  constructor() {
5627
5631
  this.expiration = DETAULT_EXPIRATION;
5628
5632
  this.authenticated = false;
5629
5633
  this.minSubscriptionType = null;
5634
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
5635
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
5630
5636
  }
5631
5637
 
5632
5638
  init(clientId ,
@@ -5659,12 +5665,18 @@ class Auth {
5659
5665
  setFetchOptions(options);
5660
5666
  }
5661
5667
 
5662
- async logIn(username , password ) {
5668
+ async logIn(username , password , backend , tenantId ) {
5669
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
5670
+ throw new NoTenantIdError('No tenant id');
5671
+ }
5672
+
5663
5673
  this.authenticated = false;
5664
5674
  this.session = null;
5665
5675
  const rawSession = await getApiClient().auth.logIn({
5666
5676
  username,
5667
5677
  password,
5678
+ backend,
5679
+ tenantId,
5668
5680
  expiration: this.expiration,
5669
5681
  mobile: this.mobile,
5670
5682
  });
@@ -13096,6 +13108,7 @@ const Wazo = {
13096
13108
  InvalidAuthorization,
13097
13109
  CanceledCallError,
13098
13110
  SFUNotAvailableError,
13111
+ NoTenantIdError,
13099
13112
  };
13100
13113
 
13101
13114
  if (window) {
@@ -2208,6 +2208,7 @@ class Session {
2208
2208
  /* */
2209
2209
 
2210
2210
  const DEFAULT_BACKEND_USER = 'wazo_user';
2211
+ const BACKEND_LDAP_USER = 'ldap_user';
2211
2212
  const DETAULT_EXPIRATION = 3600;
2212
2213
 
2213
2214
  var authMethods = (client , baseUrl ) => ({
@@ -5609,6 +5610,7 @@ var getApiClient = (forServer ) => {
5609
5610
 
5610
5611
  class InvalidSubscription extends Error {}
5611
5612
  class InvalidAuthorization extends Error {}
5613
+ class NoTenantIdError extends Error {}
5612
5614
 
5613
5615
  const logger$9 = IssueReporter$1.loggerFor('simple-auth');
5614
5616
 
@@ -5622,11 +5624,15 @@ class Auth {
5622
5624
 
5623
5625
 
5624
5626
 
5627
+
5628
+
5625
5629
 
5626
5630
  constructor() {
5627
5631
  this.expiration = DETAULT_EXPIRATION;
5628
5632
  this.authenticated = false;
5629
5633
  this.minSubscriptionType = null;
5634
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
5635
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
5630
5636
  }
5631
5637
 
5632
5638
  init(clientId ,
@@ -5659,12 +5665,18 @@ class Auth {
5659
5665
  setFetchOptions(options);
5660
5666
  }
5661
5667
 
5662
- async logIn(username , password ) {
5668
+ async logIn(username , password , backend , tenantId ) {
5669
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
5670
+ throw new NoTenantIdError('No tenant id');
5671
+ }
5672
+
5663
5673
  this.authenticated = false;
5664
5674
  this.session = null;
5665
5675
  const rawSession = await getApiClient().auth.logIn({
5666
5676
  username,
5667
5677
  password,
5678
+ backend,
5679
+ tenantId,
5668
5680
  expiration: this.expiration,
5669
5681
  mobile: this.mobile,
5670
5682
  });
@@ -13107,6 +13119,7 @@ const Wazo = {
13107
13119
  InvalidAuthorization,
13108
13120
  CanceledCallError,
13109
13121
  SFUNotAvailableError,
13122
+ NoTenantIdError,
13110
13123
  };
13111
13124
 
13112
13125
  if (window) {
@@ -2208,6 +2208,7 @@ class Session {
2208
2208
  /* */
2209
2209
 
2210
2210
  const DEFAULT_BACKEND_USER = 'wazo_user';
2211
+ const BACKEND_LDAP_USER = 'ldap_user';
2211
2212
  const DETAULT_EXPIRATION = 3600;
2212
2213
 
2213
2214
  var authMethods = (client , baseUrl ) => ({
@@ -5609,6 +5610,7 @@ var getApiClient = (forServer ) => {
5609
5610
 
5610
5611
  class InvalidSubscription extends Error {}
5611
5612
  class InvalidAuthorization extends Error {}
5613
+ class NoTenantIdError extends Error {}
5612
5614
 
5613
5615
  const logger$9 = IssueReporter$1.loggerFor('simple-auth');
5614
5616
 
@@ -5622,11 +5624,15 @@ class Auth {
5622
5624
 
5623
5625
 
5624
5626
 
5627
+
5628
+
5625
5629
 
5626
5630
  constructor() {
5627
5631
  this.expiration = DETAULT_EXPIRATION;
5628
5632
  this.authenticated = false;
5629
5633
  this.minSubscriptionType = null;
5634
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
5635
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
5630
5636
  }
5631
5637
 
5632
5638
  init(clientId ,
@@ -5659,12 +5665,18 @@ class Auth {
5659
5665
  setFetchOptions(options);
5660
5666
  }
5661
5667
 
5662
- async logIn(username , password ) {
5668
+ async logIn(username , password , backend , tenantId ) {
5669
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
5670
+ throw new NoTenantIdError('No tenant id');
5671
+ }
5672
+
5663
5673
  this.authenticated = false;
5664
5674
  this.session = null;
5665
5675
  const rawSession = await getApiClient().auth.logIn({
5666
5676
  username,
5667
5677
  password,
5678
+ backend,
5679
+ tenantId,
5668
5680
  expiration: this.expiration,
5669
5681
  mobile: this.mobile,
5670
5682
  });
@@ -13804,6 +13816,7 @@ const Wazo = {
13804
13816
  InvalidAuthorization,
13805
13817
  CanceledCallError,
13806
13818
  SFUNotAvailableError,
13819
+ NoTenantIdError,
13807
13820
  };
13808
13821
 
13809
13822
  if (window) {
@@ -2208,6 +2208,7 @@ class ApiRequester {
2208
2208
  /* */
2209
2209
 
2210
2210
  const DEFAULT_BACKEND_USER = 'wazo_user';
2211
+ const BACKEND_LDAP_USER = 'ldap_user';
2211
2212
  const DETAULT_EXPIRATION = 3600;
2212
2213
 
2213
2214
  var authMethods = (client , baseUrl ) => ({
@@ -5609,6 +5610,7 @@ var getApiClient = (forServer ) => {
5609
5610
 
5610
5611
  class InvalidSubscription extends Error {}
5611
5612
  class InvalidAuthorization extends Error {}
5613
+ class NoTenantIdError extends Error {}
5612
5614
 
5613
5615
  const logger$9 = IssueReporter$1.loggerFor('simple-auth');
5614
5616
 
@@ -5622,11 +5624,15 @@ class Auth {
5622
5624
 
5623
5625
 
5624
5626
 
5627
+
5628
+
5625
5629
 
5626
5630
  constructor() {
5627
5631
  this.expiration = DETAULT_EXPIRATION;
5628
5632
  this.authenticated = false;
5629
5633
  this.minSubscriptionType = null;
5634
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
5635
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
5630
5636
  }
5631
5637
 
5632
5638
  init(clientId ,
@@ -5659,12 +5665,18 @@ class Auth {
5659
5665
  setFetchOptions(options);
5660
5666
  }
5661
5667
 
5662
- async logIn(username , password ) {
5668
+ async logIn(username , password , backend , tenantId ) {
5669
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
5670
+ throw new NoTenantIdError('No tenant id');
5671
+ }
5672
+
5663
5673
  this.authenticated = false;
5664
5674
  this.session = null;
5665
5675
  const rawSession = await getApiClient().auth.logIn({
5666
5676
  username,
5667
5677
  password,
5678
+ backend,
5679
+ tenantId,
5668
5680
  expiration: this.expiration,
5669
5681
  mobile: this.mobile,
5670
5682
  });
@@ -13885,6 +13897,7 @@ const Wazo = {
13885
13897
  InvalidAuthorization,
13886
13898
  CanceledCallError,
13887
13899
  SFUNotAvailableError,
13900
+ NoTenantIdError,
13888
13901
  };
13889
13902
 
13890
13903
  if (window) {