vc-error-handlers 0.1.4 → 0.1.6

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.
Files changed (24) hide show
  1. package/esm2020/lib/shared/components/page-not-found/page-not-found.component.mjs +6 -6
  2. package/esm2020/lib/shared/components/session-expired/session-expired.component.mjs +16 -7
  3. package/esm2020/lib/shared/components/session-expired-modal/session-expired-modal.component.mjs +13 -18
  4. package/esm2020/lib/shared/components/unauthorized/unauthorized.component.mjs +15 -5
  5. package/esm2020/lib/shared/constants/error-handling.constants.mjs +1 -2
  6. package/esm2020/lib/shared/interceptors/http.interceptor.mjs +5 -13
  7. package/esm2020/lib/shared/services/auth.service.mjs +1 -1
  8. package/esm2020/lib/shared/services/global-error.service.mjs +13 -5
  9. package/esm2020/lib/shared/types/global-error.types.mjs +3 -6
  10. package/esm2020/lib/vc-error-handlers.component.mjs +19 -14
  11. package/fesm2015/vc-error-handlers.mjs +77 -61
  12. package/fesm2015/vc-error-handlers.mjs.map +1 -1
  13. package/fesm2020/vc-error-handlers.mjs +77 -61
  14. package/fesm2020/vc-error-handlers.mjs.map +1 -1
  15. package/lib/shared/components/page-not-found/page-not-found.component.d.ts +1 -1
  16. package/lib/shared/components/session-expired/session-expired.component.d.ts +5 -2
  17. package/lib/shared/components/session-expired-modal/session-expired-modal.component.d.ts +3 -6
  18. package/lib/shared/components/unauthorized/unauthorized.component.d.ts +1 -1
  19. package/lib/shared/constants/error-handling.constants.d.ts +0 -1
  20. package/lib/shared/interceptors/http.interceptor.d.ts +0 -3
  21. package/lib/shared/services/global-error.service.d.ts +3 -2
  22. package/lib/shared/types/global-error.types.d.ts +3 -6
  23. package/lib/vc-error-handlers.component.d.ts +3 -4
  24. package/package.json +2 -2
@@ -1,6 +1,5 @@
1
1
  export declare const VCOMPLY_IMAGE_URL = "https://cdn.v-comply.com/logo/prod/v-logo.svg";
2
2
  export declare const API_TIMEOUT_TIME: number;
3
- export declare const API_RETRY_COUNT = 2;
4
3
  export declare const ERROR_CONFIG: {
5
4
  PAGE_NOT_FOUND: {
6
5
  imageUrl: string;
@@ -1,14 +1,11 @@
1
1
  import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
- import { ErrorStatusCode } from '../types/global-error.types';
4
3
  import { GlobalErrorService } from '../services/global-error.service';
5
4
  import * as i0 from "@angular/core";
6
5
  export declare class HttpReqInterceptor implements HttpInterceptor {
7
6
  private errorService;
8
- errorCodes: typeof ErrorStatusCode;
9
7
  constructor(errorService: GlobalErrorService);
10
8
  intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
11
- private canNotifyErrorService;
12
9
  static ɵfac: i0.ɵɵFactoryDeclaration<HttpReqInterceptor, never>;
13
10
  static ɵprov: i0.ɵɵInjectableDeclaration<HttpReqInterceptor>;
14
11
  }
@@ -1,12 +1,13 @@
1
1
  import { HttpErrorResponse, HttpRequest } from '@angular/common/http';
2
2
  import { Subject } from 'rxjs';
3
- import { ErrorStatusCode } from '../types/global-error.types';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class GlobalErrorService {
6
- errorCodes: typeof ErrorStatusCode;
7
5
  globalError$: Subject<any>;
8
6
  localError$: Subject<any>;
9
7
  handleError(error: HttpErrorResponse, request: HttpRequest<any>): void;
8
+ private isUnauthenticated;
9
+ private isUnauthorizedAccess;
10
+ private isNetworkUnavailable;
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<GlobalErrorService, never>;
11
12
  static ɵprov: i0.ɵɵInjectableDeclaration<GlobalErrorService>;
12
13
  }
@@ -6,14 +6,11 @@ export interface DialogData {
6
6
  export declare enum ErrorStatusCode {
7
7
  URLNotFound = 404,
8
8
  UnauthorizedAccess = 403,
9
- RequestTimeout = 408,
10
9
  Unauthenticated = 401,
11
10
  InternalServerError = 500,
12
11
  ServiceUnavailable = 503,
13
- NetworkError = 502,
12
+ BadGateway = 502,
13
+ RequestTimeout = 504,
14
14
  NetworkUnavailable = 0,
15
- JSChunkUnavailable = 600,
16
- SoftError = 601,
17
- NotFoundError = 602,
18
- includes = 603
15
+ JSChunkUnavailable = 600
19
16
  }
@@ -1,13 +1,12 @@
1
1
  import { GlobalErrorService } from './shared/services/global-error.service';
2
- import { ErrorStatusCode } from './shared/types/global-error.types';
3
2
  import * as i0 from "@angular/core";
4
3
  export declare class VcErrorHandlersComponent {
5
- private globalErrorService;
6
- errorCodes: typeof ErrorStatusCode;
4
+ private errorService;
7
5
  unauthorized: boolean;
8
6
  sessionExpired: boolean;
9
7
  networkUnavailable: boolean;
10
- constructor(globalErrorService: GlobalErrorService);
8
+ constructor(errorService: GlobalErrorService);
9
+ private subscribeGlobalError;
11
10
  private handleError;
12
11
  static ɵfac: i0.ɵɵFactoryDeclaration<VcErrorHandlersComponent, never>;
13
12
  static ɵcmp: i0.ɵɵComponentDeclaration<VcErrorHandlersComponent, "lib-vc-error-handlers", never, {}, {}, never, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vc-error-handlers",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": " 13.x || 14.x || 15.x || 16.x || 17.x || 18.x || 19.x || 20.x",
6
6
  "@angular/core": "13.x || 14.x || 15.x || 16.x || 17.x || 18.x || 19.x || 20.x"
@@ -32,4 +32,4 @@
32
32
  "dependencies": {
33
33
  "tslib": "^2.3.0"
34
34
  }
35
- }
35
+ }