@angular/common 18.0.0-next.5 → 18.0.0-rc.0
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/http/public_api.mjs +2 -2
- package/esm2022/http/src/client.mjs +3 -3
- package/esm2022/http/src/errors.mjs +1 -1
- package/esm2022/http/src/fetch.mjs +6 -6
- package/esm2022/http/src/interceptor.mjs +3 -3
- package/esm2022/http/src/jsonp.mjs +9 -9
- package/esm2022/http/src/module.mjs +17 -13
- package/esm2022/http/src/response.mjs +8 -2
- package/esm2022/http/src/transfer_cache.mjs +73 -12
- package/esm2022/http/src/xhr.mjs +7 -7
- package/esm2022/http/src/xsrf.mjs +6 -6
- package/esm2022/http/testing/src/backend.mjs +3 -3
- package/esm2022/http/testing/src/module.mjs +7 -5
- package/esm2022/src/common_module.mjs +4 -4
- package/esm2022/src/directives/ng_class.mjs +3 -3
- package/esm2022/src/directives/ng_component_outlet.mjs +3 -3
- package/esm2022/src/directives/ng_for_of.mjs +3 -3
- package/esm2022/src/directives/ng_if.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/lcp_image_observer.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/ng_optimized_image.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/preconnect_link_checker.mjs +3 -3
- package/esm2022/src/directives/ng_optimized_image/preload-link-creator.mjs +3 -3
- package/esm2022/src/directives/ng_plural.mjs +6 -6
- package/esm2022/src/directives/ng_style.mjs +3 -3
- package/esm2022/src/directives/ng_switch.mjs +9 -9
- package/esm2022/src/directives/ng_template_outlet.mjs +3 -3
- package/esm2022/src/i18n/locale_data_api.mjs +86 -3
- package/esm2022/src/i18n/localization.mjs +6 -6
- package/esm2022/src/location/hash_location_strategy.mjs +3 -3
- package/esm2022/src/location/location.mjs +3 -3
- package/esm2022/src/location/location_strategy.mjs +6 -6
- package/esm2022/src/location/platform_location.mjs +6 -6
- package/esm2022/src/navigation/platform_navigation.mjs +3 -3
- package/esm2022/src/pipes/async_pipe.mjs +3 -3
- package/esm2022/src/pipes/case_conversion_pipes.mjs +9 -9
- package/esm2022/src/pipes/date_pipe.mjs +3 -3
- package/esm2022/src/pipes/i18n_plural_pipe.mjs +3 -3
- package/esm2022/src/pipes/i18n_select_pipe.mjs +3 -3
- package/esm2022/src/pipes/json_pipe.mjs +3 -3
- package/esm2022/src/pipes/keyvalue_pipe.mjs +3 -3
- package/esm2022/src/pipes/number_pipe.mjs +9 -9
- package/esm2022/src/pipes/slice_pipe.mjs +3 -3
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/location_mock.mjs +3 -3
- package/esm2022/testing/src/mock_location_strategy.mjs +3 -3
- package/esm2022/testing/src/mock_platform_location.mjs +6 -6
- package/esm2022/upgrade/src/location_upgrade_module.mjs +4 -4
- package/fesm2022/common.mjs +202 -119
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http/testing.mjs +10 -8
- package/fesm2022/http/testing.mjs.map +1 -1
- package/fesm2022/http.mjs +123 -52
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/testing.mjs +16 -16
- package/fesm2022/upgrade.mjs +5 -5
- package/http/index.d.ts +36 -1
- package/http/testing/index.d.ts +3 -1
- package/index.d.ts +88 -2
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v18.0.0-
|
|
2
|
+
* @license Angular v18.0.0-rc.0
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -311,10 +311,10 @@ class HttpClientTestingBackend {
|
|
|
311
311
|
return `Match by function: ${matcher.name}`;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
315
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
314
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
315
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingBackend }); }
|
|
316
316
|
}
|
|
317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
|
|
318
318
|
type: Injectable
|
|
319
319
|
}] });
|
|
320
320
|
function describeRequest(testRequest) {
|
|
@@ -338,13 +338,15 @@ function provideHttpClientTesting() {
|
|
|
338
338
|
* Inject `HttpTestingController` to expect and flush requests in your tests.
|
|
339
339
|
*
|
|
340
340
|
* @publicApi
|
|
341
|
+
*
|
|
342
|
+
* @deprecated Add `provideHttpClientTesting()` to your providers instead.
|
|
341
343
|
*/
|
|
342
344
|
class HttpClientTestingModule {
|
|
343
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
344
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-
|
|
345
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-
|
|
345
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
346
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] }); }
|
|
347
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingModule, providers: [provideHttpClientTesting()], imports: [HttpClientModule] }); }
|
|
346
348
|
}
|
|
347
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientTestingModule, decorators: [{
|
|
348
350
|
type: NgModule,
|
|
349
351
|
args: [{
|
|
350
352
|
imports: [HttpClientModule],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../packages/common/http/testing/src/api.ts","../../../../../../../packages/common/http/testing/src/request.ts","../../../../../../../packages/common/http/testing/src/backend.ts","../../../../../../../packages/common/http/testing/src/provider.ts","../../../../../../../packages/common/http/testing/src/module.ts","../../../../../../../packages/common/http/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpRequest} from '@angular/common/http';\n\nimport {TestRequest} from './request';\n\n/**\n * Defines a matcher for requests based on URL, method, or both.\n *\n * @publicApi\n */\nexport interface RequestMatch {\n method?: string;\n url?: string;\n}\n\n/**\n * Controller to be injected into tests, that allows for mocking and flushing\n * of requests.\n *\n * @publicApi\n */\nexport abstract class HttpTestingController {\n /**\n * Search for requests that match the given parameter, without any expectations.\n */\n abstract match(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n ): TestRequest[];\n\n /**\n * Expect that a single request has been made which matches the given URL, and return its\n * mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(url: string, description?: string): TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given parameters, and return\n * its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(params: RequestMatch, description?: string): TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given predicate function, and\n * return its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(\n matchFn: (req: HttpRequest<any>) => boolean,\n description?: string,\n ): TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given condition, and return\n * its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n description?: string,\n ): TestRequest;\n\n /**\n * Expect that no requests have been made which match the given URL.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(url: string, description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given parameters.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(params: RequestMatch, description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given predicate function.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(matchFn: (req: HttpRequest<any>) => boolean, description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given condition.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n description?: string,\n ): void;\n\n /**\n * Verify that no unmatched requests are outstanding.\n *\n * If any requests are outstanding, fail with an error message indicating which requests were not\n * handled.\n *\n * If `ignoreCancelled` is not set (the default), `verify()` will also fail if cancelled requests\n * were not explicitly matched.\n */\n abstract verify(opts?: {ignoreCancelled?: boolean}): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n HttpErrorResponse,\n HttpEvent,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n HttpStatusCode,\n} from '@angular/common/http';\nimport {Observer} from 'rxjs';\n\n/**\n * Type that describes options that can be used to create an error\n * in `TestRequest`.\n */\ntype TestRequestErrorOptions = {\n headers?: HttpHeaders | {[name: string]: string | string[]};\n status?: number;\n statusText?: string;\n};\n\n/**\n * A mock requests that was received and is ready to be answered.\n *\n * This interface allows access to the underlying `HttpRequest`, and allows\n * responding with `HttpEvent`s or `HttpErrorResponse`s.\n *\n * @publicApi\n */\nexport class TestRequest {\n /**\n * Whether the request was cancelled after it was sent.\n */\n get cancelled(): boolean {\n return this._cancelled;\n }\n\n /**\n * @internal set by `HttpClientTestingBackend`\n */\n _cancelled = false;\n\n constructor(\n public request: HttpRequest<any>,\n private observer: Observer<HttpEvent<any>>,\n ) {}\n\n /**\n * Resolve the request by returning a body plus additional HTTP information (such as response\n * headers) if provided.\n * If the request specifies an expected body type, the body is converted into the requested type.\n * Otherwise, the body is converted to `JSON` by default.\n *\n * Both successful and unsuccessful responses can be delivered via `flush()`.\n */\n flush(\n body:\n | ArrayBuffer\n | Blob\n | boolean\n | string\n | number\n | Object\n | (boolean | string | number | Object | null)[]\n | null,\n opts: {\n headers?: HttpHeaders | {[name: string]: string | string[]};\n status?: number;\n statusText?: string;\n } = {},\n ): void {\n if (this.cancelled) {\n throw new Error(`Cannot flush a cancelled request.`);\n }\n const url = this.request.urlWithParams;\n const headers =\n opts.headers instanceof HttpHeaders ? opts.headers : new HttpHeaders(opts.headers);\n body = _maybeConvertBody(this.request.responseType, body);\n let statusText: string | undefined = opts.statusText;\n let status: number = opts.status !== undefined ? opts.status : HttpStatusCode.Ok;\n if (opts.status === undefined) {\n if (body === null) {\n status = HttpStatusCode.NoContent;\n statusText ||= 'No Content';\n } else {\n statusText ||= 'OK';\n }\n }\n if (statusText === undefined) {\n throw new Error('statusText is required when setting a custom status.');\n }\n if (status >= 200 && status < 300) {\n this.observer.next(new HttpResponse<any>({body, headers, status, statusText, url}));\n this.observer.complete();\n } else {\n this.observer.error(new HttpErrorResponse({error: body, headers, status, statusText, url}));\n }\n }\n\n /**\n * Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).\n * @deprecated Http requests never emit an `ErrorEvent`. Please specify a `ProgressEvent`.\n */\n error(error: ErrorEvent, opts?: TestRequestErrorOptions): void;\n /**\n * Resolve the request by returning an `ProgressEvent` (e.g. simulating a network failure).\n */\n error(error: ProgressEvent, opts?: TestRequestErrorOptions): void;\n error(error: ProgressEvent | ErrorEvent, opts: TestRequestErrorOptions = {}): void {\n if (this.cancelled) {\n throw new Error(`Cannot return an error for a cancelled request.`);\n }\n if (opts.status && opts.status >= 200 && opts.status < 300) {\n throw new Error(`error() called with a successful status.`);\n }\n const headers =\n opts.headers instanceof HttpHeaders ? opts.headers : new HttpHeaders(opts.headers);\n this.observer.error(\n new HttpErrorResponse({\n error,\n headers,\n status: opts.status || 0,\n statusText: opts.statusText || '',\n url: this.request.urlWithParams,\n }),\n );\n }\n\n /**\n * Deliver an arbitrary `HttpEvent` (such as a progress event) on the response stream for this\n * request.\n */\n event(event: HttpEvent<any>): void {\n if (this.cancelled) {\n throw new Error(`Cannot send events to a cancelled request.`);\n }\n this.observer.next(event);\n }\n}\n\n/**\n * Helper function to convert a response body to an ArrayBuffer.\n */\nfunction _toArrayBufferBody(\n body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[],\n): ArrayBuffer {\n if (typeof ArrayBuffer === 'undefined') {\n throw new Error('ArrayBuffer responses are not supported on this platform.');\n }\n if (body instanceof ArrayBuffer) {\n return body;\n }\n throw new Error('Automatic conversion to ArrayBuffer is not supported for response type.');\n}\n\n/**\n * Helper function to convert a response body to a Blob.\n */\nfunction _toBlob(\n body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[],\n): Blob {\n if (typeof Blob === 'undefined') {\n throw new Error('Blob responses are not supported on this platform.');\n }\n if (body instanceof Blob) {\n return body;\n }\n if (ArrayBuffer && body instanceof ArrayBuffer) {\n return new Blob([body]);\n }\n throw new Error('Automatic conversion to Blob is not supported for response type.');\n}\n\n/**\n * Helper function to convert a response body to JSON data.\n */\nfunction _toJsonBody(\n body:\n | ArrayBuffer\n | Blob\n | boolean\n | string\n | number\n | Object\n | (boolean | string | number | Object | null)[],\n format: string = 'JSON',\n): Object | string | number | (Object | string | number)[] {\n if (typeof ArrayBuffer !== 'undefined' && body instanceof ArrayBuffer) {\n throw new Error(`Automatic conversion to ${format} is not supported for ArrayBuffers.`);\n }\n if (typeof Blob !== 'undefined' && body instanceof Blob) {\n throw new Error(`Automatic conversion to ${format} is not supported for Blobs.`);\n }\n if (\n typeof body === 'string' ||\n typeof body === 'number' ||\n typeof body === 'object' ||\n typeof body === 'boolean' ||\n Array.isArray(body)\n ) {\n return body;\n }\n throw new Error(`Automatic conversion to ${format} is not supported for response type.`);\n}\n\n/**\n * Helper function to convert a response body to a string.\n */\nfunction _toTextBody(\n body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[],\n): string {\n if (typeof body === 'string') {\n return body;\n }\n if (typeof ArrayBuffer !== 'undefined' && body instanceof ArrayBuffer) {\n throw new Error('Automatic conversion to text is not supported for ArrayBuffers.');\n }\n if (typeof Blob !== 'undefined' && body instanceof Blob) {\n throw new Error('Automatic conversion to text is not supported for Blobs.');\n }\n return JSON.stringify(_toJsonBody(body, 'text'));\n}\n\n/**\n * Convert a response body to the requested type.\n */\nfunction _maybeConvertBody(\n responseType: string,\n body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[] | null,\n): ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[] | null {\n if (body === null) {\n return null;\n }\n switch (responseType) {\n case 'arraybuffer':\n return _toArrayBufferBody(body);\n case 'blob':\n return _toBlob(body);\n case 'json':\n return _toJsonBody(body);\n case 'text':\n return _toTextBody(body);\n default:\n throw new Error(`Unsupported responseType: ${responseType}`);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpBackend, HttpEvent, HttpEventType, HttpRequest} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {Observable, Observer} from 'rxjs';\n\nimport {HttpTestingController, RequestMatch} from './api';\nimport {TestRequest} from './request';\n\n/**\n * A testing backend for `HttpClient` which both acts as an `HttpBackend`\n * and as the `HttpTestingController`.\n *\n * `HttpClientTestingBackend` works by keeping a list of all open requests.\n * As requests come in, they're added to the list. Users can assert that specific\n * requests were made and then flush them. In the end, a verify() method asserts\n * that no unexpected requests were made.\n *\n *\n */\n@Injectable()\nexport class HttpClientTestingBackend implements HttpBackend, HttpTestingController {\n /**\n * List of pending requests which have not yet been expected.\n */\n private open: TestRequest[] = [];\n\n /**\n * Handle an incoming request by queueing it in the list of open requests.\n */\n handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {\n return new Observable((observer: Observer<any>) => {\n const testReq = new TestRequest(req, observer);\n this.open.push(testReq);\n observer.next({type: HttpEventType.Sent} as HttpEvent<any>);\n return () => {\n testReq._cancelled = true;\n };\n });\n }\n\n /**\n * Helper function to search for requests in the list of open requests.\n */\n private _match(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n ): TestRequest[] {\n if (typeof match === 'string') {\n return this.open.filter((testReq) => testReq.request.urlWithParams === match);\n } else if (typeof match === 'function') {\n return this.open.filter((testReq) => match(testReq.request));\n } else {\n return this.open.filter(\n (testReq) =>\n (!match.method || testReq.request.method === match.method.toUpperCase()) &&\n (!match.url || testReq.request.urlWithParams === match.url),\n );\n }\n }\n\n /**\n * Search for requests in the list of open requests, and return all that match\n * without asserting anything about the number of matches.\n */\n match(match: string | RequestMatch | ((req: HttpRequest<any>) => boolean)): TestRequest[] {\n const results = this._match(match);\n results.forEach((result) => {\n const index = this.open.indexOf(result);\n if (index !== -1) {\n this.open.splice(index, 1);\n }\n });\n return results;\n }\n\n /**\n * Expect that a single outstanding request matches the given matcher, and return\n * it.\n *\n * Requests returned through this API will no longer be in the list of open requests,\n * and thus will not match twice.\n */\n expectOne(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n description?: string,\n ): TestRequest {\n description ||= this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 1) {\n throw new Error(\n `Expected one matching request for criteria \"${description}\", found ${matches.length} requests.`,\n );\n }\n if (matches.length === 0) {\n let message = `Expected one matching request for criteria \"${description}\", found none.`;\n if (this.open.length > 0) {\n // Show the methods and URLs of open requests in the error, for convenience.\n const requests = this.open.map(describeRequest).join(', ');\n message += ` Requests received are: ${requests}.`;\n }\n throw new Error(message);\n }\n return matches[0];\n }\n\n /**\n * Expect that no outstanding requests match the given matcher, and throw an error\n * if any do.\n */\n expectNone(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n description?: string,\n ): void {\n description ||= this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 0) {\n throw new Error(\n `Expected zero matching requests for criteria \"${description}\", found ${matches.length}.`,\n );\n }\n }\n\n /**\n * Validate that there are no outstanding requests.\n */\n verify(opts: {ignoreCancelled?: boolean} = {}): void {\n let open = this.open;\n // It's possible that some requests may be cancelled, and this is expected.\n // The user can ask to ignore open requests which have been cancelled.\n if (opts.ignoreCancelled) {\n open = open.filter((testReq) => !testReq.cancelled);\n }\n if (open.length > 0) {\n // Show the methods and URLs of open requests in the error, for convenience.\n const requests = open.map(describeRequest).join(', ');\n throw new Error(`Expected no open requests, found ${open.length}: ${requests}`);\n }\n }\n\n private descriptionFromMatcher(\n matcher: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n ): string {\n if (typeof matcher === 'string') {\n return `Match URL: ${matcher}`;\n } else if (typeof matcher === 'object') {\n const method = matcher.method || '(any)';\n const url = matcher.url || '(any)';\n return `Match method: ${method}, URL: ${url}`;\n } else {\n return `Match by function: ${matcher.name}`;\n }\n }\n}\n\nfunction describeRequest(testRequest: TestRequest): string {\n const url = testRequest.request.urlWithParams;\n const method = testRequest.request.method;\n return `${method} ${url}`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpBackend, ɵREQUESTS_CONTRIBUTE_TO_STABILITY} from '@angular/common/http';\nimport {Provider} from '@angular/core';\n\nimport {HttpTestingController} from './api';\nimport {HttpClientTestingBackend} from './backend';\n\nexport function provideHttpClientTesting(): Provider[] {\n return [\n HttpClientTestingBackend,\n {provide: HttpBackend, useExisting: HttpClientTestingBackend},\n {provide: HttpTestingController, useExisting: HttpClientTestingBackend},\n {provide: ɵREQUESTS_CONTRIBUTE_TO_STABILITY, useValue: false},\n ];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\n\nimport {provideHttpClientTesting} from './provider';\n\n/**\n * Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.\n *\n * Inject `HttpTestingController` to expect and flush requests in your tests.\n *\n * @publicApi\n */\n@NgModule({\n imports: [HttpClientModule],\n providers: [provideHttpClientTesting()],\n})\nexport class HttpClientTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAsBA;;;;;AAKG;MACmB,qBAAqB,CAAA;AA+F1C;;AC/FD;;;;;;;AAOG;MACU,WAAW,CAAA;AACtB;;AAEG;AACH,IAAA,IAAI,SAAS,GAAA;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;KACxB;IAOD,WACS,CAAA,OAAyB,EACxB,QAAkC,EAAA;QADnC,IAAO,CAAA,OAAA,GAAP,OAAO,CAAkB;QACxB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAA0B;AAP5C;;AAEG;QACH,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;KAKf;AAEJ;;;;;;;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,EAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAHxB,gBAAgB,CAAA,EAAA,CAAA,CAAA,EAAA;AAGf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,aAFvB,CAAC,wBAAwB,EAAE,CAAC,YAD7B,gBAAgB,CAAA,EAAA,CAAA,CAAA,EAAA;;sGAGf,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC3B,oBAAA,SAAS,EAAE,CAAC,wBAAwB,EAAE,CAAC;AACxC,iBAAA,CAAA;;;ACvBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../packages/common/http/testing/src/api.ts","../../../../../../../packages/common/http/testing/src/request.ts","../../../../../../../packages/common/http/testing/src/backend.ts","../../../../../../../packages/common/http/testing/src/provider.ts","../../../../../../../packages/common/http/testing/src/module.ts","../../../../../../../packages/common/http/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpRequest} from '@angular/common/http';\n\nimport {TestRequest} from './request';\n\n/**\n * Defines a matcher for requests based on URL, method, or both.\n *\n * @publicApi\n */\nexport interface RequestMatch {\n method?: string;\n url?: string;\n}\n\n/**\n * Controller to be injected into tests, that allows for mocking and flushing\n * of requests.\n *\n * @publicApi\n */\nexport abstract class HttpTestingController {\n /**\n * Search for requests that match the given parameter, without any expectations.\n */\n abstract match(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n ): TestRequest[];\n\n /**\n * Expect that a single request has been made which matches the given URL, and return its\n * mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(url: string, description?: string): TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given parameters, and return\n * its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(params: RequestMatch, description?: string): TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given predicate function, and\n * return its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(\n matchFn: (req: HttpRequest<any>) => boolean,\n description?: string,\n ): TestRequest;\n\n /**\n * Expect that a single request has been made which matches the given condition, and return\n * its mock.\n *\n * If no such request has been made, or more than one such request has been made, fail with an\n * error message including the given request description, if any.\n */\n abstract expectOne(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n description?: string,\n ): TestRequest;\n\n /**\n * Expect that no requests have been made which match the given URL.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(url: string, description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given parameters.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(params: RequestMatch, description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given predicate function.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(matchFn: (req: HttpRequest<any>) => boolean, description?: string): void;\n\n /**\n * Expect that no requests have been made which match the given condition.\n *\n * If a matching request has been made, fail with an error message including the given request\n * description, if any.\n */\n abstract expectNone(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n description?: string,\n ): void;\n\n /**\n * Verify that no unmatched requests are outstanding.\n *\n * If any requests are outstanding, fail with an error message indicating which requests were not\n * handled.\n *\n * If `ignoreCancelled` is not set (the default), `verify()` will also fail if cancelled requests\n * were not explicitly matched.\n */\n abstract verify(opts?: {ignoreCancelled?: boolean}): void;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n HttpErrorResponse,\n HttpEvent,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n HttpStatusCode,\n} from '@angular/common/http';\nimport {Observer} from 'rxjs';\n\n/**\n * Type that describes options that can be used to create an error\n * in `TestRequest`.\n */\ntype TestRequestErrorOptions = {\n headers?: HttpHeaders | {[name: string]: string | string[]};\n status?: number;\n statusText?: string;\n};\n\n/**\n * A mock requests that was received and is ready to be answered.\n *\n * This interface allows access to the underlying `HttpRequest`, and allows\n * responding with `HttpEvent`s or `HttpErrorResponse`s.\n *\n * @publicApi\n */\nexport class TestRequest {\n /**\n * Whether the request was cancelled after it was sent.\n */\n get cancelled(): boolean {\n return this._cancelled;\n }\n\n /**\n * @internal set by `HttpClientTestingBackend`\n */\n _cancelled = false;\n\n constructor(\n public request: HttpRequest<any>,\n private observer: Observer<HttpEvent<any>>,\n ) {}\n\n /**\n * Resolve the request by returning a body plus additional HTTP information (such as response\n * headers) if provided.\n * If the request specifies an expected body type, the body is converted into the requested type.\n * Otherwise, the body is converted to `JSON` by default.\n *\n * Both successful and unsuccessful responses can be delivered via `flush()`.\n */\n flush(\n body:\n | ArrayBuffer\n | Blob\n | boolean\n | string\n | number\n | Object\n | (boolean | string | number | Object | null)[]\n | null,\n opts: {\n headers?: HttpHeaders | {[name: string]: string | string[]};\n status?: number;\n statusText?: string;\n } = {},\n ): void {\n if (this.cancelled) {\n throw new Error(`Cannot flush a cancelled request.`);\n }\n const url = this.request.urlWithParams;\n const headers =\n opts.headers instanceof HttpHeaders ? opts.headers : new HttpHeaders(opts.headers);\n body = _maybeConvertBody(this.request.responseType, body);\n let statusText: string | undefined = opts.statusText;\n let status: number = opts.status !== undefined ? opts.status : HttpStatusCode.Ok;\n if (opts.status === undefined) {\n if (body === null) {\n status = HttpStatusCode.NoContent;\n statusText ||= 'No Content';\n } else {\n statusText ||= 'OK';\n }\n }\n if (statusText === undefined) {\n throw new Error('statusText is required when setting a custom status.');\n }\n if (status >= 200 && status < 300) {\n this.observer.next(new HttpResponse<any>({body, headers, status, statusText, url}));\n this.observer.complete();\n } else {\n this.observer.error(new HttpErrorResponse({error: body, headers, status, statusText, url}));\n }\n }\n\n /**\n * Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).\n * @deprecated Http requests never emit an `ErrorEvent`. Please specify a `ProgressEvent`.\n */\n error(error: ErrorEvent, opts?: TestRequestErrorOptions): void;\n /**\n * Resolve the request by returning an `ProgressEvent` (e.g. simulating a network failure).\n */\n error(error: ProgressEvent, opts?: TestRequestErrorOptions): void;\n error(error: ProgressEvent | ErrorEvent, opts: TestRequestErrorOptions = {}): void {\n if (this.cancelled) {\n throw new Error(`Cannot return an error for a cancelled request.`);\n }\n if (opts.status && opts.status >= 200 && opts.status < 300) {\n throw new Error(`error() called with a successful status.`);\n }\n const headers =\n opts.headers instanceof HttpHeaders ? opts.headers : new HttpHeaders(opts.headers);\n this.observer.error(\n new HttpErrorResponse({\n error,\n headers,\n status: opts.status || 0,\n statusText: opts.statusText || '',\n url: this.request.urlWithParams,\n }),\n );\n }\n\n /**\n * Deliver an arbitrary `HttpEvent` (such as a progress event) on the response stream for this\n * request.\n */\n event(event: HttpEvent<any>): void {\n if (this.cancelled) {\n throw new Error(`Cannot send events to a cancelled request.`);\n }\n this.observer.next(event);\n }\n}\n\n/**\n * Helper function to convert a response body to an ArrayBuffer.\n */\nfunction _toArrayBufferBody(\n body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[],\n): ArrayBuffer {\n if (typeof ArrayBuffer === 'undefined') {\n throw new Error('ArrayBuffer responses are not supported on this platform.');\n }\n if (body instanceof ArrayBuffer) {\n return body;\n }\n throw new Error('Automatic conversion to ArrayBuffer is not supported for response type.');\n}\n\n/**\n * Helper function to convert a response body to a Blob.\n */\nfunction _toBlob(\n body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[],\n): Blob {\n if (typeof Blob === 'undefined') {\n throw new Error('Blob responses are not supported on this platform.');\n }\n if (body instanceof Blob) {\n return body;\n }\n if (ArrayBuffer && body instanceof ArrayBuffer) {\n return new Blob([body]);\n }\n throw new Error('Automatic conversion to Blob is not supported for response type.');\n}\n\n/**\n * Helper function to convert a response body to JSON data.\n */\nfunction _toJsonBody(\n body:\n | ArrayBuffer\n | Blob\n | boolean\n | string\n | number\n | Object\n | (boolean | string | number | Object | null)[],\n format: string = 'JSON',\n): Object | string | number | (Object | string | number)[] {\n if (typeof ArrayBuffer !== 'undefined' && body instanceof ArrayBuffer) {\n throw new Error(`Automatic conversion to ${format} is not supported for ArrayBuffers.`);\n }\n if (typeof Blob !== 'undefined' && body instanceof Blob) {\n throw new Error(`Automatic conversion to ${format} is not supported for Blobs.`);\n }\n if (\n typeof body === 'string' ||\n typeof body === 'number' ||\n typeof body === 'object' ||\n typeof body === 'boolean' ||\n Array.isArray(body)\n ) {\n return body;\n }\n throw new Error(`Automatic conversion to ${format} is not supported for response type.`);\n}\n\n/**\n * Helper function to convert a response body to a string.\n */\nfunction _toTextBody(\n body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[],\n): string {\n if (typeof body === 'string') {\n return body;\n }\n if (typeof ArrayBuffer !== 'undefined' && body instanceof ArrayBuffer) {\n throw new Error('Automatic conversion to text is not supported for ArrayBuffers.');\n }\n if (typeof Blob !== 'undefined' && body instanceof Blob) {\n throw new Error('Automatic conversion to text is not supported for Blobs.');\n }\n return JSON.stringify(_toJsonBody(body, 'text'));\n}\n\n/**\n * Convert a response body to the requested type.\n */\nfunction _maybeConvertBody(\n responseType: string,\n body: ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[] | null,\n): ArrayBuffer | Blob | string | number | Object | (string | number | Object | null)[] | null {\n if (body === null) {\n return null;\n }\n switch (responseType) {\n case 'arraybuffer':\n return _toArrayBufferBody(body);\n case 'blob':\n return _toBlob(body);\n case 'json':\n return _toJsonBody(body);\n case 'text':\n return _toTextBody(body);\n default:\n throw new Error(`Unsupported responseType: ${responseType}`);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpBackend, HttpEvent, HttpEventType, HttpRequest} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {Observable, Observer} from 'rxjs';\n\nimport {HttpTestingController, RequestMatch} from './api';\nimport {TestRequest} from './request';\n\n/**\n * A testing backend for `HttpClient` which both acts as an `HttpBackend`\n * and as the `HttpTestingController`.\n *\n * `HttpClientTestingBackend` works by keeping a list of all open requests.\n * As requests come in, they're added to the list. Users can assert that specific\n * requests were made and then flush them. In the end, a verify() method asserts\n * that no unexpected requests were made.\n *\n *\n */\n@Injectable()\nexport class HttpClientTestingBackend implements HttpBackend, HttpTestingController {\n /**\n * List of pending requests which have not yet been expected.\n */\n private open: TestRequest[] = [];\n\n /**\n * Handle an incoming request by queueing it in the list of open requests.\n */\n handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {\n return new Observable((observer: Observer<any>) => {\n const testReq = new TestRequest(req, observer);\n this.open.push(testReq);\n observer.next({type: HttpEventType.Sent} as HttpEvent<any>);\n return () => {\n testReq._cancelled = true;\n };\n });\n }\n\n /**\n * Helper function to search for requests in the list of open requests.\n */\n private _match(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n ): TestRequest[] {\n if (typeof match === 'string') {\n return this.open.filter((testReq) => testReq.request.urlWithParams === match);\n } else if (typeof match === 'function') {\n return this.open.filter((testReq) => match(testReq.request));\n } else {\n return this.open.filter(\n (testReq) =>\n (!match.method || testReq.request.method === match.method.toUpperCase()) &&\n (!match.url || testReq.request.urlWithParams === match.url),\n );\n }\n }\n\n /**\n * Search for requests in the list of open requests, and return all that match\n * without asserting anything about the number of matches.\n */\n match(match: string | RequestMatch | ((req: HttpRequest<any>) => boolean)): TestRequest[] {\n const results = this._match(match);\n results.forEach((result) => {\n const index = this.open.indexOf(result);\n if (index !== -1) {\n this.open.splice(index, 1);\n }\n });\n return results;\n }\n\n /**\n * Expect that a single outstanding request matches the given matcher, and return\n * it.\n *\n * Requests returned through this API will no longer be in the list of open requests,\n * and thus will not match twice.\n */\n expectOne(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n description?: string,\n ): TestRequest {\n description ||= this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 1) {\n throw new Error(\n `Expected one matching request for criteria \"${description}\", found ${matches.length} requests.`,\n );\n }\n if (matches.length === 0) {\n let message = `Expected one matching request for criteria \"${description}\", found none.`;\n if (this.open.length > 0) {\n // Show the methods and URLs of open requests in the error, for convenience.\n const requests = this.open.map(describeRequest).join(', ');\n message += ` Requests received are: ${requests}.`;\n }\n throw new Error(message);\n }\n return matches[0];\n }\n\n /**\n * Expect that no outstanding requests match the given matcher, and throw an error\n * if any do.\n */\n expectNone(\n match: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n description?: string,\n ): void {\n description ||= this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 0) {\n throw new Error(\n `Expected zero matching requests for criteria \"${description}\", found ${matches.length}.`,\n );\n }\n }\n\n /**\n * Validate that there are no outstanding requests.\n */\n verify(opts: {ignoreCancelled?: boolean} = {}): void {\n let open = this.open;\n // It's possible that some requests may be cancelled, and this is expected.\n // The user can ask to ignore open requests which have been cancelled.\n if (opts.ignoreCancelled) {\n open = open.filter((testReq) => !testReq.cancelled);\n }\n if (open.length > 0) {\n // Show the methods and URLs of open requests in the error, for convenience.\n const requests = open.map(describeRequest).join(', ');\n throw new Error(`Expected no open requests, found ${open.length}: ${requests}`);\n }\n }\n\n private descriptionFromMatcher(\n matcher: string | RequestMatch | ((req: HttpRequest<any>) => boolean),\n ): string {\n if (typeof matcher === 'string') {\n return `Match URL: ${matcher}`;\n } else if (typeof matcher === 'object') {\n const method = matcher.method || '(any)';\n const url = matcher.url || '(any)';\n return `Match method: ${method}, URL: ${url}`;\n } else {\n return `Match by function: ${matcher.name}`;\n }\n }\n}\n\nfunction describeRequest(testRequest: TestRequest): string {\n const url = testRequest.request.urlWithParams;\n const method = testRequest.request.method;\n return `${method} ${url}`;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpBackend, ɵREQUESTS_CONTRIBUTE_TO_STABILITY} from '@angular/common/http';\nimport {Provider} from '@angular/core';\n\nimport {HttpTestingController} from './api';\nimport {HttpClientTestingBackend} from './backend';\n\nexport function provideHttpClientTesting(): Provider[] {\n return [\n HttpClientTestingBackend,\n {provide: HttpBackend, useExisting: HttpClientTestingBackend},\n {provide: HttpTestingController, useExisting: HttpClientTestingBackend},\n {provide: ɵREQUESTS_CONTRIBUTE_TO_STABILITY, useValue: false},\n ];\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\n\nimport {provideHttpClientTesting} from './provider';\n\n/**\n * Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.\n *\n * Inject `HttpTestingController` to expect and flush requests in your tests.\n *\n * @publicApi\n *\n * @deprecated Add `provideHttpClientTesting()` to your providers instead.\n */\n@NgModule({\n imports: [HttpClientModule],\n providers: [provideHttpClientTesting()],\n})\nexport class HttpClientTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAsBA;;;;;AAKG;MACmB,qBAAqB,CAAA;AA+F1C;;AC/FD;;;;;;;AAOG;MACU,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ponseBase {
|
|
|
970
970
|
* The single parameter accepted is an initialization hash. Any properties
|
|
971
971
|
* of the response passed there will override the default values.
|
|
972
972
|
*/
|
|
973
|
-
constructor(init, defaultStatus =
|
|
973
|
+
constructor(init, defaultStatus = 200, defaultStatusText = 'OK') {
|
|
974
974
|
// If the hash has values passed, use them to initialize the response.
|
|
975
975
|
// Otherwise use the default values.
|
|
976
976
|
this.headers = init.headers || new HttpHeaders();
|
|
@@ -1075,6 +1075,12 @@ class HttpErrorResponse extends HttpResponseBase {
|
|
|
1075
1075
|
this.error = init.error || null;
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
|
+
/**
|
|
1079
|
+
* We use these constant to prevent pulling the whole HttpStatusCode enum
|
|
1080
|
+
* Those are the only ones referenced directly by the framework
|
|
1081
|
+
*/
|
|
1082
|
+
const HTTP_STATUS_CODE_OK = 200;
|
|
1083
|
+
const HTTP_STATUS_CODE_NO_CONTENT = 204;
|
|
1078
1084
|
/**
|
|
1079
1085
|
* Http status codes.
|
|
1080
1086
|
* As per https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
|
|
@@ -1448,10 +1454,10 @@ class HttpClient {
|
|
|
1448
1454
|
put(url, body, options = {}) {
|
|
1449
1455
|
return this.request('PUT', url, addBody(options, body));
|
|
1450
1456
|
}
|
|
1451
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
1452
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
1457
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1458
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClient }); }
|
|
1453
1459
|
}
|
|
1454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
1460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClient, decorators: [{
|
|
1455
1461
|
type: Injectable
|
|
1456
1462
|
}], ctorParameters: () => [{ type: HttpHandler }] });
|
|
1457
1463
|
|
|
@@ -1582,7 +1588,7 @@ class FetchBackend {
|
|
|
1582
1588
|
}
|
|
1583
1589
|
// Same behavior as the XhrBackend
|
|
1584
1590
|
if (status === 0) {
|
|
1585
|
-
status = body ?
|
|
1591
|
+
status = body ? HTTP_STATUS_CODE_OK : 0;
|
|
1586
1592
|
}
|
|
1587
1593
|
// ok determines whether the response will be transmitted on the event or
|
|
1588
1594
|
// error channel. Unsuccessful status codes (not 2xx) will always be errors,
|
|
@@ -1657,10 +1663,10 @@ class FetchBackend {
|
|
|
1657
1663
|
}
|
|
1658
1664
|
return chunksAll;
|
|
1659
1665
|
}
|
|
1660
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
1661
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
1666
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1667
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: FetchBackend }); }
|
|
1662
1668
|
}
|
|
1663
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
1669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: FetchBackend, decorators: [{
|
|
1664
1670
|
type: Injectable
|
|
1665
1671
|
}] });
|
|
1666
1672
|
/**
|
|
@@ -1805,10 +1811,10 @@ class HttpInterceptorHandler extends HttpHandler {
|
|
|
1805
1811
|
return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
|
|
1806
1812
|
}
|
|
1807
1813
|
}
|
|
1808
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
1809
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
1814
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1815
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpInterceptorHandler }); }
|
|
1810
1816
|
}
|
|
1811
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
1817
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
|
|
1812
1818
|
type: Injectable
|
|
1813
1819
|
}], ctorParameters: () => [{ type: HttpBackend }, { type: i0.EnvironmentInjector }] });
|
|
1814
1820
|
|
|
@@ -1963,7 +1969,7 @@ class JsonpClientBackend {
|
|
|
1963
1969
|
// returned.
|
|
1964
1970
|
observer.next(new HttpResponse({
|
|
1965
1971
|
body,
|
|
1966
|
-
status:
|
|
1972
|
+
status: HTTP_STATUS_CODE_OK,
|
|
1967
1973
|
statusText: 'OK',
|
|
1968
1974
|
url,
|
|
1969
1975
|
}));
|
|
@@ -2008,10 +2014,10 @@ class JsonpClientBackend {
|
|
|
2008
2014
|
foreignDocument ??= this.document.implementation.createHTMLDocument();
|
|
2009
2015
|
foreignDocument.adoptNode(script);
|
|
2010
2016
|
}
|
|
2011
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
2012
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
2017
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2018
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpClientBackend }); }
|
|
2013
2019
|
}
|
|
2014
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
2020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpClientBackend, decorators: [{
|
|
2015
2021
|
type: Injectable
|
|
2016
2022
|
}], ctorParameters: () => [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
|
|
2017
2023
|
type: Inject,
|
|
@@ -2049,10 +2055,10 @@ class JsonpInterceptor {
|
|
|
2049
2055
|
intercept(initialRequest, next) {
|
|
2050
2056
|
return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
|
|
2051
2057
|
}
|
|
2052
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
2053
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
2058
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2059
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpInterceptor }); }
|
|
2054
2060
|
}
|
|
2055
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
2061
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: JsonpInterceptor, decorators: [{
|
|
2056
2062
|
type: Injectable
|
|
2057
2063
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
2058
2064
|
|
|
@@ -2167,13 +2173,13 @@ class HttpXhrBackend {
|
|
|
2167
2173
|
let { headers, status, statusText, url } = partialFromXhr();
|
|
2168
2174
|
// The body will be read out if present.
|
|
2169
2175
|
let body = null;
|
|
2170
|
-
if (status !==
|
|
2176
|
+
if (status !== HTTP_STATUS_CODE_NO_CONTENT) {
|
|
2171
2177
|
// Use XMLHttpRequest.response if set, responseText otherwise.
|
|
2172
2178
|
body = typeof xhr.response === 'undefined' ? xhr.responseText : xhr.response;
|
|
2173
2179
|
}
|
|
2174
2180
|
// Normalize another potential bug (this one comes from CORS).
|
|
2175
2181
|
if (status === 0) {
|
|
2176
|
-
status = !!body ?
|
|
2182
|
+
status = !!body ? HTTP_STATUS_CODE_OK : 0;
|
|
2177
2183
|
}
|
|
2178
2184
|
// ok determines whether the response will be transmitted on the event or
|
|
2179
2185
|
// error channel. Unsuccessful status codes (not 2xx) will always be errors,
|
|
@@ -2332,10 +2338,10 @@ class HttpXhrBackend {
|
|
|
2332
2338
|
});
|
|
2333
2339
|
}));
|
|
2334
2340
|
}
|
|
2335
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
2336
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
2341
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2342
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXhrBackend }); }
|
|
2337
2343
|
}
|
|
2338
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
2344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXhrBackend, decorators: [{
|
|
2339
2345
|
type: Injectable
|
|
2340
2346
|
}], ctorParameters: () => [{ type: i1.XhrFactory }] });
|
|
2341
2347
|
|
|
@@ -2384,10 +2390,10 @@ class HttpXsrfCookieExtractor {
|
|
|
2384
2390
|
}
|
|
2385
2391
|
return this.lastToken;
|
|
2386
2392
|
}
|
|
2387
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
2388
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
2393
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2394
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor }); }
|
|
2389
2395
|
}
|
|
2390
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
2396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
|
|
2391
2397
|
type: Injectable
|
|
2392
2398
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2393
2399
|
type: Inject,
|
|
@@ -2430,10 +2436,10 @@ class HttpXsrfInterceptor {
|
|
|
2430
2436
|
intercept(initialRequest, next) {
|
|
2431
2437
|
return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
|
|
2432
2438
|
}
|
|
2433
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
2434
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-
|
|
2439
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2440
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor }); }
|
|
2435
2441
|
}
|
|
2436
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
2442
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
|
|
2437
2443
|
type: Injectable
|
|
2438
2444
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
2439
2445
|
|
|
@@ -2676,6 +2682,8 @@ function withFetch() {
|
|
|
2676
2682
|
* and the default header name is `X-XSRF-TOKEN`.
|
|
2677
2683
|
*
|
|
2678
2684
|
* @publicApi
|
|
2685
|
+
* @deprecated Use withXsrfConfiguration({cookieName: 'XSRF-TOKEN', headerName: 'X-XSRF-TOKEN'}) as
|
|
2686
|
+
* providers instead or `withNoXsrfProtection` if you want to disabled XSRF protection.
|
|
2679
2687
|
*/
|
|
2680
2688
|
class HttpClientXsrfModule {
|
|
2681
2689
|
/**
|
|
@@ -2701,9 +2709,9 @@ class HttpClientXsrfModule {
|
|
|
2701
2709
|
providers: withXsrfConfiguration(options).ɵproviders,
|
|
2702
2710
|
};
|
|
2703
2711
|
}
|
|
2704
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
2705
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-
|
|
2706
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-
|
|
2712
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2713
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientXsrfModule }); }
|
|
2714
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, providers: [
|
|
2707
2715
|
HttpXsrfInterceptor,
|
|
2708
2716
|
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
|
|
2709
2717
|
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
|
|
@@ -2714,7 +2722,7 @@ class HttpClientXsrfModule {
|
|
|
2714
2722
|
{ provide: XSRF_ENABLED, useValue: true },
|
|
2715
2723
|
] }); }
|
|
2716
2724
|
}
|
|
2717
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
2725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
|
|
2718
2726
|
type: NgModule,
|
|
2719
2727
|
args: [{
|
|
2720
2728
|
providers: [
|
|
@@ -2737,13 +2745,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.5",
|
|
|
2737
2745
|
* multiprovider for built-in DI token `HTTP_INTERCEPTORS`.
|
|
2738
2746
|
*
|
|
2739
2747
|
* @publicApi
|
|
2748
|
+
* @deprecated use `provideHttpClient(withInterceptorsFromDi())` as providers instead
|
|
2740
2749
|
*/
|
|
2741
2750
|
class HttpClientModule {
|
|
2742
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
2743
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-
|
|
2744
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-
|
|
2751
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2752
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientModule }); }
|
|
2753
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] }); }
|
|
2745
2754
|
}
|
|
2746
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
2755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientModule, decorators: [{
|
|
2747
2756
|
type: NgModule,
|
|
2748
2757
|
args: [{
|
|
2749
2758
|
/**
|
|
@@ -2760,19 +2769,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.5",
|
|
|
2760
2769
|
* with method JSONP, where they are rejected.
|
|
2761
2770
|
*
|
|
2762
2771
|
* @publicApi
|
|
2772
|
+
* @deprecated `withJsonpSupport()` as providers instead
|
|
2763
2773
|
*/
|
|
2764
2774
|
class HttpClientJsonpModule {
|
|
2765
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-
|
|
2766
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-
|
|
2767
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-
|
|
2775
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2776
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientJsonpModule }); }
|
|
2777
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] }); }
|
|
2768
2778
|
}
|
|
2769
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-
|
|
2779
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-rc.0", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
|
|
2770
2780
|
type: NgModule,
|
|
2771
2781
|
args: [{
|
|
2772
2782
|
providers: [withJsonpSupport().ɵproviders],
|
|
2773
2783
|
}]
|
|
2774
2784
|
}] });
|
|
2775
2785
|
|
|
2786
|
+
/**
|
|
2787
|
+
* If your application uses different HTTP origins to make API calls (via `HttpClient`) on the server and
|
|
2788
|
+
* on the client, the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token allows you to establish a mapping
|
|
2789
|
+
* between those origins, so that `HttpTransferCache` feature can recognize those requests as the same
|
|
2790
|
+
* ones and reuse the data cached on the server during hydration on the client.
|
|
2791
|
+
*
|
|
2792
|
+
* **Important note**: the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token should *only* be provided in
|
|
2793
|
+
* the *server* code of your application (typically in the `app.server.config.ts` script). Angular throws an
|
|
2794
|
+
* error if it detects that the token is defined while running on the client.
|
|
2795
|
+
*
|
|
2796
|
+
* @usageNotes
|
|
2797
|
+
*
|
|
2798
|
+
* When the same API endpoint is accessed via `http://internal-domain.com:8080` on the server and
|
|
2799
|
+
* via `https://external-domain.com` on the client, you can use the following configuration:
|
|
2800
|
+
* ```typescript
|
|
2801
|
+
* // in app.server.config.ts
|
|
2802
|
+
* {
|
|
2803
|
+
* provide: HTTP_TRANSFER_CACHE_ORIGIN_MAP,
|
|
2804
|
+
* useValue: {
|
|
2805
|
+
* 'http://internal-domain.com:8080': 'https://external-domain.com'
|
|
2806
|
+
* }
|
|
2807
|
+
* }
|
|
2808
|
+
* ```
|
|
2809
|
+
*
|
|
2810
|
+
* @publicApi
|
|
2811
|
+
*/
|
|
2812
|
+
const HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken(ngDevMode ? 'HTTP_TRANSFER_CACHE_ORIGIN_MAP' : '');
|
|
2776
2813
|
/**
|
|
2777
2814
|
* Keys within cached response data structure.
|
|
2778
2815
|
*/
|
|
@@ -2780,7 +2817,7 @@ const BODY = 'b';
|
|
|
2780
2817
|
const HEADERS = 'h';
|
|
2781
2818
|
const STATUS = 's';
|
|
2782
2819
|
const STATUS_TEXT = 'st';
|
|
2783
|
-
const
|
|
2820
|
+
const REQ_URL = 'u';
|
|
2784
2821
|
const RESPONSE_TYPE = 'rt';
|
|
2785
2822
|
const CACHE_OPTIONS = new InjectionToken(ngDevMode ? 'HTTP_TRANSFER_STATE_CACHE_OPTIONS' : '');
|
|
2786
2823
|
/**
|
|
@@ -2792,15 +2829,28 @@ function transferCacheInterceptorFn(req, next) {
|
|
|
2792
2829
|
const { transferCache: requestOptions, method: requestMethod } = req;
|
|
2793
2830
|
// In the following situations we do not want to cache the request
|
|
2794
2831
|
if (!isCacheActive ||
|
|
2832
|
+
requestOptions === false ||
|
|
2795
2833
|
// POST requests are allowed either globally or at request level
|
|
2796
2834
|
(requestMethod === 'POST' && !globalOptions.includePostRequests && !requestOptions) ||
|
|
2797
2835
|
(requestMethod !== 'POST' && !ALLOWED_METHODS.includes(requestMethod)) ||
|
|
2798
|
-
|
|
2836
|
+
// Do not cache request that require authorization when includeRequestsWithAuthHeaders is falsey
|
|
2837
|
+
(!globalOptions.includeRequestsWithAuthHeaders && hasAuthHeaders(req)) ||
|
|
2799
2838
|
globalOptions.filter?.(req) === false) {
|
|
2800
2839
|
return next(req);
|
|
2801
2840
|
}
|
|
2802
2841
|
const transferState = inject(TransferState);
|
|
2803
|
-
const
|
|
2842
|
+
const originMap = inject(HTTP_TRANSFER_CACHE_ORIGIN_MAP, {
|
|
2843
|
+
optional: true,
|
|
2844
|
+
});
|
|
2845
|
+
const isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
2846
|
+
if (originMap && !isServer) {
|
|
2847
|
+
throw new ɵRuntimeError(2803 /* RuntimeErrorCode.HTTP_ORIGIN_MAP_USED_IN_CLIENT */, ngDevMode &&
|
|
2848
|
+
'Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and ' +
|
|
2849
|
+
'present in the client side code. Please ensure that this token is only provided in the ' +
|
|
2850
|
+
'server code of the application.');
|
|
2851
|
+
}
|
|
2852
|
+
const requestUrl = isServer && originMap ? mapRequestOriginUrl(req.url, originMap) : req.url;
|
|
2853
|
+
const storeKey = makeCacheKey(req, requestUrl);
|
|
2804
2854
|
const response = transferState.get(storeKey, null);
|
|
2805
2855
|
let headersToInclude = globalOptions.includeHeaders;
|
|
2806
2856
|
if (typeof requestOptions === 'object' && requestOptions.includeHeaders) {
|
|
@@ -2808,7 +2858,7 @@ function transferCacheInterceptorFn(req, next) {
|
|
|
2808
2858
|
headersToInclude = requestOptions.includeHeaders;
|
|
2809
2859
|
}
|
|
2810
2860
|
if (response) {
|
|
2811
|
-
const { [BODY]: undecodedBody, [RESPONSE_TYPE]: responseType, [HEADERS]: httpHeaders, [STATUS]: status, [STATUS_TEXT]: statusText, [
|
|
2861
|
+
const { [BODY]: undecodedBody, [RESPONSE_TYPE]: responseType, [HEADERS]: httpHeaders, [STATUS]: status, [STATUS_TEXT]: statusText, [REQ_URL]: url, } = response;
|
|
2812
2862
|
// Request found in cache. Respond using it.
|
|
2813
2863
|
let body = undecodedBody;
|
|
2814
2864
|
switch (responseType) {
|
|
@@ -2837,7 +2887,6 @@ function transferCacheInterceptorFn(req, next) {
|
|
|
2837
2887
|
url,
|
|
2838
2888
|
}));
|
|
2839
2889
|
}
|
|
2840
|
-
const isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
2841
2890
|
// Request not found in cache. Make the request and cache it if on the server.
|
|
2842
2891
|
return next(req).pipe(tap((event) => {
|
|
2843
2892
|
if (event instanceof HttpResponse && isServer) {
|
|
@@ -2846,12 +2895,16 @@ function transferCacheInterceptorFn(req, next) {
|
|
|
2846
2895
|
[HEADERS]: getFilteredHeaders(event.headers, headersToInclude),
|
|
2847
2896
|
[STATUS]: event.status,
|
|
2848
2897
|
[STATUS_TEXT]: event.statusText,
|
|
2849
|
-
[
|
|
2898
|
+
[REQ_URL]: requestUrl,
|
|
2850
2899
|
[RESPONSE_TYPE]: req.responseType,
|
|
2851
2900
|
});
|
|
2852
2901
|
}
|
|
2853
2902
|
}));
|
|
2854
2903
|
}
|
|
2904
|
+
/** @returns true when the requests contains autorization related headers. */
|
|
2905
|
+
function hasAuthHeaders(req) {
|
|
2906
|
+
return req.headers.has('authorization') || req.headers.has('proxy-authorization');
|
|
2907
|
+
}
|
|
2855
2908
|
function getFilteredHeaders(headers, includeHeaders) {
|
|
2856
2909
|
if (!includeHeaders) {
|
|
2857
2910
|
return {};
|
|
@@ -2871,9 +2924,9 @@ function sortAndConcatParams(params) {
|
|
|
2871
2924
|
.map((k) => `${k}=${params.getAll(k)}`)
|
|
2872
2925
|
.join('&');
|
|
2873
2926
|
}
|
|
2874
|
-
function makeCacheKey(request) {
|
|
2927
|
+
function makeCacheKey(request, mappedRequestUrl) {
|
|
2875
2928
|
// make the params encoded same as a url so it's easy to identify
|
|
2876
|
-
const { params, method, responseType
|
|
2929
|
+
const { params, method, responseType } = request;
|
|
2877
2930
|
const encodedParams = sortAndConcatParams(params);
|
|
2878
2931
|
let serializedBody = request.serializeBody();
|
|
2879
2932
|
if (serializedBody instanceof URLSearchParams) {
|
|
@@ -2882,7 +2935,7 @@ function makeCacheKey(request) {
|
|
|
2882
2935
|
else if (typeof serializedBody !== 'string') {
|
|
2883
2936
|
serializedBody = '';
|
|
2884
2937
|
}
|
|
2885
|
-
const key = [method, responseType,
|
|
2938
|
+
const key = [method, responseType, mappedRequestUrl, serializedBody, encodedParams].join('|');
|
|
2886
2939
|
const hash = generateHash(key);
|
|
2887
2940
|
return makeStateKey(hash);
|
|
2888
2941
|
}
|
|
@@ -2977,6 +3030,24 @@ function appendMissingHeadersDetection(url, headers, headersToInclude) {
|
|
|
2977
3030
|
},
|
|
2978
3031
|
});
|
|
2979
3032
|
}
|
|
3033
|
+
function mapRequestOriginUrl(url, originMap) {
|
|
3034
|
+
const origin = new URL(url, 'resolve://').origin;
|
|
3035
|
+
const mappedOrigin = originMap[origin];
|
|
3036
|
+
if (!mappedOrigin) {
|
|
3037
|
+
return url;
|
|
3038
|
+
}
|
|
3039
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
3040
|
+
verifyMappedOrigin(mappedOrigin);
|
|
3041
|
+
}
|
|
3042
|
+
return url.replace(origin, mappedOrigin);
|
|
3043
|
+
}
|
|
3044
|
+
function verifyMappedOrigin(url) {
|
|
3045
|
+
if (new URL(url, 'resolve://').pathname !== '/') {
|
|
3046
|
+
throw new ɵRuntimeError(2804 /* RuntimeErrorCode.HTTP_ORIGIN_MAP_CONTAINS_PATH */, 'Angular detected a URL with a path segment in the value provided for the ' +
|
|
3047
|
+
`\`HTTP_TRANSFER_CACHE_ORIGIN_MAP\` token: ${url}. The map should only contain origins ` +
|
|
3048
|
+
'without any other segments.');
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
2980
3051
|
|
|
2981
3052
|
// This file is not used to build this module. It is only used during editing
|
|
2982
3053
|
|
|
@@ -2984,5 +3055,5 @@ function appendMissingHeadersDetection(url, headers, headersToInclude) {
|
|
|
2984
3055
|
* Generated bundle index. Do not edit.
|
|
2985
3056
|
*/
|
|
2986
3057
|
|
|
2987
|
-
export { FetchBackend, HTTP_INTERCEPTORS, HttpBackend, HttpClient, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpErrorResponse, HttpEventType, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpStatusCode, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, provideHttpClient, withFetch, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HTTP_ROOT_INTERCEPTOR_FNS as ɵHTTP_ROOT_INTERCEPTOR_FNS, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler, PRIMARY_HTTP_BACKEND as ɵPRIMARY_HTTP_BACKEND, REQUESTS_CONTRIBUTE_TO_STABILITY as ɵREQUESTS_CONTRIBUTE_TO_STABILITY, withHttpTransferCache as ɵwithHttpTransferCache };
|
|
3058
|
+
export { FetchBackend, HTTP_INTERCEPTORS, HTTP_TRANSFER_CACHE_ORIGIN_MAP, HttpBackend, HttpClient, HttpClientJsonpModule, HttpClientModule, HttpClientXsrfModule, HttpContext, HttpContextToken, HttpErrorResponse, HttpEventType, HttpFeatureKind, HttpHandler, HttpHeaderResponse, HttpHeaders, HttpParams, HttpRequest, HttpResponse, HttpResponseBase, HttpStatusCode, HttpUrlEncodingCodec, HttpXhrBackend, HttpXsrfTokenExtractor, JsonpClientBackend, JsonpInterceptor, provideHttpClient, withFetch, withInterceptors, withInterceptorsFromDi, withJsonpSupport, withNoXsrfProtection, withRequestsMadeViaParent, withXsrfConfiguration, HTTP_ROOT_INTERCEPTOR_FNS as ɵHTTP_ROOT_INTERCEPTOR_FNS, HttpInterceptorHandler as ɵHttpInterceptingHandler, HttpInterceptorHandler as ɵHttpInterceptorHandler, PRIMARY_HTTP_BACKEND as ɵPRIMARY_HTTP_BACKEND, REQUESTS_CONTRIBUTE_TO_STABILITY as ɵREQUESTS_CONTRIBUTE_TO_STABILITY, withHttpTransferCache as ɵwithHttpTransferCache };
|
|
2988
3059
|
//# sourceMappingURL=http.mjs.map
|