@valtimo/security 4.15.2-next-main.14 → 4.15.3-next-main.15

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.
@@ -4,603 +4,603 @@
4
4
  (global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.security = {}), global.ng.core, global.ngxLogger, global.config, global.ng.router, global.ng.common, global.rxjs, global.rxjs.operators, global.ngxToastr, global.ng.common.http));
5
5
  }(this, (function (exports, i0, i2, i1, router, common, rxjs, operators, i1$1, i2$1) { 'use strict';
6
6
 
7
- /*
8
- * Copyright 2015-2020 Ritense BV, the Netherlands.
9
- *
10
- * Licensed under EUPL, Version 1.2 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" basis,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
- var AuthGuardService = /** @class */ (function () {
23
- function AuthGuardService(configService, injector, logger) {
24
- this.injector = injector;
25
- this.logger = logger;
26
- this.authGuardServiceProvider = injector.get(configService.config.authentication.authProviders.guardServiceProvider);
27
- this.logger.debug('Loading AuthGuardServiceProvider service', this.authGuardServiceProvider);
28
- }
29
- AuthGuardService.prototype.canActivate = function (route, state) {
30
- this.logger.debug('Delegating AuthGuard canActivate');
31
- return this.authGuardServiceProvider.canActivate(route, state);
32
- };
33
- return AuthGuardService;
34
- }());
35
- AuthGuardService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthGuardService_Factory() { return new AuthGuardService(i0.ɵɵinject(i1.ConfigService), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(i2.NGXLogger)); }, token: AuthGuardService, providedIn: "root" });
36
- AuthGuardService.decorators = [
37
- { type: i0.Injectable, args: [{
38
- providedIn: 'root'
39
- },] }
40
- ];
41
- AuthGuardService.ctorParameters = function () { return [
42
- { type: i1.ConfigService },
43
- { type: i0.Injector },
44
- { type: i2.NGXLogger }
7
+ /*
8
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
9
+ *
10
+ * Licensed under EUPL, Version 1.2 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" basis,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ var AuthGuardService = /** @class */ (function () {
23
+ function AuthGuardService(configService, injector, logger) {
24
+ this.injector = injector;
25
+ this.logger = logger;
26
+ this.authGuardServiceProvider = injector.get(configService.config.authentication.authProviders.guardServiceProvider);
27
+ this.logger.debug('Loading AuthGuardServiceProvider service', this.authGuardServiceProvider);
28
+ }
29
+ AuthGuardService.prototype.canActivate = function (route, state) {
30
+ this.logger.debug('Delegating AuthGuard canActivate');
31
+ return this.authGuardServiceProvider.canActivate(route, state);
32
+ };
33
+ return AuthGuardService;
34
+ }());
35
+ AuthGuardService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthGuardService_Factory() { return new AuthGuardService(i0.ɵɵinject(i1.ConfigService), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(i2.NGXLogger)); }, token: AuthGuardService, providedIn: "root" });
36
+ AuthGuardService.decorators = [
37
+ { type: i0.Injectable, args: [{
38
+ providedIn: 'root'
39
+ },] }
40
+ ];
41
+ AuthGuardService.ctorParameters = function () { return [
42
+ { type: i1.ConfigService },
43
+ { type: i0.Injector },
44
+ { type: i2.NGXLogger }
45
45
  ]; };
46
46
 
47
- /*
48
- * Copyright 2015-2020 Ritense BV, the Netherlands.
49
- *
50
- * Licensed under EUPL, Version 1.2 (the "License");
51
- * you may not use this file except in compliance with the License.
52
- * You may obtain a copy of the License at
53
- *
54
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
55
- *
56
- * Unless required by applicable law or agreed to in writing, software
57
- * distributed under the License is distributed on an "AS IS" basis,
58
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
- * See the License for the specific language governing permissions and
60
- * limitations under the License.
61
- */
62
- var ErrorComponent = /** @class */ (function () {
63
- function ErrorComponent(activatedRoute) {
64
- this.activatedRoute = activatedRoute;
65
- }
66
- ErrorComponent.prototype.ngOnInit = function () {
67
- if (this.activatedRoute.snapshot.data) {
68
- this.err = {
69
- title: this.activatedRoute.snapshot.data.title,
70
- error: this.activatedRoute.snapshot.data.error
71
- };
72
- }
73
- };
74
- return ErrorComponent;
75
- }());
76
- ErrorComponent.decorators = [
77
- { type: i0.Component, args: [{
78
- selector: 'valtimo-error',
79
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h1>{{ err.error }}</h1>\n <p>{{ err.title }}</p>\n </div>\n </div>\n </div>\n</div>\n",
80
- styles: [""]
81
- },] }
82
- ];
83
- ErrorComponent.ctorParameters = function () { return [
84
- { type: router.ActivatedRoute }
47
+ /*
48
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
49
+ *
50
+ * Licensed under EUPL, Version 1.2 (the "License");
51
+ * you may not use this file except in compliance with the License.
52
+ * You may obtain a copy of the License at
53
+ *
54
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
55
+ *
56
+ * Unless required by applicable law or agreed to in writing, software
57
+ * distributed under the License is distributed on an "AS IS" basis,
58
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
+ * See the License for the specific language governing permissions and
60
+ * limitations under the License.
61
+ */
62
+ var ErrorComponent = /** @class */ (function () {
63
+ function ErrorComponent(activatedRoute) {
64
+ this.activatedRoute = activatedRoute;
65
+ }
66
+ ErrorComponent.prototype.ngOnInit = function () {
67
+ if (this.activatedRoute.snapshot.data) {
68
+ this.err = {
69
+ title: this.activatedRoute.snapshot.data.title,
70
+ error: this.activatedRoute.snapshot.data.error
71
+ };
72
+ }
73
+ };
74
+ return ErrorComponent;
75
+ }());
76
+ ErrorComponent.decorators = [
77
+ { type: i0.Component, args: [{
78
+ selector: 'valtimo-error',
79
+ template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h1>{{ err.error }}</h1>\n <p>{{ err.title }}</p>\n </div>\n </div>\n </div>\n</div>\n",
80
+ styles: [""]
81
+ },] }
82
+ ];
83
+ ErrorComponent.ctorParameters = function () { return [
84
+ { type: router.ActivatedRoute }
85
85
  ]; };
86
86
 
87
- /*
88
- * Copyright 2015-2020 Ritense BV, the Netherlands.
89
- *
90
- * Licensed under EUPL, Version 1.2 (the "License");
91
- * you may not use this file except in compliance with the License.
92
- * You may obtain a copy of the License at
93
- *
94
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
95
- *
96
- * Unless required by applicable law or agreed to in writing, software
97
- * distributed under the License is distributed on an "AS IS" basis,
98
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
- * See the License for the specific language governing permissions and
100
- * limitations under the License.
101
- */
102
- var InterceptorSkip = 'X-Skip-Interceptor';
87
+ /*
88
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
89
+ *
90
+ * Licensed under EUPL, Version 1.2 (the "License");
91
+ * you may not use this file except in compliance with the License.
92
+ * You may obtain a copy of the License at
93
+ *
94
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
95
+ *
96
+ * Unless required by applicable law or agreed to in writing, software
97
+ * distributed under the License is distributed on an "AS IS" basis,
98
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
+ * See the License for the specific language governing permissions and
100
+ * limitations under the License.
101
+ */
102
+ var InterceptorSkip = 'X-Skip-Interceptor';
103
103
  var InterceptorSkipHeader = new i2$1.HttpHeaders().set(InterceptorSkip, '');
104
104
 
105
- var HttpErrorInterceptor = /** @class */ (function () {
106
- function HttpErrorInterceptor(toastr, logger) {
107
- this.toastr = toastr;
108
- this.logger = logger;
109
- }
110
- HttpErrorInterceptor.prototype.intercept = function (request, next) {
111
- var _this = this;
112
- if (request.headers && request.headers.has(InterceptorSkip)) {
113
- var headers = request.headers.delete(InterceptorSkip);
114
- return next.handle(request.clone({ headers: headers }));
115
- }
116
- else {
117
- return next.handle(request)
118
- .pipe(operators.retry(1), operators.catchError(function (error) {
119
- var errorMessage = '';
120
- if (error.error instanceof ErrorEvent) {
121
- // client-side error
122
- errorMessage = "Error: " + error.error.message;
123
- }
124
- else {
125
- // server-side error
126
- if (error.error.errors) {
127
- errorMessage = error.error.errors;
128
- }
129
- else if (error.error.message) {
130
- errorMessage = error.error.message;
131
- }
132
- else {
133
- errorMessage = "Error Code: " + error.status + "\nMessage: " + error.message;
134
- }
135
- }
136
- _this.toastr.warning("An unexpected error occurred..." + errorMessage);
137
- return rxjs.throwError(errorMessage);
138
- }));
139
- }
140
- };
141
- return HttpErrorInterceptor;
142
- }());
143
- HttpErrorInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function HttpErrorInterceptor_Factory() { return new HttpErrorInterceptor(i0.ɵɵinject(i1$1.ToastrService), i0.ɵɵinject(i2.NGXLogger)); }, token: HttpErrorInterceptor, providedIn: "root" });
144
- HttpErrorInterceptor.decorators = [
145
- { type: i0.Injectable, args: [{
146
- providedIn: 'root'
147
- },] }
148
- ];
149
- HttpErrorInterceptor.ctorParameters = function () { return [
150
- { type: i1$1.ToastrService },
151
- { type: i2.NGXLogger }
105
+ var HttpErrorInterceptor = /** @class */ (function () {
106
+ function HttpErrorInterceptor(toastr, logger) {
107
+ this.toastr = toastr;
108
+ this.logger = logger;
109
+ }
110
+ HttpErrorInterceptor.prototype.intercept = function (request, next) {
111
+ var _this = this;
112
+ if (request.headers && request.headers.has(InterceptorSkip)) {
113
+ var headers = request.headers.delete(InterceptorSkip);
114
+ return next.handle(request.clone({ headers: headers }));
115
+ }
116
+ else {
117
+ return next.handle(request)
118
+ .pipe(operators.retry(1), operators.catchError(function (error) {
119
+ var errorMessage = '';
120
+ if (error.error instanceof ErrorEvent) {
121
+ // client-side error
122
+ errorMessage = "Error: " + error.error.message;
123
+ }
124
+ else {
125
+ // server-side error
126
+ if (error.error.errors) {
127
+ errorMessage = error.error.errors;
128
+ }
129
+ else if (error.error.message) {
130
+ errorMessage = error.error.message;
131
+ }
132
+ else {
133
+ errorMessage = "Error Code: " + error.status + "\nMessage: " + error.message;
134
+ }
135
+ }
136
+ _this.toastr.warning("An unexpected error occurred..." + errorMessage);
137
+ return rxjs.throwError(errorMessage);
138
+ }));
139
+ }
140
+ };
141
+ return HttpErrorInterceptor;
142
+ }());
143
+ HttpErrorInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function HttpErrorInterceptor_Factory() { return new HttpErrorInterceptor(i0.ɵɵinject(i1$1.ToastrService), i0.ɵɵinject(i2.NGXLogger)); }, token: HttpErrorInterceptor, providedIn: "root" });
144
+ HttpErrorInterceptor.decorators = [
145
+ { type: i0.Injectable, args: [{
146
+ providedIn: 'root'
147
+ },] }
148
+ ];
149
+ HttpErrorInterceptor.ctorParameters = function () { return [
150
+ { type: i1$1.ToastrService },
151
+ { type: i2.NGXLogger }
152
152
  ]; };
153
153
 
154
- /*
155
- * Copyright 2015-2020 Ritense BV, the Netherlands.
156
- *
157
- * Licensed under EUPL, Version 1.2 (the "License");
158
- * you may not use this file except in compliance with the License.
159
- * You may obtain a copy of the License at
160
- *
161
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
162
- *
163
- * Unless required by applicable law or agreed to in writing, software
164
- * distributed under the License is distributed on an "AS IS" basis,
165
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
166
- * See the License for the specific language governing permissions and
167
- * limitations under the License.
168
- */
169
- var ɵ0 = { title: 'Access Forbidden', error: 403 }, ɵ1 = { title: 'Not Found', error: 404 }, ɵ2 = { title: 'Internal Server Error', error: 500 }, ɵ3 = { title: 'Service Unavailable', error: 503 };
170
- var routes = [
171
- { path: '403', component: ErrorComponent, data: ɵ0 },
172
- { path: '404', component: ErrorComponent, data: ɵ1 },
173
- { path: '500', component: ErrorComponent, data: ɵ2 },
174
- { path: '503', component: ErrorComponent, data: ɵ3 }
175
- ];
176
- var ErrorRoutingModule = /** @class */ (function () {
177
- function ErrorRoutingModule() {
178
- }
179
- return ErrorRoutingModule;
180
- }());
181
- ErrorRoutingModule.decorators = [
182
- { type: i0.NgModule, args: [{
183
- declarations: [],
184
- imports: [
185
- common.CommonModule,
186
- router.RouterModule.forChild(routes)
187
- ],
188
- exports: [router.RouterModule],
189
- providers: [{ provide: i2$1.HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }]
190
- },] }
154
+ /*
155
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
156
+ *
157
+ * Licensed under EUPL, Version 1.2 (the "License");
158
+ * you may not use this file except in compliance with the License.
159
+ * You may obtain a copy of the License at
160
+ *
161
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
162
+ *
163
+ * Unless required by applicable law or agreed to in writing, software
164
+ * distributed under the License is distributed on an "AS IS" basis,
165
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
166
+ * See the License for the specific language governing permissions and
167
+ * limitations under the License.
168
+ */
169
+ var ɵ0 = { title: 'Access Forbidden', error: 403 }, ɵ1 = { title: 'Not Found', error: 404 }, ɵ2 = { title: 'Internal Server Error', error: 500 }, ɵ3 = { title: 'Service Unavailable', error: 503 };
170
+ var routes = [
171
+ { path: '403', component: ErrorComponent, data: ɵ0 },
172
+ { path: '404', component: ErrorComponent, data: ɵ1 },
173
+ { path: '500', component: ErrorComponent, data: ɵ2 },
174
+ { path: '503', component: ErrorComponent, data: ɵ3 }
175
+ ];
176
+ var ErrorRoutingModule = /** @class */ (function () {
177
+ function ErrorRoutingModule() {
178
+ }
179
+ return ErrorRoutingModule;
180
+ }());
181
+ ErrorRoutingModule.decorators = [
182
+ { type: i0.NgModule, args: [{
183
+ declarations: [],
184
+ imports: [
185
+ common.CommonModule,
186
+ router.RouterModule.forChild(routes)
187
+ ],
188
+ exports: [router.RouterModule],
189
+ providers: [{ provide: i2$1.HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }]
190
+ },] }
191
191
  ];
192
192
 
193
- /*
194
- * Copyright 2015-2020 Ritense BV, the Netherlands.
195
- *
196
- * Licensed under EUPL, Version 1.2 (the "License");
197
- * you may not use this file except in compliance with the License.
198
- * You may obtain a copy of the License at
199
- *
200
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
201
- *
202
- * Unless required by applicable law or agreed to in writing, software
203
- * distributed under the License is distributed on an "AS IS" basis,
204
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
- * See the License for the specific language governing permissions and
206
- * limitations under the License.
207
- */
208
- var SecurityModule = /** @class */ (function () {
209
- function SecurityModule() {
210
- }
211
- return SecurityModule;
212
- }());
213
- SecurityModule.decorators = [
214
- { type: i0.NgModule, args: [{
215
- declarations: [ErrorComponent],
216
- imports: [ErrorRoutingModule],
217
- exports: [ErrorComponent],
218
- providers: [AuthGuardService]
219
- },] }
193
+ /*
194
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
195
+ *
196
+ * Licensed under EUPL, Version 1.2 (the "License");
197
+ * you may not use this file except in compliance with the License.
198
+ * You may obtain a copy of the License at
199
+ *
200
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
201
+ *
202
+ * Unless required by applicable law or agreed to in writing, software
203
+ * distributed under the License is distributed on an "AS IS" basis,
204
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ * See the License for the specific language governing permissions and
206
+ * limitations under the License.
207
+ */
208
+ var SecurityModule = /** @class */ (function () {
209
+ function SecurityModule() {
210
+ }
211
+ return SecurityModule;
212
+ }());
213
+ SecurityModule.decorators = [
214
+ { type: i0.NgModule, args: [{
215
+ declarations: [ErrorComponent],
216
+ imports: [ErrorRoutingModule],
217
+ exports: [ErrorComponent],
218
+ providers: [AuthGuardService]
219
+ },] }
220
220
  ];
221
221
 
222
- /*! *****************************************************************************
223
- Copyright (c) Microsoft Corporation.
224
-
225
- Permission to use, copy, modify, and/or distribute this software for any
226
- purpose with or without fee is hereby granted.
227
-
228
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
229
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
230
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
231
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
232
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
233
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
234
- PERFORMANCE OF THIS SOFTWARE.
235
- ***************************************************************************** */
236
- /* global Reflect, Promise */
237
- var extendStatics = function (d, b) {
238
- extendStatics = Object.setPrototypeOf ||
239
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
240
- function (d, b) { for (var p in b)
241
- if (Object.prototype.hasOwnProperty.call(b, p))
242
- d[p] = b[p]; };
243
- return extendStatics(d, b);
244
- };
245
- function __extends(d, b) {
246
- extendStatics(d, b);
247
- function __() { this.constructor = d; }
248
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
249
- }
250
- var __assign = function () {
251
- __assign = Object.assign || function __assign(t) {
252
- for (var s, i = 1, n = arguments.length; i < n; i++) {
253
- s = arguments[i];
254
- for (var p in s)
255
- if (Object.prototype.hasOwnProperty.call(s, p))
256
- t[p] = s[p];
257
- }
258
- return t;
259
- };
260
- return __assign.apply(this, arguments);
261
- };
262
- function __rest(s, e) {
263
- var t = {};
264
- for (var p in s)
265
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
266
- t[p] = s[p];
267
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
268
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
269
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
270
- t[p[i]] = s[p[i]];
271
- }
272
- return t;
273
- }
274
- function __decorate(decorators, target, key, desc) {
275
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
276
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
277
- r = Reflect.decorate(decorators, target, key, desc);
278
- else
279
- for (var i = decorators.length - 1; i >= 0; i--)
280
- if (d = decorators[i])
281
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
282
- return c > 3 && r && Object.defineProperty(target, key, r), r;
283
- }
284
- function __param(paramIndex, decorator) {
285
- return function (target, key) { decorator(target, key, paramIndex); };
286
- }
287
- function __metadata(metadataKey, metadataValue) {
288
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
289
- return Reflect.metadata(metadataKey, metadataValue);
290
- }
291
- function __awaiter(thisArg, _arguments, P, generator) {
292
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
293
- return new (P || (P = Promise))(function (resolve, reject) {
294
- function fulfilled(value) { try {
295
- step(generator.next(value));
296
- }
297
- catch (e) {
298
- reject(e);
299
- } }
300
- function rejected(value) { try {
301
- step(generator["throw"](value));
302
- }
303
- catch (e) {
304
- reject(e);
305
- } }
306
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
307
- step((generator = generator.apply(thisArg, _arguments || [])).next());
308
- });
309
- }
310
- function __generator(thisArg, body) {
311
- var _ = { label: 0, sent: function () { if (t[0] & 1)
312
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
313
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
314
- function verb(n) { return function (v) { return step([n, v]); }; }
315
- function step(op) {
316
- if (f)
317
- throw new TypeError("Generator is already executing.");
318
- while (_)
319
- try {
320
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
321
- return t;
322
- if (y = 0, t)
323
- op = [op[0] & 2, t.value];
324
- switch (op[0]) {
325
- case 0:
326
- case 1:
327
- t = op;
328
- break;
329
- case 4:
330
- _.label++;
331
- return { value: op[1], done: false };
332
- case 5:
333
- _.label++;
334
- y = op[1];
335
- op = [0];
336
- continue;
337
- case 7:
338
- op = _.ops.pop();
339
- _.trys.pop();
340
- continue;
341
- default:
342
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
343
- _ = 0;
344
- continue;
345
- }
346
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
347
- _.label = op[1];
348
- break;
349
- }
350
- if (op[0] === 6 && _.label < t[1]) {
351
- _.label = t[1];
352
- t = op;
353
- break;
354
- }
355
- if (t && _.label < t[2]) {
356
- _.label = t[2];
357
- _.ops.push(op);
358
- break;
359
- }
360
- if (t[2])
361
- _.ops.pop();
362
- _.trys.pop();
363
- continue;
364
- }
365
- op = body.call(thisArg, _);
366
- }
367
- catch (e) {
368
- op = [6, e];
369
- y = 0;
370
- }
371
- finally {
372
- f = t = 0;
373
- }
374
- if (op[0] & 5)
375
- throw op[1];
376
- return { value: op[0] ? op[1] : void 0, done: true };
377
- }
378
- }
379
- var __createBinding = Object.create ? (function (o, m, k, k2) {
380
- if (k2 === undefined)
381
- k2 = k;
382
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
383
- }) : (function (o, m, k, k2) {
384
- if (k2 === undefined)
385
- k2 = k;
386
- o[k2] = m[k];
387
- });
388
- function __exportStar(m, o) {
389
- for (var p in m)
390
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
391
- __createBinding(o, m, p);
392
- }
393
- function __values(o) {
394
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
395
- if (m)
396
- return m.call(o);
397
- if (o && typeof o.length === "number")
398
- return {
399
- next: function () {
400
- if (o && i >= o.length)
401
- o = void 0;
402
- return { value: o && o[i++], done: !o };
403
- }
404
- };
405
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
406
- }
407
- function __read(o, n) {
408
- var m = typeof Symbol === "function" && o[Symbol.iterator];
409
- if (!m)
410
- return o;
411
- var i = m.call(o), r, ar = [], e;
412
- try {
413
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
414
- ar.push(r.value);
415
- }
416
- catch (error) {
417
- e = { error: error };
418
- }
419
- finally {
420
- try {
421
- if (r && !r.done && (m = i["return"]))
422
- m.call(i);
423
- }
424
- finally {
425
- if (e)
426
- throw e.error;
427
- }
428
- }
429
- return ar;
430
- }
431
- function __spread() {
432
- for (var ar = [], i = 0; i < arguments.length; i++)
433
- ar = ar.concat(__read(arguments[i]));
434
- return ar;
435
- }
436
- function __spreadArrays() {
437
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
438
- s += arguments[i].length;
439
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
440
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
441
- r[k] = a[j];
442
- return r;
443
- }
444
- ;
445
- function __await(v) {
446
- return this instanceof __await ? (this.v = v, this) : new __await(v);
447
- }
448
- function __asyncGenerator(thisArg, _arguments, generator) {
449
- if (!Symbol.asyncIterator)
450
- throw new TypeError("Symbol.asyncIterator is not defined.");
451
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
452
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
453
- function verb(n) { if (g[n])
454
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
455
- function resume(n, v) { try {
456
- step(g[n](v));
457
- }
458
- catch (e) {
459
- settle(q[0][3], e);
460
- } }
461
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
462
- function fulfill(value) { resume("next", value); }
463
- function reject(value) { resume("throw", value); }
464
- function settle(f, v) { if (f(v), q.shift(), q.length)
465
- resume(q[0][0], q[0][1]); }
466
- }
467
- function __asyncDelegator(o) {
468
- var i, p;
469
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
470
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
471
- }
472
- function __asyncValues(o) {
473
- if (!Symbol.asyncIterator)
474
- throw new TypeError("Symbol.asyncIterator is not defined.");
475
- var m = o[Symbol.asyncIterator], i;
476
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
477
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
478
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
479
- }
480
- function __makeTemplateObject(cooked, raw) {
481
- if (Object.defineProperty) {
482
- Object.defineProperty(cooked, "raw", { value: raw });
483
- }
484
- else {
485
- cooked.raw = raw;
486
- }
487
- return cooked;
488
- }
489
- ;
490
- var __setModuleDefault = Object.create ? (function (o, v) {
491
- Object.defineProperty(o, "default", { enumerable: true, value: v });
492
- }) : function (o, v) {
493
- o["default"] = v;
494
- };
495
- function __importStar(mod) {
496
- if (mod && mod.__esModule)
497
- return mod;
498
- var result = {};
499
- if (mod != null)
500
- for (var k in mod)
501
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
502
- __createBinding(result, mod, k);
503
- __setModuleDefault(result, mod);
504
- return result;
505
- }
506
- function __importDefault(mod) {
507
- return (mod && mod.__esModule) ? mod : { default: mod };
508
- }
509
- function __classPrivateFieldGet(receiver, privateMap) {
510
- if (!privateMap.has(receiver)) {
511
- throw new TypeError("attempted to get private field on non-instance");
512
- }
513
- return privateMap.get(receiver);
514
- }
515
- function __classPrivateFieldSet(receiver, privateMap, value) {
516
- if (!privateMap.has(receiver)) {
517
- throw new TypeError("attempted to set private field on non-instance");
518
- }
519
- privateMap.set(receiver, value);
520
- return value;
222
+ /*! *****************************************************************************
223
+ Copyright (c) Microsoft Corporation.
224
+
225
+ Permission to use, copy, modify, and/or distribute this software for any
226
+ purpose with or without fee is hereby granted.
227
+
228
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
229
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
230
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
231
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
232
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
233
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
234
+ PERFORMANCE OF THIS SOFTWARE.
235
+ ***************************************************************************** */
236
+ /* global Reflect, Promise */
237
+ var extendStatics = function (d, b) {
238
+ extendStatics = Object.setPrototypeOf ||
239
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
240
+ function (d, b) { for (var p in b)
241
+ if (Object.prototype.hasOwnProperty.call(b, p))
242
+ d[p] = b[p]; };
243
+ return extendStatics(d, b);
244
+ };
245
+ function __extends(d, b) {
246
+ extendStatics(d, b);
247
+ function __() { this.constructor = d; }
248
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
249
+ }
250
+ var __assign = function () {
251
+ __assign = Object.assign || function __assign(t) {
252
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
253
+ s = arguments[i];
254
+ for (var p in s)
255
+ if (Object.prototype.hasOwnProperty.call(s, p))
256
+ t[p] = s[p];
257
+ }
258
+ return t;
259
+ };
260
+ return __assign.apply(this, arguments);
261
+ };
262
+ function __rest(s, e) {
263
+ var t = {};
264
+ for (var p in s)
265
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
266
+ t[p] = s[p];
267
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
268
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
269
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
270
+ t[p[i]] = s[p[i]];
271
+ }
272
+ return t;
273
+ }
274
+ function __decorate(decorators, target, key, desc) {
275
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
276
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
277
+ r = Reflect.decorate(decorators, target, key, desc);
278
+ else
279
+ for (var i = decorators.length - 1; i >= 0; i--)
280
+ if (d = decorators[i])
281
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
282
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
283
+ }
284
+ function __param(paramIndex, decorator) {
285
+ return function (target, key) { decorator(target, key, paramIndex); };
286
+ }
287
+ function __metadata(metadataKey, metadataValue) {
288
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
289
+ return Reflect.metadata(metadataKey, metadataValue);
290
+ }
291
+ function __awaiter(thisArg, _arguments, P, generator) {
292
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
293
+ return new (P || (P = Promise))(function (resolve, reject) {
294
+ function fulfilled(value) { try {
295
+ step(generator.next(value));
296
+ }
297
+ catch (e) {
298
+ reject(e);
299
+ } }
300
+ function rejected(value) { try {
301
+ step(generator["throw"](value));
302
+ }
303
+ catch (e) {
304
+ reject(e);
305
+ } }
306
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
307
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
308
+ });
309
+ }
310
+ function __generator(thisArg, body) {
311
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
312
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
313
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
314
+ function verb(n) { return function (v) { return step([n, v]); }; }
315
+ function step(op) {
316
+ if (f)
317
+ throw new TypeError("Generator is already executing.");
318
+ while (_)
319
+ try {
320
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
321
+ return t;
322
+ if (y = 0, t)
323
+ op = [op[0] & 2, t.value];
324
+ switch (op[0]) {
325
+ case 0:
326
+ case 1:
327
+ t = op;
328
+ break;
329
+ case 4:
330
+ _.label++;
331
+ return { value: op[1], done: false };
332
+ case 5:
333
+ _.label++;
334
+ y = op[1];
335
+ op = [0];
336
+ continue;
337
+ case 7:
338
+ op = _.ops.pop();
339
+ _.trys.pop();
340
+ continue;
341
+ default:
342
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
343
+ _ = 0;
344
+ continue;
345
+ }
346
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
347
+ _.label = op[1];
348
+ break;
349
+ }
350
+ if (op[0] === 6 && _.label < t[1]) {
351
+ _.label = t[1];
352
+ t = op;
353
+ break;
354
+ }
355
+ if (t && _.label < t[2]) {
356
+ _.label = t[2];
357
+ _.ops.push(op);
358
+ break;
359
+ }
360
+ if (t[2])
361
+ _.ops.pop();
362
+ _.trys.pop();
363
+ continue;
364
+ }
365
+ op = body.call(thisArg, _);
366
+ }
367
+ catch (e) {
368
+ op = [6, e];
369
+ y = 0;
370
+ }
371
+ finally {
372
+ f = t = 0;
373
+ }
374
+ if (op[0] & 5)
375
+ throw op[1];
376
+ return { value: op[0] ? op[1] : void 0, done: true };
377
+ }
378
+ }
379
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
380
+ if (k2 === undefined)
381
+ k2 = k;
382
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
383
+ }) : (function (o, m, k, k2) {
384
+ if (k2 === undefined)
385
+ k2 = k;
386
+ o[k2] = m[k];
387
+ });
388
+ function __exportStar(m, o) {
389
+ for (var p in m)
390
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
391
+ __createBinding(o, m, p);
392
+ }
393
+ function __values(o) {
394
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
395
+ if (m)
396
+ return m.call(o);
397
+ if (o && typeof o.length === "number")
398
+ return {
399
+ next: function () {
400
+ if (o && i >= o.length)
401
+ o = void 0;
402
+ return { value: o && o[i++], done: !o };
403
+ }
404
+ };
405
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
406
+ }
407
+ function __read(o, n) {
408
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
409
+ if (!m)
410
+ return o;
411
+ var i = m.call(o), r, ar = [], e;
412
+ try {
413
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
414
+ ar.push(r.value);
415
+ }
416
+ catch (error) {
417
+ e = { error: error };
418
+ }
419
+ finally {
420
+ try {
421
+ if (r && !r.done && (m = i["return"]))
422
+ m.call(i);
423
+ }
424
+ finally {
425
+ if (e)
426
+ throw e.error;
427
+ }
428
+ }
429
+ return ar;
430
+ }
431
+ function __spread() {
432
+ for (var ar = [], i = 0; i < arguments.length; i++)
433
+ ar = ar.concat(__read(arguments[i]));
434
+ return ar;
435
+ }
436
+ function __spreadArrays() {
437
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
438
+ s += arguments[i].length;
439
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
440
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
441
+ r[k] = a[j];
442
+ return r;
443
+ }
444
+ ;
445
+ function __await(v) {
446
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
447
+ }
448
+ function __asyncGenerator(thisArg, _arguments, generator) {
449
+ if (!Symbol.asyncIterator)
450
+ throw new TypeError("Symbol.asyncIterator is not defined.");
451
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
452
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
453
+ function verb(n) { if (g[n])
454
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
455
+ function resume(n, v) { try {
456
+ step(g[n](v));
457
+ }
458
+ catch (e) {
459
+ settle(q[0][3], e);
460
+ } }
461
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
462
+ function fulfill(value) { resume("next", value); }
463
+ function reject(value) { resume("throw", value); }
464
+ function settle(f, v) { if (f(v), q.shift(), q.length)
465
+ resume(q[0][0], q[0][1]); }
466
+ }
467
+ function __asyncDelegator(o) {
468
+ var i, p;
469
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
470
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
471
+ }
472
+ function __asyncValues(o) {
473
+ if (!Symbol.asyncIterator)
474
+ throw new TypeError("Symbol.asyncIterator is not defined.");
475
+ var m = o[Symbol.asyncIterator], i;
476
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
477
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
478
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
479
+ }
480
+ function __makeTemplateObject(cooked, raw) {
481
+ if (Object.defineProperty) {
482
+ Object.defineProperty(cooked, "raw", { value: raw });
483
+ }
484
+ else {
485
+ cooked.raw = raw;
486
+ }
487
+ return cooked;
488
+ }
489
+ ;
490
+ var __setModuleDefault = Object.create ? (function (o, v) {
491
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
492
+ }) : function (o, v) {
493
+ o["default"] = v;
494
+ };
495
+ function __importStar(mod) {
496
+ if (mod && mod.__esModule)
497
+ return mod;
498
+ var result = {};
499
+ if (mod != null)
500
+ for (var k in mod)
501
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
502
+ __createBinding(result, mod, k);
503
+ __setModuleDefault(result, mod);
504
+ return result;
505
+ }
506
+ function __importDefault(mod) {
507
+ return (mod && mod.__esModule) ? mod : { default: mod };
508
+ }
509
+ function __classPrivateFieldGet(receiver, privateMap) {
510
+ if (!privateMap.has(receiver)) {
511
+ throw new TypeError("attempted to get private field on non-instance");
512
+ }
513
+ return privateMap.get(receiver);
514
+ }
515
+ function __classPrivateFieldSet(receiver, privateMap, value) {
516
+ if (!privateMap.has(receiver)) {
517
+ throw new TypeError("attempted to set private field on non-instance");
518
+ }
519
+ privateMap.set(receiver, value);
520
+ return value;
521
521
  }
522
522
 
523
- var UserProviderService = /** @class */ (function () {
524
- function UserProviderService(configService, injector, http, logger) {
525
- this.configService = configService;
526
- this.injector = injector;
527
- this.http = http;
528
- this.logger = logger;
529
- this.valtimoApiConfig = configService.config.valtimoApi;
530
- this.userService = injector.get(configService.config.authentication.authProviders.userServiceProvider);
531
- this.logger.debug('Loading UserProviderService service', this.userService);
532
- }
533
- UserProviderService.prototype.getUserSubject = function () {
534
- this.logger.debug('Delegating UserProviderService::getUserIdentity');
535
- return this.userService.getUserSubject();
536
- };
537
- UserProviderService.prototype.logout = function () {
538
- this.logger.debug('Delegating UserProviderService::logout');
539
- return this.userService.logout();
540
- };
541
- UserProviderService.prototype.getToken = function () {
542
- return __awaiter(this, void 0, void 0, function () {
543
- return __generator(this, function (_a) {
544
- this.logger.debug('Delegating UserProviderService::getToken');
545
- return [2 /*return*/, this.userService.getToken()];
546
- });
547
- });
548
- };
549
- UserProviderService.prototype.updateToken = function (minValidity) {
550
- return __awaiter(this, void 0, void 0, function () {
551
- return __generator(this, function (_a) {
552
- this.logger.debug('Delegating UserProviderService::updateToken');
553
- if (this.userService.updateToken) {
554
- return [2 /*return*/, this.userService.updateToken(minValidity)];
555
- }
556
- else {
557
- return [2 /*return*/, new Promise(function (resolve) { return resolve(true); })];
558
- }
559
- return [2 /*return*/];
560
- });
561
- });
562
- };
563
- UserProviderService.prototype.getEmailNotificationSettings = function () {
564
- this.logger.debug('getEmailNotificationSettings');
565
- return this.http.get(this.valtimoApiConfig.endpointUri + "email-notification-settings");
566
- };
567
- UserProviderService.prototype.updateEmailNotificationSettings = function (settings) {
568
- this.logger.debug('updateEmailNotificationSettings', settings);
569
- return this.http.put(this.valtimoApiConfig.endpointUri + "email-notification-settings", settings);
570
- };
571
- return UserProviderService;
572
- }());
573
- UserProviderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UserProviderService_Factory() { return new UserProviderService(i0.ɵɵinject(i1.ConfigService), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(i2$1.HttpClient), i0.ɵɵinject(i2.NGXLogger)); }, token: UserProviderService, providedIn: "root" });
574
- UserProviderService.decorators = [
575
- { type: i0.Injectable, args: [{
576
- providedIn: 'root'
577
- },] }
578
- ];
579
- UserProviderService.ctorParameters = function () { return [
580
- { type: i1.ConfigService },
581
- { type: i0.Injector },
582
- { type: i2$1.HttpClient },
583
- { type: i2.NGXLogger }
523
+ var UserProviderService = /** @class */ (function () {
524
+ function UserProviderService(configService, injector, http, logger) {
525
+ this.configService = configService;
526
+ this.injector = injector;
527
+ this.http = http;
528
+ this.logger = logger;
529
+ this.valtimoApiConfig = configService.config.valtimoApi;
530
+ this.userService = injector.get(configService.config.authentication.authProviders.userServiceProvider);
531
+ this.logger.debug('Loading UserProviderService service', this.userService);
532
+ }
533
+ UserProviderService.prototype.getUserSubject = function () {
534
+ this.logger.debug('Delegating UserProviderService::getUserIdentity');
535
+ return this.userService.getUserSubject();
536
+ };
537
+ UserProviderService.prototype.logout = function () {
538
+ this.logger.debug('Delegating UserProviderService::logout');
539
+ return this.userService.logout();
540
+ };
541
+ UserProviderService.prototype.getToken = function () {
542
+ return __awaiter(this, void 0, void 0, function () {
543
+ return __generator(this, function (_a) {
544
+ this.logger.debug('Delegating UserProviderService::getToken');
545
+ return [2 /*return*/, this.userService.getToken()];
546
+ });
547
+ });
548
+ };
549
+ UserProviderService.prototype.updateToken = function (minValidity) {
550
+ return __awaiter(this, void 0, void 0, function () {
551
+ return __generator(this, function (_a) {
552
+ this.logger.debug('Delegating UserProviderService::updateToken');
553
+ if (this.userService.updateToken) {
554
+ return [2 /*return*/, this.userService.updateToken(minValidity)];
555
+ }
556
+ else {
557
+ return [2 /*return*/, new Promise(function (resolve) { return resolve(true); })];
558
+ }
559
+ return [2 /*return*/];
560
+ });
561
+ });
562
+ };
563
+ UserProviderService.prototype.getEmailNotificationSettings = function () {
564
+ this.logger.debug('getEmailNotificationSettings');
565
+ return this.http.get(this.valtimoApiConfig.endpointUri + "email-notification-settings");
566
+ };
567
+ UserProviderService.prototype.updateEmailNotificationSettings = function (settings) {
568
+ this.logger.debug('updateEmailNotificationSettings', settings);
569
+ return this.http.put(this.valtimoApiConfig.endpointUri + "email-notification-settings", settings);
570
+ };
571
+ return UserProviderService;
572
+ }());
573
+ UserProviderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UserProviderService_Factory() { return new UserProviderService(i0.ɵɵinject(i1.ConfigService), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(i2$1.HttpClient), i0.ɵɵinject(i2.NGXLogger)); }, token: UserProviderService, providedIn: "root" });
574
+ UserProviderService.decorators = [
575
+ { type: i0.Injectable, args: [{
576
+ providedIn: 'root'
577
+ },] }
578
+ ];
579
+ UserProviderService.ctorParameters = function () { return [
580
+ { type: i1.ConfigService },
581
+ { type: i0.Injector },
582
+ { type: i2$1.HttpClient },
583
+ { type: i2.NGXLogger }
584
584
  ]; };
585
585
 
586
- /*
587
- * Copyright 2015-2020 Ritense BV, the Netherlands.
588
- *
589
- * Licensed under EUPL, Version 1.2 (the "License");
590
- * you may not use this file except in compliance with the License.
591
- * You may obtain a copy of the License at
592
- *
593
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
594
- *
595
- * Unless required by applicable law or agreed to in writing, software
596
- * distributed under the License is distributed on an "AS IS" basis,
597
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
598
- * See the License for the specific language governing permissions and
599
- * limitations under the License.
586
+ /*
587
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
588
+ *
589
+ * Licensed under EUPL, Version 1.2 (the "License");
590
+ * you may not use this file except in compliance with the License.
591
+ * You may obtain a copy of the License at
592
+ *
593
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
594
+ *
595
+ * Unless required by applicable law or agreed to in writing, software
596
+ * distributed under the License is distributed on an "AS IS" basis,
597
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
598
+ * See the License for the specific language governing permissions and
599
+ * limitations under the License.
600
600
  */
601
601
 
602
- /**
603
- * Generated bundle index. Do not edit.
602
+ /**
603
+ * Generated bundle index. Do not edit.
604
604
  */
605
605
 
606
606
  exports.AuthGuardService = AuthGuardService;