taxtank-core 0.2.4 → 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 +882 -452
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/property.collection.js +8 -1
- 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/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 +834 -427
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/property.collection.d.ts +5 -0
- 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/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
|
|
|
@@ -5645,6 +6378,36 @@
|
|
|
5645
6378
|
return ClientPortfolioReport;
|
|
5646
6379
|
}());
|
|
5647
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
|
+
|
|
5648
6411
|
/**
|
|
5649
6412
|
* Class to generate data-table structure based on provided collection.
|
|
5650
6413
|
* Use to work with HTML/PDF/XLSX tables
|
|
@@ -5820,243 +6583,72 @@
|
|
|
5820
6583
|
/**
|
|
5821
6584
|
* Get API url prefix
|
|
5822
6585
|
*/
|
|
5823
|
-
Document.prototype.getApiUrlPrefix = function () {
|
|
5824
|
-
return exports.DocumentApiUrlPrefixEnum.FOLDERS;
|
|
5825
|
-
};
|
|
5826
|
-
return Document;
|
|
5827
|
-
}(Document$1));
|
|
5828
|
-
|
|
5829
|
-
var DOCUMENT_FILE_TYPES = {
|
|
5830
|
-
image: [
|
|
5831
|
-
'image/png',
|
|
5832
|
-
'image/jpg',
|
|
5833
|
-
'image/jpeg',
|
|
5834
|
-
'image/tiff',
|
|
5835
|
-
'image/bmp'
|
|
5836
|
-
],
|
|
5837
|
-
all: [
|
|
5838
|
-
'image/png',
|
|
5839
|
-
'image/jpg',
|
|
5840
|
-
'image/jpeg',
|
|
5841
|
-
'image/tiff',
|
|
5842
|
-
'image/bmp',
|
|
5843
|
-
'application/msword',
|
|
5844
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
5845
|
-
'application/pdf',
|
|
5846
|
-
'application/vnd.ms-excel',
|
|
5847
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
5848
|
-
'text/csv'
|
|
5849
|
-
]
|
|
5850
|
-
};
|
|
5851
|
-
|
|
5852
|
-
var DocumentFolder$1 = /** @class */ (function () {
|
|
5853
|
-
function DocumentFolder() {
|
|
5854
|
-
}
|
|
5855
|
-
return DocumentFolder;
|
|
5856
|
-
}());
|
|
5857
|
-
|
|
5858
|
-
var DocumentFolder = /** @class */ (function (_super) {
|
|
5859
|
-
__extends(DocumentFolder, _super);
|
|
5860
|
-
function DocumentFolder() {
|
|
5861
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
5862
|
-
}
|
|
5863
|
-
return DocumentFolder;
|
|
5864
|
-
}(DocumentFolder$1));
|
|
5865
|
-
__decorate([
|
|
5866
|
-
classTransformer.Type(function () { return Document; })
|
|
5867
|
-
], DocumentFolder.prototype, "documents", void 0);
|
|
5868
|
-
|
|
5869
|
-
var EmployeeInvite$1 = /** @class */ (function () {
|
|
5870
|
-
function EmployeeInvite() {
|
|
5871
|
-
}
|
|
5872
|
-
return EmployeeInvite;
|
|
5873
|
-
}());
|
|
5874
|
-
|
|
5875
|
-
var EmployeeInvite = /** @class */ (function (_super) {
|
|
5876
|
-
__extends(EmployeeInvite, _super);
|
|
5877
|
-
function EmployeeInvite() {
|
|
5878
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
5879
|
-
}
|
|
5880
|
-
return EmployeeInvite;
|
|
5881
|
-
}(EmployeeInvite$1));
|
|
5882
|
-
__decorate([
|
|
5883
|
-
classTransformer.Type(function () { return RegistrationInvite; })
|
|
5884
|
-
], EmployeeInvite.prototype, "registrationInvite", void 0);
|
|
5885
|
-
__decorate([
|
|
5886
|
-
classTransformer.Type(function () { return User; })
|
|
5887
|
-
], EmployeeInvite.prototype, "employee", void 0);
|
|
5888
|
-
|
|
5889
|
-
/**
|
|
5890
|
-
* Backend endpoint class
|
|
5891
|
-
*/
|
|
5892
|
-
var Endpoint = /** @class */ (function () {
|
|
5893
|
-
function Endpoint(method, pattern) {
|
|
5894
|
-
this.method = method;
|
|
5895
|
-
this.pattern = pattern;
|
|
5896
|
-
}
|
|
5897
|
-
/**
|
|
5898
|
-
* check url with regexp
|
|
5899
|
-
* @param url
|
|
5900
|
-
*/
|
|
5901
|
-
Endpoint.prototype.test = function (url) {
|
|
5902
|
-
return this.regexp.test(url);
|
|
5903
|
-
};
|
|
5904
|
-
Object.defineProperty(Endpoint.prototype, "regexp", {
|
|
5905
|
-
/**
|
|
5906
|
-
* Get regexp for endpoint
|
|
5907
|
-
*/
|
|
5908
|
-
get: function () {
|
|
5909
|
-
return new RegExp("^" + this.method + " .*" + this.pattern + "$");
|
|
5910
|
-
},
|
|
5911
|
-
enumerable: false,
|
|
5912
|
-
configurable: true
|
|
5913
|
-
});
|
|
5914
|
-
return Endpoint;
|
|
5915
|
-
}());
|
|
5916
|
-
|
|
5917
|
-
/**
|
|
5918
|
-
* List of all app endpoints
|
|
5919
|
-
*/
|
|
5920
|
-
var ENDPOINTS = {
|
|
5921
|
-
ASSETS_GET: new Endpoint('GET', '\\/assets\\/\.\*\\/\\d+'),
|
|
5922
|
-
BANK_ACCOUNTS_GET: new Endpoint('GET', '\\/bank-accounts'),
|
|
5923
|
-
BANK_ACCOUNTS_POST: new Endpoint('POST', '\\/bank-accounts'),
|
|
5924
|
-
BANK_ACCOUNTS_PUT: new Endpoint('PUT', '\\/bank-accounts\\/\\d+'),
|
|
5925
|
-
BANK_CONNECTION_POST: new Endpoint('POST', '\\/bank-connections'),
|
|
5926
|
-
BANK_TRANSACTIONS_GET: new Endpoint('GET', '\\/bank-transactions'),
|
|
5927
|
-
BANK_TRANSACTIONS_DELETE: new Endpoint('DELETE', '\\/bank-transactions\\/\\d+'),
|
|
5928
|
-
BANK_TRANSACTIONS_IMPORT_POST: new Endpoint('POST', '\\/bank-transactions\\/\\d+\\/import'),
|
|
5929
|
-
BASIQ_ACCOUNTS_GET: new Endpoint('GET', '\\/basiq\\/\\accounts'),
|
|
5930
|
-
CAPITAL_COSTS_GET: new Endpoint('GET', '\\/capital-costs'),
|
|
5931
|
-
CHARTS_INCOME_GET: new Endpoint('GET', '\\/charts\\/\\incomes'),
|
|
5932
|
-
CHARTS_EXPENSES_GET: new Endpoint('GET', '\\/charts\\/\\expenses'),
|
|
5933
|
-
CHART_ACCOUNTS_GET: new Endpoint('GET', '\\/chart-accounts'),
|
|
5934
|
-
CLIENTS_GET: new Endpoint('GET', '\\/clients'),
|
|
5935
|
-
CLIENTS_PUT: new Endpoint('PUT', '\\/clients'),
|
|
5936
|
-
CLIENTS_EXCLUDE_PUT: new Endpoint('PUT', '\\/clients\\/\\d+\\/exclude'),
|
|
5937
|
-
CLIENTS_INVITES_GET: new Endpoint('GET', '\\/clients\\/\\invites'),
|
|
5938
|
-
CLIENTS_INVITES_POST: new Endpoint('POST', '\\/clients\\/\\invites'),
|
|
5939
|
-
CLIENTS_INVITES_DELETE: new Endpoint('DELETE', '\\/clients\\/\\invites\\/\\d+'),
|
|
5940
|
-
CLIENTS_INVITES_ACCEPT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/accept'),
|
|
5941
|
-
CLIENTS_INVITES_REJECT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/reject'),
|
|
5942
|
-
CLIENTS_INVITES_RESEND_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/resend'),
|
|
5943
|
-
CLIENT_MOVEMENTS_GET: new Endpoint('GET', '\\/client-movements'),
|
|
5944
|
-
CLIENT_MOVEMENTS_POST: new Endpoint('POST', '\\/client-movements'),
|
|
5945
|
-
COUNTRIES_GET: new Endpoint('GET', '\\/countries'),
|
|
5946
|
-
DEPRECIATIONS_CLOSING_GET: new Endpoint('GET', '\\/depreciations\\/\\closing-balance\.\*'),
|
|
5947
|
-
DEPRECIATIONS_GET: new Endpoint('GET', '\\/depreciations'),
|
|
5948
|
-
DEPRECIATIONS_POST: new Endpoint('POST', '\\/depreciations'),
|
|
5949
|
-
DEPRECIATIONS_PUT: new Endpoint('PUT', '\\/depreciations\\/\\d+'),
|
|
5950
|
-
EMPLOYEES_GET: new Endpoint('GET', '\\/employees'),
|
|
5951
|
-
EMPLOYEES_INVITES_GET: new Endpoint('GET', '\\/employees\\/\\invites'),
|
|
5952
|
-
EMPLOYEES_INVITES_DELETE: new Endpoint('DELETE', '\\/employees\\/\\invites\\/\\d+'),
|
|
5953
|
-
EMPLOYEES_INVITE_POST: new Endpoint('POST', '\\/employees\\/\\invites'),
|
|
5954
|
-
EMPLOYEES_INVITES_REJECT_POST: new Endpoint('POST', '\\/employees\\/\\invites\\/\\d+\\/\\reject'),
|
|
5955
|
-
EMPLOYEES_INVITES_RESEND_POST: new Endpoint('POST', '\\/employees\\/\\invites\\/\\d+\\/\\resend'),
|
|
5956
|
-
FIRM_GET: new Endpoint('GET', '\\/firms'),
|
|
5957
|
-
FIRM_CURRENT_GET: new Endpoint('GET', '\\/firms\\/current'),
|
|
5958
|
-
FIRM_CURRENT_PUT: new Endpoint('PUT', '\\/firms\\/current\.\*'),
|
|
5959
|
-
FIRM_INVITE_POST: new Endpoint('POST', '\\/firms\\/invite'),
|
|
5960
|
-
FIRM_REGISTRATION_POST: new Endpoint('POST', '\\/firms\\/registration'),
|
|
5961
|
-
FIRM_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/firms\\/photo\.\*'),
|
|
5962
|
-
FOLDERS_GET: new Endpoint('GET', '\\/folders'),
|
|
5963
|
-
FOLDERS_POST: new Endpoint('POST', '\\/folders'),
|
|
5964
|
-
FOLDERS_PUT: new Endpoint('PUT', '\\/folders\\/\\d+'),
|
|
5965
|
-
FOLDERS_DOCUMENTS_POST: new Endpoint('POST', '\\/folders\\/\\d+\\/documents'),
|
|
5966
|
-
FOLDERS_DOCUMENTS_PUT: new Endpoint('PUT', '\\/folders\\/\\d+\\/documents\\/\\d+'),
|
|
5967
|
-
INCOME_SOURCES_GET: new Endpoint('GET', '\\/income-sources'),
|
|
5968
|
-
INCOME_SOURCES_POST: new Endpoint('POST', '\\/income-sources'),
|
|
5969
|
-
INCOME_SOURCES_PUT: new Endpoint('PUT', '\\/income-sources'),
|
|
5970
|
-
INCOME_SOURCES_DELETE: new Endpoint('DELETE', '\\/income-sources\\/\\d+'),
|
|
5971
|
-
INCOME_SOURCE_FORECAST_GET: new Endpoint('GET', '\\/income-source-forecasts'),
|
|
5972
|
-
INCOME_SOURCE_FORECAST_POST: new Endpoint('POST', '\\/income-source-forecasts'),
|
|
5973
|
-
INCOME_SOURCE_FORECAST_PUT: new Endpoint('PUT', '\\/income-source-forecasts'),
|
|
5974
|
-
INCOME_SOURCE_FORECAST_DELETE: new Endpoint('DELETE', '\\/income-source-forecasts\\/\\d+'),
|
|
5975
|
-
INCOME_SOURCE_TYPES_GET: new Endpoint('GET', '\\/income-source-types'),
|
|
5976
|
-
LOANS_GET: new Endpoint('GET', '\\/bank-accounts\\/loans'),
|
|
5977
|
-
LOANS_POST: new Endpoint('POST', '\\/bank-accounts\\/loans'),
|
|
5978
|
-
LOANS_PUT: new Endpoint('PUT', '\\/bank-accounts\\/loans/\\d+'),
|
|
5979
|
-
LOANS_PAYOUT_POST: new Endpoint('POST', '\\/loans\\/\\d+\\/payout'),
|
|
5980
|
-
LOANS_PAYOUT_PUT: new Endpoint('PUT', '\\/loans\\/\\d+\\/payout\\/\\d+'),
|
|
5981
|
-
LOANS_PAYOUT_DELETE: new Endpoint('DELETE', '\\/loans\\/\\d+\\/payout\\/\\d+'),
|
|
5982
|
-
LOANS_CALCULATION_POST: new Endpoint('POST', '\\/bank-accounts\\/loans\\/calculation'),
|
|
5983
|
-
LOGIN_CHECK_POST: new Endpoint('POST', '\\/login_check'),
|
|
5984
|
-
NOTIFICATIONS_GET: new Endpoint('GET', '\\/service-notifications'),
|
|
5985
|
-
OCCUPATIONS_GET: new Endpoint('GET', '\\/occupations'),
|
|
5986
|
-
PROPERTIES_GET: new Endpoint('GET', '\\/properties'),
|
|
5987
|
-
PROPERTIES_POST: new Endpoint('POST', '\\/properties'),
|
|
5988
|
-
PROPERTY_PUT: new Endpoint('PUT', '\\/properties/\\d+'),
|
|
5989
|
-
PROPERTIES_PUT: new Endpoint('PUT', '\\/properties'),
|
|
5990
|
-
PROPERTIES_CATEGORIES_EQUITY_GET: new Endpoint('GET', '\\/properties\\/categories\\/equity'),
|
|
5991
|
-
PROPERTIES_CATEGORIES_GET: new Endpoint('GET', '\\/properties\\/categories'),
|
|
5992
|
-
PROPERTIES_CATEGORIES_PUT: new Endpoint('PUT', '\\/properties\\/categories\\/\\d+'),
|
|
5993
|
-
PROPERTIES_CATEGORIES_POST: new Endpoint('POST', '\\/properties\\/categories'),
|
|
5994
|
-
PROPERTIES_CATEGORY_MOVEMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/category-movements'),
|
|
5995
|
-
PROPERTIES_CATEGORY_MOVEMENTS_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/category-movements\\/\\d+'),
|
|
5996
|
-
PROPERTIES_CO_OWNERS_PUT: new Endpoint('PUT', '\\/properties\\/co-owners\\/\\d+'),
|
|
5997
|
-
PROPERTIES_CO_OWNERS_GET: new Endpoint('GET', '\\/properties\\/co-owners'),
|
|
5998
|
-
PROPERTIES_CO_OWNERS_POST: new Endpoint('POST', '\\/properties\\/co-owners'),
|
|
5999
|
-
PROPERTIES_DEACTIVATE_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/deactivate'),
|
|
6000
|
-
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_GET: new Endpoint('GET', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
|
|
6001
|
-
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
|
|
6002
|
-
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/depreciation-capital-projects\\/\\d+'),
|
|
6003
|
-
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_DELETE: new Endpoint('DELETE', '\\/properties\\/\\d+\\/depreciation-capital-projects\\/\\d+'),
|
|
6004
|
-
PROPERTIES_DOCUMENTS_GET: new Endpoint('GET', '\\/properties\\/documents'),
|
|
6005
|
-
PROPERTIES_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/documents'),
|
|
6006
|
-
PROPERTIES_DOCUMENTS_PUT: new Endpoint('PUT', '\\/properties\\/documents\\/\\d+'),
|
|
6007
|
-
PROPERTIES_DOCUMENTS_DELETE: new Endpoint('DELETE', '\\/properties\\/documents\\/\\d+'),
|
|
6008
|
-
PROPERTIES_PHOTO_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/photo\.\*'),
|
|
6009
|
-
PROPERTIES_SUGGESTIONS_GET: new Endpoint('GET', '/property\\/\\w+\\/v2\\/.*$'),
|
|
6010
|
-
PROPERTIES_VALUATIONS_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/valuations\\/\\d+\\/documents'),
|
|
6011
|
-
PRORATION_COST_POST: new Endpoint('POST', '\\/subscriptions\\/proration-cost'),
|
|
6012
|
-
SALARY_FORECAST_GET: new Endpoint('GET', '\\/salary-forecasts'),
|
|
6013
|
-
SALARY_FORECAST_POST: new Endpoint('POST', '\\/salary-forecasts'),
|
|
6014
|
-
SALARY_FORECAST_PUT: new Endpoint('PUT', '\\/salary-forecasts'),
|
|
6015
|
-
SERVICE_PRICES_GET: new Endpoint('GET', '\\/service-prices'),
|
|
6016
|
-
SERVICE_PAYMENTS_GET: new Endpoint('GET', '\\/service-payments'),
|
|
6017
|
-
STRIPE_BILLING_PORTAL_GET: new Endpoint('GET', '\\/stripe\\/billing-portal-session'),
|
|
6018
|
-
STRIPE_CHECKOUT_SESSION_POST: new Endpoint('POST', '\\/stripe\\/checkout-session'),
|
|
6019
|
-
SUBSCRIPTION_LAST_GET: new Endpoint('GET', '\\/subscriptions\\/last'),
|
|
6020
|
-
SUBSCRIPTION_ITEMS_PUT: new Endpoint('PUT', '\\/subscriptions\\/items'),
|
|
6021
|
-
TAX_CALCULATION_POST: new Endpoint('POST', '\\/tax-calculation'),
|
|
6022
|
-
TAX_REVIEWS_GET: new Endpoint('GET', '\\/tax-reviews'),
|
|
6023
|
-
TAX_REVIEWS_DELETE: new Endpoint('DELETE', '\\/tax-reviews\\/\\d+'),
|
|
6024
|
-
TAX_REVIEWS_POST: new Endpoint('POST', '\\/tax-reviews'),
|
|
6025
|
-
TAX_REVIEWS_PUT: new Endpoint('PUT', '\\/tax-reviews\\/\\d+'),
|
|
6026
|
-
TAX_SUMMARY_ACTUAL_GET: new Endpoint('GET', '\\/tax-summary\\/actuals'),
|
|
6027
|
-
TAX_SUMMARY_FORECAST_GET: new Endpoint('GET', '\\/tax-summary\\/forecasts'),
|
|
6028
|
-
TRANSACTION_DELETE: new Endpoint('DELETE', '\\/transactions\\/\\d+'),
|
|
6029
|
-
TRANSACTION_PUT: new Endpoint('PUT', '\\/transactions\\/\\d+'),
|
|
6030
|
-
TRANSACTIONS_GET: new Endpoint('GET', '\\/transactions'),
|
|
6031
|
-
TRANSACTIONS_POST: new Endpoint('POST', '\\/transactions'),
|
|
6032
|
-
TRANSACTIONS_PUT: new Endpoint('PUT', '\\/transactions'),
|
|
6033
|
-
TRANSACTIONS_ALLOCATIONS_GET: new Endpoint('GET', '\\/transactions-allocations'),
|
|
6034
|
-
TRANSACTIONS_ALLOCATIONS_POST: new Endpoint('POST', '\\/transactions-allocations'),
|
|
6035
|
-
TRANSACTIONS_ALLOCATIONS_DELETE: new Endpoint('DELETE', '\\/transactions-allocations\\/\\d+'),
|
|
6036
|
-
USER_CONFIRMATION_POST: new Endpoint('POST', '\\/users\\/confirmation'),
|
|
6037
|
-
USER_CURRENT_GET: new Endpoint('GET', '\\/users\\/current'),
|
|
6038
|
-
USER_CURRENT_PASSWORD_PUT: new Endpoint('PUT', '\\/users\\/current\\/password\.\*'),
|
|
6039
|
-
USER_EVENT_SETTINGS_GET: new Endpoint('GET', '\\/user-event-settings'),
|
|
6040
|
-
USER_EVENT_TYPES_GET: new Endpoint('GET', '\\/user-event-types'),
|
|
6041
|
-
USER_INVITE_DELETE: new Endpoint('DELETE', '\\/users\\/invite\\/\\d+'),
|
|
6042
|
-
USER_INVITE_POST: new Endpoint('POST', '\\/users\\/invite'),
|
|
6043
|
-
USER_INVITE_RESEND_POST: new Endpoint('POST', '\\/users\\/invite/\\d+\\/resend'),
|
|
6044
|
-
USER_PUT: new Endpoint('PUT', '\\/users\\/\\d+'),
|
|
6045
|
-
USER_REGISTRATION_POST: new Endpoint('POST', '\\/users\\/registration'),
|
|
6046
|
-
USER_RESET_PASSWORD_PUT: new Endpoint('PUT', '\\/users\\/reset-password'),
|
|
6047
|
-
USER_SEARCH_GET: new Endpoint('GET', '\\/users\\/search\.\*'),
|
|
6048
|
-
USER_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/users\\/photo\.\*'),
|
|
6049
|
-
USER_STATUS_PUT: new Endpoint('PUT', '\\/users\\/status'),
|
|
6050
|
-
VEHICLES_GET: new Endpoint('GET', '\\/vehicles'),
|
|
6051
|
-
VEHICLES_POST: new Endpoint('POST', '\\/vehicles'),
|
|
6052
|
-
VEHICLES_PUT: new Endpoint('PUT', '\\/vehicles\\/\\d+'),
|
|
6053
|
-
VEHICLE_CLAIMS_GET: new Endpoint('GET', '\\/vehicle-claims'),
|
|
6054
|
-
VEHICLE_CLAIMS_POST: new Endpoint('POST', '\\/vehicle-claims'),
|
|
6055
|
-
VEHICLE_LOGBOOK_POST: new Endpoint('POST', '\\/vehicles\\/\\d+\\/logbooks'),
|
|
6056
|
-
VEHICLE_LOGBOOK_PUT: new Endpoint('PUT', '\\/vehicles\\/\\d+\\/logbooks\\/\\d+'),
|
|
6057
|
-
VEHICLE_CLAIMS_PUT: new Endpoint('PUT', '\\/vehicle-claims\\/\\d+')
|
|
6586
|
+
Document.prototype.getApiUrlPrefix = function () {
|
|
6587
|
+
return exports.DocumentApiUrlPrefixEnum.FOLDERS;
|
|
6588
|
+
};
|
|
6589
|
+
return Document;
|
|
6590
|
+
}(Document$1));
|
|
6591
|
+
|
|
6592
|
+
var DOCUMENT_FILE_TYPES = {
|
|
6593
|
+
image: [
|
|
6594
|
+
'image/png',
|
|
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
|
+
]
|
|
6058
6613
|
};
|
|
6059
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
|
+
|
|
6060
6652
|
/**
|
|
6061
6653
|
* any event happened in the app, which needs to be handled somehow (distributed to other part of the app)
|
|
6062
6654
|
*/
|
|
@@ -6466,16 +7058,6 @@
|
|
|
6466
7058
|
}),
|
|
6467
7059
|
];
|
|
6468
7060
|
|
|
6469
|
-
/**
|
|
6470
|
-
* https://api-uat.corelogic.asia/property/au/v2/suggest.json
|
|
6471
|
-
* address suggestion from corelogic service
|
|
6472
|
-
*/
|
|
6473
|
-
var CorelogicSuggestion = /** @class */ (function () {
|
|
6474
|
-
function CorelogicSuggestion() {
|
|
6475
|
-
}
|
|
6476
|
-
return CorelogicSuggestion;
|
|
6477
|
-
}());
|
|
6478
|
-
|
|
6479
7061
|
/**
|
|
6480
7062
|
* Enum with properties ownership filter options
|
|
6481
7063
|
*/
|
|
@@ -7235,44 +7817,6 @@
|
|
|
7235
7817
|
}] }];
|
|
7236
7818
|
} });
|
|
7237
7819
|
|
|
7238
|
-
var KEY = '_switch_user';
|
|
7239
|
-
/**
|
|
7240
|
-
* provides user management to managers (users with ROLE_ACCOUNTANT for now, more in future)
|
|
7241
|
-
*/
|
|
7242
|
-
var UserSwitcherService = /** @class */ (function () {
|
|
7243
|
-
function UserSwitcherService() {
|
|
7244
|
-
}
|
|
7245
|
-
/**
|
|
7246
|
-
* get switched username
|
|
7247
|
-
*/
|
|
7248
|
-
UserSwitcherService.prototype.get = function () {
|
|
7249
|
-
return localStorage[KEY];
|
|
7250
|
-
};
|
|
7251
|
-
/**
|
|
7252
|
-
* switch to user (username should be used for correct work of backend)
|
|
7253
|
-
*/
|
|
7254
|
-
UserSwitcherService.prototype.set = function (username) {
|
|
7255
|
-
localStorage[KEY] = username;
|
|
7256
|
-
window.location.replace('/client/dashboard');
|
|
7257
|
-
};
|
|
7258
|
-
/**
|
|
7259
|
-
* go back to original user
|
|
7260
|
-
*/
|
|
7261
|
-
UserSwitcherService.prototype.reset = function () {
|
|
7262
|
-
localStorage.removeItem(KEY);
|
|
7263
|
-
window.location.replace('/firm/dashboard');
|
|
7264
|
-
};
|
|
7265
|
-
return UserSwitcherService;
|
|
7266
|
-
}());
|
|
7267
|
-
UserSwitcherService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
7268
|
-
UserSwitcherService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, providedIn: 'root' });
|
|
7269
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: UserSwitcherService, decorators: [{
|
|
7270
|
-
type: i0.Injectable,
|
|
7271
|
-
args: [{
|
|
7272
|
-
providedIn: 'root'
|
|
7273
|
-
}]
|
|
7274
|
-
}] });
|
|
7275
|
-
|
|
7276
7820
|
/**
|
|
7277
7821
|
* Service to work with assets (documents, receipts, e.t.c.)
|
|
7278
7822
|
*/
|
|
@@ -7323,90 +7867,6 @@
|
|
|
7323
7867
|
}] }];
|
|
7324
7868
|
} });
|
|
7325
7869
|
|
|
7326
|
-
var NAME_TOKEN = 'token';
|
|
7327
|
-
var NAME_REFRESH_TOKEN = 'refreshToken';
|
|
7328
|
-
var JwtService = /** @class */ (function (_super) {
|
|
7329
|
-
__extends(JwtService, _super);
|
|
7330
|
-
function JwtService() {
|
|
7331
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
7332
|
-
}
|
|
7333
|
-
JwtService.prototype.getToken = function () {
|
|
7334
|
-
return localStorage[NAME_TOKEN];
|
|
7335
|
-
};
|
|
7336
|
-
JwtService.prototype.getRefreshToken = function () {
|
|
7337
|
-
return localStorage[NAME_REFRESH_TOKEN];
|
|
7338
|
-
};
|
|
7339
|
-
JwtService.prototype.saveTokens = function (tokens) {
|
|
7340
|
-
localStorage[NAME_TOKEN] = tokens.token;
|
|
7341
|
-
localStorage[NAME_REFRESH_TOKEN] = tokens.refreshToken;
|
|
7342
|
-
};
|
|
7343
|
-
JwtService.prototype.destroyTokens = function () {
|
|
7344
|
-
localStorage.removeItem(NAME_TOKEN);
|
|
7345
|
-
localStorage.removeItem(NAME_REFRESH_TOKEN);
|
|
7346
|
-
};
|
|
7347
|
-
JwtService.prototype.getUser = function () {
|
|
7348
|
-
return this.decodeToken();
|
|
7349
|
-
};
|
|
7350
|
-
JwtService.prototype.isMe = function (userId) {
|
|
7351
|
-
return this.getUser().id === userId;
|
|
7352
|
-
};
|
|
7353
|
-
return JwtService;
|
|
7354
|
-
}(angularJwt.JwtHelperService));
|
|
7355
|
-
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 });
|
|
7356
|
-
JwtService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtService, providedIn: 'root' });
|
|
7357
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: JwtService, decorators: [{
|
|
7358
|
-
type: i0.Injectable,
|
|
7359
|
-
args: [{
|
|
7360
|
-
providedIn: 'root'
|
|
7361
|
-
}]
|
|
7362
|
-
}] });
|
|
7363
|
-
|
|
7364
|
-
var AuthService = /** @class */ (function () {
|
|
7365
|
-
function AuthService(http, jwtService, environment) {
|
|
7366
|
-
this.http = http;
|
|
7367
|
-
this.jwtService = jwtService;
|
|
7368
|
-
this.environment = environment;
|
|
7369
|
-
this.isLoggedInSubject = new rxjs.BehaviorSubject(!this.jwtService.isTokenExpired());
|
|
7370
|
-
}
|
|
7371
|
-
AuthService.prototype.setAuth = function (response) {
|
|
7372
|
-
this.jwtService.saveTokens(response);
|
|
7373
|
-
this.isLoggedInSubject.next(true);
|
|
7374
|
-
};
|
|
7375
|
-
AuthService.prototype.login = function (username, password) {
|
|
7376
|
-
var _this = this;
|
|
7377
|
-
return this.http.post(this.environment.apiV2 + "/login_check", { username: username, password: password }).pipe(operators.map(function (response) {
|
|
7378
|
-
_this.setAuth(response);
|
|
7379
|
-
return response;
|
|
7380
|
-
}));
|
|
7381
|
-
};
|
|
7382
|
-
AuthService.prototype.refresh = function (refreshToken) {
|
|
7383
|
-
var _this = this;
|
|
7384
|
-
return this.http.post(this.environment.apiV2 + "/token/refresh", { refreshToken: refreshToken }).pipe(operators.map(function (response) {
|
|
7385
|
-
_this.setAuth(response);
|
|
7386
|
-
return response;
|
|
7387
|
-
}));
|
|
7388
|
-
};
|
|
7389
|
-
AuthService.prototype.logoutFront = function (url) {
|
|
7390
|
-
if (url === void 0) { url = '/login'; }
|
|
7391
|
-
localStorage.clear();
|
|
7392
|
-
location.replace(url);
|
|
7393
|
-
};
|
|
7394
|
-
return AuthService;
|
|
7395
|
-
}());
|
|
7396
|
-
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 });
|
|
7397
|
-
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: AuthService, providedIn: 'root' });
|
|
7398
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
7399
|
-
type: i0.Injectable,
|
|
7400
|
-
args: [{
|
|
7401
|
-
providedIn: 'root'
|
|
7402
|
-
}]
|
|
7403
|
-
}], ctorParameters: function () {
|
|
7404
|
-
return [{ type: i1__namespace.HttpClient }, { type: JwtService }, { type: undefined, decorators: [{
|
|
7405
|
-
type: i0.Inject,
|
|
7406
|
-
args: ['environment']
|
|
7407
|
-
}] }];
|
|
7408
|
-
} });
|
|
7409
|
-
|
|
7410
7870
|
// replace array element with the new one (only arrays of objects)
|
|
7411
7871
|
function replace(array, item, matchField) {
|
|
7412
7872
|
if (matchField === void 0) { matchField = 'id'; }
|
|
@@ -9921,68 +10381,36 @@
|
|
|
9921
10381
|
}]
|
|
9922
10382
|
}] });
|
|
9923
10383
|
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
return this.activePreloaders.asObservable();
|
|
9930
|
-
};
|
|
9931
|
-
PreloaderService.prototype.add = function (endpoint) {
|
|
9932
|
-
var activePreloaders = this.activePreloaders.getValue();
|
|
9933
|
-
activePreloaders.push(endpoint);
|
|
9934
|
-
this.activePreloaders.next(activePreloaders);
|
|
9935
|
-
};
|
|
9936
|
-
PreloaderService.prototype.delete = function (endpoint) {
|
|
9937
|
-
var activePreloaders = this.activePreloaders.getValue();
|
|
9938
|
-
activePreloaders = activePreloaders.filter(function (preloader) { return preloader !== endpoint; });
|
|
9939
|
-
this.activePreloaders.next(activePreloaders);
|
|
9940
|
-
};
|
|
9941
|
-
return PreloaderService;
|
|
9942
|
-
}());
|
|
9943
|
-
PreloaderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
9944
|
-
PreloaderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, providedIn: 'root' });
|
|
9945
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreloaderService, decorators: [{
|
|
9946
|
-
type: i0.Injectable,
|
|
9947
|
-
args: [{
|
|
9948
|
-
providedIn: 'root'
|
|
9949
|
-
}]
|
|
9950
|
-
}], ctorParameters: function () { return []; } });
|
|
9951
|
-
|
|
9952
|
-
var CorelogicService = /** @class */ (function () {
|
|
9953
|
-
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) {
|
|
9954
10389
|
this.http = http;
|
|
9955
10390
|
this.environment = environment;
|
|
9956
|
-
this.accessTokenSubject = new rxjs.ReplaySubject(1);
|
|
9957
10391
|
}
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
if (!this._accessToken || force) {
|
|
9962
|
-
this.http.get(this.environment.coreLogicUrl + "/access/oauth/token?grant_type=client_credentials&client_id=" + this.environment.coreLogicId + "&client_secret=" + this.environment.coreLogicSecret)
|
|
9963
|
-
.pipe(operators.map(function (response) {
|
|
9964
|
-
return response.access_token;
|
|
9965
|
-
}))
|
|
9966
|
-
.subscribe(function (token) {
|
|
9967
|
-
_this._accessToken = token;
|
|
9968
|
-
_this.accessTokenSubject.next(_this._accessToken);
|
|
9969
|
-
});
|
|
9970
|
-
}
|
|
9971
|
-
return this.accessTokenSubject.asObservable();
|
|
9972
|
-
};
|
|
9973
|
-
CorelogicService.prototype.getSuggestions = function (query, country) {
|
|
9974
|
-
if (country === void 0) { country = 'au'; }
|
|
9975
|
-
// @TODO handle different countries in future
|
|
9976
|
-
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")
|
|
9977
10395
|
.pipe(operators.map(function (response) {
|
|
9978
|
-
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
|
+
});
|
|
9979
10407
|
}));
|
|
9980
10408
|
};
|
|
9981
|
-
return
|
|
10409
|
+
return EquityPositionChartService;
|
|
9982
10410
|
}());
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
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: [{
|
|
9986
10414
|
type: i0.Injectable,
|
|
9987
10415
|
args: [{
|
|
9988
10416
|
providedIn: 'root'
|
|
@@ -12004,6 +12432,7 @@
|
|
|
12004
12432
|
exports.EmployeeInviteService = EmployeeInviteService;
|
|
12005
12433
|
exports.EmployeeService = EmployeeService;
|
|
12006
12434
|
exports.Endpoint = Endpoint;
|
|
12435
|
+
exports.EquityPositionChartService = EquityPositionChartService;
|
|
12007
12436
|
exports.EventDispatcherService = EventDispatcherService;
|
|
12008
12437
|
exports.FinancialYear = FinancialYear;
|
|
12009
12438
|
exports.Firm = Firm;
|
|
@@ -12017,6 +12446,7 @@
|
|
|
12017
12446
|
exports.IncomeSourceForecastService = IncomeSourceForecastService;
|
|
12018
12447
|
exports.IncomeSourceService = IncomeSourceService;
|
|
12019
12448
|
exports.IncomeSourceType = IncomeSourceType;
|
|
12449
|
+
exports.InterceptorsModule = InterceptorsModule;
|
|
12020
12450
|
exports.IntercomService = IntercomService;
|
|
12021
12451
|
exports.JwtService = JwtService;
|
|
12022
12452
|
exports.Loan = Loan;
|