@fluxhub/fluxhub-lib 19.0.65 → 19.0.66

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.
@@ -36149,7 +36149,7 @@ class AuthHttpRequestInterceptor {
36149
36149
  refreshToken: refreshToken,
36150
36150
  });
36151
36151
  return this.http
36152
- .post(this.appService.API2_ENDPOINT + 'token/refresh', credentials, {
36152
+ .post(this.appService.API_ENDPOINT + 'token/refresh', credentials, {
36153
36153
  headers: new HttpHeaders({
36154
36154
  'Content-Type': 'application/json',
36155
36155
  }),
@@ -36178,6 +36178,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
36178
36178
  type: Injectable
36179
36179
  }], ctorParameters: () => [{ type: AuthenticationService }, { type: AppService }, { type: i1$1.HttpClient }] });
36180
36180
 
36181
+ class RegistrationService {
36182
+ toastr;
36183
+ http;
36184
+ app_s;
36185
+ goto_after = '';
36186
+ headers;
36187
+ url = null;
36188
+ constructor(toastr, http, app_s) {
36189
+ this.toastr = toastr;
36190
+ this.http = http;
36191
+ this.app_s = app_s;
36192
+ this.headers = new HttpHeaders({
36193
+ 'Content-Type': 'application/json',
36194
+ // 'Authorization' : 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
36195
+ });
36196
+ this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
36197
+ }
36198
+ register_user(username, email, nome, cognome, password, userType = 'standard', displayError = true) {
36199
+ this.url = this.app_s.API_ENDPOINT + 'register';
36200
+ let post_v = JSON.stringify({
36201
+ username: username,
36202
+ password: password,
36203
+ email: email,
36204
+ nome: nome,
36205
+ cognome: cognome,
36206
+ user_type: userType,
36207
+ });
36208
+ return this.http
36209
+ .post(this.url, post_v, {
36210
+ headers: this.headers || {},
36211
+ })
36212
+ .pipe(map((res) => {
36213
+ let err;
36214
+ if (!res) {
36215
+ err = new Error('Empty server response');
36216
+ }
36217
+ else if (res.result_msg === 'KO') {
36218
+ return res || new QGResult();
36219
+ }
36220
+ else {
36221
+ if (res.token) {
36222
+ localStorage.setItem(this.app_s.COMPANY_KEY + 'token', res.token);
36223
+ }
36224
+ if (res.refreshToken) {
36225
+ localStorage.setItem(this.app_s.COMPANY_KEY + 'refreshToken', res.refreshToken);
36226
+ res.result_data = [
36227
+ { token: res.token, refreshToken: res.refreshToken },
36228
+ ];
36229
+ return res || new QGResult();
36230
+ }
36231
+ if (res.refreshtoken) {
36232
+ localStorage.setItem(this.app_s.COMPANY_KEY + 'refreshToken', res.refreshtoken);
36233
+ res.result_data = [
36234
+ { token: res.token, refreshToken: res.refreshtoken },
36235
+ ];
36236
+ return res || new QGResult();
36237
+ }
36238
+ if (res.result_data.length > 0) {
36239
+ localStorage.setItem(this.app_s.COMPANY_KEY + 'token', res.result_data[0].token);
36240
+ }
36241
+ }
36242
+ if (err) {
36243
+ if (displayError) {
36244
+ this.toastr.error(err.message);
36245
+ }
36246
+ throw new Error();
36247
+ }
36248
+ return res || new QGResult();
36249
+ }), catchError((err) => {
36250
+ let errMsg = err.message
36251
+ ? err.message
36252
+ : err.status
36253
+ ? `${err.status} - ${err.statusText}`
36254
+ : 'Server error';
36255
+ console.error(errMsg); // log to console instead
36256
+ throw err;
36257
+ }));
36258
+ }
36259
+ 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 });
36260
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RegistrationService, providedIn: 'root' });
36261
+ }
36262
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: RegistrationService, decorators: [{
36263
+ type: Injectable,
36264
+ args: [{
36265
+ providedIn: 'root',
36266
+ }]
36267
+ }], ctorParameters: () => [{ type: i3.ToastrService }, { type: i1$1.HttpClient }, { type: AppService }] });
36268
+
36181
36269
  /*
36182
36270
  * Public API Surface of fluxhublib
36183
36271
  */
@@ -36186,5 +36274,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
36186
36274
  * Generated bundle index. Do not edit.
36187
36275
  */
36188
36276
 
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 };
36277
+ 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
36278
  //# sourceMappingURL=fluxhub-fluxhub-lib.mjs.map