@orbis-systems/orbis-api-clients 0.5.2 → 0.6.0

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.
@@ -279,6 +279,7 @@ class $3621850f1f570615$export$4f22f74eddb7716a {
279
279
  this.storage = config.storage ?? sessionStorage;
280
280
  this.axiosInstance = (0, ($parcel$interopDefault($ixKlR$axios))).create({
281
281
  baseURL: config.baseUrl,
282
+ withCredentials: config.withCredentials,
282
283
  headers: {
283
284
  'Content-Type': 'application/json',
284
285
  ...config.defaultHeaders
@@ -420,6 +421,7 @@ class $538ed1203bac2e79$export$f280b732bbc5934b extends (0, $3621850f1f570615$ex
420
421
  this.renewTokenCallback = renewTokenCallback;
421
422
  }
422
423
  async prepareAuthRequestConfig() {
424
+ if (this.config.withCredentials) return {};
423
425
  let { accessToken: accessToken } = this.getAuthData() || {};
424
426
  if (!accessToken) {
425
427
  (0, $ixKlR$consola.consola).warn('No access token found. Please set auth data after authorization.');
@@ -444,7 +446,7 @@ class $538ed1203bac2e79$export$f280b732bbc5934b extends (0, $3621850f1f570615$ex
444
446
  isTokenExpired(token) {
445
447
  const payload = (0, $ixKlR$jwtdecode.jwtDecode)(token);
446
448
  if (!payload.exp) return true;
447
- return (0, $ixKlR$datefns.isBefore)((0, $ixKlR$datefns.subMinutes)(payload.exp * 1000, 5), Date.now());
449
+ return (0, $ixKlR$datefns.isBefore)((0, $ixKlR$datefns.subMinutes)(payload.exp * 1000, 1), Date.now());
448
450
  }
449
451
  async renewToken() {
450
452
  const callback = this.config.onRenewToken ?? this.renewTokenCallback;
@@ -461,7 +463,7 @@ class $4d6a8fd4875e2166$export$c3b634545cedfd73 extends (0, $538ed1203bac2e79$ex
461
463
  const error = data ? data.error || data.errors : undefined;
462
464
  if (error) {
463
465
  const errorString = JSON.stringify(error);
464
- const matched = errorString.match(/"(ERR_.+):/);
466
+ const matched = errorString.match(/"(ERR_.+?);?"/);
465
467
  if (matched) {
466
468
  const errorCode = matched[1]?.toString() || '';
467
469
  return {
@@ -6842,6 +6844,21 @@ class $99afd9e3cb938fa3$export$bbc9669481600618 {
6842
6844
  secure: true
6843
6845
  });
6844
6846
  }
6847
+ /**
6848
+ * @tags Watchmen Ffi User Account Management
6849
+ * @name UserInformation
6850
+ * @summary User Information
6851
+ * @request GET:/rest/v1/uam/user/data
6852
+ * @secure
6853
+ */ userInformation(query, config) {
6854
+ return this.apiClient.request({
6855
+ ...config,
6856
+ url: `/rest/v1/uam/user/data`,
6857
+ method: 'GET',
6858
+ params: query,
6859
+ secure: true
6860
+ });
6861
+ }
6845
6862
  /**
6846
6863
  * @tags Watchmen Ffi User Account Management
6847
6864
  * @name ListLinkedAccounts