taxtank-core 0.28.67 → 0.28.68

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('class-transformer'), require('@auth0/angular-jwt'), require('lodash/get'), require('lodash/flatten'), require('lodash/hasIn'), require('lodash/first'), require('lodash/last'), require('lodash/uniqBy'), require('lodash/concat'), require('rxjs/internal/observable/throwError'), require('moment'), require('moment-range'), require('lodash/cloneDeep'), require('event-source-polyfill/src/eventsource.min.js'), require('lodash/compact'), require('lodash/differenceBy'), require('@angular/forms'), require('lodash/merge'), require('lodash/isEqual'), require('lodash/fromPairs'), require('lodash'), require('@angular/router'), require('lodash/clone'), require('html2pdf.js'), require('jspdf'), require('jspdf-autotable'), require('@stripe/stripe-js'), require('xlsx'), require('file-saver')) :
3
- typeof define === 'function' && define.amd ? define('taxtank-core', ['exports', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs/operators', 'rxjs', 'class-transformer', '@auth0/angular-jwt', 'lodash/get', 'lodash/flatten', 'lodash/hasIn', 'lodash/first', 'lodash/last', 'lodash/uniqBy', 'lodash/concat', 'rxjs/internal/observable/throwError', 'moment', 'moment-range', 'lodash/cloneDeep', 'event-source-polyfill/src/eventsource.min.js', 'lodash/compact', 'lodash/differenceBy', '@angular/forms', 'lodash/merge', 'lodash/isEqual', 'lodash/fromPairs', 'lodash', '@angular/router', 'lodash/clone', 'html2pdf.js', 'jspdf', 'jspdf-autotable', '@stripe/stripe-js', 'xlsx', 'file-saver'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["taxtank-core"] = {}, global.ng.core, global.ng.common, global.ng.common.http, global.rxjs.operators, global.rxjs, global.classTransformer, global.angularJwt, global.get, global.flatten, global.hasIn, global.first, global.last, global.uniqBy, global.concat, global.rxjs["internal/observable/throwError"], global.moment$1, global.momentRange, global.cloneDeep$1, global.eventsource_min_js, global.compact, global.differenceBy, global.ng.forms, global.merge, global.isEqual, global.fromPairs, global._, global.ng.router, global.clone, global.html2pdf, global.jsPDF, global.autoTable, global.stripeJs, global.xlsx, global.FileSaver));
5
- })(this, (function (exports, i0, i1$1, i1, operators, rxjs, classTransformer, angularJwt, get, flatten, hasIn, first, last, uniqBy, concat, throwError, moment$1, momentRange, cloneDeep$1, eventsource_min_js, compact, differenceBy, forms, merge, isEqual, fromPairs, _, i1$2, clone, html2pdf, jsPDF, autoTable, stripeJs, xlsx, FileSaver) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('class-transformer'), require('@auth0/angular-jwt'), require('lodash/get'), require('lodash/flatten'), require('lodash/hasIn'), require('lodash/first'), require('lodash/last'), require('lodash/uniqBy'), require('lodash/concat'), require('moment'), require('moment-range'), require('lodash/cloneDeep'), require('rxjs/internal/observable/throwError'), require('event-source-polyfill/src/eventsource.min.js'), require('lodash/compact'), require('lodash/differenceBy'), require('@angular/forms'), require('lodash/merge'), require('lodash/isEqual'), require('lodash/fromPairs'), require('lodash'), require('@angular/router'), require('lodash/clone'), require('html2pdf.js'), require('jspdf'), require('jspdf-autotable'), require('@stripe/stripe-js'), require('xlsx'), require('file-saver')) :
3
+ typeof define === 'function' && define.amd ? define('taxtank-core', ['exports', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs/operators', 'rxjs', 'class-transformer', '@auth0/angular-jwt', 'lodash/get', 'lodash/flatten', 'lodash/hasIn', 'lodash/first', 'lodash/last', 'lodash/uniqBy', 'lodash/concat', 'moment', 'moment-range', 'lodash/cloneDeep', 'rxjs/internal/observable/throwError', 'event-source-polyfill/src/eventsource.min.js', 'lodash/compact', 'lodash/differenceBy', '@angular/forms', 'lodash/merge', 'lodash/isEqual', 'lodash/fromPairs', 'lodash', '@angular/router', 'lodash/clone', 'html2pdf.js', 'jspdf', 'jspdf-autotable', '@stripe/stripe-js', 'xlsx', 'file-saver'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["taxtank-core"] = {}, global.ng.core, global.ng.common, global.ng.common.http, global.rxjs.operators, global.rxjs, global.classTransformer, global.angularJwt, global.get, global.flatten, global.hasIn, global.first, global.last, global.uniqBy, global.concat, global.moment$1, global.momentRange, global.cloneDeep$1, global.rxjs["internal/observable/throwError"], global.eventsource_min_js, global.compact, global.differenceBy, global.ng.forms, global.merge, global.isEqual, global.fromPairs, global._, global.ng.router, global.clone, global.html2pdf, global.jsPDF, global.autoTable, global.stripeJs, global.xlsx, global.FileSaver));
5
+ })(this, (function (exports, i0, i1$1, i1, operators, rxjs, classTransformer, angularJwt, get, flatten, hasIn, first, last, uniqBy, concat, moment$1, momentRange, cloneDeep$1, throwError, eventsource_min_js, compact, differenceBy, forms, merge, isEqual, fromPairs, _, i1$2, clone, html2pdf, jsPDF, autoTable, stripeJs, xlsx, FileSaver) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -567,64 +567,65 @@
567
567
  AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONSENT_UPDATED"] = 7] = "BASIQ_CONSENT_UPDATED";
568
568
  AppEventTypeEnum[AppEventTypeEnum["BASIQ_CONNECTION_UPDATED"] = 8] = "BASIQ_CONNECTION_UPDATED";
569
569
  AppEventTypeEnum[AppEventTypeEnum["BASIQ_JOB_CREATED"] = 9] = "BASIQ_JOB_CREATED";
570
- AppEventTypeEnum[AppEventTypeEnum["BASIQ_LOGIN_FINISHED"] = 10] = "BASIQ_LOGIN_FINISHED";
571
- AppEventTypeEnum[AppEventTypeEnum["CLIENT_INVITE_ACCEPTED"] = 11] = "CLIENT_INVITE_ACCEPTED";
572
- AppEventTypeEnum[AppEventTypeEnum["CLIENT_OPEN_CHAT"] = 12] = "CLIENT_OPEN_CHAT";
573
- AppEventTypeEnum[AppEventTypeEnum["CLIENT_TRANSFER_TO_OTHER_EMPLOYEE"] = 13] = "CLIENT_TRANSFER_TO_OTHER_EMPLOYEE";
574
- AppEventTypeEnum[AppEventTypeEnum["CURRENT_USER_GET_FAILED"] = 14] = "CURRENT_USER_GET_FAILED";
575
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_DELETED"] = 15] = "DEPRECIATION_DELETED";
576
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATIONS_CREATED"] = 16] = "DEPRECIATIONS_CREATED";
577
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_RECEIPT"] = 17] = "DEPRECIATION_UPDATED_WITH_RECEIPT";
578
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT"] = 18] = "DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT";
579
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_CREATED"] = 19] = "DEPRECIATION_RECEIPT_CREATED";
580
- AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_DELETED"] = 20] = "DEPRECIATION_RECEIPT_DELETED";
581
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 21] = "INCOME_SOURCES_CREATED";
582
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 22] = "INCOME_SOURCES_UPDATED";
583
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 23] = "INCOME_SOURCES_FORECASTS_CREATED";
584
- AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 24] = "INCOME_SOURCES_FORECASTS_UPDATED";
585
- AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 25] = "LOAN_UPDATED";
586
- AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 26] = "LOAN_PAYOUT_UPDATED";
587
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 27] = "MESSAGE_CREATED";
588
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 28] = "MESSAGE_FILE_CREATED";
589
- AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 29] = "MESSAGE_FILE_DELETED";
590
- AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 30] = "NOTIFICATION_ADDED";
591
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DEPRECIATION_CALCULATION_UPDATED"] = 31] = "PROPERTY_DEPRECIATION_CALCULATION_UPDATED";
592
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED"] = 32] = "PROPERTY_UPDATED";
593
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 33] = "PROPERTY_UPDATED_WITH_DOCUMENT";
594
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 34] = "PROPERTY_DOCUMENT_ADDED";
595
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 35] = "PROPERTY_MOVEMENT_CREATED";
596
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 36] = "PROPERTY_MOVEMENT_UPDATED";
597
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 37] = "PROPERTY_MOVEMENT_DELETED";
598
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 38] = "PROPERTY_SHARE_UPDATED";
599
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 39] = "PROPERTY_SALE_ADDED";
600
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 40] = "PROPERTY_SALE_DELETED";
601
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 41] = "PROPERTY_SUBSCRIPTION_ADDED";
602
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 42] = "PROPERTY_SUBSCRIPTION_DELETED";
603
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 43] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
604
- AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 44] = "SERVICE_SUBSCRIPTION_UPDATED";
605
- AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 45] = "SOLE_BUSINESS_CREATED";
606
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 46] = "SOLE_DEPRECIATION_METHOD_UPDATED";
607
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 47] = "SOLE_DETAILS_CREATED";
608
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 48] = "SOLE_DETAILS_UPDATED";
609
- AppEventTypeEnum[AppEventTypeEnum["SOLE_INVOICE_PUBLISHED"] = 49] = "SOLE_INVOICE_PUBLISHED";
610
- AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 50] = "TAX_REVIEW_UPDATED";
611
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 51] = "TRANSACTION_CREATED";
612
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 52] = "TRANSACTION_DELETED";
613
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 53] = "TRANSACTION_UPDATED";
614
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 54] = "TRANSACTION_UPDATED_WITH_RECEIPT";
615
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 55] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
616
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 56] = "TRANSACTION_RECEIPT_CREATED";
617
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 57] = "TRANSACTION_RECEIPT_DELETED";
618
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 58] = "TRANSACTIONS_CREATED";
619
- AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 59] = "USER_UPDATED";
620
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 60] = "VEHICLE_CLAIM_UPDATED";
621
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 61] = "VEHICLE_CLAIM_CREATED";
622
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 62] = "VEHICLE_CLAIM_DETAILS_UPDATED";
623
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 63] = "VEHICLE_CLAIM_DETAILS_CREATED";
624
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 64] = "VEHICLE_LOGBOOK_CREATED";
625
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 65] = "VEHICLE_LOGBOOK_UPDATED";
626
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 66] = "VEHICLE_LOGBOOK_DELETED";
627
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 67] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
570
+ AppEventTypeEnum[AppEventTypeEnum["BASIQ_LOGIN_SUCCESS"] = 10] = "BASIQ_LOGIN_SUCCESS";
571
+ AppEventTypeEnum[AppEventTypeEnum["BASIQ_LOGIN_FAILED"] = 11] = "BASIQ_LOGIN_FAILED";
572
+ AppEventTypeEnum[AppEventTypeEnum["CLIENT_INVITE_ACCEPTED"] = 12] = "CLIENT_INVITE_ACCEPTED";
573
+ AppEventTypeEnum[AppEventTypeEnum["CLIENT_OPEN_CHAT"] = 13] = "CLIENT_OPEN_CHAT";
574
+ AppEventTypeEnum[AppEventTypeEnum["CLIENT_TRANSFER_TO_OTHER_EMPLOYEE"] = 14] = "CLIENT_TRANSFER_TO_OTHER_EMPLOYEE";
575
+ AppEventTypeEnum[AppEventTypeEnum["CURRENT_USER_GET_FAILED"] = 15] = "CURRENT_USER_GET_FAILED";
576
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_DELETED"] = 16] = "DEPRECIATION_DELETED";
577
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATIONS_CREATED"] = 17] = "DEPRECIATIONS_CREATED";
578
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_RECEIPT"] = 18] = "DEPRECIATION_UPDATED_WITH_RECEIPT";
579
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT"] = 19] = "DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT";
580
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_CREATED"] = 20] = "DEPRECIATION_RECEIPT_CREATED";
581
+ AppEventTypeEnum[AppEventTypeEnum["DEPRECIATION_RECEIPT_DELETED"] = 21] = "DEPRECIATION_RECEIPT_DELETED";
582
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_CREATED"] = 22] = "INCOME_SOURCES_CREATED";
583
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_UPDATED"] = 23] = "INCOME_SOURCES_UPDATED";
584
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_CREATED"] = 24] = "INCOME_SOURCES_FORECASTS_CREATED";
585
+ AppEventTypeEnum[AppEventTypeEnum["INCOME_SOURCES_FORECASTS_UPDATED"] = 25] = "INCOME_SOURCES_FORECASTS_UPDATED";
586
+ AppEventTypeEnum[AppEventTypeEnum["LOAN_UPDATED"] = 26] = "LOAN_UPDATED";
587
+ AppEventTypeEnum[AppEventTypeEnum["LOAN_PAYOUT_UPDATED"] = 27] = "LOAN_PAYOUT_UPDATED";
588
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_CREATED"] = 28] = "MESSAGE_CREATED";
589
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_CREATED"] = 29] = "MESSAGE_FILE_CREATED";
590
+ AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 30] = "MESSAGE_FILE_DELETED";
591
+ AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 31] = "NOTIFICATION_ADDED";
592
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DEPRECIATION_CALCULATION_UPDATED"] = 32] = "PROPERTY_DEPRECIATION_CALCULATION_UPDATED";
593
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED"] = 33] = "PROPERTY_UPDATED";
594
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 34] = "PROPERTY_UPDATED_WITH_DOCUMENT";
595
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 35] = "PROPERTY_DOCUMENT_ADDED";
596
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 36] = "PROPERTY_MOVEMENT_CREATED";
597
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 37] = "PROPERTY_MOVEMENT_UPDATED";
598
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 38] = "PROPERTY_MOVEMENT_DELETED";
599
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 39] = "PROPERTY_SHARE_UPDATED";
600
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 40] = "PROPERTY_SALE_ADDED";
601
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 41] = "PROPERTY_SALE_DELETED";
602
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 42] = "PROPERTY_SUBSCRIPTION_ADDED";
603
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 43] = "PROPERTY_SUBSCRIPTION_DELETED";
604
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 44] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
605
+ AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 45] = "SERVICE_SUBSCRIPTION_UPDATED";
606
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 46] = "SOLE_BUSINESS_CREATED";
607
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 47] = "SOLE_DEPRECIATION_METHOD_UPDATED";
608
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 48] = "SOLE_DETAILS_CREATED";
609
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 49] = "SOLE_DETAILS_UPDATED";
610
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_INVOICE_PUBLISHED"] = 50] = "SOLE_INVOICE_PUBLISHED";
611
+ AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 51] = "TAX_REVIEW_UPDATED";
612
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 52] = "TRANSACTION_CREATED";
613
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 53] = "TRANSACTION_DELETED";
614
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 54] = "TRANSACTION_UPDATED";
615
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 55] = "TRANSACTION_UPDATED_WITH_RECEIPT";
616
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 56] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
617
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 57] = "TRANSACTION_RECEIPT_CREATED";
618
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 58] = "TRANSACTION_RECEIPT_DELETED";
619
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 59] = "TRANSACTIONS_CREATED";
620
+ AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 60] = "USER_UPDATED";
621
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 61] = "VEHICLE_CLAIM_UPDATED";
622
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 62] = "VEHICLE_CLAIM_CREATED";
623
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 63] = "VEHICLE_CLAIM_DETAILS_UPDATED";
624
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 64] = "VEHICLE_CLAIM_DETAILS_CREATED";
625
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 65] = "VEHICLE_LOGBOOK_CREATED";
626
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 66] = "VEHICLE_LOGBOOK_UPDATED";
627
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 67] = "VEHICLE_LOGBOOK_DELETED";
628
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 68] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
628
629
  })(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
629
630
 
630
631
  var EventDispatcherService = /** @class */ (function () {
@@ -6783,8 +6784,18 @@
6783
6784
  _this.cacheSubject.next(cloneDeep__default["default"](_this.cache));
6784
6785
  }
6785
6786
  }
6786
- _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BANK_CONNECTION_ADDED, null));
6787
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BANK_CONNECTION_ADDED, connection));
6787
6788
  return classTransformer.plainToClass(BankConnection, connection);
6789
+ }), operators.catchError(function (error) {
6790
+ // Show error when user provided wrong login data
6791
+ if (error.status === 401) {
6792
+ _this.toastService.error('Invalid credentials');
6793
+ }
6794
+ // Show error when user provided another login (not login he used before)
6795
+ if (error.status === 400) {
6796
+ _this.toastService.error('Please enter the login you used before');
6797
+ }
6798
+ return throwError.throwError(error);
6788
6799
  }));
6789
6800
  };
6790
6801
  BankConnectionService.prototype.listenToAddedBankAccounts = function () {
@@ -6809,10 +6820,19 @@
6809
6820
  }
6810
6821
  });
6811
6822
  };
6823
+ /**
6824
+ * Create/reconnect bank connection when user successfully logged in to basiq
6825
+ */
6812
6826
  BankConnectionService.prototype.listenBasiqLogin = function () {
6813
6827
  var _this = this;
6814
- this.eventDispatcherService.on(exports.AppEventTypeEnum.BASIQ_LOGIN_FINISHED).subscribe(function () {
6815
- _this.resetCache();
6828
+ this.eventDispatcherService.on(exports.AppEventTypeEnum.BASIQ_LOGIN_SUCCESS).subscribe(function (data) {
6829
+ _this.add(classTransformer.plainToClass(BankConnection, { id: data.connectionId, basiqJob: { externalId: data.jobId } }))
6830
+ .subscribe(function () { },
6831
+ // When user already has some bank accounts in handling connection and trying to login with different credentials, backend can not save this connection.
6832
+ // So we should handle this case as failed login
6833
+ function () {
6834
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_LOGIN_FAILED, null));
6835
+ });
6816
6836
  });
6817
6837
  };
6818
6838
  return BankConnectionService;
@@ -6836,7 +6856,9 @@
6836
6856
  */
6837
6857
  var BasiqService = /** @class */ (function (_super) {
6838
6858
  __extends(BasiqService, _super);
6839
- function BasiqService(http, eventDispatcherService, environment, toastService, bankConnectionService) {
6859
+ function BasiqService(http, eventDispatcherService, environment, toastService,
6860
+ // this inject required to init bank connection service and listen basiq login event
6861
+ bankConnectionService) {
6840
6862
  var _this = _super.call(this, http, eventDispatcherService, environment, toastService) || this;
6841
6863
  _this.http = http;
6842
6864
  _this.eventDispatcherService = eventDispatcherService;
@@ -6852,58 +6874,25 @@
6852
6874
  */
6853
6875
  BasiqService.prototype.listenEvents = function () {
6854
6876
  this.listenNotifications();
6855
- this.listenJobs();
6877
+ this.listenJobCreated();
6856
6878
  };
6857
6879
  /**
6858
- * Create a new Bank connection based on Basiq job.
6859
- * Here we have nested requests because we need to get a job id before we create a bank connection.
6860
- * There is no way to use event dispatcher because we expect some errors from bank-connections API, but in components
6861
- * we interact with basiq service.
6880
+ * Start basiq login process.
6881
+ * Create a basiq job, which contain credentials verifying status.
6882
+ * We can not see login result immediately, because it may take some time (average 10-20 sec)
6862
6883
  */
6863
- BasiqService.prototype.createConnection = function (loginData, userId) {
6884
+ BasiqService.prototype.login = function (loginData, userId) {
6864
6885
  var _this = this;
6865
- // Send login data to basiq API to create a basiq job
6866
- return this.http.post(BasiqService.basiqApiUrl + "/users/" + userId + "/connections", loginData)
6867
- .pipe(operators.mergeMap(function (response) {
6868
- _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_JOB_CREATED, response.id));
6869
- // Create bank connection based on basiq job
6870
- return _this.bankConnectionService.add(classTransformer.plainToClass(BankConnection, { basiqJob: { externalId: response.id } }));
6871
- }), operators.catchError(function (error) {
6872
- // Show error when user provided wrong login data
6873
- if (error.status === 401) {
6874
- _this.toastService.error('Invalid credentials');
6875
- }
6876
- return throwError.throwError(error);
6877
- }));
6878
- };
6879
- /**
6880
- * Update disconnected bank connection
6881
- * Here we have nested requests because we need to get a job id before we create a bank connection.
6882
- * There is no way to use event dispatcher because we expect some errors from bank-connections API, but in components
6883
- * we interact with basiq service.
6884
- */
6885
- BasiqService.prototype.updateConnection = function (data, userId, connection) {
6886
- var _this = this;
6887
- // Send login data and connection id to basiq API to create a basiq job
6888
- return this.http.post(BasiqService.basiqApiUrl + "/users/" + userId + "/connections", Object.assign(data, { id: connection.externalId }))
6889
- .pipe(operators.mergeMap(function (response) {
6890
- _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_JOB_CREATED, response.id));
6891
- // Create bank connection based on basiq job
6892
- return _this.bankConnectionService.add(classTransformer.plainToClass(BankConnection, {
6893
- id: connection.id,
6894
- basiqJob: { externalId: response.id }
6895
- }));
6896
- }), operators.catchError(function (error) {
6897
- // Show error when user provided wrong login data
6898
- if (error.status === 401) {
6899
- _this.toastService.error('Invalid credentials');
6900
- }
6901
- // Show error when user provided another login (not login he used before)
6902
- if (error.status === 400) {
6903
- _this.toastService.error('Please enter the login you used before');
6904
- }
6905
- return throwError.throwError(error);
6906
- }));
6886
+ this.http.post(BasiqService.basiqApiUrl + "/users/" + userId + "/connections", loginData)
6887
+ .subscribe(function (response) {
6888
+ // we need jobId to check credentials verifying statis from Basiq API
6889
+ // we need connectionId to know if we are creating a new connection or reconnecting existing invalid connection
6890
+ var data = {
6891
+ jobId: response.id,
6892
+ connectionId: loginData.id
6893
+ };
6894
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_JOB_CREATED, data));
6895
+ });
6907
6896
  };
6908
6897
  BasiqService.prototype.getByConnection = function (connection) {
6909
6898
  return this.get().pipe(operators.map(function (bankAccounts) {
@@ -6916,32 +6905,38 @@
6916
6905
  }));
6917
6906
  };
6918
6907
  /**
6919
- * Get status of credentials verifying. Expected statuses: 'in-progress', 'failed' or 'success'
6920
- * We send this request by interval until basiq return success or failed
6921
- * @TODO Alex (TT-2431): check logic and try to remove subscribe, use pipes instead
6922
- * @TODO Alex (TT-2431): implement some limit and handle (message or something) if basiq stuck
6923
- * @TODO Alex (TT-2431): check logic and handle case when user cancelled loading
6924
- */
6925
- BasiqService.prototype.checkBankCredentials = function (jobId) {
6908
+ * Get status of credentials verifying. Expected statuses: 'in-progress', 'failed' or 'success'
6909
+ * We send this request by interval until basiq return success or failed.
6910
+ *
6911
+ * Because of Basiq login may take a long time (10-20sec) we have to check job status until it seccess or failed.
6912
+ *
6913
+ * @TODO Alex (TT-2431): check logic and try to remove subscribe, use pipes instead
6914
+ * @TODO Alex (TT-2431): implement some limit and handle (message or something) if basiq stuck
6915
+ * @TODO Alex (TT-2431): check logic and handle case when user cancelled loading
6916
+ */
6917
+ BasiqService.prototype.checkLoginStatus = function (data) {
6926
6918
  var _this = this;
6927
- this.http.get(BasiqService.basiqApiUrl + "/jobs/" + jobId)
6919
+ this.http.get(BasiqService.basiqApiUrl + "/jobs/" + data.jobId)
6928
6920
  .pipe(
6929
- // unsubscribe after each request to avoid wrong requests (example: user cancelled too long login and login to another bank, then we will send 2 different requests)
6930
- operators.take(1),
6931
6921
  // get verify-credentials step from basiq job
6932
- operators.map(function (response) { return classTransformer.plainToClass(BasiqJobResponse, response).getVerifyCredentialsStep(); }),
6922
+ operators.map(function (response) { return classTransformer.plainToClass(BasiqJobResponse, response); }),
6933
6923
  // check credentials status again if not finished
6934
- operators.filter(function (step) {
6935
- if (!step.isInProgress()) {
6924
+ operators.filter(function (response) {
6925
+ if (!response.getVerifyCredentialsStep().isInProgress()) {
6936
6926
  return true;
6937
6927
  }
6938
6928
  setTimeout(function () {
6939
- _this.checkBankCredentials(jobId);
6929
+ _this.checkLoginStatus(data);
6940
6930
  }, BasiqService.bankCredintialsCheckInterval);
6941
6931
  return false;
6942
6932
  }))
6943
- .subscribe(function (step) {
6944
- _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_LOGIN_FINISHED, step.isSuccess()));
6933
+ .subscribe(function (response) {
6934
+ if (response.getVerifyCredentialsStep().isSuccess()) {
6935
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_LOGIN_SUCCESS, data));
6936
+ }
6937
+ else {
6938
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.BASIQ_LOGIN_FAILED, null));
6939
+ }
6945
6940
  });
6946
6941
  };
6947
6942
  /**
@@ -6956,12 +6951,12 @@
6956
6951
  });
6957
6952
  };
6958
6953
  /**
6959
- * Listen Basiq job created to check its verify credentials status
6954
+ * Start check job credential status when it created
6960
6955
  */
6961
- BasiqService.prototype.listenJobs = function () {
6956
+ BasiqService.prototype.listenJobCreated = function () {
6962
6957
  var _this = this;
6963
- this.eventDispatcherService.on(exports.AppEventTypeEnum.BASIQ_JOB_CREATED).subscribe(function (jobId) {
6964
- _this.checkBankCredentials(jobId);
6958
+ this.eventDispatcherService.on(exports.AppEventTypeEnum.BASIQ_JOB_CREATED).subscribe(function (data) {
6959
+ _this.checkLoginStatus(data);
6965
6960
  });
6966
6961
  };
6967
6962
  return BasiqService;