@arsedizioni/ars-utils 19.3.13 → 19.3.14
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/clipper.common/common/interceptors/auth.interceptor.d.ts +0 -1
- package/core/core.module.d.ts +1 -0
- package/core/definitions.d.ts +6 -0
- package/core/messages.d.ts +7 -0
- package/evolution.common/common/interceptors/auth.interceptor.d.ts +0 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +8 -9
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs +10 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +8 -9
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs +8 -10
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
- package/package.json +5 -5
- package/support.common/common/interceptors/auth.interceptor.d.ts +0 -1
|
@@ -4,7 +4,6 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class ClipperAuthInterceptor implements HttpInterceptor {
|
|
5
5
|
private clipperService;
|
|
6
6
|
private broadcastService;
|
|
7
|
-
private dialogService;
|
|
8
7
|
private lastErrorTime;
|
|
9
8
|
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
10
9
|
/**
|
package/core/core.module.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare class ArsCoreModule {
|
|
|
15
15
|
static ɵinj: i0.ɵɵInjectorDeclaration<ArsCoreModule>;
|
|
16
16
|
}
|
|
17
17
|
export * from './definitions';
|
|
18
|
+
export * from './messages';
|
|
18
19
|
export * from './selectable';
|
|
19
20
|
export * from './services/broadcast.service';
|
|
20
21
|
export * from './services/environment.service';
|
package/core/definitions.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ export declare class FileInfo implements Validated {
|
|
|
36
36
|
valid: boolean;
|
|
37
37
|
isValid(): boolean;
|
|
38
38
|
}
|
|
39
|
+
export interface ErrorInfo {
|
|
40
|
+
invalidateSession?: boolean;
|
|
41
|
+
title?: string;
|
|
42
|
+
message?: string;
|
|
43
|
+
errorStatus?: number;
|
|
44
|
+
}
|
|
39
45
|
export interface NameValueItem<T> {
|
|
40
46
|
name: string;
|
|
41
47
|
value: T;
|
|
@@ -4,7 +4,6 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class EvolutionAuthInterceptor implements HttpInterceptor {
|
|
5
5
|
private evolutionService;
|
|
6
6
|
private broadcastService;
|
|
7
|
-
private dialogService;
|
|
8
7
|
private lastErrorTime;
|
|
9
8
|
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
10
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { signal, computed, inject, Injectable, NgModule } from '@angular/core';
|
|
3
3
|
import { HttpClient, HttpHeaders, HttpRequest, HttpErrorResponse } from '@angular/common/http';
|
|
4
|
-
import { BroadcastService, SystemUtils } from '@arsedizioni/ars-utils/core';
|
|
4
|
+
import { BroadcastService, SystemUtils, UtilsMessages } from '@arsedizioni/ars-utils/core';
|
|
5
|
+
import { EMPTY, throwError, of, catchError as catchError$1, switchMap } from 'rxjs';
|
|
5
6
|
import { DialogService } from '@arsedizioni/ars-utils/ui';
|
|
6
|
-
import { EMPTY, throwError, of, finalize as finalize$1, catchError as catchError$1, switchMap } from 'rxjs';
|
|
7
7
|
import { catchError, map, finalize } from 'rxjs/operators';
|
|
8
8
|
|
|
9
9
|
const ClipperMessages = {
|
|
@@ -3187,14 +3187,13 @@ class ClipperAuthInterceptor {
|
|
|
3187
3187
|
constructor() {
|
|
3188
3188
|
this.clipperService = inject(ClipperService);
|
|
3189
3189
|
this.broadcastService = inject(BroadcastService);
|
|
3190
|
-
this.dialogService = inject(DialogService);
|
|
3191
3190
|
this.lastErrorTime = -1;
|
|
3192
3191
|
}
|
|
3193
3192
|
intercept(request, next) {
|
|
3194
3193
|
if (request.url.startsWith(this.clipperService.serviceUri)) {
|
|
3195
3194
|
request = request.clone({ withCredentials: true });
|
|
3196
3195
|
return next.handle(this.addTokenToRequest(request))
|
|
3197
|
-
.pipe(
|
|
3196
|
+
.pipe(catchError$1(error => {
|
|
3198
3197
|
if (error.url.startsWith(this.clipperService.serviceUri)) {
|
|
3199
3198
|
if (error instanceof HttpErrorResponse &&
|
|
3200
3199
|
error.status === 401 &&
|
|
@@ -3218,11 +3217,11 @@ class ClipperAuthInterceptor {
|
|
|
3218
3217
|
message = (error.error?.message ?? error.message ?? "Impossibile eseguire l'operazione richiesta.").replaceAll("\r\n", "</p><p>");
|
|
3219
3218
|
break;
|
|
3220
3219
|
}
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3220
|
+
this.broadcastService.sendMessage(UtilsMessages.UTILS_ERROR_MESSAGE, {
|
|
3221
|
+
invalidateSession: errorStatus === 405 || errorStatus === 410,
|
|
3222
|
+
message: message,
|
|
3223
|
+
title: "Errore in Clipper",
|
|
3224
|
+
errorStatus: errorStatus
|
|
3226
3225
|
});
|
|
3227
3226
|
}
|
|
3228
3227
|
}
|