@orbis-systems/orbis-api-clients 0.5.1 → 0.5.3

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.
@@ -427,8 +427,8 @@ class $538ed1203bac2e79$export$f280b732bbc5934b extends (0, $3621850f1f570615$ex
427
427
  }
428
428
  if (this.config.autoRenewToken !== false && this.isTokenExpired(accessToken)) try {
429
429
  await this.lock.runExclusive(async ()=>{
430
- (0, $ixKlR$consola.consola).info("Token expired. Renewing\u2026");
431
- await this.renewToken();
430
+ if (this.config.debug) (0, $ixKlR$consola.consola).debug("Token expired. Renewing\u2026");
431
+ accessToken = (await this.renewToken()).accessToken;
432
432
  this.lock.cancel();
433
433
  });
434
434
  } catch (error) {
@@ -444,12 +444,14 @@ class $538ed1203bac2e79$export$f280b732bbc5934b extends (0, $3621850f1f570615$ex
444
444
  isTokenExpired(token) {
445
445
  const payload = (0, $ixKlR$jwtdecode.jwtDecode)(token);
446
446
  if (!payload.exp) return true;
447
- return (0, $ixKlR$datefns.isBefore)((0, $ixKlR$datefns.subMinutes)(payload.exp * 1000, 5), Date.now());
447
+ return (0, $ixKlR$datefns.isBefore)((0, $ixKlR$datefns.subMinutes)(payload.exp * 1000, 1), Date.now());
448
448
  }
449
449
  async renewToken() {
450
- if (!this.renewTokenCallback) throw new Error('No renew token callback provided');
451
- const authData = await this.renewTokenCallback();
450
+ const callback = this.config.onRenewToken ?? this.renewTokenCallback;
451
+ if (!callback) throw new Error('No renew token callback provided');
452
+ const authData = await callback();
452
453
  this.setAuthData(authData);
454
+ return authData;
453
455
  }
454
456
  }
455
457
 
@@ -459,7 +461,7 @@ class $4d6a8fd4875e2166$export$c3b634545cedfd73 extends (0, $538ed1203bac2e79$ex
459
461
  const error = data ? data.error || data.errors : undefined;
460
462
  if (error) {
461
463
  const errorString = JSON.stringify(error);
462
- const matched = errorString.match(/"(ERR_.+):/);
464
+ const matched = errorString.match(/"(ERR_.+?);?"/);
463
465
  if (matched) {
464
466
  const errorCode = matched[1]?.toString() || '';
465
467
  return {
@@ -5577,6 +5579,38 @@ class $2117554f67927a83$export$68997731bcbd545c {
5577
5579
  contentType: (0, $3621850f1f570615$export$e2e108cbe2e4f865).Json
5578
5580
  });
5579
5581
  }
5582
+ /**
5583
+ * @tags Transfers
5584
+ * @name CryptoWithdrawalEstimate
5585
+ * @summary Crypto Withdrawal Estimate
5586
+ * @request POST:/transfer/crypto/withdrawal/estimate
5587
+ * @secure
5588
+ */ cryptoWithdrawalEstimate(data, config) {
5589
+ return this.apiClient.request({
5590
+ ...config,
5591
+ url: `/transfer/crypto/withdrawal/estimate`,
5592
+ method: 'POST',
5593
+ data: data,
5594
+ secure: true,
5595
+ contentType: (0, $3621850f1f570615$export$e2e108cbe2e4f865).Json
5596
+ });
5597
+ }
5598
+ /**
5599
+ * @tags Transfers
5600
+ * @name CryptoWithdrawal
5601
+ * @summary Crypto Withdrawal
5602
+ * @request POST:/transfer/crypto/withdraw
5603
+ * @secure
5604
+ */ cryptoWithdrawal(data, config) {
5605
+ return this.apiClient.request({
5606
+ ...config,
5607
+ url: `/transfer/crypto/withdraw`,
5608
+ method: 'POST',
5609
+ data: data,
5610
+ secure: true,
5611
+ contentType: (0, $3621850f1f570615$export$e2e108cbe2e4f865).Json
5612
+ });
5613
+ }
5580
5614
  }
5581
5615
 
5582
5616
 
@@ -6808,6 +6842,21 @@ class $99afd9e3cb938fa3$export$bbc9669481600618 {
6808
6842
  secure: true
6809
6843
  });
6810
6844
  }
6845
+ /**
6846
+ * @tags Watchmen Ffi User Account Management
6847
+ * @name UserInformation
6848
+ * @summary User Information
6849
+ * @request GET:/rest/v1/uam/user/data
6850
+ * @secure
6851
+ */ userInformation(query, config) {
6852
+ return this.apiClient.request({
6853
+ ...config,
6854
+ url: `/rest/v1/uam/user/data`,
6855
+ method: 'GET',
6856
+ params: query,
6857
+ secure: true
6858
+ });
6859
+ }
6811
6860
  /**
6812
6861
  * @tags Watchmen Ffi User Account Management
6813
6862
  * @name ListLinkedAccounts
@@ -6935,7 +6984,7 @@ class $a2bb19832837fbd4$export$9c691b12c2ddd3aa extends (0, $780091c10287ceed$ex
6935
6984
  ...config,
6936
6985
  authSchema: 'SessionId',
6937
6986
  defaultSecure: true
6938
- }));
6987
+ })), this.config = config;
6939
6988
  this.advisory = new (0, $4a7999c6f9764642$export$422b120052f6cfe8)(this.apiClient);
6940
6989
  this.authentication = new (0, $bb03ab235021c56e$export$d9e3c9dc7eaad0c3)(this.apiClient);
6941
6990
  this.blacklist = new (0, $06f8f19ecf792c6e$export$5c19a9452db0f3f6)(this.apiClient);