taxtank-core 0.16.11 → 0.16.12
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/bundles/taxtank-core.umd.js +0 -78
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/services/http/bank/basiq/basiq.service.js +5 -79
- package/fesm2015/taxtank-core.js +1 -74
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/services/http/bank/basiq/basiq.service.d.ts +2 -29
- package/package.json +1 -1
|
@@ -10489,14 +10489,6 @@
|
|
|
10489
10489
|
}]
|
|
10490
10490
|
}] });
|
|
10491
10491
|
|
|
10492
|
-
/**
|
|
10493
|
-
* Basiq consent UI initial URL. Replace USER_ID and TOKEN by user data + handle action parameter
|
|
10494
|
-
*/
|
|
10495
|
-
var BASIQ_CONSENT_URL = 'https://consent.basiq.io/home?userId=USER_ID&token=TOKEN&action=connect';
|
|
10496
|
-
/**
|
|
10497
|
-
* Event message name we listen to handle basiq UI result
|
|
10498
|
-
*/
|
|
10499
|
-
var FINISH_BASIQ_EVENT = 'finish-basiq';
|
|
10500
10492
|
/**
|
|
10501
10493
|
* basiq is a middleman between bank and user
|
|
10502
10494
|
* service is responsible for fetching bank related information
|
|
@@ -10516,25 +10508,6 @@
|
|
|
10516
10508
|
BasiqService.prototype.listenEvents = function () {
|
|
10517
10509
|
this.listenToBankConnectionAdded();
|
|
10518
10510
|
this.listenNotifications();
|
|
10519
|
-
this.listenBasiqConcentUpdated();
|
|
10520
|
-
};
|
|
10521
|
-
/**
|
|
10522
|
-
* Update user's basiq consents data on backend
|
|
10523
|
-
*/
|
|
10524
|
-
BasiqService.prototype.confirmConsents = function () {
|
|
10525
|
-
var _this = this;
|
|
10526
|
-
return this.http.put(this.environment.apiV2 + "/basiq/consents", {}).pipe(operators.map(function (isConfirmed) {
|
|
10527
|
-
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_CONSENT_UPDATED, isConfirmed));
|
|
10528
|
-
}));
|
|
10529
|
-
};
|
|
10530
|
-
/**
|
|
10531
|
-
* Notify backend to update connections
|
|
10532
|
-
*/
|
|
10533
|
-
BasiqService.prototype.updateConnections = function () {
|
|
10534
|
-
var _this = this;
|
|
10535
|
-
return this.http.post(this.environment.apiV2 + "/basiq/connections", {}).pipe(operators.map(function (connections) {
|
|
10536
|
-
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_CONNECTION_UPDATED, !!connections));
|
|
10537
|
-
}));
|
|
10538
10511
|
};
|
|
10539
10512
|
/**
|
|
10540
10513
|
* access token to use basiq connect ui iframe
|
|
@@ -10548,15 +10521,11 @@
|
|
|
10548
10521
|
return new BasiqToken(response['access_token'], new Date(now + response['expires_in'] * 1000));
|
|
10549
10522
|
}))
|
|
10550
10523
|
.subscribe(function (token) {
|
|
10551
|
-
_this.token = token;
|
|
10552
10524
|
_this.tokenSubject.next(token);
|
|
10553
10525
|
});
|
|
10554
10526
|
}
|
|
10555
10527
|
return this.tokenSubject.asObservable();
|
|
10556
10528
|
};
|
|
10557
|
-
/**
|
|
10558
|
-
* Get list of user's bank conections
|
|
10559
|
-
*/
|
|
10560
10529
|
BasiqService.prototype.getConnections = function () {
|
|
10561
10530
|
return this.get().pipe(operators.map(function (bankAccounts) {
|
|
10562
10531
|
// get all connections
|
|
@@ -10567,41 +10536,6 @@
|
|
|
10567
10536
|
return __spreadArray([], __read(new Map(connections.map(function (connection) { return [connection.id, connection]; })).values()));
|
|
10568
10537
|
}));
|
|
10569
10538
|
};
|
|
10570
|
-
/**
|
|
10571
|
-
* Listen response from basiq UI to handle result.
|
|
10572
|
-
* @param isBasiqConsentExist flag from User.ClientDetails - true if user confirmed basiq consent
|
|
10573
|
-
* @param callback function we run after basiq UI work is finished
|
|
10574
|
-
*/
|
|
10575
|
-
BasiqService.prototype.listenBasiqResponse = function (isBasiqConsentExist, callback) {
|
|
10576
|
-
var _this = this;
|
|
10577
|
-
window.addEventListener('message', function (message) {
|
|
10578
|
-
if (message.data !== FINISH_BASIQ_EVENT) {
|
|
10579
|
-
return;
|
|
10580
|
-
}
|
|
10581
|
-
// update user's basiq consent confirmation status for the first basiq ui run
|
|
10582
|
-
if (isBasiqConsentExist) {
|
|
10583
|
-
_this.updateConnections().pipe(operators.take(1)).subscribe();
|
|
10584
|
-
}
|
|
10585
|
-
else {
|
|
10586
|
-
_this.confirmConsents().pipe(operators.take(1)).subscribe();
|
|
10587
|
-
}
|
|
10588
|
-
callback();
|
|
10589
|
-
}, { once: true });
|
|
10590
|
-
};
|
|
10591
|
-
/**
|
|
10592
|
-
* Get URL with filled params to run basiq UI iframe
|
|
10593
|
-
*/
|
|
10594
|
-
BasiqService.prototype.generateBasiqConsentUrl = function (user) {
|
|
10595
|
-
return this.getToken().pipe(operators.map(function (token) {
|
|
10596
|
-
var url = BASIQ_CONSENT_URL;
|
|
10597
|
-
url = url.replace('USER_ID', user.basiqId);
|
|
10598
|
-
url = url.replace('TOKEN', token.value);
|
|
10599
|
-
if (!user.clientDetails.basiqConsentExist) {
|
|
10600
|
-
url = url.split('&action')[0];
|
|
10601
|
-
}
|
|
10602
|
-
return url;
|
|
10603
|
-
}));
|
|
10604
|
-
};
|
|
10605
10539
|
/**
|
|
10606
10540
|
* Listen to EventDispatcherService event related to added Bank connection
|
|
10607
10541
|
*/
|
|
@@ -10626,18 +10560,6 @@
|
|
|
10626
10560
|
}
|
|
10627
10561
|
});
|
|
10628
10562
|
};
|
|
10629
|
-
/**
|
|
10630
|
-
* Update user's basiq connections when user confirmed basiq consent
|
|
10631
|
-
*/
|
|
10632
|
-
BasiqService.prototype.listenBasiqConcentUpdated = function () {
|
|
10633
|
-
var _this = this;
|
|
10634
|
-
this.eventDispatcherService.on(exports.AppEventTypeEnum.BASIQ_CONSENT_UPDATED).subscribe(function (isConfirmed) {
|
|
10635
|
-
if (!isConfirmed) {
|
|
10636
|
-
return;
|
|
10637
|
-
}
|
|
10638
|
-
_this.updateConnections().pipe(operators.take(1)).subscribe();
|
|
10639
|
-
});
|
|
10640
|
-
};
|
|
10641
10563
|
return BasiqService;
|
|
10642
10564
|
}(RestService));
|
|
10643
10565
|
BasiqService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: BasiqService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
|