taxtank-core 0.2.1 → 0.3.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.
- package/bundles/taxtank-core.umd.js +898 -447
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/property.collection.js +8 -1
- package/esm2015/lib/db/Enums/chart-accounts-metadata-list.enum.js +2 -3
- package/esm2015/lib/interceptors/corelogic-interceptor.js +44 -0
- package/esm2015/lib/interceptors/financial-year-interceptor.js +30 -0
- package/esm2015/lib/interceptors/interceptors.module.js +74 -0
- package/esm2015/lib/interceptors/jwt-interceptor.js +137 -0
- package/esm2015/lib/interceptors/preloader.interceptor.js +32 -0
- package/esm2015/lib/interceptors/user-switcher-interceptor.js +42 -0
- package/esm2015/lib/models/color/alphabet-colors.enum.js +30 -0
- package/esm2015/lib/models/endpoint/endpoints.const.js +3 -1
- package/esm2015/lib/models/transaction/transaction.js +5 -5
- package/esm2015/lib/services/bank/bank-account.service.js +7 -1
- package/esm2015/lib/services/bank/bank-connection.service.js +10 -1
- package/esm2015/lib/services/property/equity-position-chart.service.js +45 -0
- package/esm2015/lib/tt-core.module.js +8 -4
- package/esm2015/public-api.js +7 -1
- package/fesm2015/taxtank-core.js +845 -422
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/property.collection.d.ts +5 -0
- package/lib/db/Enums/chart-accounts-metadata-list.enum.d.ts +1 -2
- package/lib/interceptors/corelogic-interceptor.d.ts +20 -0
- package/lib/interceptors/financial-year-interceptor.d.ts +12 -0
- package/lib/interceptors/interceptors.module.d.ts +6 -0
- package/lib/interceptors/jwt-interceptor.d.ts +42 -0
- package/lib/interceptors/preloader.interceptor.d.ts +15 -0
- package/lib/interceptors/user-switcher-interceptor.d.ts +19 -0
- package/lib/models/color/alphabet-colors.enum.d.ts +28 -0
- package/lib/models/transaction/transaction.d.ts +1 -3
- package/lib/services/bank/bank-account.service.d.ts +1 -0
- package/lib/services/bank/bank-connection.service.d.ts +2 -0
- package/lib/services/property/equity-position-chart.service.d.ts +15 -0
- package/lib/tt-core.module.d.ts +2 -1
- package/package.json +1 -1
- package/public-api.d.ts +6 -0
|
@@ -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('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('taxtank-core', ['exports', '@angular/core', '@angular/common', 'lodash/has', 'lodash/get', 'lodash/flatten', 'lodash/first', 'lodash/last', 'lodash/uniqBy', 'lodash/concat', 'lodash/compact', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["taxtank-core"] = {}, global.ng.core, global.ng.common, global.
|
|
5
|
-
})(this, (function (exports, i0, common, has, get, flatten, first, last, uniqBy, concat, compact,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('class-transformer'), require('@auth0/angular-jwt'), require('lodash/has'), require('lodash/get'), require('lodash/flatten'), require('lodash/first'), require('lodash/last'), require('lodash/uniqBy'), require('lodash/concat'), require('lodash/compact'), require('moment'), require('moment-range'), require('lodash/cloneDeep'), require('@angular/forms'), require('lodash'), require('event-source-polyfill/src/eventsource.min.js'), require('@angular/router'), require('lodash/clone'), 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', 'rxjs/operators', 'class-transformer', '@auth0/angular-jwt', 'lodash/has', 'lodash/get', 'lodash/flatten', 'lodash/first', 'lodash/last', 'lodash/uniqBy', 'lodash/concat', 'lodash/compact', 'moment', 'moment-range', 'lodash/cloneDeep', '@angular/forms', 'lodash', 'event-source-polyfill/src/eventsource.min.js', '@angular/router', 'lodash/clone', '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, global.rxjs.operators, global.classTransformer, global.angularJwt, global.has, global.get, global.flatten, global.first, global.last, global.uniqBy, global.concat, global.compact, global.moment, global.momentRange, global.cloneDeep$1, global.ng.forms, global._, global.eventsource_min_js, global.ng.router, global.clone, global.jsPDF, global.autoTable, global.stripeJs, global.xlsx, global.FileSaver));
|
|
5
|
+
})(this, (function (exports, i0, common, i1, rxjs, operators, classTransformer, angularJwt, has, get, flatten, first, last, uniqBy, concat, compact, moment, momentRange, cloneDeep$1, forms, _, eventsource_min_js, i1$1, clone, 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
|
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
28
29
|
var has__default = /*#__PURE__*/_interopDefaultLegacy(has);
|
|
29
30
|
var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
|
|
30
31
|
var flatten__default = /*#__PURE__*/_interopDefaultLegacy(flatten);
|
|
@@ -35,7 +36,6 @@
|
|
|
35
36
|
var compact__default = /*#__PURE__*/_interopDefaultLegacy(compact);
|
|
36
37
|
var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
|
|
37
38
|
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep$1);
|
|
38
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
39
39
|
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
40
40
|
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
41
41
|
var clone__default = /*#__PURE__*/_interopDefaultLegacy(clone);
|
|
@@ -44,36 +44,133 @@
|
|
|
44
44
|
var xlsx__namespace = /*#__PURE__*/_interopNamespace(xlsx);
|
|
45
45
|
var FileSaver__namespace = /*#__PURE__*/_interopNamespace(FileSaver);
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
/**
|
|
48
|
+
* https://api-uat.corelogic.asia/property/au/v2/suggest.json
|
|
49
|
+
* address suggestion from corelogic service
|
|
50
|
+
*/
|
|
51
|
+
var CorelogicSuggestion = /** @class */ (function () {
|
|
52
|
+
function CorelogicSuggestion() {
|
|
49
53
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
return CorelogicSuggestion;
|
|
55
|
+
}());
|
|
56
|
+
|
|
57
|
+
var CorelogicService = /** @class */ (function () {
|
|
58
|
+
function CorelogicService(http, environment) {
|
|
59
|
+
this.http = http;
|
|
60
|
+
this.environment = environment;
|
|
61
|
+
this.accessTokenSubject = new rxjs.ReplaySubject(1);
|
|
62
|
+
}
|
|
63
|
+
CorelogicService.prototype.getAccessToken = function (force) {
|
|
64
|
+
var _this = this;
|
|
65
|
+
if (force === void 0) { force = false; }
|
|
66
|
+
if (!this._accessToken || force) {
|
|
67
|
+
this.http.get(this.environment.coreLogicUrl + "/access/oauth/token?grant_type=client_credentials&client_id=" + this.environment.coreLogicId + "&client_secret=" + this.environment.coreLogicSecret)
|
|
68
|
+
.pipe(operators.map(function (response) {
|
|
69
|
+
return response.access_token;
|
|
70
|
+
}))
|
|
71
|
+
.subscribe(function (token) {
|
|
72
|
+
_this._accessToken = token;
|
|
73
|
+
_this.accessTokenSubject.next(_this._accessToken);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return this.accessTokenSubject.asObservable();
|
|
61
77
|
};
|
|
62
|
-
|
|
78
|
+
CorelogicService.prototype.getSuggestions = function (query, country) {
|
|
79
|
+
if (country === void 0) { country = 'au'; }
|
|
80
|
+
// @TODO handle different countries in future
|
|
81
|
+
return this.http.get(this.environment.coreLogicUrl + "/property/" + country + "/v2/suggest.json?q=" + query)
|
|
82
|
+
.pipe(operators.map(function (response) {
|
|
83
|
+
return response.suggestions.map(function (item) { return classTransformer.plainToClass(CorelogicSuggestion, item); });
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
return CorelogicService;
|
|
63
87
|
}());
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
]] });
|
|
69
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TtCoreModule, decorators: [{
|
|
70
|
-
type: i0.NgModule,
|
|
88
|
+
CorelogicService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CorelogicService, deps: [{ token: i1__namespace.HttpClient }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
89
|
+
CorelogicService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CorelogicService, providedIn: 'root' });
|
|
90
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CorelogicService, decorators: [{
|
|
91
|
+
type: i0.Injectable,
|
|
71
92
|
args: [{
|
|
72
|
-
|
|
73
|
-
imports: [
|
|
74
|
-
common.CommonModule
|
|
75
|
-
]
|
|
93
|
+
providedIn: 'root'
|
|
76
94
|
}]
|
|
95
|
+
}], ctorParameters: function () {
|
|
96
|
+
return [{ type: i1__namespace.HttpClient }, { type: undefined, decorators: [{
|
|
97
|
+
type: i0.Inject,
|
|
98
|
+
args: ['environment']
|
|
99
|
+
}] }];
|
|
100
|
+
} });
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Corelogic interceptor add Core Logic access token for each search requests related with Core Logic API
|
|
104
|
+
*/
|
|
105
|
+
var CorelogicInterceptor = /** @class */ (function () {
|
|
106
|
+
function CorelogicInterceptor(corelogicService, environment) {
|
|
107
|
+
this.corelogicService = corelogicService;
|
|
108
|
+
this.environment = environment;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Check if requested url requested core logic, but not core logic auth api
|
|
112
|
+
* @param req
|
|
113
|
+
*/
|
|
114
|
+
CorelogicInterceptor.prototype.addToken = function (req) {
|
|
115
|
+
// don't need token for this endpoint
|
|
116
|
+
if (req.url.includes(this.environment.coreLogicUrl + "/access/oauth/token")) {
|
|
117
|
+
return req;
|
|
118
|
+
}
|
|
119
|
+
// add core logic token to request headers
|
|
120
|
+
if (req.url.includes(this.environment.coreLogicUrl)) {
|
|
121
|
+
return req.clone({
|
|
122
|
+
setHeaders: {
|
|
123
|
+
Authorization: 'Bearer ' + this.corelogicService._accessToken
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// return request without changes if url not related with core logic
|
|
128
|
+
return req;
|
|
129
|
+
};
|
|
130
|
+
CorelogicInterceptor.prototype.intercept = function (request, next) {
|
|
131
|
+
return next.handle(this.addToken(request));
|
|
132
|
+
};
|
|
133
|
+
return CorelogicInterceptor;
|
|
134
|
+
}());
|
|
135
|
+
CorelogicInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CorelogicInterceptor, deps: [{ token: CorelogicService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
136
|
+
CorelogicInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CorelogicInterceptor });
|
|
137
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CorelogicInterceptor, decorators: [{
|
|
138
|
+
type: i0.Injectable
|
|
139
|
+
}], ctorParameters: function () {
|
|
140
|
+
return [{ type: CorelogicService }, { type: undefined, decorators: [{
|
|
141
|
+
type: i0.Inject,
|
|
142
|
+
args: ['environment']
|
|
143
|
+
}] }];
|
|
144
|
+
} });
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Financial Year interceptor add financialYear parameter to requests because a lot of POST and GET requests require this parameter
|
|
148
|
+
* @TODO now we can get current fin year from user on backend. So we can remove this interceptor
|
|
149
|
+
*/
|
|
150
|
+
var FinancialYearInterceptor = /** @class */ (function () {
|
|
151
|
+
function FinancialYearInterceptor() {
|
|
152
|
+
}
|
|
153
|
+
FinancialYearInterceptor.prototype.intercept = function (request, next) {
|
|
154
|
+
// Set financial year parameter to requests
|
|
155
|
+
var params = new i1.HttpParams({
|
|
156
|
+
fromString: request.params.toString()
|
|
157
|
+
});
|
|
158
|
+
// clone request to add new parameters
|
|
159
|
+
var clonedReq = request.clone();
|
|
160
|
+
if (!params.get('financialYear')) {
|
|
161
|
+
params = params.set('financialYear', localStorage.getItem('financialYear'));
|
|
162
|
+
clonedReq = request.clone({
|
|
163
|
+
params: params
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return next.handle(clonedReq);
|
|
167
|
+
};
|
|
168
|
+
return FinancialYearInterceptor;
|
|
169
|
+
}());
|
|
170
|
+
FinancialYearInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FinancialYearInterceptor, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
171
|
+
FinancialYearInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FinancialYearInterceptor });
|
|
172
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FinancialYearInterceptor, decorators: [{
|
|
173
|
+
type: i0.Injectable
|
|
77
174
|
}] });
|
|
78
175
|
|
|
79
176
|
/*! *****************************************************************************
|
|
@@ -394,6 +491,636 @@
|
|
|
394
491
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
395
492
|
}
|
|
396
493
|
|
|
494
|
+
var NAME_TOKEN = 'token';
|
|
495
|
+
var NAME_REFRESH_TOKEN = 'refreshToken';
|
|
496
|
+
var JwtService = /** @class */ (function (_super) {
|
|
497
|
+
__extends(JwtService, _super);
|
|
498
|
+
function JwtService() {
|
|
499
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
500
|
+
}
|
|
501
|
+
JwtService.prototype.getToken = function () {
|
|
502
|
+
return localStorage[NAME_TOKEN];
|
|
503
|
+
};
|
|
504
|
+
JwtService.prototype.getRefreshToken = function () {
|
|
505
|
+
return localStorage[NAME_REFRESH_TOKEN];
|
|
506
|
+
};
|
|
507
|
+
JwtService.prototype.saveTokens = function (tokens) {
|
|
508
|
+
localStorage[NAME_TOKEN] = tokens.token;
|
|
509
|
+
localStorage[NAME_REFRESH_TOKEN] = tokens.refreshToken;
|
|
510
|
+
};
|
|
511
|
+
JwtService.prototype.destroyTokens = function () {
|
|
512
|
+
localStorage.removeItem(NAME_TOKEN);
|
|
513
|
+
localStorage.removeItem(NAME_REFRESH_TOKEN);
|
|
514
|
+
};
|
|
515
|
+
JwtService.prototype.getUser = function () {
|
|
516
|
+
return this.decodeToken();
|
|
517
|
+
};
|
|
518
|
+
JwtService.prototype.isMe = function (userId) {
|
|
519
|
+
return this.getUser().id === userId;
|
|
520
|
+
};
|
|
521
|
+
return JwtService;
|
|
522
|
+
}(angularJwt.JwtHelperService));
|
|
523
|
+
JwtService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
524
|
+
JwtService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtService, providedIn: 'root' });
|
|
525
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtService, decorators: [{
|
|
526
|
+
type: i0.Injectable,
|
|
527
|
+
args: [{
|
|
528
|
+
providedIn: 'root'
|
|
529
|
+
}]
|
|
530
|
+
}] });
|
|
531
|
+
|
|
532
|
+
var AuthService = /** @class */ (function () {
|
|
533
|
+
function AuthService(http, jwtService, environment) {
|
|
534
|
+
this.http = http;
|
|
535
|
+
this.jwtService = jwtService;
|
|
536
|
+
this.environment = environment;
|
|
537
|
+
this.isLoggedInSubject = new rxjs.BehaviorSubject(!this.jwtService.isTokenExpired());
|
|
538
|
+
}
|
|
539
|
+
AuthService.prototype.setAuth = function (response) {
|
|
540
|
+
this.jwtService.saveTokens(response);
|
|
541
|
+
this.isLoggedInSubject.next(true);
|
|
542
|
+
};
|
|
543
|
+
AuthService.prototype.login = function (username, password) {
|
|
544
|
+
var _this = this;
|
|
545
|
+
return this.http.post(this.environment.apiV2 + "/login_check", { username: username, password: password }).pipe(operators.map(function (response) {
|
|
546
|
+
_this.setAuth(response);
|
|
547
|
+
return response;
|
|
548
|
+
}));
|
|
549
|
+
};
|
|
550
|
+
AuthService.prototype.refresh = function (refreshToken) {
|
|
551
|
+
var _this = this;
|
|
552
|
+
return this.http.post(this.environment.apiV2 + "/token/refresh", { refreshToken: refreshToken }).pipe(operators.map(function (response) {
|
|
553
|
+
_this.setAuth(response);
|
|
554
|
+
return response;
|
|
555
|
+
}));
|
|
556
|
+
};
|
|
557
|
+
AuthService.prototype.logoutFront = function (url) {
|
|
558
|
+
if (url === void 0) { url = '/login'; }
|
|
559
|
+
localStorage.clear();
|
|
560
|
+
location.replace(url);
|
|
561
|
+
};
|
|
562
|
+
return AuthService;
|
|
563
|
+
}());
|
|
564
|
+
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.HttpClient }, { token: JwtService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
565
|
+
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: AuthService, providedIn: 'root' });
|
|
566
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
567
|
+
type: i0.Injectable,
|
|
568
|
+
args: [{
|
|
569
|
+
providedIn: 'root'
|
|
570
|
+
}]
|
|
571
|
+
}], ctorParameters: function () {
|
|
572
|
+
return [{ type: i1__namespace.HttpClient }, { type: JwtService }, { type: undefined, decorators: [{
|
|
573
|
+
type: i0.Inject,
|
|
574
|
+
args: ['environment']
|
|
575
|
+
}] }];
|
|
576
|
+
} });
|
|
577
|
+
|
|
578
|
+
var MESSAGE_DEFAULT_500_ERROR = 'Unexpected error! Please try again later. You can send us via chat your questions.';
|
|
579
|
+
/**
|
|
580
|
+
* JWT Interceptor add jwt token to each request related with TaxTank API
|
|
581
|
+
*/
|
|
582
|
+
var JwtInterceptor = /** @class */ (function () {
|
|
583
|
+
function JwtInterceptor(jwtService, authService, environment) {
|
|
584
|
+
this.jwtService = jwtService;
|
|
585
|
+
this.authService = authService;
|
|
586
|
+
this.environment = environment;
|
|
587
|
+
this.isRefreshingToken = false;
|
|
588
|
+
this.tokenSubject = new rxjs.BehaviorSubject(null);
|
|
589
|
+
}
|
|
590
|
+
JwtInterceptor.prototype.addToken = function (req) {
|
|
591
|
+
return req.clone({
|
|
592
|
+
setHeaders: { Authorization: 'Bearer ' + this.jwtService.getToken() },
|
|
593
|
+
withCredentials: true
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
JwtInterceptor.prototype.intercept = function (request, next) {
|
|
597
|
+
var _this = this;
|
|
598
|
+
// skip third party requests
|
|
599
|
+
if (!request.url.includes(this.environment.api_uri)) {
|
|
600
|
+
return next.handle(request);
|
|
601
|
+
}
|
|
602
|
+
// add token to every api request
|
|
603
|
+
return next.handle(this.addToken(request)).pipe(
|
|
604
|
+
// handle errors
|
|
605
|
+
operators.catchError(function (err) {
|
|
606
|
+
if (err instanceof i1.HttpErrorResponse) {
|
|
607
|
+
switch (err.status) {
|
|
608
|
+
// unexpected errors
|
|
609
|
+
case 405:
|
|
610
|
+
case 500:
|
|
611
|
+
_this.handle500Error();
|
|
612
|
+
break;
|
|
613
|
+
// expected errors
|
|
614
|
+
case 401:
|
|
615
|
+
return _this.handle401Error(request, next, err);
|
|
616
|
+
case 400:
|
|
617
|
+
case 403:
|
|
618
|
+
// @TODO in most cases 404 is not an error, handle in components
|
|
619
|
+
// case 404:
|
|
620
|
+
_this.showErrorMessages(err);
|
|
621
|
+
break;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return rxjs.throwError(err);
|
|
625
|
+
}));
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* @TODO log
|
|
629
|
+
* @TODO waiting for backend to handle errors in a better way
|
|
630
|
+
*/
|
|
631
|
+
JwtInterceptor.prototype.handle400Error = function (err) {
|
|
632
|
+
// this.snackBar.open(err.error['hydra:description'], '', {
|
|
633
|
+
// panelClass: 'error'
|
|
634
|
+
// });
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* @TODO log
|
|
638
|
+
* @TODO waiting for backend to handle errors in a better way
|
|
639
|
+
*/
|
|
640
|
+
JwtInterceptor.prototype.handle403Error = function (err) {
|
|
641
|
+
// this.snackBar.open(err.error['hydra:description'], '', {
|
|
642
|
+
// panelClass: 'error'
|
|
643
|
+
// });
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* @TODO log
|
|
647
|
+
*/
|
|
648
|
+
JwtInterceptor.prototype.handle500Error = function () {
|
|
649
|
+
// this.snackBar.open(MESSAGE_DEFAULT_500_ERROR, '', {
|
|
650
|
+
// panelClass: 'error'
|
|
651
|
+
// });
|
|
652
|
+
};
|
|
653
|
+
JwtInterceptor.prototype.handle401Error = function (req, next, err) {
|
|
654
|
+
var _this = this;
|
|
655
|
+
if (req.url.includes('token/refresh') || req.url.includes('login')) {
|
|
656
|
+
if (req.url.includes('token/refresh')) {
|
|
657
|
+
this.authService.logoutFront();
|
|
658
|
+
}
|
|
659
|
+
return rxjs.throwError(err);
|
|
660
|
+
}
|
|
661
|
+
// refreshing token, wait until it's done and retry the request
|
|
662
|
+
if (this.isRefreshingToken) {
|
|
663
|
+
return this.tokenSubject.pipe(operators.filter(function (token) { return token != null; }), operators.take(1), operators.switchMap(function (token) { return next.handle(_this.addToken(req)); }));
|
|
664
|
+
// refresh token
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
// subsequent requests should wait until refresh token is ready
|
|
668
|
+
this.isRefreshingToken = true;
|
|
669
|
+
this.tokenSubject.next(null);
|
|
670
|
+
return this.authService.refresh(this.jwtService.getRefreshToken()).pipe(operators.switchMap(function (tokens) {
|
|
671
|
+
_this.tokenSubject.next(tokens.token);
|
|
672
|
+
return next.handle(_this.addToken(req));
|
|
673
|
+
}), operators.catchError(function () {
|
|
674
|
+
_this.authService.logoutFront();
|
|
675
|
+
return rxjs.throwError(err);
|
|
676
|
+
}), operators.finalize(function () {
|
|
677
|
+
_this.isRefreshingToken = false;
|
|
678
|
+
}));
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
/**
|
|
682
|
+
* Handle error messages
|
|
683
|
+
* @param errorResponse from which messages should be taken
|
|
684
|
+
*
|
|
685
|
+
* @TODO move to separated interceptor
|
|
686
|
+
*/
|
|
687
|
+
JwtInterceptor.prototype.showErrorMessages = function (errorResponse) {
|
|
688
|
+
if (!errorResponse.error.violations) {
|
|
689
|
+
// this.snackBar.open('Something went wrong', '', {
|
|
690
|
+
// panelClass: 'error'
|
|
691
|
+
// });
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
errorResponse.error.violations.forEach(function (violation) {
|
|
695
|
+
// this.snackBar.open(violation['message'], '', {
|
|
696
|
+
// panelClass: 'error'
|
|
697
|
+
// });
|
|
698
|
+
});
|
|
699
|
+
};
|
|
700
|
+
return JwtInterceptor;
|
|
701
|
+
}());
|
|
702
|
+
JwtInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtInterceptor, deps: [{ token: JwtService }, { token: AuthService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
703
|
+
JwtInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtInterceptor });
|
|
704
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtInterceptor, decorators: [{
|
|
705
|
+
type: i0.Injectable
|
|
706
|
+
}], ctorParameters: function () {
|
|
707
|
+
return [{ type: JwtService }, { type: AuthService }, { type: undefined, decorators: [{
|
|
708
|
+
type: i0.Inject,
|
|
709
|
+
args: ['environment']
|
|
710
|
+
}] }];
|
|
711
|
+
} });
|
|
712
|
+
|
|
713
|
+
var KEY = '_switch_user';
|
|
714
|
+
/**
|
|
715
|
+
* provides user management to managers (users with ROLE_ACCOUNTANT for now, more in future)
|
|
716
|
+
*/
|
|
717
|
+
var UserSwitcherService = /** @class */ (function () {
|
|
718
|
+
function UserSwitcherService() {
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* get switched username
|
|
722
|
+
*/
|
|
723
|
+
UserSwitcherService.prototype.get = function () {
|
|
724
|
+
return localStorage[KEY];
|
|
725
|
+
};
|
|
726
|
+
/**
|
|
727
|
+
* switch to user (username should be used for correct work of backend)
|
|
728
|
+
*/
|
|
729
|
+
UserSwitcherService.prototype.set = function (username) {
|
|
730
|
+
localStorage[KEY] = username;
|
|
731
|
+
window.location.replace('/client/dashboard');
|
|
732
|
+
};
|
|
733
|
+
/**
|
|
734
|
+
* go back to original user
|
|
735
|
+
*/
|
|
736
|
+
UserSwitcherService.prototype.reset = function () {
|
|
737
|
+
localStorage.removeItem(KEY);
|
|
738
|
+
window.location.replace('/firm/dashboard');
|
|
739
|
+
};
|
|
740
|
+
return UserSwitcherService;
|
|
741
|
+
}());
|
|
742
|
+
UserSwitcherService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
743
|
+
UserSwitcherService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, providedIn: 'root' });
|
|
744
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, decorators: [{
|
|
745
|
+
type: i0.Injectable,
|
|
746
|
+
args: [{
|
|
747
|
+
providedIn: 'root'
|
|
748
|
+
}]
|
|
749
|
+
}] });
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Impersonate current's user (manager) to client experience with help of special header
|
|
753
|
+
*/
|
|
754
|
+
var UserSwitcherInterceptor = /** @class */ (function () {
|
|
755
|
+
function UserSwitcherInterceptor(userSwitcherService, environment) {
|
|
756
|
+
this.userSwitcherService = userSwitcherService;
|
|
757
|
+
this.environment = environment;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* add token header if request url contain TaxTank API URL
|
|
761
|
+
*/
|
|
762
|
+
UserSwitcherInterceptor.prototype.switch = function (req, username) {
|
|
763
|
+
// skip third party api requests
|
|
764
|
+
if (!req.url.includes(this.environment.api_uri) || !username) {
|
|
765
|
+
return req;
|
|
766
|
+
}
|
|
767
|
+
var params = new i1.HttpParams({ fromString: req.params.toString() }).set('_switch_user', username);
|
|
768
|
+
return req.clone({ params: params });
|
|
769
|
+
// @TODO move to header solution when backend can support it
|
|
770
|
+
// return req.clone({
|
|
771
|
+
// setHeaders: {
|
|
772
|
+
// HTTP_X_SWITCH_USER: username
|
|
773
|
+
// }
|
|
774
|
+
// });
|
|
775
|
+
};
|
|
776
|
+
UserSwitcherInterceptor.prototype.intercept = function (request, next) {
|
|
777
|
+
return next.handle(this.switch(request, this.userSwitcherService.get()));
|
|
778
|
+
};
|
|
779
|
+
return UserSwitcherInterceptor;
|
|
780
|
+
}());
|
|
781
|
+
UserSwitcherInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherInterceptor, deps: [{ token: UserSwitcherService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
782
|
+
UserSwitcherInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherInterceptor });
|
|
783
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherInterceptor, decorators: [{
|
|
784
|
+
type: i0.Injectable
|
|
785
|
+
}], ctorParameters: function () {
|
|
786
|
+
return [{ type: UserSwitcherService }, { type: undefined, decorators: [{
|
|
787
|
+
type: i0.Inject,
|
|
788
|
+
args: ['environment']
|
|
789
|
+
}] }];
|
|
790
|
+
} });
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Backend endpoint class
|
|
794
|
+
*/
|
|
795
|
+
var Endpoint = /** @class */ (function () {
|
|
796
|
+
function Endpoint(method, pattern) {
|
|
797
|
+
this.method = method;
|
|
798
|
+
this.pattern = pattern;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* check url with regexp
|
|
802
|
+
* @param url
|
|
803
|
+
*/
|
|
804
|
+
Endpoint.prototype.test = function (url) {
|
|
805
|
+
return this.regexp.test(url);
|
|
806
|
+
};
|
|
807
|
+
Object.defineProperty(Endpoint.prototype, "regexp", {
|
|
808
|
+
/**
|
|
809
|
+
* Get regexp for endpoint
|
|
810
|
+
*/
|
|
811
|
+
get: function () {
|
|
812
|
+
return new RegExp("^" + this.method + " .*" + this.pattern + "$");
|
|
813
|
+
},
|
|
814
|
+
enumerable: false,
|
|
815
|
+
configurable: true
|
|
816
|
+
});
|
|
817
|
+
return Endpoint;
|
|
818
|
+
}());
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* List of all app endpoints
|
|
822
|
+
*/
|
|
823
|
+
var ENDPOINTS = {
|
|
824
|
+
ASSETS_GET: new Endpoint('GET', '\\/assets\\/\.\*\\/\\d+'),
|
|
825
|
+
BANK_ACCOUNTS_GET: new Endpoint('GET', '\\/bank-accounts'),
|
|
826
|
+
BANK_ACCOUNTS_POST: new Endpoint('POST', '\\/bank-accounts'),
|
|
827
|
+
BANK_ACCOUNTS_PUT: new Endpoint('PUT', '\\/bank-accounts\\/\\d+'),
|
|
828
|
+
BANK_CONNECTION_POST: new Endpoint('POST', '\\/bank-connections'),
|
|
829
|
+
BANK_TRANSACTIONS_GET: new Endpoint('GET', '\\/bank-transactions'),
|
|
830
|
+
BANK_TRANSACTIONS_DELETE: new Endpoint('DELETE', '\\/bank-transactions\\/\\d+'),
|
|
831
|
+
BANK_TRANSACTIONS_IMPORT_POST: new Endpoint('POST', '\\/bank-transactions\\/\\d+\\/import'),
|
|
832
|
+
BASIQ_ACCOUNTS_GET: new Endpoint('GET', '\\/basiq\\/\\accounts'),
|
|
833
|
+
CAPITAL_COSTS_GET: new Endpoint('GET', '\\/capital-costs'),
|
|
834
|
+
CHARTS_INCOME_GET: new Endpoint('GET', '\\/charts\\/\\incomes'),
|
|
835
|
+
CHARTS_EXPENSES_GET: new Endpoint('GET', '\\/charts\\/\\expenses'),
|
|
836
|
+
CHART_ACCOUNTS_GET: new Endpoint('GET', '\\/chart-accounts'),
|
|
837
|
+
CLIENTS_GET: new Endpoint('GET', '\\/clients'),
|
|
838
|
+
CLIENTS_PUT: new Endpoint('PUT', '\\/clients'),
|
|
839
|
+
CLIENTS_EXCLUDE_PUT: new Endpoint('PUT', '\\/clients\\/\\d+\\/exclude'),
|
|
840
|
+
CLIENTS_INVITES_GET: new Endpoint('GET', '\\/clients\\/\\invites'),
|
|
841
|
+
CLIENTS_INVITES_POST: new Endpoint('POST', '\\/clients\\/\\invites'),
|
|
842
|
+
CLIENTS_INVITES_DELETE: new Endpoint('DELETE', '\\/clients\\/\\invites\\/\\d+'),
|
|
843
|
+
CLIENTS_INVITES_ACCEPT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/accept'),
|
|
844
|
+
CLIENTS_INVITES_REJECT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/reject'),
|
|
845
|
+
CLIENTS_INVITES_RESEND_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/resend'),
|
|
846
|
+
CLIENT_MOVEMENTS_GET: new Endpoint('GET', '\\/client-movements'),
|
|
847
|
+
CLIENT_MOVEMENTS_POST: new Endpoint('POST', '\\/client-movements'),
|
|
848
|
+
COUNTRIES_GET: new Endpoint('GET', '\\/countries'),
|
|
849
|
+
DEPRECIATIONS_CLOSING_GET: new Endpoint('GET', '\\/depreciations\\/\\closing-balance\.\*'),
|
|
850
|
+
DEPRECIATIONS_GET: new Endpoint('GET', '\\/depreciations'),
|
|
851
|
+
DEPRECIATIONS_POST: new Endpoint('POST', '\\/depreciations'),
|
|
852
|
+
DEPRECIATIONS_PUT: new Endpoint('PUT', '\\/depreciations\\/\\d+'),
|
|
853
|
+
EMPLOYEES_GET: new Endpoint('GET', '\\/employees'),
|
|
854
|
+
EMPLOYEES_INVITES_GET: new Endpoint('GET', '\\/employees\\/\\invites'),
|
|
855
|
+
EMPLOYEES_INVITES_DELETE: new Endpoint('DELETE', '\\/employees\\/\\invites\\/\\d+'),
|
|
856
|
+
EMPLOYEES_INVITE_POST: new Endpoint('POST', '\\/employees\\/\\invites'),
|
|
857
|
+
EMPLOYEES_INVITES_REJECT_POST: new Endpoint('POST', '\\/employees\\/\\invites\\/\\d+\\/\\reject'),
|
|
858
|
+
EMPLOYEES_INVITES_RESEND_POST: new Endpoint('POST', '\\/employees\\/\\invites\\/\\d+\\/\\resend'),
|
|
859
|
+
FIRM_GET: new Endpoint('GET', '\\/firms'),
|
|
860
|
+
FIRM_CURRENT_GET: new Endpoint('GET', '\\/firms\\/current'),
|
|
861
|
+
FIRM_CURRENT_PUT: new Endpoint('PUT', '\\/firms\\/current\.\*'),
|
|
862
|
+
FIRM_INVITE_POST: new Endpoint('POST', '\\/firms\\/invite'),
|
|
863
|
+
FIRM_REGISTRATION_POST: new Endpoint('POST', '\\/firms\\/registration'),
|
|
864
|
+
FIRM_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/firms\\/photo\.\*'),
|
|
865
|
+
FOLDERS_GET: new Endpoint('GET', '\\/folders'),
|
|
866
|
+
FOLDERS_POST: new Endpoint('POST', '\\/folders'),
|
|
867
|
+
FOLDERS_PUT: new Endpoint('PUT', '\\/folders\\/\\d+'),
|
|
868
|
+
FOLDERS_DOCUMENTS_POST: new Endpoint('POST', '\\/folders\\/\\d+\\/documents'),
|
|
869
|
+
FOLDERS_DOCUMENTS_PUT: new Endpoint('PUT', '\\/folders\\/\\d+\\/documents\\/\\d+'),
|
|
870
|
+
INCOME_SOURCES_GET: new Endpoint('GET', '\\/income-sources'),
|
|
871
|
+
INCOME_SOURCES_POST: new Endpoint('POST', '\\/income-sources'),
|
|
872
|
+
INCOME_SOURCES_PUT: new Endpoint('PUT', '\\/income-sources'),
|
|
873
|
+
INCOME_SOURCES_DELETE: new Endpoint('DELETE', '\\/income-sources\\/\\d+'),
|
|
874
|
+
INCOME_SOURCE_FORECAST_GET: new Endpoint('GET', '\\/income-source-forecasts'),
|
|
875
|
+
INCOME_SOURCE_FORECAST_POST: new Endpoint('POST', '\\/income-source-forecasts'),
|
|
876
|
+
INCOME_SOURCE_FORECAST_PUT: new Endpoint('PUT', '\\/income-source-forecasts'),
|
|
877
|
+
INCOME_SOURCE_FORECAST_DELETE: new Endpoint('DELETE', '\\/income-source-forecasts\\/\\d+'),
|
|
878
|
+
INCOME_SOURCE_TYPES_GET: new Endpoint('GET', '\\/income-source-types'),
|
|
879
|
+
LOANS_GET: new Endpoint('GET', '\\/bank-accounts\\/loans'),
|
|
880
|
+
LOANS_POST: new Endpoint('POST', '\\/bank-accounts\\/loans'),
|
|
881
|
+
LOANS_PUT: new Endpoint('PUT', '\\/bank-accounts\\/loans/\\d+'),
|
|
882
|
+
LOANS_PAYOUT_POST: new Endpoint('POST', '\\/loans\\/\\d+\\/payout'),
|
|
883
|
+
LOANS_PAYOUT_PUT: new Endpoint('PUT', '\\/loans\\/\\d+\\/payout\\/\\d+'),
|
|
884
|
+
LOANS_PAYOUT_DELETE: new Endpoint('DELETE', '\\/loans\\/\\d+\\/payout\\/\\d+'),
|
|
885
|
+
LOANS_CALCULATION_POST: new Endpoint('POST', '\\/bank-accounts\\/loans\\/calculation'),
|
|
886
|
+
LOGIN_CHECK_POST: new Endpoint('POST', '\\/login_check'),
|
|
887
|
+
NOTIFICATIONS_GET: new Endpoint('GET', '\\/service-notifications'),
|
|
888
|
+
OCCUPATIONS_GET: new Endpoint('GET', '\\/occupations'),
|
|
889
|
+
PROPERTIES_GET: new Endpoint('GET', '\\/properties'),
|
|
890
|
+
PROPERTIES_POST: new Endpoint('POST', '\\/properties'),
|
|
891
|
+
PROPERTY_PUT: new Endpoint('PUT', '\\/properties/\\d+'),
|
|
892
|
+
PROPERTIES_PUT: new Endpoint('PUT', '\\/properties'),
|
|
893
|
+
PROPERTIES_CATEGORIES_EQUITY_GET: new Endpoint('GET', '\\/properties\\/categories\\/equity'),
|
|
894
|
+
PROPERTIES_CATEGORIES_GET: new Endpoint('GET', '\\/properties\\/categories'),
|
|
895
|
+
PROPERTIES_CATEGORIES_PUT: new Endpoint('PUT', '\\/properties\\/categories\\/\\d+'),
|
|
896
|
+
PROPERTIES_CATEGORIES_POST: new Endpoint('POST', '\\/properties\\/categories'),
|
|
897
|
+
PROPERTIES_CATEGORY_MOVEMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/category-movements'),
|
|
898
|
+
PROPERTIES_CATEGORY_MOVEMENTS_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/category-movements\\/\\d+'),
|
|
899
|
+
PROPERTIES_CO_OWNERS_PUT: new Endpoint('PUT', '\\/properties\\/co-owners\\/\\d+'),
|
|
900
|
+
PROPERTIES_CO_OWNERS_GET: new Endpoint('GET', '\\/properties\\/co-owners'),
|
|
901
|
+
PROPERTIES_CO_OWNERS_POST: new Endpoint('POST', '\\/properties\\/co-owners'),
|
|
902
|
+
PROPERTIES_DEACTIVATE_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/deactivate'),
|
|
903
|
+
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_GET: new Endpoint('GET', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
|
|
904
|
+
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
|
|
905
|
+
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/depreciation-capital-projects\\/\\d+'),
|
|
906
|
+
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_DELETE: new Endpoint('DELETE', '\\/properties\\/\\d+\\/depreciation-capital-projects\\/\\d+'),
|
|
907
|
+
PROPERTIES_DOCUMENTS_GET: new Endpoint('GET', '\\/properties\\/documents'),
|
|
908
|
+
PROPERTIES_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/documents'),
|
|
909
|
+
PROPERTIES_DOCUMENTS_PUT: new Endpoint('PUT', '\\/properties\\/documents\\/\\d+'),
|
|
910
|
+
PROPERTIES_DOCUMENTS_DELETE: new Endpoint('DELETE', '\\/properties\\/documents\\/\\d+'),
|
|
911
|
+
PROPERTIES_PHOTO_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/photo\.\*'),
|
|
912
|
+
PROPERTIES_SUGGESTIONS_GET: new Endpoint('GET', '/property\\/\\w+\\/v2\\/.*$'),
|
|
913
|
+
PROPERTIES_VALUATIONS_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/valuations\\/\\d+\\/documents'),
|
|
914
|
+
PRORATION_COST_POST: new Endpoint('POST', '\\/subscriptions\\/proration-cost'),
|
|
915
|
+
SALARY_FORECAST_GET: new Endpoint('GET', '\\/salary-forecasts'),
|
|
916
|
+
SALARY_FORECAST_POST: new Endpoint('POST', '\\/salary-forecasts'),
|
|
917
|
+
SALARY_FORECAST_PUT: new Endpoint('PUT', '\\/salary-forecasts'),
|
|
918
|
+
SERVICE_PRICES_GET: new Endpoint('GET', '\\/service-prices'),
|
|
919
|
+
SERVICE_PAYMENTS_GET: new Endpoint('GET', '\\/service-payments'),
|
|
920
|
+
STRIPE_BILLING_PORTAL_GET: new Endpoint('GET', '\\/stripe\\/billing-portal-session'),
|
|
921
|
+
STRIPE_CHECKOUT_SESSION_POST: new Endpoint('POST', '\\/stripe\\/checkout-session'),
|
|
922
|
+
SUBSCRIPTION_LAST_GET: new Endpoint('GET', '\\/subscriptions\\/last'),
|
|
923
|
+
SUBSCRIPTION_ITEMS_PUT: new Endpoint('PUT', '\\/subscriptions\\/items'),
|
|
924
|
+
TAX_CALCULATION_POST: new Endpoint('POST', '\\/tax-calculation'),
|
|
925
|
+
TAX_REVIEWS_GET: new Endpoint('GET', '\\/tax-reviews'),
|
|
926
|
+
TAX_REVIEWS_DELETE: new Endpoint('DELETE', '\\/tax-reviews\\/\\d+'),
|
|
927
|
+
TAX_REVIEWS_POST: new Endpoint('POST', '\\/tax-reviews'),
|
|
928
|
+
TAX_REVIEWS_PUT: new Endpoint('PUT', '\\/tax-reviews\\/\\d+'),
|
|
929
|
+
TAX_SUMMARY_ACTUAL_GET: new Endpoint('GET', '\\/tax-summary\\/actuals'),
|
|
930
|
+
TAX_SUMMARY_FORECAST_GET: new Endpoint('GET', '\\/tax-summary\\/forecasts'),
|
|
931
|
+
TRANSACTION_DELETE: new Endpoint('DELETE', '\\/transactions\\/\\d+'),
|
|
932
|
+
TRANSACTION_PUT: new Endpoint('PUT', '\\/transactions\\/\\d+'),
|
|
933
|
+
TRANSACTIONS_GET: new Endpoint('GET', '\\/transactions'),
|
|
934
|
+
TRANSACTIONS_POST: new Endpoint('POST', '\\/transactions'),
|
|
935
|
+
TRANSACTIONS_PUT: new Endpoint('PUT', '\\/transactions'),
|
|
936
|
+
TRANSACTIONS_ALLOCATIONS_GET: new Endpoint('GET', '\\/transactions-allocations'),
|
|
937
|
+
TRANSACTIONS_ALLOCATIONS_POST: new Endpoint('POST', '\\/transactions-allocations'),
|
|
938
|
+
TRANSACTIONS_ALLOCATIONS_DELETE: new Endpoint('DELETE', '\\/transactions-allocations\\/\\d+'),
|
|
939
|
+
USER_CONFIRMATION_POST: new Endpoint('POST', '\\/users\\/confirmation'),
|
|
940
|
+
USER_CURRENT_GET: new Endpoint('GET', '\\/users\\/current'),
|
|
941
|
+
USER_CURRENT_PASSWORD_PUT: new Endpoint('PUT', '\\/users\\/current\\/password\.\*'),
|
|
942
|
+
USER_EVENT_SETTINGS_GET: new Endpoint('GET', '\\/user-event-settings'),
|
|
943
|
+
USER_EVENT_TYPES_GET: new Endpoint('GET', '\\/user-event-types'),
|
|
944
|
+
USER_INVITE_DELETE: new Endpoint('DELETE', '\\/users\\/invite\\/\\d+'),
|
|
945
|
+
USER_INVITE_POST: new Endpoint('POST', '\\/users\\/invite'),
|
|
946
|
+
USER_INVITE_RESEND_POST: new Endpoint('POST', '\\/users\\/invite/\\d+\\/resend'),
|
|
947
|
+
USER_PUT: new Endpoint('PUT', '\\/users\\/\\d+'),
|
|
948
|
+
USER_REGISTRATION_POST: new Endpoint('POST', '\\/users\\/registration'),
|
|
949
|
+
USER_RESET_PASSWORD_PUT: new Endpoint('PUT', '\\/users\\/reset-password'),
|
|
950
|
+
USER_SEARCH_GET: new Endpoint('GET', '\\/users\\/search\.\*'),
|
|
951
|
+
USER_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/users\\/photo\.\*'),
|
|
952
|
+
USER_STATUS_PUT: new Endpoint('PUT', '\\/users\\/status'),
|
|
953
|
+
VEHICLES_GET: new Endpoint('GET', '\\/vehicles'),
|
|
954
|
+
VEHICLES_POST: new Endpoint('POST', '\\/vehicles'),
|
|
955
|
+
VEHICLES_PUT: new Endpoint('PUT', '\\/vehicles\\/\\d+'),
|
|
956
|
+
VEHICLE_CLAIMS_GET: new Endpoint('GET', '\\/vehicle-claims'),
|
|
957
|
+
VEHICLE_CLAIMS_POST: new Endpoint('POST', '\\/vehicle-claims'),
|
|
958
|
+
VEHICLE_LOGBOOK_POST: new Endpoint('POST', '\\/vehicles\\/\\d+\\/logbooks'),
|
|
959
|
+
VEHICLE_LOGBOOK_PUT: new Endpoint('PUT', '\\/vehicles\\/\\d+\\/logbooks\\/\\d+'),
|
|
960
|
+
VEHICLE_CLAIMS_PUT: new Endpoint('PUT', '\\/vehicle-claims\\/\\d+')
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
var PreloaderService = /** @class */ (function () {
|
|
964
|
+
function PreloaderService() {
|
|
965
|
+
this.activePreloaders = new rxjs.BehaviorSubject([]);
|
|
966
|
+
}
|
|
967
|
+
PreloaderService.prototype.get = function () {
|
|
968
|
+
return this.activePreloaders.asObservable();
|
|
969
|
+
};
|
|
970
|
+
PreloaderService.prototype.add = function (endpoint) {
|
|
971
|
+
var activePreloaders = this.activePreloaders.getValue();
|
|
972
|
+
activePreloaders.push(endpoint);
|
|
973
|
+
this.activePreloaders.next(activePreloaders);
|
|
974
|
+
};
|
|
975
|
+
PreloaderService.prototype.delete = function (endpoint) {
|
|
976
|
+
var activePreloaders = this.activePreloaders.getValue();
|
|
977
|
+
activePreloaders = activePreloaders.filter(function (preloader) { return preloader !== endpoint; });
|
|
978
|
+
this.activePreloaders.next(activePreloaders);
|
|
979
|
+
};
|
|
980
|
+
return PreloaderService;
|
|
981
|
+
}());
|
|
982
|
+
PreloaderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
983
|
+
PreloaderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, providedIn: 'root' });
|
|
984
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, decorators: [{
|
|
985
|
+
type: i0.Injectable,
|
|
986
|
+
args: [{
|
|
987
|
+
providedIn: 'root'
|
|
988
|
+
}]
|
|
989
|
+
}], ctorParameters: function () { return []; } });
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* interceptor for preloader handling
|
|
993
|
+
*/
|
|
994
|
+
var PreloaderInterceptor = /** @class */ (function () {
|
|
995
|
+
function PreloaderInterceptor(preloaderService) {
|
|
996
|
+
this.preloaderService = preloaderService;
|
|
997
|
+
}
|
|
998
|
+
PreloaderInterceptor.prototype.intercept = function (request, next) {
|
|
999
|
+
var _this = this;
|
|
1000
|
+
var endpoint = this.findEndpoint(request.method + " " + request.url);
|
|
1001
|
+
if (!!endpoint) {
|
|
1002
|
+
this.preloaderService.add(endpoint);
|
|
1003
|
+
return next.handle(request).pipe(operators.finalize(function () {
|
|
1004
|
+
_this.preloaderService.delete(endpoint);
|
|
1005
|
+
}));
|
|
1006
|
+
}
|
|
1007
|
+
return next.handle(request);
|
|
1008
|
+
};
|
|
1009
|
+
PreloaderInterceptor.prototype.findEndpoint = function (requestPath) {
|
|
1010
|
+
return Object.values(ENDPOINTS).find(function (endpoint) { return endpoint.test(requestPath); });
|
|
1011
|
+
};
|
|
1012
|
+
return PreloaderInterceptor;
|
|
1013
|
+
}());
|
|
1014
|
+
PreloaderInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderInterceptor, deps: [{ token: PreloaderService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1015
|
+
PreloaderInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderInterceptor });
|
|
1016
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderInterceptor, decorators: [{
|
|
1017
|
+
type: i0.Injectable
|
|
1018
|
+
}], ctorParameters: function () { return [{ type: PreloaderService }]; } });
|
|
1019
|
+
|
|
1020
|
+
var InterceptorsModule = /** @class */ (function () {
|
|
1021
|
+
function InterceptorsModule() {
|
|
1022
|
+
}
|
|
1023
|
+
return InterceptorsModule;
|
|
1024
|
+
}());
|
|
1025
|
+
InterceptorsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: InterceptorsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1026
|
+
InterceptorsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: InterceptorsModule });
|
|
1027
|
+
InterceptorsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: InterceptorsModule, providers: [
|
|
1028
|
+
{
|
|
1029
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1030
|
+
useClass: CorelogicInterceptor,
|
|
1031
|
+
multi: true
|
|
1032
|
+
},
|
|
1033
|
+
// @TODO move to user module
|
|
1034
|
+
{
|
|
1035
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1036
|
+
useClass: FinancialYearInterceptor,
|
|
1037
|
+
multi: true
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1041
|
+
useClass: JwtInterceptor,
|
|
1042
|
+
multi: true
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1046
|
+
useClass: UserSwitcherInterceptor,
|
|
1047
|
+
multi: true
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1051
|
+
useClass: PreloaderInterceptor,
|
|
1052
|
+
multi: true
|
|
1053
|
+
}
|
|
1054
|
+
] });
|
|
1055
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: InterceptorsModule, decorators: [{
|
|
1056
|
+
type: i0.NgModule,
|
|
1057
|
+
args: [{
|
|
1058
|
+
providers: [
|
|
1059
|
+
{
|
|
1060
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1061
|
+
useClass: CorelogicInterceptor,
|
|
1062
|
+
multi: true
|
|
1063
|
+
},
|
|
1064
|
+
// @TODO move to user module
|
|
1065
|
+
{
|
|
1066
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1067
|
+
useClass: FinancialYearInterceptor,
|
|
1068
|
+
multi: true
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1072
|
+
useClass: JwtInterceptor,
|
|
1073
|
+
multi: true
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1077
|
+
useClass: UserSwitcherInterceptor,
|
|
1078
|
+
multi: true
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
provide: i1.HTTP_INTERCEPTORS,
|
|
1082
|
+
useClass: PreloaderInterceptor,
|
|
1083
|
+
multi: true
|
|
1084
|
+
}
|
|
1085
|
+
]
|
|
1086
|
+
}]
|
|
1087
|
+
}] });
|
|
1088
|
+
|
|
1089
|
+
var TtCoreModule = /** @class */ (function () {
|
|
1090
|
+
function TtCoreModule() {
|
|
1091
|
+
}
|
|
1092
|
+
TtCoreModule.forRoot = function (environment) {
|
|
1093
|
+
localStorage.setItem('api_uri', environment['api_uri']);
|
|
1094
|
+
return {
|
|
1095
|
+
ngModule: TtCoreModule,
|
|
1096
|
+
providers: [
|
|
1097
|
+
{
|
|
1098
|
+
provide: 'environment',
|
|
1099
|
+
useValue: environment
|
|
1100
|
+
}
|
|
1101
|
+
]
|
|
1102
|
+
};
|
|
1103
|
+
};
|
|
1104
|
+
return TtCoreModule;
|
|
1105
|
+
}());
|
|
1106
|
+
TtCoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TtCoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1107
|
+
TtCoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TtCoreModule, imports: [common.CommonModule,
|
|
1108
|
+
InterceptorsModule] });
|
|
1109
|
+
TtCoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TtCoreModule, imports: [[
|
|
1110
|
+
common.CommonModule,
|
|
1111
|
+
InterceptorsModule
|
|
1112
|
+
]] });
|
|
1113
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TtCoreModule, decorators: [{
|
|
1114
|
+
type: i0.NgModule,
|
|
1115
|
+
args: [{
|
|
1116
|
+
declarations: [],
|
|
1117
|
+
imports: [
|
|
1118
|
+
common.CommonModule,
|
|
1119
|
+
InterceptorsModule
|
|
1120
|
+
]
|
|
1121
|
+
}]
|
|
1122
|
+
}] });
|
|
1123
|
+
|
|
397
1124
|
/**
|
|
398
1125
|
* List of collections grouped by passed property
|
|
399
1126
|
*/
|
|
@@ -1530,6 +2257,12 @@
|
|
|
1530
2257
|
enumerable: false,
|
|
1531
2258
|
configurable: true
|
|
1532
2259
|
});
|
|
2260
|
+
/**
|
|
2261
|
+
* Get list of unique property categories from collection
|
|
2262
|
+
*/
|
|
2263
|
+
PropertyCollection.prototype.getCategories = function () {
|
|
2264
|
+
return uniqBy__default["default"](this.items.map(function (property) { return property.category; }), 'id');
|
|
2265
|
+
};
|
|
1533
2266
|
return PropertyCollection;
|
|
1534
2267
|
}(AbstractCollection));
|
|
1535
2268
|
|
|
@@ -2321,8 +3054,7 @@
|
|
|
2321
3054
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_OFFSETS"] = 8] = "TAX_OFFSETS";
|
|
2322
3055
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["HOURS"] = 11] = "HOURS";
|
|
2323
3056
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_PAID"] = 13] = "TAX_PAID";
|
|
2324
|
-
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["
|
|
2325
|
-
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["NON_REDUNDANCY"] = 18] = "NON_REDUNDANCY";
|
|
3057
|
+
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["TAX_FREE_COMPONENT"] = 18] = "TAX_FREE_COMPONENT";
|
|
2326
3058
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["YEARS_OF_SERVICE"] = 19] = "YEARS_OF_SERVICE";
|
|
2327
3059
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["UNTAXED_ELEMENT"] = 24] = "UNTAXED_ELEMENT";
|
|
2328
3060
|
ChartAccountsMetadataListEnum[ChartAccountsMetadataListEnum["FRANKED"] = 26] = "FRANKED";
|
|
@@ -4884,10 +5616,14 @@
|
|
|
4884
5616
|
// @TODO fix hack while transactions refactoring (use class-transformer)
|
|
4885
5617
|
return +(Math.round(this.getIncomeAmountByType(exports.IncomeAmountTypeEnum.GROSS) * 100) / 100).toFixed(2);
|
|
4886
5618
|
};
|
|
5619
|
+
Object.defineProperty(Transaction.prototype, "taxFreeComponent", {
|
|
5620
|
+
get: function () {
|
|
5621
|
+
return this.getMetadataFieldValue(exports.ChartAccountsMetadataListEnum.TAX_FREE_COMPONENT);
|
|
5622
|
+
},
|
|
5623
|
+
enumerable: false,
|
|
5624
|
+
configurable: true
|
|
5625
|
+
});
|
|
4887
5626
|
Object.defineProperty(Transaction.prototype, "frankingCredit", {
|
|
4888
|
-
/**
|
|
4889
|
-
* find franking credits metadata and return value
|
|
4890
|
-
*/
|
|
4891
5627
|
get: function () {
|
|
4892
5628
|
return this.getMetadataFieldValue(exports.ChartAccountsMetadataListEnum.FRANKING_CREDIT);
|
|
4893
5629
|
},
|
|
@@ -4935,7 +5671,7 @@
|
|
|
4935
5671
|
(this.transactions
|
|
4936
5672
|
.reduce(function (sum, transaction) { return sum + Math.abs(transaction.amount); }, 0) * modifier);
|
|
4937
5673
|
case this.isWorkTank():
|
|
4938
|
-
return this.amount + ((this.tax + this.frankingCredit) * modifier);
|
|
5674
|
+
return this.amount + ((this.tax + this.frankingCredit - this.taxFreeComponent) * modifier);
|
|
4939
5675
|
default:
|
|
4940
5676
|
return this.amount || 0;
|
|
4941
5677
|
}
|
|
@@ -5642,6 +6378,36 @@
|
|
|
5642
6378
|
return ClientPortfolioReport;
|
|
5643
6379
|
}());
|
|
5644
6380
|
|
|
6381
|
+
exports.AlphabetColorsEnum = void 0;
|
|
6382
|
+
(function (AlphabetColorsEnum) {
|
|
6383
|
+
AlphabetColorsEnum["A"] = "#9CC3D5";
|
|
6384
|
+
AlphabetColorsEnum["B"] = "#E69A8D";
|
|
6385
|
+
AlphabetColorsEnum["C"] = "#ED2B33";
|
|
6386
|
+
AlphabetColorsEnum["D"] = "#E3CD81";
|
|
6387
|
+
AlphabetColorsEnum["E"] = "#343148";
|
|
6388
|
+
AlphabetColorsEnum["F"] = "#2C5F2D";
|
|
6389
|
+
AlphabetColorsEnum["G"] = "#FFA177";
|
|
6390
|
+
AlphabetColorsEnum["H"] = "#435E55";
|
|
6391
|
+
AlphabetColorsEnum["I"] = "#2BAE66";
|
|
6392
|
+
AlphabetColorsEnum["J"] = "#3C1053";
|
|
6393
|
+
AlphabetColorsEnum["K"] = "#DD4132";
|
|
6394
|
+
AlphabetColorsEnum["L"] = "#FC766A";
|
|
6395
|
+
AlphabetColorsEnum["M"] = "#ADEFD1";
|
|
6396
|
+
AlphabetColorsEnum["N"] = "#79C000";
|
|
6397
|
+
AlphabetColorsEnum["O"] = "#D198C5";
|
|
6398
|
+
AlphabetColorsEnum["P"] = "#5B84B1";
|
|
6399
|
+
AlphabetColorsEnum["Q"] = "#A13941";
|
|
6400
|
+
AlphabetColorsEnum["R"] = "#D85A7F";
|
|
6401
|
+
AlphabetColorsEnum["S"] = "#00203F";
|
|
6402
|
+
AlphabetColorsEnum["T"] = "#42EADD";
|
|
6403
|
+
AlphabetColorsEnum["U"] = "#5F4B8B";
|
|
6404
|
+
AlphabetColorsEnum["V"] = "#FDDB27";
|
|
6405
|
+
AlphabetColorsEnum["W"] = "#CDB599";
|
|
6406
|
+
AlphabetColorsEnum["X"] = "#4B878B";
|
|
6407
|
+
AlphabetColorsEnum["Y"] = "#B0B8B4";
|
|
6408
|
+
AlphabetColorsEnum["Z"] = "#E3C9CE";
|
|
6409
|
+
})(exports.AlphabetColorsEnum || (exports.AlphabetColorsEnum = {}));
|
|
6410
|
+
|
|
5645
6411
|
/**
|
|
5646
6412
|
* Class to generate data-table structure based on provided collection.
|
|
5647
6413
|
* Use to work with HTML/PDF/XLSX tables
|
|
@@ -5826,232 +6592,63 @@
|
|
|
5826
6592
|
var DOCUMENT_FILE_TYPES = {
|
|
5827
6593
|
image: [
|
|
5828
6594
|
'image/png',
|
|
5829
|
-
'image/jpg',
|
|
5830
|
-
'image/jpeg',
|
|
5831
|
-
'image/tiff',
|
|
5832
|
-
'image/bmp'
|
|
5833
|
-
],
|
|
5834
|
-
all: [
|
|
5835
|
-
'image/png',
|
|
5836
|
-
'image/jpg',
|
|
5837
|
-
'image/jpeg',
|
|
5838
|
-
'image/tiff',
|
|
5839
|
-
'image/bmp',
|
|
5840
|
-
'application/msword',
|
|
5841
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
5842
|
-
'application/pdf',
|
|
5843
|
-
'application/vnd.ms-excel',
|
|
5844
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
5845
|
-
'text/csv'
|
|
5846
|
-
]
|
|
5847
|
-
};
|
|
5848
|
-
|
|
5849
|
-
var DocumentFolder$1 = /** @class */ (function () {
|
|
5850
|
-
function DocumentFolder() {
|
|
5851
|
-
}
|
|
5852
|
-
return DocumentFolder;
|
|
5853
|
-
}());
|
|
5854
|
-
|
|
5855
|
-
var DocumentFolder = /** @class */ (function (_super) {
|
|
5856
|
-
__extends(DocumentFolder, _super);
|
|
5857
|
-
function DocumentFolder() {
|
|
5858
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
5859
|
-
}
|
|
5860
|
-
return DocumentFolder;
|
|
5861
|
-
}(DocumentFolder$1));
|
|
5862
|
-
__decorate([
|
|
5863
|
-
classTransformer.Type(function () { return Document; })
|
|
5864
|
-
], DocumentFolder.prototype, "documents", void 0);
|
|
5865
|
-
|
|
5866
|
-
var EmployeeInvite$1 = /** @class */ (function () {
|
|
5867
|
-
function EmployeeInvite() {
|
|
5868
|
-
}
|
|
5869
|
-
return EmployeeInvite;
|
|
5870
|
-
}());
|
|
5871
|
-
|
|
5872
|
-
var EmployeeInvite = /** @class */ (function (_super) {
|
|
5873
|
-
__extends(EmployeeInvite, _super);
|
|
5874
|
-
function EmployeeInvite() {
|
|
5875
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
5876
|
-
}
|
|
5877
|
-
return EmployeeInvite;
|
|
5878
|
-
}(EmployeeInvite$1));
|
|
5879
|
-
__decorate([
|
|
5880
|
-
classTransformer.Type(function () { return RegistrationInvite; })
|
|
5881
|
-
], EmployeeInvite.prototype, "registrationInvite", void 0);
|
|
5882
|
-
__decorate([
|
|
5883
|
-
classTransformer.Type(function () { return User; })
|
|
5884
|
-
], EmployeeInvite.prototype, "employee", void 0);
|
|
5885
|
-
|
|
5886
|
-
/**
|
|
5887
|
-
* Backend endpoint class
|
|
5888
|
-
*/
|
|
5889
|
-
var Endpoint = /** @class */ (function () {
|
|
5890
|
-
function Endpoint(method, pattern) {
|
|
5891
|
-
this.method = method;
|
|
5892
|
-
this.pattern = pattern;
|
|
5893
|
-
}
|
|
5894
|
-
/**
|
|
5895
|
-
* check url with regexp
|
|
5896
|
-
* @param url
|
|
5897
|
-
*/
|
|
5898
|
-
Endpoint.prototype.test = function (url) {
|
|
5899
|
-
return this.regexp.test(url);
|
|
5900
|
-
};
|
|
5901
|
-
Object.defineProperty(Endpoint.prototype, "regexp", {
|
|
5902
|
-
/**
|
|
5903
|
-
* Get regexp for endpoint
|
|
5904
|
-
*/
|
|
5905
|
-
get: function () {
|
|
5906
|
-
return new RegExp("^" + this.method + " .*" + this.pattern + "$");
|
|
5907
|
-
},
|
|
5908
|
-
enumerable: false,
|
|
5909
|
-
configurable: true
|
|
5910
|
-
});
|
|
5911
|
-
return Endpoint;
|
|
5912
|
-
}());
|
|
5913
|
-
|
|
5914
|
-
/**
|
|
5915
|
-
* List of all app endpoints
|
|
5916
|
-
*/
|
|
5917
|
-
var ENDPOINTS = {
|
|
5918
|
-
ASSETS_GET: new Endpoint('GET', '\\/assets\\/\.\*\\/\\d+'),
|
|
5919
|
-
BANK_ACCOUNTS_GET: new Endpoint('GET', '\\/bank-accounts'),
|
|
5920
|
-
BANK_ACCOUNTS_POST: new Endpoint('POST', '\\/bank-accounts'),
|
|
5921
|
-
BANK_ACCOUNTS_PUT: new Endpoint('PUT', '\\/bank-accounts\\/\\d+'),
|
|
5922
|
-
BANK_CONNECTION_POST: new Endpoint('POST', '\\/bank-connections'),
|
|
5923
|
-
BANK_TRANSACTIONS_GET: new Endpoint('GET', '\\/bank-transactions'),
|
|
5924
|
-
BANK_TRANSACTIONS_DELETE: new Endpoint('DELETE', '\\/bank-transactions\\/\\d+'),
|
|
5925
|
-
BANK_TRANSACTIONS_IMPORT_POST: new Endpoint('POST', '\\/bank-transactions\\/\\d+\\/import'),
|
|
5926
|
-
BASIQ_ACCOUNTS_GET: new Endpoint('GET', '\\/basiq\\/\\accounts'),
|
|
5927
|
-
CAPITAL_COSTS_GET: new Endpoint('GET', '\\/capital-costs'),
|
|
5928
|
-
CHARTS_INCOME_GET: new Endpoint('GET', '\\/charts\\/\\incomes'),
|
|
5929
|
-
CHARTS_EXPENSES_GET: new Endpoint('GET', '\\/charts\\/\\expenses'),
|
|
5930
|
-
CHART_ACCOUNTS_GET: new Endpoint('GET', '\\/chart-accounts'),
|
|
5931
|
-
CLIENTS_GET: new Endpoint('GET', '\\/clients'),
|
|
5932
|
-
CLIENTS_PUT: new Endpoint('PUT', '\\/clients'),
|
|
5933
|
-
CLIENTS_EXCLUDE_PUT: new Endpoint('PUT', '\\/clients\\/\\d+\\/exclude'),
|
|
5934
|
-
CLIENTS_INVITES_GET: new Endpoint('GET', '\\/clients\\/\\invites'),
|
|
5935
|
-
CLIENTS_INVITES_POST: new Endpoint('POST', '\\/clients\\/\\invites'),
|
|
5936
|
-
CLIENTS_INVITES_DELETE: new Endpoint('DELETE', '\\/clients\\/\\invites\\/\\d+'),
|
|
5937
|
-
CLIENTS_INVITES_ACCEPT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/accept'),
|
|
5938
|
-
CLIENTS_INVITES_REJECT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/reject'),
|
|
5939
|
-
CLIENTS_INVITES_RESEND_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/resend'),
|
|
5940
|
-
CLIENT_MOVEMENTS_GET: new Endpoint('GET', '\\/client-movements'),
|
|
5941
|
-
CLIENT_MOVEMENTS_POST: new Endpoint('POST', '\\/client-movements'),
|
|
5942
|
-
COUNTRIES_GET: new Endpoint('GET', '\\/countries'),
|
|
5943
|
-
DEPRECIATIONS_CLOSING_GET: new Endpoint('GET', '\\/depreciations\\/\\closing-balance\.\*'),
|
|
5944
|
-
DEPRECIATIONS_GET: new Endpoint('GET', '\\/depreciations'),
|
|
5945
|
-
DEPRECIATIONS_POST: new Endpoint('POST', '\\/depreciations'),
|
|
5946
|
-
DEPRECIATIONS_PUT: new Endpoint('PUT', '\\/depreciations\\/\\d+'),
|
|
5947
|
-
EMPLOYEES_GET: new Endpoint('GET', '\\/employees'),
|
|
5948
|
-
EMPLOYEES_INVITES_GET: new Endpoint('GET', '\\/employees\\/\\invites'),
|
|
5949
|
-
EMPLOYEES_INVITES_DELETE: new Endpoint('DELETE', '\\/employees\\/\\invites\\/\\d+'),
|
|
5950
|
-
EMPLOYEES_INVITE_POST: new Endpoint('POST', '\\/employees\\/\\invites'),
|
|
5951
|
-
EMPLOYEES_INVITES_REJECT_POST: new Endpoint('POST', '\\/employees\\/\\invites\\/\\d+\\/\\reject'),
|
|
5952
|
-
EMPLOYEES_INVITES_RESEND_POST: new Endpoint('POST', '\\/employees\\/\\invites\\/\\d+\\/\\resend'),
|
|
5953
|
-
FIRM_GET: new Endpoint('GET', '\\/firms'),
|
|
5954
|
-
FIRM_CURRENT_GET: new Endpoint('GET', '\\/firms\\/current'),
|
|
5955
|
-
FIRM_CURRENT_PUT: new Endpoint('PUT', '\\/firms\\/current\.\*'),
|
|
5956
|
-
FIRM_INVITE_POST: new Endpoint('POST', '\\/firms\\/invite'),
|
|
5957
|
-
FIRM_REGISTRATION_POST: new Endpoint('POST', '\\/firms\\/registration'),
|
|
5958
|
-
FIRM_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/firms\\/photo\.\*'),
|
|
5959
|
-
FOLDERS_GET: new Endpoint('GET', '\\/folders'),
|
|
5960
|
-
FOLDERS_POST: new Endpoint('POST', '\\/folders'),
|
|
5961
|
-
FOLDERS_PUT: new Endpoint('PUT', '\\/folders\\/\\d+'),
|
|
5962
|
-
FOLDERS_DOCUMENTS_POST: new Endpoint('POST', '\\/folders\\/\\d+\\/documents'),
|
|
5963
|
-
FOLDERS_DOCUMENTS_PUT: new Endpoint('PUT', '\\/folders\\/\\d+\\/documents\\/\\d+'),
|
|
5964
|
-
INCOME_SOURCES_GET: new Endpoint('GET', '\\/income-sources'),
|
|
5965
|
-
INCOME_SOURCES_POST: new Endpoint('POST', '\\/income-sources'),
|
|
5966
|
-
INCOME_SOURCES_PUT: new Endpoint('PUT', '\\/income-sources'),
|
|
5967
|
-
INCOME_SOURCES_DELETE: new Endpoint('DELETE', '\\/income-sources\\/\\d+'),
|
|
5968
|
-
INCOME_SOURCE_FORECAST_GET: new Endpoint('GET', '\\/income-source-forecasts'),
|
|
5969
|
-
INCOME_SOURCE_FORECAST_POST: new Endpoint('POST', '\\/income-source-forecasts'),
|
|
5970
|
-
INCOME_SOURCE_FORECAST_PUT: new Endpoint('PUT', '\\/income-source-forecasts'),
|
|
5971
|
-
INCOME_SOURCE_FORECAST_DELETE: new Endpoint('DELETE', '\\/income-source-forecasts\\/\\d+'),
|
|
5972
|
-
INCOME_SOURCE_TYPES_GET: new Endpoint('GET', '\\/income-source-types'),
|
|
5973
|
-
LOANS_GET: new Endpoint('GET', '\\/bank-accounts\\/loans'),
|
|
5974
|
-
LOANS_POST: new Endpoint('POST', '\\/bank-accounts\\/loans'),
|
|
5975
|
-
LOANS_PUT: new Endpoint('PUT', '\\/bank-accounts\\/loans/\\d+'),
|
|
5976
|
-
LOANS_PAYOUT_POST: new Endpoint('POST', '\\/loans\\/\\d+\\/payout'),
|
|
5977
|
-
LOANS_PAYOUT_PUT: new Endpoint('PUT', '\\/loans\\/\\d+\\/payout\\/\\d+'),
|
|
5978
|
-
LOANS_PAYOUT_DELETE: new Endpoint('DELETE', '\\/loans\\/\\d+\\/payout\\/\\d+'),
|
|
5979
|
-
LOANS_CALCULATION_POST: new Endpoint('POST', '\\/bank-accounts\\/loans\\/calculation'),
|
|
5980
|
-
LOGIN_CHECK_POST: new Endpoint('POST', '\\/login_check'),
|
|
5981
|
-
NOTIFICATIONS_GET: new Endpoint('GET', '\\/service-notifications'),
|
|
5982
|
-
OCCUPATIONS_GET: new Endpoint('GET', '\\/occupations'),
|
|
5983
|
-
PROPERTIES_GET: new Endpoint('GET', '\\/properties'),
|
|
5984
|
-
PROPERTIES_POST: new Endpoint('POST', '\\/properties'),
|
|
5985
|
-
PROPERTY_PUT: new Endpoint('PUT', '\\/properties/\\d+'),
|
|
5986
|
-
PROPERTIES_PUT: new Endpoint('PUT', '\\/properties'),
|
|
5987
|
-
PROPERTIES_CATEGORIES_EQUITY_GET: new Endpoint('GET', '\\/properties\\/categories\\/equity'),
|
|
5988
|
-
PROPERTIES_CATEGORIES_GET: new Endpoint('GET', '\\/properties\\/categories'),
|
|
5989
|
-
PROPERTIES_CATEGORIES_PUT: new Endpoint('PUT', '\\/properties\\/categories\\/\\d+'),
|
|
5990
|
-
PROPERTIES_CATEGORIES_POST: new Endpoint('POST', '\\/properties\\/categories'),
|
|
5991
|
-
PROPERTIES_CATEGORY_MOVEMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/category-movements'),
|
|
5992
|
-
PROPERTIES_CATEGORY_MOVEMENTS_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/category-movements\\/\\d+'),
|
|
5993
|
-
PROPERTIES_CO_OWNERS_PUT: new Endpoint('PUT', '\\/properties\\/co-owners\\/\\d+'),
|
|
5994
|
-
PROPERTIES_CO_OWNERS_GET: new Endpoint('GET', '\\/properties\\/co-owners'),
|
|
5995
|
-
PROPERTIES_CO_OWNERS_POST: new Endpoint('POST', '\\/properties\\/co-owners'),
|
|
5996
|
-
PROPERTIES_DEACTIVATE_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/deactivate'),
|
|
5997
|
-
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_GET: new Endpoint('GET', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
|
|
5998
|
-
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
|
|
5999
|
-
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/depreciation-capital-projects\\/\\d+'),
|
|
6000
|
-
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_DELETE: new Endpoint('DELETE', '\\/properties\\/\\d+\\/depreciation-capital-projects\\/\\d+'),
|
|
6001
|
-
PROPERTIES_DOCUMENTS_GET: new Endpoint('GET', '\\/properties\\/documents'),
|
|
6002
|
-
PROPERTIES_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/documents'),
|
|
6003
|
-
PROPERTIES_DOCUMENTS_PUT: new Endpoint('PUT', '\\/properties\\/documents\\/\\d+'),
|
|
6004
|
-
PROPERTIES_DOCUMENTS_DELETE: new Endpoint('DELETE', '\\/properties\\/documents\\/\\d+'),
|
|
6005
|
-
PROPERTIES_PHOTO_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/photo\.\*'),
|
|
6006
|
-
PROPERTIES_SUGGESTIONS_GET: new Endpoint('GET', '/property\\/\\w+\\/v2\\/.*$'),
|
|
6007
|
-
PROPERTIES_VALUATIONS_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/valuations\\/\\d+\\/documents'),
|
|
6008
|
-
PRORATION_COST_POST: new Endpoint('POST', '\\/subscriptions\\/proration-cost'),
|
|
6009
|
-
SALARY_FORECAST_GET: new Endpoint('GET', '\\/salary-forecasts'),
|
|
6010
|
-
SALARY_FORECAST_POST: new Endpoint('POST', '\\/salary-forecasts'),
|
|
6011
|
-
SALARY_FORECAST_PUT: new Endpoint('PUT', '\\/salary-forecasts'),
|
|
6012
|
-
SERVICE_PRICES_GET: new Endpoint('GET', '\\/service-prices'),
|
|
6013
|
-
SERVICE_PAYMENTS_GET: new Endpoint('GET', '\\/service-payments'),
|
|
6014
|
-
STRIPE_BILLING_PORTAL_GET: new Endpoint('GET', '\\/stripe\\/billing-portal-session'),
|
|
6015
|
-
STRIPE_CHECKOUT_SESSION_POST: new Endpoint('POST', '\\/stripe\\/checkout-session'),
|
|
6016
|
-
SUBSCRIPTION_LAST_GET: new Endpoint('GET', '\\/subscriptions\\/last'),
|
|
6017
|
-
SUBSCRIPTION_ITEMS_PUT: new Endpoint('PUT', '\\/subscriptions\\/items'),
|
|
6018
|
-
TAX_CALCULATION_POST: new Endpoint('POST', '\\/tax-calculation'),
|
|
6019
|
-
TAX_REVIEWS_GET: new Endpoint('GET', '\\/tax-reviews'),
|
|
6020
|
-
TAX_REVIEWS_DELETE: new Endpoint('DELETE', '\\/tax-reviews\\/\\d+'),
|
|
6021
|
-
TAX_REVIEWS_POST: new Endpoint('POST', '\\/tax-reviews'),
|
|
6022
|
-
TAX_REVIEWS_PUT: new Endpoint('PUT', '\\/tax-reviews\\/\\d+'),
|
|
6023
|
-
TAX_SUMMARY_ACTUAL_GET: new Endpoint('GET', '\\/tax-summary\\/actuals'),
|
|
6024
|
-
TAX_SUMMARY_FORECAST_GET: new Endpoint('GET', '\\/tax-summary\\/forecasts'),
|
|
6025
|
-
TRANSACTION_DELETE: new Endpoint('DELETE', '\\/transactions\\/\\d+'),
|
|
6026
|
-
TRANSACTION_PUT: new Endpoint('PUT', '\\/transactions\\/\\d+'),
|
|
6027
|
-
TRANSACTIONS_GET: new Endpoint('GET', '\\/transactions'),
|
|
6028
|
-
TRANSACTIONS_POST: new Endpoint('POST', '\\/transactions'),
|
|
6029
|
-
TRANSACTIONS_PUT: new Endpoint('PUT', '\\/transactions'),
|
|
6030
|
-
TRANSACTIONS_ALLOCATIONS_GET: new Endpoint('GET', '\\/transactions-allocations'),
|
|
6031
|
-
TRANSACTIONS_ALLOCATIONS_POST: new Endpoint('POST', '\\/transactions-allocations'),
|
|
6032
|
-
TRANSACTIONS_ALLOCATIONS_DELETE: new Endpoint('DELETE', '\\/transactions-allocations\\/\\d+'),
|
|
6033
|
-
USER_CONFIRMATION_POST: new Endpoint('POST', '\\/users\\/confirmation'),
|
|
6034
|
-
USER_CURRENT_GET: new Endpoint('GET', '\\/users\\/current'),
|
|
6035
|
-
USER_CURRENT_PASSWORD_PUT: new Endpoint('PUT', '\\/users\\/current\\/password\.\*'),
|
|
6036
|
-
USER_EVENT_SETTINGS_GET: new Endpoint('GET', '\\/user-event-settings'),
|
|
6037
|
-
USER_EVENT_TYPES_GET: new Endpoint('GET', '\\/user-event-types'),
|
|
6038
|
-
USER_INVITE_DELETE: new Endpoint('DELETE', '\\/users\\/invite\\/\\d+'),
|
|
6039
|
-
USER_INVITE_POST: new Endpoint('POST', '\\/users\\/invite'),
|
|
6040
|
-
USER_INVITE_RESEND_POST: new Endpoint('POST', '\\/users\\/invite/\\d+\\/resend'),
|
|
6041
|
-
USER_PUT: new Endpoint('PUT', '\\/users\\/\\d+'),
|
|
6042
|
-
USER_REGISTRATION_POST: new Endpoint('POST', '\\/users\\/registration'),
|
|
6043
|
-
USER_RESET_PASSWORD_PUT: new Endpoint('PUT', '\\/users\\/reset-password'),
|
|
6044
|
-
USER_SEARCH_GET: new Endpoint('GET', '\\/users\\/search\.\*'),
|
|
6045
|
-
USER_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/users\\/photo\.\*'),
|
|
6046
|
-
USER_STATUS_PUT: new Endpoint('PUT', '\\/users\\/status'),
|
|
6047
|
-
VEHICLES_GET: new Endpoint('GET', '\\/vehicles'),
|
|
6048
|
-
VEHICLE_CLAIMS_GET: new Endpoint('GET', '\\/vehicle-claims'),
|
|
6049
|
-
VEHICLE_CLAIMS_POST: new Endpoint('POST', '\\/vehicle-claims'),
|
|
6050
|
-
VEHICLE_LOGBOOK_POST: new Endpoint('POST', '\\/vehicles\\/\\d+\\/logbooks'),
|
|
6051
|
-
VEHICLE_LOGBOOK_PUT: new Endpoint('PUT', '\\/vehicles\\/\\d+\\/logbooks\\/\\d+'),
|
|
6052
|
-
VEHICLE_CLAIMS_PUT: new Endpoint('PUT', '\\/vehicle-claims\\/\\d+')
|
|
6595
|
+
'image/jpg',
|
|
6596
|
+
'image/jpeg',
|
|
6597
|
+
'image/tiff',
|
|
6598
|
+
'image/bmp'
|
|
6599
|
+
],
|
|
6600
|
+
all: [
|
|
6601
|
+
'image/png',
|
|
6602
|
+
'image/jpg',
|
|
6603
|
+
'image/jpeg',
|
|
6604
|
+
'image/tiff',
|
|
6605
|
+
'image/bmp',
|
|
6606
|
+
'application/msword',
|
|
6607
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
6608
|
+
'application/pdf',
|
|
6609
|
+
'application/vnd.ms-excel',
|
|
6610
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
6611
|
+
'text/csv'
|
|
6612
|
+
]
|
|
6053
6613
|
};
|
|
6054
6614
|
|
|
6615
|
+
var DocumentFolder$1 = /** @class */ (function () {
|
|
6616
|
+
function DocumentFolder() {
|
|
6617
|
+
}
|
|
6618
|
+
return DocumentFolder;
|
|
6619
|
+
}());
|
|
6620
|
+
|
|
6621
|
+
var DocumentFolder = /** @class */ (function (_super) {
|
|
6622
|
+
__extends(DocumentFolder, _super);
|
|
6623
|
+
function DocumentFolder() {
|
|
6624
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
6625
|
+
}
|
|
6626
|
+
return DocumentFolder;
|
|
6627
|
+
}(DocumentFolder$1));
|
|
6628
|
+
__decorate([
|
|
6629
|
+
classTransformer.Type(function () { return Document; })
|
|
6630
|
+
], DocumentFolder.prototype, "documents", void 0);
|
|
6631
|
+
|
|
6632
|
+
var EmployeeInvite$1 = /** @class */ (function () {
|
|
6633
|
+
function EmployeeInvite() {
|
|
6634
|
+
}
|
|
6635
|
+
return EmployeeInvite;
|
|
6636
|
+
}());
|
|
6637
|
+
|
|
6638
|
+
var EmployeeInvite = /** @class */ (function (_super) {
|
|
6639
|
+
__extends(EmployeeInvite, _super);
|
|
6640
|
+
function EmployeeInvite() {
|
|
6641
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
6642
|
+
}
|
|
6643
|
+
return EmployeeInvite;
|
|
6644
|
+
}(EmployeeInvite$1));
|
|
6645
|
+
__decorate([
|
|
6646
|
+
classTransformer.Type(function () { return RegistrationInvite; })
|
|
6647
|
+
], EmployeeInvite.prototype, "registrationInvite", void 0);
|
|
6648
|
+
__decorate([
|
|
6649
|
+
classTransformer.Type(function () { return User; })
|
|
6650
|
+
], EmployeeInvite.prototype, "employee", void 0);
|
|
6651
|
+
|
|
6055
6652
|
/**
|
|
6056
6653
|
* any event happened in the app, which needs to be handled somehow (distributed to other part of the app)
|
|
6057
6654
|
*/
|
|
@@ -6461,16 +7058,6 @@
|
|
|
6461
7058
|
}),
|
|
6462
7059
|
];
|
|
6463
7060
|
|
|
6464
|
-
/**
|
|
6465
|
-
* https://api-uat.corelogic.asia/property/au/v2/suggest.json
|
|
6466
|
-
* address suggestion from corelogic service
|
|
6467
|
-
*/
|
|
6468
|
-
var CorelogicSuggestion = /** @class */ (function () {
|
|
6469
|
-
function CorelogicSuggestion() {
|
|
6470
|
-
}
|
|
6471
|
-
return CorelogicSuggestion;
|
|
6472
|
-
}());
|
|
6473
|
-
|
|
6474
7061
|
/**
|
|
6475
7062
|
* Enum with properties ownership filter options
|
|
6476
7063
|
*/
|
|
@@ -7230,44 +7817,6 @@
|
|
|
7230
7817
|
}] }];
|
|
7231
7818
|
} });
|
|
7232
7819
|
|
|
7233
|
-
var KEY = '_switch_user';
|
|
7234
|
-
/**
|
|
7235
|
-
* provides user management to managers (users with ROLE_ACCOUNTANT for now, more in future)
|
|
7236
|
-
*/
|
|
7237
|
-
var UserSwitcherService = /** @class */ (function () {
|
|
7238
|
-
function UserSwitcherService() {
|
|
7239
|
-
}
|
|
7240
|
-
/**
|
|
7241
|
-
* get switched username
|
|
7242
|
-
*/
|
|
7243
|
-
UserSwitcherService.prototype.get = function () {
|
|
7244
|
-
return localStorage[KEY];
|
|
7245
|
-
};
|
|
7246
|
-
/**
|
|
7247
|
-
* switch to user (username should be used for correct work of backend)
|
|
7248
|
-
*/
|
|
7249
|
-
UserSwitcherService.prototype.set = function (username) {
|
|
7250
|
-
localStorage[KEY] = username;
|
|
7251
|
-
window.location.replace('/client/dashboard');
|
|
7252
|
-
};
|
|
7253
|
-
/**
|
|
7254
|
-
* go back to original user
|
|
7255
|
-
*/
|
|
7256
|
-
UserSwitcherService.prototype.reset = function () {
|
|
7257
|
-
localStorage.removeItem(KEY);
|
|
7258
|
-
window.location.replace('/firm/dashboard');
|
|
7259
|
-
};
|
|
7260
|
-
return UserSwitcherService;
|
|
7261
|
-
}());
|
|
7262
|
-
UserSwitcherService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
7263
|
-
UserSwitcherService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, providedIn: 'root' });
|
|
7264
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, decorators: [{
|
|
7265
|
-
type: i0.Injectable,
|
|
7266
|
-
args: [{
|
|
7267
|
-
providedIn: 'root'
|
|
7268
|
-
}]
|
|
7269
|
-
}] });
|
|
7270
|
-
|
|
7271
7820
|
/**
|
|
7272
7821
|
* Service to work with assets (documents, receipts, e.t.c.)
|
|
7273
7822
|
*/
|
|
@@ -7318,90 +7867,6 @@
|
|
|
7318
7867
|
}] }];
|
|
7319
7868
|
} });
|
|
7320
7869
|
|
|
7321
|
-
var NAME_TOKEN = 'token';
|
|
7322
|
-
var NAME_REFRESH_TOKEN = 'refreshToken';
|
|
7323
|
-
var JwtService = /** @class */ (function (_super) {
|
|
7324
|
-
__extends(JwtService, _super);
|
|
7325
|
-
function JwtService() {
|
|
7326
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
7327
|
-
}
|
|
7328
|
-
JwtService.prototype.getToken = function () {
|
|
7329
|
-
return localStorage[NAME_TOKEN];
|
|
7330
|
-
};
|
|
7331
|
-
JwtService.prototype.getRefreshToken = function () {
|
|
7332
|
-
return localStorage[NAME_REFRESH_TOKEN];
|
|
7333
|
-
};
|
|
7334
|
-
JwtService.prototype.saveTokens = function (tokens) {
|
|
7335
|
-
localStorage[NAME_TOKEN] = tokens.token;
|
|
7336
|
-
localStorage[NAME_REFRESH_TOKEN] = tokens.refreshToken;
|
|
7337
|
-
};
|
|
7338
|
-
JwtService.prototype.destroyTokens = function () {
|
|
7339
|
-
localStorage.removeItem(NAME_TOKEN);
|
|
7340
|
-
localStorage.removeItem(NAME_REFRESH_TOKEN);
|
|
7341
|
-
};
|
|
7342
|
-
JwtService.prototype.getUser = function () {
|
|
7343
|
-
return this.decodeToken();
|
|
7344
|
-
};
|
|
7345
|
-
JwtService.prototype.isMe = function (userId) {
|
|
7346
|
-
return this.getUser().id === userId;
|
|
7347
|
-
};
|
|
7348
|
-
return JwtService;
|
|
7349
|
-
}(angularJwt.JwtHelperService));
|
|
7350
|
-
JwtService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
7351
|
-
JwtService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtService, providedIn: 'root' });
|
|
7352
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtService, decorators: [{
|
|
7353
|
-
type: i0.Injectable,
|
|
7354
|
-
args: [{
|
|
7355
|
-
providedIn: 'root'
|
|
7356
|
-
}]
|
|
7357
|
-
}] });
|
|
7358
|
-
|
|
7359
|
-
var AuthService = /** @class */ (function () {
|
|
7360
|
-
function AuthService(http, jwtService, environment) {
|
|
7361
|
-
this.http = http;
|
|
7362
|
-
this.jwtService = jwtService;
|
|
7363
|
-
this.environment = environment;
|
|
7364
|
-
this.isLoggedInSubject = new rxjs.BehaviorSubject(!this.jwtService.isTokenExpired());
|
|
7365
|
-
}
|
|
7366
|
-
AuthService.prototype.setAuth = function (response) {
|
|
7367
|
-
this.jwtService.saveTokens(response);
|
|
7368
|
-
this.isLoggedInSubject.next(true);
|
|
7369
|
-
};
|
|
7370
|
-
AuthService.prototype.login = function (username, password) {
|
|
7371
|
-
var _this = this;
|
|
7372
|
-
return this.http.post(this.environment.apiV2 + "/login_check", { username: username, password: password }).pipe(operators.map(function (response) {
|
|
7373
|
-
_this.setAuth(response);
|
|
7374
|
-
return response;
|
|
7375
|
-
}));
|
|
7376
|
-
};
|
|
7377
|
-
AuthService.prototype.refresh = function (refreshToken) {
|
|
7378
|
-
var _this = this;
|
|
7379
|
-
return this.http.post(this.environment.apiV2 + "/token/refresh", { refreshToken: refreshToken }).pipe(operators.map(function (response) {
|
|
7380
|
-
_this.setAuth(response);
|
|
7381
|
-
return response;
|
|
7382
|
-
}));
|
|
7383
|
-
};
|
|
7384
|
-
AuthService.prototype.logoutFront = function (url) {
|
|
7385
|
-
if (url === void 0) { url = '/login'; }
|
|
7386
|
-
localStorage.clear();
|
|
7387
|
-
location.replace(url);
|
|
7388
|
-
};
|
|
7389
|
-
return AuthService;
|
|
7390
|
-
}());
|
|
7391
|
-
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.HttpClient }, { token: JwtService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
7392
|
-
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: AuthService, providedIn: 'root' });
|
|
7393
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
7394
|
-
type: i0.Injectable,
|
|
7395
|
-
args: [{
|
|
7396
|
-
providedIn: 'root'
|
|
7397
|
-
}]
|
|
7398
|
-
}], ctorParameters: function () {
|
|
7399
|
-
return [{ type: i1__namespace.HttpClient }, { type: JwtService }, { type: undefined, decorators: [{
|
|
7400
|
-
type: i0.Inject,
|
|
7401
|
-
args: ['environment']
|
|
7402
|
-
}] }];
|
|
7403
|
-
} });
|
|
7404
|
-
|
|
7405
7870
|
// replace array element with the new one (only arrays of objects)
|
|
7406
7871
|
function replace(array, item, matchField) {
|
|
7407
7872
|
if (matchField === void 0) { matchField = 'id'; }
|
|
@@ -7774,6 +8239,12 @@
|
|
|
7774
8239
|
return updatedBankAccount;
|
|
7775
8240
|
}));
|
|
7776
8241
|
};
|
|
8242
|
+
BankAccountService.prototype.getOwn = function () {
|
|
8243
|
+
return this.get()
|
|
8244
|
+
.pipe(operators.map(function (bankAccounts) {
|
|
8245
|
+
return bankAccounts.filter(function (bankAccount) { return bankAccount.isOwner(+localStorage.getItem('userId')); });
|
|
8246
|
+
}));
|
|
8247
|
+
};
|
|
7777
8248
|
/**
|
|
7778
8249
|
* Listen to EventDispatcherService events
|
|
7779
8250
|
*/
|
|
@@ -7914,8 +8385,12 @@
|
|
|
7914
8385
|
_this.environment = environment;
|
|
7915
8386
|
_this.modelClass = BankConnection;
|
|
7916
8387
|
_this.url = 'bank-connections';
|
|
8388
|
+
_this.listenEvents();
|
|
7917
8389
|
return _this;
|
|
7918
8390
|
}
|
|
8391
|
+
BankConnectionService.prototype.listenEvents = function () {
|
|
8392
|
+
this.listenToAddedBankAccounts();
|
|
8393
|
+
};
|
|
7919
8394
|
BankConnectionService.prototype.post = function (bankConnection) {
|
|
7920
8395
|
var _this = this;
|
|
7921
8396
|
return this.http.post(this.environment.apiV2 + "/" + this.url, bankConnection)
|
|
@@ -7924,6 +8399,12 @@
|
|
|
7924
8399
|
return classTransformer.plainToClass(BankConnection, bankConnectionBase);
|
|
7925
8400
|
}));
|
|
7926
8401
|
};
|
|
8402
|
+
BankConnectionService.prototype.listenToAddedBankAccounts = function () {
|
|
8403
|
+
var _this = this;
|
|
8404
|
+
this.eventDispatcherService.on(exports.AppEventTypeEnum.BANK_ACCOUNT_CREATED).subscribe(function () {
|
|
8405
|
+
_this.resetCache();
|
|
8406
|
+
});
|
|
8407
|
+
};
|
|
7927
8408
|
return BankConnectionService;
|
|
7928
8409
|
}(BaseRestService));
|
|
7929
8410
|
BankConnectionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: BankConnectionService, deps: [{ token: i1__namespace.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
@@ -9900,68 +10381,36 @@
|
|
|
9900
10381
|
}]
|
|
9901
10382
|
}] });
|
|
9902
10383
|
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
return this.activePreloaders.asObservable();
|
|
9909
|
-
};
|
|
9910
|
-
PreloaderService.prototype.add = function (endpoint) {
|
|
9911
|
-
var activePreloaders = this.activePreloaders.getValue();
|
|
9912
|
-
activePreloaders.push(endpoint);
|
|
9913
|
-
this.activePreloaders.next(activePreloaders);
|
|
9914
|
-
};
|
|
9915
|
-
PreloaderService.prototype.delete = function (endpoint) {
|
|
9916
|
-
var activePreloaders = this.activePreloaders.getValue();
|
|
9917
|
-
activePreloaders = activePreloaders.filter(function (preloader) { return preloader !== endpoint; });
|
|
9918
|
-
this.activePreloaders.next(activePreloaders);
|
|
9919
|
-
};
|
|
9920
|
-
return PreloaderService;
|
|
9921
|
-
}());
|
|
9922
|
-
PreloaderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
9923
|
-
PreloaderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, providedIn: 'root' });
|
|
9924
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, decorators: [{
|
|
9925
|
-
type: i0.Injectable,
|
|
9926
|
-
args: [{
|
|
9927
|
-
providedIn: 'root'
|
|
9928
|
-
}]
|
|
9929
|
-
}], ctorParameters: function () { return []; } });
|
|
9930
|
-
|
|
9931
|
-
var CorelogicService = /** @class */ (function () {
|
|
9932
|
-
function CorelogicService(http, environment) {
|
|
10384
|
+
/**
|
|
10385
|
+
* Service for get property equity position half-year history chart data
|
|
10386
|
+
*/
|
|
10387
|
+
var EquityPositionChartService = /** @class */ (function () {
|
|
10388
|
+
function EquityPositionChartService(http, environment) {
|
|
9933
10389
|
this.http = http;
|
|
9934
10390
|
this.environment = environment;
|
|
9935
|
-
this.accessTokenSubject = new rxjs.ReplaySubject(1);
|
|
9936
10391
|
}
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
if (!this._accessToken || force) {
|
|
9941
|
-
this.http.get(this.environment.coreLogicUrl + "/access/oauth/token?grant_type=client_credentials&client_id=" + this.environment.coreLogicId + "&client_secret=" + this.environment.coreLogicSecret)
|
|
9942
|
-
.pipe(operators.map(function (response) {
|
|
9943
|
-
return response.access_token;
|
|
9944
|
-
}))
|
|
9945
|
-
.subscribe(function (token) {
|
|
9946
|
-
_this._accessToken = token;
|
|
9947
|
-
_this.accessTokenSubject.next(_this._accessToken);
|
|
9948
|
-
});
|
|
9949
|
-
}
|
|
9950
|
-
return this.accessTokenSubject.asObservable();
|
|
9951
|
-
};
|
|
9952
|
-
CorelogicService.prototype.getSuggestions = function (query, country) {
|
|
9953
|
-
if (country === void 0) { country = 'au'; }
|
|
9954
|
-
// @TODO handle different countries in future
|
|
9955
|
-
return this.http.get(this.environment.coreLogicUrl + "/property/" + country + "/v2/suggest.json?q=" + query)
|
|
10392
|
+
EquityPositionChartService.prototype.get = function () {
|
|
10393
|
+
// @TODO refactor backend
|
|
10394
|
+
return this.http.get(this.environment.apiV2 + "/properties/categories/equity")
|
|
9956
10395
|
.pipe(operators.map(function (response) {
|
|
9957
|
-
return response.
|
|
10396
|
+
return response.map(function (item) {
|
|
10397
|
+
return classTransformer.plainToClass(ChartData, {
|
|
10398
|
+
name: item.category.name,
|
|
10399
|
+
data: item.equity.map(function (serie) {
|
|
10400
|
+
return classTransformer.plainToClass(ChartSerie, {
|
|
10401
|
+
label: serie.date,
|
|
10402
|
+
value: serie.amount
|
|
10403
|
+
});
|
|
10404
|
+
})
|
|
10405
|
+
});
|
|
10406
|
+
});
|
|
9958
10407
|
}));
|
|
9959
10408
|
};
|
|
9960
|
-
return
|
|
10409
|
+
return EquityPositionChartService;
|
|
9961
10410
|
}());
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type:
|
|
10411
|
+
EquityPositionChartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: EquityPositionChartService, deps: [{ token: i1__namespace.HttpClient }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
10412
|
+
EquityPositionChartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: EquityPositionChartService, providedIn: 'root' });
|
|
10413
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: EquityPositionChartService, decorators: [{
|
|
9965
10414
|
type: i0.Injectable,
|
|
9966
10415
|
args: [{
|
|
9967
10416
|
providedIn: 'root'
|
|
@@ -11983,6 +12432,7 @@
|
|
|
11983
12432
|
exports.EmployeeInviteService = EmployeeInviteService;
|
|
11984
12433
|
exports.EmployeeService = EmployeeService;
|
|
11985
12434
|
exports.Endpoint = Endpoint;
|
|
12435
|
+
exports.EquityPositionChartService = EquityPositionChartService;
|
|
11986
12436
|
exports.EventDispatcherService = EventDispatcherService;
|
|
11987
12437
|
exports.FinancialYear = FinancialYear;
|
|
11988
12438
|
exports.Firm = Firm;
|
|
@@ -11996,6 +12446,7 @@
|
|
|
11996
12446
|
exports.IncomeSourceForecastService = IncomeSourceForecastService;
|
|
11997
12447
|
exports.IncomeSourceService = IncomeSourceService;
|
|
11998
12448
|
exports.IncomeSourceType = IncomeSourceType;
|
|
12449
|
+
exports.InterceptorsModule = InterceptorsModule;
|
|
11999
12450
|
exports.IntercomService = IntercomService;
|
|
12000
12451
|
exports.JwtService = JwtService;
|
|
12001
12452
|
exports.Loan = Loan;
|