fabrikantencore 1.0.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/README.md +27 -0
- package/esm2020/fabrikantencore.mjs +5 -0
- package/esm2020/public_api.mjs +4 -0
- package/esm2020/src/app/modules/fabrikantencore/beheer/components/beheer-inlog/beheer-inlog.component.mjs +17 -0
- package/esm2020/src/app/modules/fabrikantencore/beheer/components/beheer-main/beheer-main.component.mjs +14 -0
- package/esm2020/src/app/modules/fabrikantencore/components/fab-button/fab-button.component.mjs +21 -0
- package/esm2020/src/app/modules/fabrikantencore/components/fab-filters/fab-filters.component.mjs +23 -0
- package/esm2020/src/app/modules/fabrikantencore/fabrikantencore.module.mjs +83 -0
- package/esm2020/src/app/modules/fabrikantencore/helpers/auth.guard.mjs +29 -0
- package/esm2020/src/app/modules/fabrikantencore/helpers/basic-auth.interceptor.mjs +26 -0
- package/esm2020/src/app/modules/fabrikantencore/helpers/error.interceptor.mjs +27 -0
- package/esm2020/src/app/modules/fabrikantencore/services/authentication.service.mjs +44 -0
- package/esm2020/src/app/modules/fabrikantencore/swagger/SwaggerClient.mjs +341 -0
- package/fesm2015/fabrikantencore.mjs +588 -0
- package/fesm2015/fabrikantencore.mjs.map +1 -0
- package/fesm2020/fabrikantencore.mjs +584 -0
- package/fesm2020/fabrikantencore.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/package.json +42 -0
- package/public_api.d.ts +3 -0
- package/src/app/modules/fabrikantencore/beheer/components/beheer-inlog/beheer-inlog.component.d.ts +8 -0
- package/src/app/modules/fabrikantencore/beheer/components/beheer-main/beheer-main.component.d.ts +8 -0
- package/src/app/modules/fabrikantencore/components/fab-button/fab-button.component.d.ts +11 -0
- package/src/app/modules/fabrikantencore/components/fab-filters/fab-filters.component.d.ts +10 -0
- package/src/app/modules/fabrikantencore/fabrikantencore.module.d.ts +15 -0
- package/src/app/modules/fabrikantencore/helpers/auth.guard.d.ts +11 -0
- package/src/app/modules/fabrikantencore/helpers/basic-auth.interceptor.d.ts +11 -0
- package/src/app/modules/fabrikantencore/helpers/error.interceptor.d.ts +11 -0
- package/src/app/modules/fabrikantencore/services/authentication.service.d.ts +14 -0
- package/src/app/modules/fabrikantencore/swagger/SwaggerClient.d.ts +81 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, Inject, Optional, Component, Input, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1$2 from '@angular/router';
|
|
6
|
+
import { RouterModule } from '@angular/router';
|
|
7
|
+
import * as i1 from '@angular/common/http';
|
|
8
|
+
import { HttpHeaders, HttpResponseBase, HttpResponse, HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
9
|
+
import { mergeMap, catchError } from 'rxjs/operators';
|
|
10
|
+
import { throwError, Observable, of, BehaviorSubject } from 'rxjs';
|
|
11
|
+
import * as i1$3 from '@angular/material/form-field';
|
|
12
|
+
import * as i2 from '@angular/material/input';
|
|
13
|
+
import { MatInputModule } from '@angular/material/input';
|
|
14
|
+
import * as i3 from '@angular/material/button';
|
|
15
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
16
|
+
|
|
17
|
+
//----------------------
|
|
18
|
+
const API_BASE_URL = new InjectionToken('API_BASE_URL');
|
|
19
|
+
class FiltersApiClient {
|
|
20
|
+
constructor(http, baseUrl) {
|
|
21
|
+
this.jsonParseReviver = undefined;
|
|
22
|
+
this.http = http;
|
|
23
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "";
|
|
24
|
+
}
|
|
25
|
+
getFilterViewModel() {
|
|
26
|
+
let url_ = this.baseUrl + "/api/filters/viewmodel";
|
|
27
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
28
|
+
let options_ = {
|
|
29
|
+
observe: "response",
|
|
30
|
+
responseType: "blob",
|
|
31
|
+
headers: new HttpHeaders({
|
|
32
|
+
"Accept": "application/json"
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
return this.http.request("get", url_, options_).pipe(mergeMap((response_) => {
|
|
36
|
+
return this.processGetFilterViewModel(response_);
|
|
37
|
+
})).pipe(catchError((response_) => {
|
|
38
|
+
if (response_ instanceof HttpResponseBase) {
|
|
39
|
+
try {
|
|
40
|
+
return this.processGetFilterViewModel(response_);
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
return throwError(e);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else
|
|
47
|
+
return throwError(response_);
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
processGetFilterViewModel(response) {
|
|
51
|
+
const status = response.status;
|
|
52
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
53
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
54
|
+
let _headers = {};
|
|
55
|
+
if (response.headers) {
|
|
56
|
+
for (let key of response.headers.keys()) {
|
|
57
|
+
_headers[key] = response.headers.get(key);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (status === 200) {
|
|
61
|
+
return blobToText(responseBlob).pipe(mergeMap((_responseText) => {
|
|
62
|
+
let result200 = null;
|
|
63
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
64
|
+
result200 = FilterViewModel.fromJS(resultData200);
|
|
65
|
+
return of(result200);
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
else if (status !== 200 && status !== 204) {
|
|
69
|
+
return blobToText(responseBlob).pipe(mergeMap((_responseText) => {
|
|
70
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
return of(null);
|
|
74
|
+
}
|
|
75
|
+
getFilterViewModel2() {
|
|
76
|
+
let url_ = this.baseUrl + "/api/filters/viewmodel2";
|
|
77
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
78
|
+
let options_ = {
|
|
79
|
+
observe: "response",
|
|
80
|
+
responseType: "blob",
|
|
81
|
+
headers: new HttpHeaders({
|
|
82
|
+
"Accept": "application/json"
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
return this.http.request("get", url_, options_).pipe(mergeMap((response_) => {
|
|
86
|
+
return this.processGetFilterViewModel2(response_);
|
|
87
|
+
})).pipe(catchError((response_) => {
|
|
88
|
+
if (response_ instanceof HttpResponseBase) {
|
|
89
|
+
try {
|
|
90
|
+
return this.processGetFilterViewModel2(response_);
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
return throwError(e);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else
|
|
97
|
+
return throwError(response_);
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
processGetFilterViewModel2(response) {
|
|
101
|
+
const status = response.status;
|
|
102
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
103
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
104
|
+
let _headers = {};
|
|
105
|
+
if (response.headers) {
|
|
106
|
+
for (let key of response.headers.keys()) {
|
|
107
|
+
_headers[key] = response.headers.get(key);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (status === 200) {
|
|
111
|
+
return blobToText(responseBlob).pipe(mergeMap((_responseText) => {
|
|
112
|
+
let result200 = null;
|
|
113
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
114
|
+
result200 = FilterViewModel.fromJS(resultData200);
|
|
115
|
+
return of(result200);
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
else if (status !== 200 && status !== 204) {
|
|
119
|
+
return blobToText(responseBlob).pipe(mergeMap((_responseText) => {
|
|
120
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
return of(null);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
FiltersApiClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FiltersApiClient, deps: [{ token: HttpClient }, { token: API_BASE_URL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
127
|
+
FiltersApiClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FiltersApiClient });
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FiltersApiClient, decorators: [{
|
|
129
|
+
type: Injectable
|
|
130
|
+
}], ctorParameters: function () {
|
|
131
|
+
return [{ type: i1.HttpClient, decorators: [{
|
|
132
|
+
type: Inject,
|
|
133
|
+
args: [HttpClient]
|
|
134
|
+
}] }, { type: undefined, decorators: [{
|
|
135
|
+
type: Optional
|
|
136
|
+
}, {
|
|
137
|
+
type: Inject,
|
|
138
|
+
args: [API_BASE_URL]
|
|
139
|
+
}] }];
|
|
140
|
+
} });
|
|
141
|
+
class SecurityApiClient {
|
|
142
|
+
constructor(http, baseUrl) {
|
|
143
|
+
this.jsonParseReviver = undefined;
|
|
144
|
+
this.http = http;
|
|
145
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "";
|
|
146
|
+
}
|
|
147
|
+
authenticateUser(pLoginRequestModel) {
|
|
148
|
+
let url_ = this.baseUrl + "/api/security/authenticateuser";
|
|
149
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
150
|
+
const content_ = JSON.stringify(pLoginRequestModel);
|
|
151
|
+
let options_ = {
|
|
152
|
+
body: content_,
|
|
153
|
+
observe: "response",
|
|
154
|
+
responseType: "blob",
|
|
155
|
+
headers: new HttpHeaders({
|
|
156
|
+
"Content-Type": "application/json",
|
|
157
|
+
"Accept": "application/json"
|
|
158
|
+
})
|
|
159
|
+
};
|
|
160
|
+
return this.http.request("post", url_, options_).pipe(mergeMap((response_) => {
|
|
161
|
+
return this.processAuthenticateUser(response_);
|
|
162
|
+
})).pipe(catchError((response_) => {
|
|
163
|
+
if (response_ instanceof HttpResponseBase) {
|
|
164
|
+
try {
|
|
165
|
+
return this.processAuthenticateUser(response_);
|
|
166
|
+
}
|
|
167
|
+
catch (e) {
|
|
168
|
+
return throwError(e);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else
|
|
172
|
+
return throwError(response_);
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
processAuthenticateUser(response) {
|
|
176
|
+
const status = response.status;
|
|
177
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
178
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
179
|
+
let _headers = {};
|
|
180
|
+
if (response.headers) {
|
|
181
|
+
for (let key of response.headers.keys()) {
|
|
182
|
+
_headers[key] = response.headers.get(key);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (status === 200) {
|
|
186
|
+
return blobToText(responseBlob).pipe(mergeMap((_responseText) => {
|
|
187
|
+
let result200 = null;
|
|
188
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
189
|
+
result200 = LoginResponseModel.fromJS(resultData200);
|
|
190
|
+
return of(result200);
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
else if (status !== 200 && status !== 204) {
|
|
194
|
+
return blobToText(responseBlob).pipe(mergeMap((_responseText) => {
|
|
195
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
return of(null);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
SecurityApiClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: SecurityApiClient, deps: [{ token: HttpClient }, { token: API_BASE_URL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
202
|
+
SecurityApiClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: SecurityApiClient });
|
|
203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: SecurityApiClient, decorators: [{
|
|
204
|
+
type: Injectable
|
|
205
|
+
}], ctorParameters: function () {
|
|
206
|
+
return [{ type: i1.HttpClient, decorators: [{
|
|
207
|
+
type: Inject,
|
|
208
|
+
args: [HttpClient]
|
|
209
|
+
}] }, { type: undefined, decorators: [{
|
|
210
|
+
type: Optional
|
|
211
|
+
}, {
|
|
212
|
+
type: Inject,
|
|
213
|
+
args: [API_BASE_URL]
|
|
214
|
+
}] }];
|
|
215
|
+
} });
|
|
216
|
+
class FilterViewModel {
|
|
217
|
+
constructor(data) {
|
|
218
|
+
if (data) {
|
|
219
|
+
for (var property in data) {
|
|
220
|
+
if (data.hasOwnProperty(property))
|
|
221
|
+
this[property] = data[property];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
init(_data) {
|
|
226
|
+
if (_data) {
|
|
227
|
+
this.id = _data["id"];
|
|
228
|
+
this.name = _data["name"];
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
static fromJS(data) {
|
|
232
|
+
data = typeof data === 'object' ? data : {};
|
|
233
|
+
let result = new FilterViewModel();
|
|
234
|
+
result.init(data);
|
|
235
|
+
return result;
|
|
236
|
+
}
|
|
237
|
+
toJSON(data) {
|
|
238
|
+
data = typeof data === 'object' ? data : {};
|
|
239
|
+
data["id"] = this.id;
|
|
240
|
+
data["name"] = this.name;
|
|
241
|
+
return data;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
class LoginResponseModel {
|
|
245
|
+
constructor(data) {
|
|
246
|
+
if (data) {
|
|
247
|
+
for (var property in data) {
|
|
248
|
+
if (data.hasOwnProperty(property))
|
|
249
|
+
this[property] = data[property];
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
init(_data) {
|
|
254
|
+
if (_data) {
|
|
255
|
+
this.name = _data["name"];
|
|
256
|
+
if (Array.isArray(_data["roles"])) {
|
|
257
|
+
this.roles = [];
|
|
258
|
+
for (let item of _data["roles"])
|
|
259
|
+
this.roles.push(item);
|
|
260
|
+
}
|
|
261
|
+
this.loginSuccess = _data["loginSuccess"];
|
|
262
|
+
this.authData = _data["authData"];
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
static fromJS(data) {
|
|
266
|
+
data = typeof data === 'object' ? data : {};
|
|
267
|
+
let result = new LoginResponseModel();
|
|
268
|
+
result.init(data);
|
|
269
|
+
return result;
|
|
270
|
+
}
|
|
271
|
+
toJSON(data) {
|
|
272
|
+
data = typeof data === 'object' ? data : {};
|
|
273
|
+
data["name"] = this.name;
|
|
274
|
+
if (Array.isArray(this.roles)) {
|
|
275
|
+
data["roles"] = [];
|
|
276
|
+
for (let item of this.roles)
|
|
277
|
+
data["roles"].push(item);
|
|
278
|
+
}
|
|
279
|
+
data["loginSuccess"] = this.loginSuccess;
|
|
280
|
+
data["authData"] = this.authData;
|
|
281
|
+
return data;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
class LoginRequestModel {
|
|
285
|
+
constructor(data) {
|
|
286
|
+
if (data) {
|
|
287
|
+
for (var property in data) {
|
|
288
|
+
if (data.hasOwnProperty(property))
|
|
289
|
+
this[property] = data[property];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
init(_data) {
|
|
294
|
+
if (_data) {
|
|
295
|
+
this.name = _data["name"];
|
|
296
|
+
this.password = _data["password"];
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
static fromJS(data) {
|
|
300
|
+
data = typeof data === 'object' ? data : {};
|
|
301
|
+
let result = new LoginRequestModel();
|
|
302
|
+
result.init(data);
|
|
303
|
+
return result;
|
|
304
|
+
}
|
|
305
|
+
toJSON(data) {
|
|
306
|
+
data = typeof data === 'object' ? data : {};
|
|
307
|
+
data["name"] = this.name;
|
|
308
|
+
data["password"] = this.password;
|
|
309
|
+
return data;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
class ApiException extends Error {
|
|
313
|
+
constructor(message, status, response, headers, result) {
|
|
314
|
+
super();
|
|
315
|
+
this.isApiException = true;
|
|
316
|
+
this.message = message;
|
|
317
|
+
this.status = status;
|
|
318
|
+
this.response = response;
|
|
319
|
+
this.headers = headers;
|
|
320
|
+
this.result = result;
|
|
321
|
+
}
|
|
322
|
+
static isApiException(obj) {
|
|
323
|
+
return obj.isApiException === true;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function throwException(message, status, response, headers, result) {
|
|
327
|
+
if (result !== null && result !== undefined)
|
|
328
|
+
return throwError(result);
|
|
329
|
+
else
|
|
330
|
+
return throwError(new ApiException(message, status, response, headers, null));
|
|
331
|
+
}
|
|
332
|
+
function blobToText(blob) {
|
|
333
|
+
return new Observable((observer) => {
|
|
334
|
+
if (!blob) {
|
|
335
|
+
observer.next("");
|
|
336
|
+
observer.complete();
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
let reader = new FileReader();
|
|
340
|
+
reader.onload = event => {
|
|
341
|
+
observer.next(event.target.result);
|
|
342
|
+
observer.complete();
|
|
343
|
+
};
|
|
344
|
+
reader.readAsText(blob);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
class FabButtonComponent {
|
|
350
|
+
constructor() { }
|
|
351
|
+
ngOnInit() {
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
FabButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FabButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
355
|
+
FabButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: FabButtonComponent, selector: "fab-button", inputs: { text: "text", icon: "icon", clickfunction: "clickfunction" }, ngImport: i0, template: "<button class=\"card card-small\" tabindex=\"0\" (click)=\"clickfunction()\">\n <svg *ngIf=\"icon == 'plus'\" class=\"material-icons\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" /></svg>\n <span>{{ text }}</span>\n <svg *ngIf=\"icon == 'arrow'\" class=\"material-icons\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" /></svg>\n</button>\n", styles: ["@charset \"UTF-8\";.card{all:unset;border-radius:4px;border:1px solid #eee;background-color:#fafafa;height:40px;width:200px;margin:0 8px 16px;padding:16px;display:flex;flex-direction:row;justify-content:center;align-items:center;transition:all .2s ease-in-out;line-height:24px;cursor:pointer}.card.card-small{height:16px;width:168px}.card:not(.highlight-card):hover{transform:translateY(-3px);box-shadow:0 4px 17px #00000059}.card-container .card:not(.highlight-card):hover .material-icons path{fill:#696767}.card.highlight-card{background-color:#1976d2;color:#fff;font-weight:600;border:none;width:auto;min-width:30%;position:relative}.card.card.highlight-card span{margin-left:60px}a,a:visited,a:hover{color:#1976d2;text-decoration:none}a:hover{color:#125699}.terminal{position:relative;width:80%;max-width:600px;border-radius:6px;padding-top:45px;margin-top:8px;overflow:hidden;background-color:#0f0f10}.terminal:before{content:\"\\2022\\2022\\2022\";position:absolute;top:0;left:0;height:4px;background:rgb(58,58,58);color:#c2c3c4;width:100%;font-size:2rem;line-height:0;padding:14px 0;text-indent:4px}.terminal pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;color:#fff;padding:0 1rem 1rem;margin:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FabButtonComponent, decorators: [{
|
|
357
|
+
type: Component,
|
|
358
|
+
args: [{ selector: 'fab-button', template: "<button class=\"card card-small\" tabindex=\"0\" (click)=\"clickfunction()\">\n <svg *ngIf=\"icon == 'plus'\" class=\"material-icons\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" /></svg>\n <span>{{ text }}</span>\n <svg *ngIf=\"icon == 'arrow'\" class=\"material-icons\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\" /></svg>\n</button>\n", styles: ["@charset \"UTF-8\";.card{all:unset;border-radius:4px;border:1px solid #eee;background-color:#fafafa;height:40px;width:200px;margin:0 8px 16px;padding:16px;display:flex;flex-direction:row;justify-content:center;align-items:center;transition:all .2s ease-in-out;line-height:24px;cursor:pointer}.card.card-small{height:16px;width:168px}.card:not(.highlight-card):hover{transform:translateY(-3px);box-shadow:0 4px 17px #00000059}.card-container .card:not(.highlight-card):hover .material-icons path{fill:#696767}.card.highlight-card{background-color:#1976d2;color:#fff;font-weight:600;border:none;width:auto;min-width:30%;position:relative}.card.card.highlight-card span{margin-left:60px}a,a:visited,a:hover{color:#1976d2;text-decoration:none}a:hover{color:#125699}.terminal{position:relative;width:80%;max-width:600px;border-radius:6px;padding-top:45px;margin-top:8px;overflow:hidden;background-color:#0f0f10}.terminal:before{content:\"\\2022\\2022\\2022\";position:absolute;top:0;left:0;height:4px;background:rgb(58,58,58);color:#c2c3c4;width:100%;font-size:2rem;line-height:0;padding:14px 0;text-indent:4px}.terminal pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;color:#fff;padding:0 1rem 1rem;margin:0}\n"] }]
|
|
359
|
+
}], ctorParameters: function () { return []; }, propDecorators: { text: [{
|
|
360
|
+
type: Input
|
|
361
|
+
}], icon: [{
|
|
362
|
+
type: Input
|
|
363
|
+
}], clickfunction: [{
|
|
364
|
+
type: Input
|
|
365
|
+
}] } });
|
|
366
|
+
|
|
367
|
+
class FabFiltersComponent {
|
|
368
|
+
constructor(filtersapiclient) {
|
|
369
|
+
this.filtersapiclient = filtersapiclient;
|
|
370
|
+
this.filtersapiclient.getFilterViewModel().subscribe(model => {
|
|
371
|
+
this.FilterViewModel = model;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
Click() {
|
|
375
|
+
alert('test');
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
FabFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FabFiltersComponent, deps: [{ token: FiltersApiClient }], target: i0.ɵɵFactoryTarget.Component });
|
|
379
|
+
FabFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: FabFiltersComponent, selector: "fab-filters", ngImport: i0, template: "test fab-filters\r\n\r\n<div *ngIf=\"FilterViewModel != null\">\r\n {{ FilterViewModel.name }}\r\n</div>\r\n\r\n<fab-button [text]=\"'test'\" [clickfunction]=\"Click\"></fab-button>\r\n", styles: ["body{color:#00f;font-size:20px!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FabButtonComponent, selector: "fab-button", inputs: ["text", "icon", "clickfunction"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FabFiltersComponent, decorators: [{
|
|
381
|
+
type: Component,
|
|
382
|
+
args: [{ selector: 'fab-filters', encapsulation: ViewEncapsulation.None, template: "test fab-filters\r\n\r\n<div *ngIf=\"FilterViewModel != null\">\r\n {{ FilterViewModel.name }}\r\n</div>\r\n\r\n<fab-button [text]=\"'test'\" [clickfunction]=\"Click\"></fab-button>\r\n", styles: ["body{color:#00f;font-size:20px!important}\n"] }]
|
|
383
|
+
}], ctorParameters: function () { return [{ type: FiltersApiClient }]; } });
|
|
384
|
+
|
|
385
|
+
class BeheerMainComponent {
|
|
386
|
+
constructor() { }
|
|
387
|
+
ngOnInit() {
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
BeheerMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BeheerMainComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
391
|
+
BeheerMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BeheerMainComponent, selector: "app-beheer-main", ngImport: i0, template: "<p>\n beheer-main works!\n</p>\n", styles: [""] });
|
|
392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BeheerMainComponent, decorators: [{
|
|
393
|
+
type: Component,
|
|
394
|
+
args: [{ selector: 'app-beheer-main', template: "<p>\n beheer-main works!\n</p>\n" }]
|
|
395
|
+
}], ctorParameters: function () { return []; } });
|
|
396
|
+
|
|
397
|
+
class AuthenticationService {
|
|
398
|
+
constructor(securityApiClient) {
|
|
399
|
+
this.securityApiClient = securityApiClient;
|
|
400
|
+
this.currentUserSubject = new BehaviorSubject(JSON.parse(localStorage.getItem('currentUser') + ""));
|
|
401
|
+
this.currentUser = this.currentUserSubject.asObservable();
|
|
402
|
+
}
|
|
403
|
+
get currentUserValue() {
|
|
404
|
+
return this.currentUserSubject.value;
|
|
405
|
+
}
|
|
406
|
+
login(username, password) {
|
|
407
|
+
var model = new LoginRequestModel();
|
|
408
|
+
this.securityApiClient.authenticateUser(model).subscribe(model => {
|
|
409
|
+
// store user details and basic auth credentials in local storage to keep user logged in between page refreshes
|
|
410
|
+
if (model.loginSuccess) {
|
|
411
|
+
model.authData = window.btoa(username + ':' + password);
|
|
412
|
+
localStorage.setItem('currentUser', JSON.stringify(model));
|
|
413
|
+
this.currentUserSubject.next(model);
|
|
414
|
+
}
|
|
415
|
+
//return user;
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
logout() {
|
|
419
|
+
//this.http.post<any>(`/api/Fabrikanten/LogoutUser`, null)
|
|
420
|
+
// .subscribe({
|
|
421
|
+
// next: data => {
|
|
422
|
+
// // remove user from local storage to log user out
|
|
423
|
+
// localStorage.removeItem('currentUser');
|
|
424
|
+
// this.currentUserSubject.next(null);
|
|
425
|
+
// }
|
|
426
|
+
// });
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AuthenticationService, deps: [{ token: SecurityApiClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
430
|
+
AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AuthenticationService, providedIn: 'root' });
|
|
431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AuthenticationService, decorators: [{
|
|
432
|
+
type: Injectable,
|
|
433
|
+
args: [{ providedIn: 'root' }]
|
|
434
|
+
}], ctorParameters: function () { return [{ type: SecurityApiClient }]; } });
|
|
435
|
+
|
|
436
|
+
class BasicAuthInterceptor {
|
|
437
|
+
constructor(authenticationService) {
|
|
438
|
+
this.authenticationService = authenticationService;
|
|
439
|
+
}
|
|
440
|
+
intercept(request, next) {
|
|
441
|
+
// add authorization header with basic auth credentials if available
|
|
442
|
+
const currentUser = this.authenticationService.currentUserValue;
|
|
443
|
+
if (currentUser && currentUser.authData) {
|
|
444
|
+
request = request.clone({
|
|
445
|
+
setHeaders: {
|
|
446
|
+
Authorization: `Basic ${currentUser.authData}`
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
return next.handle(request);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
BasicAuthInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BasicAuthInterceptor, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
454
|
+
BasicAuthInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BasicAuthInterceptor });
|
|
455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BasicAuthInterceptor, decorators: [{
|
|
456
|
+
type: Injectable
|
|
457
|
+
}], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
|
|
458
|
+
|
|
459
|
+
class ErrorInterceptor {
|
|
460
|
+
constructor(authenticationService) {
|
|
461
|
+
this.authenticationService = authenticationService;
|
|
462
|
+
}
|
|
463
|
+
intercept(request, next) {
|
|
464
|
+
return next.handle(request).pipe(catchError(err => {
|
|
465
|
+
if (err.status === 401) {
|
|
466
|
+
// auto logout if 401 response returned from api
|
|
467
|
+
this.authenticationService.logout();
|
|
468
|
+
location.reload();
|
|
469
|
+
}
|
|
470
|
+
const error = err.error.message || err.statusText;
|
|
471
|
+
return throwError(error);
|
|
472
|
+
}));
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
ErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ErrorInterceptor, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
476
|
+
ErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ErrorInterceptor });
|
|
477
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ErrorInterceptor, decorators: [{
|
|
478
|
+
type: Injectable
|
|
479
|
+
}], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
|
|
480
|
+
|
|
481
|
+
class AuthGuard {
|
|
482
|
+
constructor(router, authenticationService) {
|
|
483
|
+
this.router = router;
|
|
484
|
+
this.authenticationService = authenticationService;
|
|
485
|
+
}
|
|
486
|
+
canActivate(route, state) {
|
|
487
|
+
const currentUser = this.authenticationService.currentUserValue;
|
|
488
|
+
if (currentUser) {
|
|
489
|
+
// logged in so return true
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
// not logged in so redirect to login page with the return url
|
|
493
|
+
//this.router.navigate(['/beheer/inloggen'], { queryParams: { returnUrl: state.url } });
|
|
494
|
+
// or without return url lol
|
|
495
|
+
this.router.navigate(['/beheer/inloggen']);
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
AuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AuthGuard, deps: [{ token: i1$2.Router }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
500
|
+
AuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AuthGuard, providedIn: 'root' });
|
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AuthGuard, decorators: [{
|
|
502
|
+
type: Injectable,
|
|
503
|
+
args: [{ providedIn: 'root' }]
|
|
504
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: AuthenticationService }]; } });
|
|
505
|
+
|
|
506
|
+
class BeheerInlogComponent {
|
|
507
|
+
constructor() { }
|
|
508
|
+
ngOnInit() {
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
BeheerInlogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BeheerInlogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
512
|
+
BeheerInlogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: BeheerInlogComponent, selector: "app-beheer-inlog", ngImport: i0, template: "\n<div class=\"container\">\n <div class=\"inlogdialog\">\n <div>\n <mat-form-field appearance=\"fill\">\n <mat-label>Gebruikersnaam</mat-label>\n <input type=\"text\" matInput value=\"\">\n </mat-form-field>\n </div>\n <div>\n <mat-form-field appearance=\"fill\">\n <mat-label>Wachtwoord</mat-label>\n <input type=\"password\" matInput value=\"\">\n </mat-form-field>\n </div>\n\n <div class=\"button-bar\">\n <button mat-raised-button>Login</button>\n </div>\n </div>\n</div>\n", styles: [".container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.inlogdialog{width:300px}.button-bar{text-align:right}mat-form-field{width:100%}\n"], dependencies: [{ kind: "component", type: i1$3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
513
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BeheerInlogComponent, decorators: [{
|
|
514
|
+
type: Component,
|
|
515
|
+
args: [{ selector: 'app-beheer-inlog', template: "\n<div class=\"container\">\n <div class=\"inlogdialog\">\n <div>\n <mat-form-field appearance=\"fill\">\n <mat-label>Gebruikersnaam</mat-label>\n <input type=\"text\" matInput value=\"\">\n </mat-form-field>\n </div>\n <div>\n <mat-form-field appearance=\"fill\">\n <mat-label>Wachtwoord</mat-label>\n <input type=\"password\" matInput value=\"\">\n </mat-form-field>\n </div>\n\n <div class=\"button-bar\">\n <button mat-raised-button>Login</button>\n </div>\n </div>\n</div>\n", styles: [".container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.inlogdialog{width:300px}.button-bar{text-align:right}mat-form-field{width:100%}\n"] }]
|
|
516
|
+
}], ctorParameters: function () { return []; } });
|
|
517
|
+
|
|
518
|
+
const routes = [
|
|
519
|
+
{ path: '', component: FabFiltersComponent },
|
|
520
|
+
{
|
|
521
|
+
path: 'beheer', children: [
|
|
522
|
+
{ path: 'inloggen', component: BeheerInlogComponent },
|
|
523
|
+
{ path: 'overview', component: BeheerMainComponent, canActivate: [AuthGuard] },
|
|
524
|
+
{ path: '', component: BeheerMainComponent, pathMatch: 'full' }
|
|
525
|
+
]
|
|
526
|
+
},
|
|
527
|
+
{ path: '**', pathMatch: 'full', component: FabFiltersComponent },
|
|
528
|
+
];
|
|
529
|
+
class FabrikantenCoreModule {
|
|
530
|
+
}
|
|
531
|
+
FabrikantenCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FabrikantenCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
532
|
+
FabrikantenCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.4", ngImport: i0, type: FabrikantenCoreModule, declarations: [FabFiltersComponent,
|
|
533
|
+
BeheerMainComponent,
|
|
534
|
+
BeheerInlogComponent,
|
|
535
|
+
FabButtonComponent], imports: [CommonModule,
|
|
536
|
+
HttpClientModule,
|
|
537
|
+
MatInputModule,
|
|
538
|
+
MatButtonModule, i1$2.RouterModule], exports: [FabFiltersComponent] });
|
|
539
|
+
FabrikantenCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FabrikantenCoreModule, providers: [
|
|
540
|
+
FiltersApiClient,
|
|
541
|
+
SecurityApiClient,
|
|
542
|
+
{ provide: HTTP_INTERCEPTORS, useClass: BasicAuthInterceptor, multi: true },
|
|
543
|
+
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
|
|
544
|
+
], imports: [CommonModule,
|
|
545
|
+
HttpClientModule,
|
|
546
|
+
MatInputModule,
|
|
547
|
+
MatButtonModule,
|
|
548
|
+
RouterModule.forRoot(routes, {
|
|
549
|
+
scrollPositionRestoration: 'enabled',
|
|
550
|
+
anchorScrolling: 'enabled',
|
|
551
|
+
})] });
|
|
552
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FabrikantenCoreModule, decorators: [{
|
|
553
|
+
type: NgModule,
|
|
554
|
+
args: [{
|
|
555
|
+
imports: [
|
|
556
|
+
CommonModule,
|
|
557
|
+
HttpClientModule,
|
|
558
|
+
MatInputModule,
|
|
559
|
+
MatButtonModule,
|
|
560
|
+
RouterModule.forRoot(routes, {
|
|
561
|
+
scrollPositionRestoration: 'enabled',
|
|
562
|
+
anchorScrolling: 'enabled',
|
|
563
|
+
}),
|
|
564
|
+
],
|
|
565
|
+
declarations: [
|
|
566
|
+
FabFiltersComponent,
|
|
567
|
+
BeheerMainComponent,
|
|
568
|
+
BeheerInlogComponent,
|
|
569
|
+
FabButtonComponent
|
|
570
|
+
],
|
|
571
|
+
providers: [
|
|
572
|
+
FiltersApiClient,
|
|
573
|
+
SecurityApiClient,
|
|
574
|
+
{ provide: HTTP_INTERCEPTORS, useClass: BasicAuthInterceptor, multi: true },
|
|
575
|
+
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
|
|
576
|
+
],
|
|
577
|
+
exports: [
|
|
578
|
+
FabFiltersComponent
|
|
579
|
+
]
|
|
580
|
+
}]
|
|
581
|
+
}] });
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Generated bundle index. Do not edit.
|
|
585
|
+
*/
|
|
586
|
+
|
|
587
|
+
export { API_BASE_URL, ApiException, FabFiltersComponent, FabrikantenCoreModule, FilterViewModel, FiltersApiClient, LoginRequestModel, LoginResponseModel, SecurityApiClient };
|
|
588
|
+
//# sourceMappingURL=fabrikantencore.mjs.map
|