taxtank-core 0.30.87 → 0.30.89

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.
@@ -9797,6 +9797,7 @@ let RestService$1 = class RestService extends DataService {
9797
9797
  .pipe(map((response) => this.isApiPlatform ? response['hydra:member'] : toArray(response)), map((response) => {
9798
9798
  this.setCache(response);
9799
9799
  this.cacheSubject.next(this.cache);
9800
+ this.isPending = false;
9800
9801
  return this.cache;
9801
9802
  }));
9802
9803
  }
@@ -10135,8 +10136,9 @@ class BasiqService extends RestService$1 {
10135
10136
  * used for upgrade to openBanking and manage shared bank accounts flow
10136
10137
  */
10137
10138
  deleteBasiq(connection) {
10138
- return this.http.put(`${this.apiUrl}/${connection.id}/remove-basiq`, connection)
10139
- .pipe(map(() => {
10139
+ return this.http.put(`${this.environment.apiV2}/bank-connections/${connection.id}/remove-basiq`, connection)
10140
+ .pipe(map((connection) => {
10141
+ return connection;
10140
10142
  // @TODO Alex token should be inside this service
10141
10143
  // this.redirectToBasiqConsent(token.value, connection.bank.externalId, true);
10142
10144
  }));
@@ -10259,20 +10261,14 @@ class BasiqTokenService extends RestService$1 {
10259
10261
  * Access token to use basiq flow
10260
10262
  */
10261
10263
  get() {
10262
- // @TODO Alex move isPending to restService
10263
- if ((!this.cache || this.cache.first.isExpired()) && !this.isPending) {
10264
- this.isPending = true;
10265
- this.http.get(this.apiUrl)
10266
- .pipe(map((response) => {
10267
- const now = new Date().getTime();
10268
- return new BasiqToken(response.access_token, new Date(now + response.expires_in * 1000));
10269
- }))
10270
- .subscribe((token) => {
10271
- this.isPending = false;
10272
- this.updateCache([token], 'get');
10273
- });
10264
+ if (this.cache && this.cache.first.isExpired()) {
10265
+ this.setCache([]);
10274
10266
  }
10275
- return this.cacheSubject.asObservable();
10267
+ return super.get();
10268
+ }
10269
+ createModelInstance(tokenResponse) {
10270
+ const now = new Date().getTime();
10271
+ return new BasiqToken(tokenResponse['access_token'], new Date(now + tokenResponse['expires_in'] * 1000));
10276
10272
  }
10277
10273
  }
10278
10274
  BasiqTokenService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BasiqTokenService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });