@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.
@@ -14,25 +14,27 @@ export declare class BaseInterceptor implements HttpInterceptor {
14
14
  */
15
15
  constructor(appSetting: AppSetting, snackBar: MatSnackBar);
16
16
  /**
17
- * Intercept an outgoing `HttpRequest` and optionally transform it or the
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 as well, by applying additional Rx operators on the 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
- * More rarely, an interceptor may choose to completely handle the request itself,
26
- * and compose a new event stream instead of invoking `next.handle()`. This is
27
- * acceptable behavior, but keep in mind further interceptors will be skipped entirely.
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 is also rare but valid for an interceptor to return multiple responses on the
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 http response errors
35
- * @param error
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, HttpErrorResponse, HttpEvent, HttpHeaders, HttpParams } from '@angular/common/http';
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
- * Returns a function that handles Http operation failures.
150
- * This error handler lets the app continue to run as if no error occurred.
151
- * @param operation - name of the operation that failed
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: HttpErrorResponse) => Observable<any>;
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
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messaia/cdk",
3
- "version": "18.1.0",
3
+ "version": "18.1.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.7",
6
6
  "@angular/core": "^18.2.7"