@fluxhub/fluxhub-lib 19.0.65 → 19.0.67
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.
|
@@ -142,6 +142,8 @@ class AppService {
|
|
|
142
142
|
QUERY_ENDPOINT = "doquery";
|
|
143
143
|
WKF_ENDPOINT = "dowkf";
|
|
144
144
|
PASSRECOVERY_ENDPOINT = "passrecovery";
|
|
145
|
+
OPEN_QUERY_ENDPOINT = "query_open";
|
|
146
|
+
REGISTER_ENDPOINT = "register";
|
|
145
147
|
user_name = null;
|
|
146
148
|
user = null;
|
|
147
149
|
user_surname = null;
|
|
@@ -36149,7 +36151,7 @@ class AuthHttpRequestInterceptor {
|
|
|
36149
36151
|
refreshToken: refreshToken,
|
|
36150
36152
|
});
|
|
36151
36153
|
return this.http
|
|
36152
|
-
.post(this.appService.
|
|
36154
|
+
.post(this.appService.API_ENDPOINT + 'token/refresh', credentials, {
|
|
36153
36155
|
headers: new HttpHeaders({
|
|
36154
36156
|
'Content-Type': 'application/json',
|
|
36155
36157
|
}),
|
|
@@ -36178,6 +36180,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
36178
36180
|
type: Injectable
|
|
36179
36181
|
}], ctorParameters: () => [{ type: AuthenticationService }, { type: AppService }, { type: i1$1.HttpClient }] });
|
|
36180
36182
|
|
|
36183
|
+
class RegistrationService {
|
|
36184
|
+
toastr;
|
|
36185
|
+
http;
|
|
36186
|
+
app_s;
|
|
36187
|
+
goto_after = '';
|
|
36188
|
+
headers;
|
|
36189
|
+
url = null;
|
|
36190
|
+
constructor(toastr, http, app_s) {
|
|
36191
|
+
this.toastr = toastr;
|
|
36192
|
+
this.http = http;
|
|
36193
|
+
this.app_s = app_s;
|
|
36194
|
+
this.headers = new HttpHeaders({
|
|
36195
|
+
'Content-Type': 'application/json',
|
|
36196
|
+
// 'Authorization' : 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
|
|
36197
|
+
});
|
|
36198
|
+
this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
|
|
36199
|
+
}
|
|
36200
|
+
register_user(username, email, nome, cognome, password, userType = 'standard', displayError = true) {
|
|
36201
|
+
this.url = this.app_s.API_ENDPOINT + this.app_s.REGISTER_ENDPOINT;
|
|
36202
|
+
let post_v = JSON.stringify({
|
|
36203
|
+
username: username,
|
|
36204
|
+
password: password,
|
|
36205
|
+
email: email,
|
|
36206
|
+
nome: nome,
|
|
36207
|
+
cognome: cognome,
|
|
36208
|
+
user_type: userType,
|
|
36209
|
+
});
|
|
36210
|
+
return this.http
|
|
36211
|
+
.post(this.url, post_v, {
|
|
36212
|
+
headers: this.headers || {},
|
|
36213
|
+
})
|
|
36214
|
+
.pipe(map((res) => {
|
|
36215
|
+
let err;
|
|
36216
|
+
if (!res) {
|
|
36217
|
+
err = new Error('Empty server response');
|
|
36218
|
+
}
|
|
36219
|
+
else if (res.result_msg === 'KO') {
|
|
36220
|
+
return res || new QGResult();
|
|
36221
|
+
}
|
|
36222
|
+
else {
|
|
36223
|
+
if (res.token) {
|
|
36224
|
+
localStorage.setItem(this.app_s.COMPANY_KEY + 'token', res.token);
|
|
36225
|
+
}
|
|
36226
|
+
if (res.refreshToken) {
|
|
36227
|
+
localStorage.setItem(this.app_s.COMPANY_KEY + 'refreshToken', res.refreshToken);
|
|
36228
|
+
res.result_data = [
|
|
36229
|
+
{ token: res.token, refreshToken: res.refreshToken },
|
|
36230
|
+
];
|
|
36231
|
+
return res || new QGResult();
|
|
36232
|
+
}
|
|
36233
|
+
if (res.refreshtoken) {
|
|
36234
|
+
localStorage.setItem(this.app_s.COMPANY_KEY + 'refreshToken', res.refreshtoken);
|
|
36235
|
+
res.result_data = [
|
|
36236
|
+
{ token: res.token, refreshToken: res.refreshtoken },
|
|
36237
|
+
];
|
|
36238
|
+
return res || new QGResult();
|
|
36239
|
+
}
|
|
36240
|
+
if (res.result_data.length > 0) {
|
|
36241
|
+
localStorage.setItem(this.app_s.COMPANY_KEY + 'token', res.result_data[0].token);
|
|
36242
|
+
}
|
|
36243
|
+
}
|
|
36244
|
+
if (err) {
|
|
36245
|
+
if (displayError) {
|
|
36246
|
+
this.toastr.error(err.message);
|
|
36247
|
+
}
|
|
36248
|
+
throw new Error();
|
|
36249
|
+
}
|
|
36250
|
+
return res || new QGResult();
|
|
36251
|
+
}), catchError((err) => {
|
|
36252
|
+
let errMsg = err.message
|
|
36253
|
+
? err.message
|
|
36254
|
+
: err.status
|
|
36255
|
+
? `${err.status} - ${err.statusText}`
|
|
36256
|
+
: 'Server error';
|
|
36257
|
+
console.error(errMsg); // log to console instead
|
|
36258
|
+
throw err;
|
|
36259
|
+
}));
|
|
36260
|
+
}
|
|
36261
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RegistrationService, deps: [{ token: i3.ToastrService }, { token: i1$1.HttpClient }, { token: AppService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
36262
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RegistrationService, providedIn: 'root' });
|
|
36263
|
+
}
|
|
36264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RegistrationService, decorators: [{
|
|
36265
|
+
type: Injectable,
|
|
36266
|
+
args: [{
|
|
36267
|
+
providedIn: 'root',
|
|
36268
|
+
}]
|
|
36269
|
+
}], ctorParameters: () => [{ type: i3.ToastrService }, { type: i1$1.HttpClient }, { type: AppService }] });
|
|
36270
|
+
|
|
36181
36271
|
/*
|
|
36182
36272
|
* Public API Surface of fluxhublib
|
|
36183
36273
|
*/
|
|
@@ -36186,5 +36276,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
36186
36276
|
* Generated bundle index. Do not edit.
|
|
36187
36277
|
*/
|
|
36188
36278
|
|
|
36189
|
-
export { AppMakerService, AppService, ApprovaGridComponent, AuthHttpRequestInterceptor, AuthenticationService, CheckboxEditorComponent, ComboBoxEditorComponent, CurrencyComponent, FHAutoCompleteComponent, FHCheckBoxComponent, FHColorPickerComponent, FHComboboxComponent, FHConfirmValues, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHDateRangePickerComponent, FHFieldPickListComponent, FHFilterComboboxComponent, FHFormBuilderComponent, FHFormExecuterComponent, FHFormToolBarComponent, FHGridComponent, FHGridJSONComponent, FHGridToolBarComponent, FHGuard, FHHelpButtonComponent, FHImageViewerComponent, FHListComponent, FHLogPanelComponent, FHMultiComboboxComponent, FHNotesPanelComponent, FHNumericFieldComponent, FHPickFieldComponent, FHPickUsersComponent, FHRichTextComponent, FHRoleManagerComponent, FHTableManagerComponent, FHTextAreaComponent, FHTextInputComponent, FHTimePickerComponent, FHUploadComponent, FHUploadPanelComponent, FHUploadPanelS3Component, FHUploadS3Component, FHUserFieldComponent, FHWinAppLogsComponent, FHWinAskBigTextComponent, FHWinAskButtonsComponent, FHWinAskNumberComponent, FHWinAskRichTextComponent, FHWinAskTextComponent, FHWinAutoComplete, FHWinComboComponent, FHWinConfirmComponent, FHWinErrorComponent, FHWinGridSelection, FHWinInfoComponent, FHWinListComponent, FHWinMappaComponent, FHWinOutputComponent, FHWinPicklistComponent, FHWinSalvaAnnulla, FHWinSelectByGridComponent, FHWinShowEmail, FHWinShowEmailS3, FHWinShowImage, FHWinShowLog, FHWinShowLogDett, FHWinTimeSlider, FHWinUploadComponent, FHWinUserInfo, FHWinUserPickerComponent, FHWinWaitComponent, FHWorkflowForm, FHWorkflowHeaderBar, FHWorkflowView, FSInput, FSResult, FileService, GridService, LocalDBService, MonthYearPickerComponent, NumericEditorComponent, OdbcService, OfficeAutomatorService, OfficeOperation, OfficeResult, QGParam, QGResult, QParam, QResult, QueryService, ReplaceLineBreaks, SafePipe, TextAreaEditorComponent, UtilityService, WkfService, YearPickerComponent };
|
|
36279
|
+
export { AppMakerService, AppService, ApprovaGridComponent, AuthHttpRequestInterceptor, AuthenticationService, CheckboxEditorComponent, ComboBoxEditorComponent, CurrencyComponent, FHAutoCompleteComponent, FHCheckBoxComponent, FHColorPickerComponent, FHComboboxComponent, FHConfirmValues, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHDateRangePickerComponent, FHFieldPickListComponent, FHFilterComboboxComponent, FHFormBuilderComponent, FHFormExecuterComponent, FHFormToolBarComponent, FHGridComponent, FHGridJSONComponent, FHGridToolBarComponent, FHGuard, FHHelpButtonComponent, FHImageViewerComponent, FHListComponent, FHLogPanelComponent, FHMultiComboboxComponent, FHNotesPanelComponent, FHNumericFieldComponent, FHPickFieldComponent, FHPickUsersComponent, FHRichTextComponent, FHRoleManagerComponent, FHTableManagerComponent, FHTextAreaComponent, FHTextInputComponent, FHTimePickerComponent, FHUploadComponent, FHUploadPanelComponent, FHUploadPanelS3Component, FHUploadS3Component, FHUserFieldComponent, FHWinAppLogsComponent, FHWinAskBigTextComponent, FHWinAskButtonsComponent, FHWinAskNumberComponent, FHWinAskRichTextComponent, FHWinAskTextComponent, FHWinAutoComplete, FHWinComboComponent, FHWinConfirmComponent, FHWinErrorComponent, FHWinGridSelection, FHWinInfoComponent, FHWinListComponent, FHWinMappaComponent, FHWinOutputComponent, FHWinPicklistComponent, FHWinSalvaAnnulla, FHWinSelectByGridComponent, FHWinShowEmail, FHWinShowEmailS3, FHWinShowImage, FHWinShowLog, FHWinShowLogDett, FHWinTimeSlider, FHWinUploadComponent, FHWinUserInfo, FHWinUserPickerComponent, FHWinWaitComponent, FHWorkflowForm, FHWorkflowHeaderBar, FHWorkflowView, FSInput, FSResult, FileService, GridService, LocalDBService, MonthYearPickerComponent, NumericEditorComponent, OdbcService, OfficeAutomatorService, OfficeOperation, OfficeResult, QGParam, QGResult, QParam, QResult, QueryService, RegistrationService, ReplaceLineBreaks, SafePipe, TextAreaEditorComponent, UtilityService, WkfService, YearPickerComponent };
|
|
36190
36280
|
//# sourceMappingURL=fluxhub-fluxhub-lib.mjs.map
|