@messaia/cdk 18.1.0 → 18.1.1
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/esm2022/lib/base/interceptors/base.interceptor.mjs +63 -35
- package/esm2022/lib/http/services/generic.service.mjs +16 -10
- package/fesm2022/messaia-cdk.mjs +77 -43
- package/fesm2022/messaia-cdk.mjs.map +1 -1
- package/lib/base/interceptors/base.interceptor.d.ts +13 -11
- package/lib/http/services/generic.service.d.ts +9 -5
- package/package.json +1 -1
|
@@ -14,25 +14,27 @@ export declare class BaseInterceptor implements HttpInterceptor {
|
|
|
14
14
|
*/
|
|
15
15
|
constructor(appSetting: AppSetting, snackBar: MatSnackBar);
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Intercepts an outgoing `HttpRequest` and optionally transforms it or the
|
|
18
18
|
* response.
|
|
19
19
|
*
|
|
20
20
|
* Typically an interceptor will transform the outgoing request before returning
|
|
21
|
-
* `next.handle(transformedReq)`. An interceptor may choose to transform the
|
|
22
|
-
* response event stream
|
|
23
|
-
* returned by `next.handle()`.
|
|
21
|
+
* `next.handle(transformedReq)`. An interceptor may also choose to transform the
|
|
22
|
+
* response event stream by applying additional Rx operators.
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
24
|
+
* In rare cases, an interceptor may completely handle the request itself,
|
|
25
|
+
* creating a new event stream and bypassing `next.handle()`. This is allowed,
|
|
26
|
+
* but it means that other interceptors will not be triggered.
|
|
28
27
|
*
|
|
29
|
-
* It
|
|
30
|
-
* event stream for a single request.
|
|
28
|
+
* It's also possible, though rare, for an interceptor to return multiple responses
|
|
29
|
+
* on the event stream for a single request.
|
|
31
30
|
*/
|
|
32
31
|
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
33
32
|
/**
|
|
34
|
-
* Parses
|
|
35
|
-
*
|
|
33
|
+
* Parses HTTP response errors and extracts the error messages.
|
|
34
|
+
* Handles both ArrayBuffer and structured error objects.
|
|
35
|
+
*
|
|
36
|
+
* @param error The error object to parse, which could be an ArrayBuffer or a structured error object.
|
|
37
|
+
* @returns A string containing all error messages, joined by new lines.
|
|
36
38
|
*/
|
|
37
39
|
protected parseErrors(error: Object): string;
|
|
38
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseInterceptor, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpClient,
|
|
1
|
+
import { HttpClient, HttpEvent, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
2
2
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
3
|
export declare class GenericService<T extends any> {
|
|
4
4
|
endpoint?: string | undefined;
|
|
@@ -146,11 +146,15 @@ export declare class GenericService<T extends any> {
|
|
|
146
146
|
*/
|
|
147
147
|
protected getFileNameFromHeaders(headers: HttpHeaders): string;
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
149
|
+
* Handles an HTTP operation that failed.
|
|
150
|
+
* Allows the application to continue by throwing a parsed error.
|
|
151
|
+
*
|
|
152
|
+
* @template T The type of the observable result.
|
|
153
|
+
* @param operation The name of the operation that failed. Defaults to 'operation'.
|
|
154
|
+
* @param result An optional value to return as the observable result.
|
|
155
|
+
* @returns A function that processes the error and returns an observable.
|
|
152
156
|
*/
|
|
153
|
-
protected handleError(operation?: string): (error:
|
|
157
|
+
protected handleError<T>(operation?: string, result?: T): (error: any) => Observable<T_1>;
|
|
154
158
|
/**
|
|
155
159
|
* Return distinct message for sent, upload progress, & response events
|
|
156
160
|
*
|