vc-error-handlers 0.1.5 → 0.1.7
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/esm2020/lib/shared/components/page-not-found/page-not-found.component.mjs +6 -6
- package/esm2020/lib/shared/components/session-expired/session-expired.component.mjs +16 -7
- package/esm2020/lib/shared/components/session-expired-modal/session-expired-modal.component.mjs +13 -19
- package/esm2020/lib/shared/components/unauthorized/unauthorized.component.mjs +5 -5
- package/esm2020/lib/shared/constants/error-handling.constants.mjs +1 -2
- package/esm2020/lib/shared/interceptors/http.interceptor.mjs +5 -13
- package/esm2020/lib/shared/services/auth.service.mjs +1 -1
- package/esm2020/lib/shared/services/global-error.service.mjs +13 -6
- package/esm2020/lib/shared/types/global-error.types.mjs +3 -6
- package/esm2020/lib/vc-error-handlers.component.mjs +20 -14
- package/esm2020/lib/vc-error-handlers.module.mjs +5 -4
- package/fesm2015/vc-error-handlers.mjs +70 -66
- package/fesm2015/vc-error-handlers.mjs.map +1 -1
- package/fesm2020/vc-error-handlers.mjs +70 -66
- package/fesm2020/vc-error-handlers.mjs.map +1 -1
- package/lib/shared/components/page-not-found/page-not-found.component.d.ts +1 -1
- package/lib/shared/components/session-expired/session-expired.component.d.ts +5 -2
- package/lib/shared/components/session-expired-modal/session-expired-modal.component.d.ts +3 -7
- package/lib/shared/components/unauthorized/unauthorized.component.d.ts +1 -1
- package/lib/shared/constants/error-handling.constants.d.ts +0 -1
- package/lib/shared/interceptors/http.interceptor.d.ts +0 -3
- package/lib/shared/services/global-error.service.d.ts +3 -1
- package/lib/shared/types/global-error.types.d.ts +3 -6
- package/lib/vc-error-handlers.component.d.ts +3 -4
- package/lib/vc-error-handlers.module.d.ts +4 -3
- package/package.json +1 -1
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { DialogConfig } from '../../../ui-kit/dialog/dialog-config';
|
|
2
|
-
import { DialogData } from '../../types/global-error.types';
|
|
3
|
-
import { AuthService } from '../../services/auth.service';
|
|
4
2
|
import { RouterService } from '../../services/router.service';
|
|
3
|
+
import { DialogData } from '../../types/global-error.types';
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
5
|
export declare class SessionExpiredModalComponent {
|
|
7
6
|
private dialogConfig;
|
|
8
|
-
private authService;
|
|
9
7
|
private routerService;
|
|
10
8
|
errorConfig: {
|
|
11
9
|
heading: string;
|
|
12
10
|
description: string;
|
|
13
11
|
buttonText: string;
|
|
14
12
|
};
|
|
15
|
-
animation: boolean;
|
|
16
13
|
data: DialogData;
|
|
17
|
-
constructor(dialogConfig: DialogConfig,
|
|
18
|
-
ngOnInit(): void;
|
|
14
|
+
constructor(dialogConfig: DialogConfig, routerService: RouterService);
|
|
19
15
|
onContinueAction(): void;
|
|
20
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<SessionExpiredModalComponent, never>;
|
|
21
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SessionExpiredModalComponent, "lib-session-expired-modal", never, {}, {}, never, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SessionExpiredModalComponent, "lib-vc-error-session-expired-modal", never, {}, {}, never, never>;
|
|
22
18
|
}
|
|
@@ -12,5 +12,5 @@ export declare class UnauthorizedComponent {
|
|
|
12
12
|
VcomplyImage: string;
|
|
13
13
|
redirectToSupport(): void;
|
|
14
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<UnauthorizedComponent, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UnauthorizedComponent, "lib-unauthorized", never, {}, {}, never, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UnauthorizedComponent, "lib-vc-error-unauthorized", never, {}, {}, never, never>;
|
|
16
16
|
}
|
|
@@ -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
|
}
|
|
@@ -2,10 +2,12 @@ import { HttpErrorResponse, HttpRequest } from '@angular/common/http';
|
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class GlobalErrorService {
|
|
5
|
-
private errorCodes;
|
|
6
5
|
globalError$: Subject<any>;
|
|
7
6
|
localError$: Subject<any>;
|
|
8
7
|
handleError(error: HttpErrorResponse, request: HttpRequest<any>): void;
|
|
8
|
+
private isUnauthenticated;
|
|
9
|
+
private isUnauthorizedAccess;
|
|
10
|
+
private isNetworkUnavailable;
|
|
9
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<GlobalErrorService, never>;
|
|
10
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<GlobalErrorService>;
|
|
11
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
|
-
|
|
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
|
|
6
|
-
errorCodes: typeof ErrorStatusCode;
|
|
4
|
+
private errorService;
|
|
7
5
|
unauthorized: boolean;
|
|
8
6
|
sessionExpired: boolean;
|
|
9
7
|
networkUnavailable: boolean;
|
|
10
|
-
constructor(
|
|
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>;
|
|
@@ -9,12 +9,13 @@ import * as i4 from "./shared/components/session-expired/session-expired.compone
|
|
|
9
9
|
import * as i5 from "./shared/components/chunk-unavailable/chunk-unavailable.component";
|
|
10
10
|
import * as i6 from "./shared/components/server-error/server-error.component";
|
|
11
11
|
import * as i7 from "./shared/components/session-expired-modal/session-expired-modal.component";
|
|
12
|
-
import * as i8 from "
|
|
13
|
-
import * as i9 from "./ui-kit/
|
|
12
|
+
import * as i8 from "@angular/common";
|
|
13
|
+
import * as i9 from "./ui-kit/dialog/dialog.module";
|
|
14
|
+
import * as i10 from "./ui-kit/snack-bar/snack-bar.module";
|
|
14
15
|
export declare const FOR_ROOT_SENTRY_OPTIONS_TOKEN: InjectionToken<BrowserOptions>;
|
|
15
16
|
export declare class VcErrorHandlersModule {
|
|
16
17
|
static forRoot(environmentConfig: Configurations): ModuleWithProviders<VcErrorHandlersModule>;
|
|
17
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<VcErrorHandlersModule, never>;
|
|
18
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<VcErrorHandlersModule, [typeof i1.VcErrorHandlersComponent, typeof i2.PageNotFoundComponent, typeof i3.UnauthorizedComponent, typeof i4.SessionExpiredComponent, typeof i5.ChunkUnavailableComponent, typeof i6.ServerErrorComponent, typeof i7.SessionExpiredModalComponent], [typeof i8.
|
|
19
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<VcErrorHandlersModule, [typeof i1.VcErrorHandlersComponent, typeof i2.PageNotFoundComponent, typeof i3.UnauthorizedComponent, typeof i4.SessionExpiredComponent, typeof i5.ChunkUnavailableComponent, typeof i6.ServerErrorComponent, typeof i7.SessionExpiredModalComponent], [typeof i8.CommonModule, typeof i9.DialogModule, typeof i10.SnackBarModule], [typeof i1.VcErrorHandlersComponent, typeof i2.PageNotFoundComponent, typeof i3.UnauthorizedComponent, typeof i4.SessionExpiredComponent, typeof i5.ChunkUnavailableComponent, typeof i6.ServerErrorComponent, typeof i7.SessionExpiredModalComponent]>;
|
|
19
20
|
static ɵinj: i0.ɵɵInjectorDeclaration<VcErrorHandlersModule>;
|
|
20
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vc-error-handlers",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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"
|