From a394400c003e1e73c42789aa43baadbc590af080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=89=B2?= Date: Sat, 24 Jul 2021 15:43:15 +0800 Subject: [PATCH] fix(theme:http): fix missing `HttpContext` (#1292) - close https://github.com/ng-alain/ng-alain/issues/2036 --- .../theme/src/services/http/http.client.ts | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/packages/theme/src/services/http/http.client.ts b/packages/theme/src/services/http/http.client.ts index cda7a591c..adfc35375 100644 --- a/packages/theme/src/services/http/http.client.ts +++ b/packages/theme/src/services/http/http.client.ts @@ -1,4 +1,4 @@ -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; +import { HttpClient, HttpContext, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable, of } from 'rxjs'; import { delay, finalize, switchMap, tap } from 'rxjs/operators'; @@ -110,6 +110,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -125,6 +126,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -140,6 +142,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -155,6 +158,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -170,6 +174,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -185,6 +190,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -197,6 +203,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } = {} ): Observable { return this.request('GET', url, { @@ -222,6 +229,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -238,6 +246,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -254,6 +263,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -270,6 +280,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -286,6 +297,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -299,6 +311,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } = {} ): Observable { return this.request('POST', url, { @@ -324,6 +337,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -339,6 +353,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -354,6 +369,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -369,6 +385,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -381,6 +398,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } = {} ): Observable { return this.request('DELETE', url, { @@ -425,6 +443,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -441,6 +460,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -457,6 +477,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -473,6 +494,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -486,6 +508,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } = {} ): Observable { return this.request('PATCH', url, { @@ -512,6 +535,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -528,6 +552,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -544,6 +569,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -560,6 +586,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -573,6 +600,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } = {} ): Observable { return this.request('PUT', url, { @@ -599,6 +627,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -615,6 +644,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -631,6 +661,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -647,6 +678,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -663,6 +695,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -676,6 +709,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } = {} ): Observable { return this.request('POST', url, { @@ -706,6 +740,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -723,6 +758,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -740,6 +776,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -757,6 +794,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -774,6 +812,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -791,6 +830,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -808,6 +848,7 @@ export class _HttpClient { observe: 'events'; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -825,6 +866,7 @@ export class _HttpClient { observe: 'events'; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -842,6 +884,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -859,6 +902,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -876,6 +920,7 @@ export class _HttpClient { reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -893,6 +938,7 @@ export class _HttpClient { observe: 'response'; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -910,6 +956,7 @@ export class _HttpClient { observe: 'response'; responseType?: 'json'; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -927,6 +974,7 @@ export class _HttpClient { responseType?: 'json'; reportProgress?: boolean; withCredentials?: boolean; + context?: HttpContext; } ): Observable>; @@ -944,6 +992,7 @@ export class _HttpClient { responseType?: 'json'; reportProgress?: boolean; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -961,6 +1010,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } ): Observable; @@ -975,6 +1025,7 @@ export class _HttpClient { reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; + context?: HttpContext; } = {} ): Observable { if (options.params) options.params = this.parseParams(options.params);