intelica-library-components 1.1.21 → 1.1.23

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.
@@ -2,9 +2,10 @@ import * as i0 from '@angular/core';
2
2
  import { inject, Injectable, signal, Pipe, Component, TemplateRef, ContentChild, Input, Directive, EventEmitter, ContentChildren, Output, HostListener, forwardRef, ViewChild, PLATFORM_ID, Inject, output, Optional, Host } from '@angular/core';
3
3
  import { getCookie, Cookies, setCookie } from 'typescript-cookie';
4
4
  import * as i1$4 from '@angular/common/http';
5
- import { HttpClient, HttpHeaders } from '@angular/common/http';
6
- import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription, of, delay, tap, map, firstValueFrom } from 'rxjs';
5
+ import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
6
+ import { BehaviorSubject, catchError, throwError, from, switchMap, Subject, Subscription, of, delay, tap as tap$1, map, firstValueFrom } from 'rxjs';
7
7
  import Swal from 'sweetalert2';
8
+ import { tap } from 'rxjs/operators';
8
9
  import * as i1 from '@angular/common';
9
10
  import { DatePipe, CommonModule, NgIf, isPlatformBrowser, NgClass } from '@angular/common';
10
11
  import * as i1$1 from '@angular/forms';
@@ -530,6 +531,70 @@ const RefreshTokenInterceptor = (req, next) => {
530
531
  return next(_request);
531
532
  };
532
533
 
534
+ const ErrorNewInterceptor = (req, next) => {
535
+ const skip = req.headers.has("Skip-Interceptor");
536
+ if (skip) {
537
+ const cleanReq = req.clone({
538
+ headers: req.headers.delete("Skip-Interceptor"),
539
+ });
540
+ return next(cleanReq);
541
+ }
542
+ const commonFeatureFlagService = inject(GlobalFeatureFlagService);
543
+ const spinnerService = inject(SpinnerService);
544
+ const sweetAlertService = inject(SweetAlertService);
545
+ const configService = inject(ConfigService);
546
+ const HeaderSettings = {};
547
+ const authenticationClientID = configService.environment?.clientID ?? "";
548
+ if (!req.url.includes("environment.json")) {
549
+ HeaderSettings["Accept"] = "application/json";
550
+ HeaderSettings["Content-Type"] = "application/json";
551
+ HeaderSettings["Authorization"] = getCookie("token") ?? "";
552
+ HeaderSettings["RefreshToken"] = getCookie("refreshToken") ?? "";
553
+ HeaderSettings["ClientID"] = configService.environment?.clientID ?? "";
554
+ HeaderSettings["PageRoot"] = commonFeatureFlagService.GetPageRoot();
555
+ HeaderSettings["LanguageCode"] = getCookie("language") ?? "";
556
+ HeaderSettings["Environment"] = configService.environment?.environment ?? "";
557
+ HeaderSettings["Access"] = authenticationClientID == "" ? "" : getCookie(authenticationClientID) ?? "";
558
+ }
559
+ let _request = req.clone({ headers: new HttpHeaders(HeaderSettings) });
560
+ return next(_request).pipe(catchError(handleErrorResponse));
561
+ function handleErrorResponse(error) {
562
+ console.log(error, "error", error.status);
563
+ spinnerService.hide();
564
+ const authenticationLocation = `${configService.environment?.authenticationWeb}?callback=${window.location.href}&clientID=${configService.environment?.clientID}`;
565
+ if (error.status == 503 || error.status == 0)
566
+ sweetAlertService.messageBox("El servicio que se necesita consumir no esta activo o no responde.");
567
+ else if (error.status == 405)
568
+ sweetAlertService.messageBox("Los parametros enviados al servicio no coinciden.");
569
+ else if (error.status == 404)
570
+ sweetAlertService.messageBox("Recurso no encontrado.");
571
+ else if (error.status == 401) {
572
+ sweetAlertService.messageBox(error.error.Error);
573
+ window.location.href = authenticationLocation;
574
+ }
575
+ else if (error.status == 403) {
576
+ sweetAlertService.messageBox(error.error.Error);
577
+ window.location.href = window.location.origin;
578
+ }
579
+ else
580
+ sweetAlertService.messageBox(error.error.message);
581
+ return throwError(() => {
582
+ error.error, error.message;
583
+ });
584
+ }
585
+ };
586
+
587
+ const ResponseHeadersInterceptor = (req, next) => {
588
+ return next(req).pipe(tap(event => {
589
+ if (event instanceof HttpResponse) {
590
+ const headers = event.headers;
591
+ const newToken = headers.get("X-Token-New");
592
+ if (newToken != null && newToken != "")
593
+ setCookie("token", newToken, CookieAttributesGeneral);
594
+ }
595
+ }));
596
+ };
597
+
533
598
  var TableSortOrder;
534
599
  (function (TableSortOrder) {
535
600
  TableSortOrder[TableSortOrder["Asc"] = 1] = "Asc";
@@ -5913,16 +5978,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
5913
5978
  class AddFavoritesService {
5914
5979
  configService = inject(ConfigService);
5915
5980
  addPageToFavorites() {
5916
- return of(void 0).pipe(delay(200), tap(() => console.log("Test: Added current page to favorites")));
5981
+ return of(void 0).pipe(delay(200), tap$1(() => console.log("Test: Added current page to favorites")));
5917
5982
  }
5918
5983
  isPageFavorite() {
5919
- return of(false).pipe(delay(200), tap(() => console.log("Test: Checked if current page is favorite")));
5984
+ return of(false).pipe(delay(200), tap$1(() => console.log("Test: Checked if current page is favorite")));
5920
5985
  }
5921
5986
  simulateToggle() {
5922
- return of(void 0).pipe(delay(200), tap(() => console.log("Test: Toggle favorite request")));
5987
+ return of(void 0).pipe(delay(200), tap$1(() => console.log("Test: Toggle favorite request")));
5923
5988
  }
5924
5989
  removeFromFavorites() {
5925
- return of(void 0).pipe(delay(200), tap(() => console.log("Test: removed from favorites")));
5990
+ return of(void 0).pipe(delay(200), tap$1(() => console.log("Test: removed from favorites")));
5926
5991
  }
5927
5992
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AddFavoritesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5928
5993
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AddFavoritesService, providedIn: "root" });
@@ -7844,7 +7909,7 @@ class ElementService {
7844
7909
  if (!pageRootValue)
7845
7910
  return of();
7846
7911
  this.PageRoot = pageRootValue;
7847
- return this.pageElementService.GetElements(this.PageRoot).pipe(tap(elements => (this.Elements = elements)), map(() => void 0));
7912
+ return this.pageElementService.GetElements(this.PageRoot).pipe(tap$1(elements => (this.Elements = elements)), map(() => void 0));
7848
7913
  }
7849
7914
  /**
7850
7915
  * Verify if page has available element by description
@@ -10420,7 +10485,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
10420
10485
  class NotificationJobService {
10421
10486
  http;
10422
10487
  configService = inject(ConfigService);
10423
- path = `${this.configService.environment?.notificationsPath}`;
10488
+ path = `${this.configService.environment?.notificationsPath}/NotificationJobs`;
10424
10489
  defaultHeaders = new HttpHeaders({
10425
10490
  refreshtoken: "f06c110a-ea4e-44a9-896f-210f3b387e57",
10426
10491
  languagecode: "EN",
@@ -10952,5 +11017,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
10952
11017
  * Generated bundle index. Do not edit.
10953
11018
  */
10954
11019
 
10955
- export { ALERT_DEFAULTS, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AddFavoritesComponent, AlertButtonMode, AlertService, AlertType, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaSessionService, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, NotificationJobService, NotificationOrchestratorService, NotificationService, NotificationSignalRService, OrderConstants, PageRootChildGuard, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
11020
+ export { ALERT_DEFAULTS, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AddFavoritesComponent, AlertButtonMode, AlertService, AlertType, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, ErrorNewInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaSessionService, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, NotificationJobService, NotificationOrchestratorService, NotificationService, NotificationSignalRService, OrderConstants, PageRootChildGuard, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, ResponseHeadersInterceptor, RouteGuard, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
10956
11021
  //# sourceMappingURL=intelica-library-components.mjs.map