@angular/common 14.0.0-next.0 → 14.0.0-next.11

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.
Files changed (66) hide show
  1. package/common.d.ts +34 -12
  2. package/esm2020/http/src/client.mjs +3 -3
  3. package/esm2020/http/src/interceptor.mjs +3 -3
  4. package/esm2020/http/src/jsonp.mjs +32 -27
  5. package/esm2020/http/src/module.mjs +15 -15
  6. package/esm2020/http/src/xhr.mjs +5 -7
  7. package/esm2020/http/src/xsrf.mjs +6 -6
  8. package/esm2020/http/testing/src/backend.mjs +11 -17
  9. package/esm2020/http/testing/src/module.mjs +4 -4
  10. package/esm2020/src/common_module.mjs +5 -11
  11. package/esm2020/src/directives/ng_class.mjs +3 -3
  12. package/esm2020/src/directives/ng_component_outlet.mjs +38 -22
  13. package/esm2020/src/directives/ng_for_of.mjs +5 -4
  14. package/esm2020/src/directives/ng_if.mjs +3 -3
  15. package/esm2020/src/directives/ng_plural.mjs +6 -6
  16. package/esm2020/src/directives/ng_style.mjs +3 -3
  17. package/esm2020/src/directives/ng_switch.mjs +11 -10
  18. package/esm2020/src/directives/ng_template_outlet.mjs +17 -8
  19. package/esm2020/src/dom_adapter.mjs +1 -1
  20. package/esm2020/src/i18n/format_date.mjs +7 -7
  21. package/esm2020/src/i18n/format_number.mjs +4 -4
  22. package/esm2020/src/i18n/localization.mjs +14 -4
  23. package/esm2020/src/location/hash_location_strategy.mjs +5 -4
  24. package/esm2020/src/location/location.mjs +20 -4
  25. package/esm2020/src/location/location_strategy.mjs +8 -7
  26. package/esm2020/src/location/platform_location.mjs +6 -6
  27. package/esm2020/src/pipes/async_pipe.mjs +3 -3
  28. package/esm2020/src/pipes/case_conversion_pipes.mjs +11 -11
  29. package/esm2020/src/pipes/date_pipe.mjs +4 -4
  30. package/esm2020/src/pipes/i18n_plural_pipe.mjs +3 -3
  31. package/esm2020/src/pipes/i18n_select_pipe.mjs +3 -3
  32. package/esm2020/src/pipes/json_pipe.mjs +3 -3
  33. package/esm2020/src/pipes/keyvalue_pipe.mjs +3 -3
  34. package/esm2020/src/pipes/number_pipe.mjs +10 -10
  35. package/esm2020/src/pipes/slice_pipe.mjs +3 -3
  36. package/esm2020/src/version.mjs +1 -1
  37. package/esm2020/testing/src/location_mock.mjs +18 -4
  38. package/esm2020/testing/src/mock_location_strategy.mjs +3 -3
  39. package/esm2020/testing/src/mock_platform_location.mjs +3 -3
  40. package/esm2020/upgrade/src/location_shim.mjs +3 -3
  41. package/esm2020/upgrade/src/location_upgrade_module.mjs +4 -4
  42. package/fesm2015/common.mjs +188 -136
  43. package/fesm2015/common.mjs.map +1 -1
  44. package/fesm2015/http/testing.mjs +15 -21
  45. package/fesm2015/http/testing.mjs.map +1 -1
  46. package/fesm2015/http.mjs +63 -60
  47. package/fesm2015/http.mjs.map +1 -1
  48. package/fesm2015/testing.mjs +26 -10
  49. package/fesm2015/testing.mjs.map +1 -1
  50. package/fesm2015/upgrade.mjs +7 -7
  51. package/fesm2015/upgrade.mjs.map +1 -1
  52. package/fesm2020/common.mjs +186 -136
  53. package/fesm2020/common.mjs.map +1 -1
  54. package/fesm2020/http/testing.mjs +15 -21
  55. package/fesm2020/http/testing.mjs.map +1 -1
  56. package/fesm2020/http.mjs +63 -60
  57. package/fesm2020/http.mjs.map +1 -1
  58. package/fesm2020/testing.mjs +24 -10
  59. package/fesm2020/testing.mjs.map +1 -1
  60. package/fesm2020/upgrade.mjs +7 -7
  61. package/fesm2020/upgrade.mjs.map +1 -1
  62. package/http/http.d.ts +2 -1
  63. package/http/testing/testing.d.ts +1 -1
  64. package/package.json +3 -3
  65. package/testing/testing.d.ts +3 -2
  66. package/upgrade/upgrade.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.0
2
+ * @license Angular v14.0.0-next.11
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -282,13 +282,7 @@ class HttpClientTestingBackend {
282
282
  let message = `Expected one matching request for criteria "${description}", found none.`;
283
283
  if (this.open.length > 0) {
284
284
  // Show the methods and URLs of open requests in the error, for convenience.
285
- const requests = this.open
286
- .map(testReq => {
287
- const url = testReq.request.urlWithParams;
288
- const method = testReq.request.method;
289
- return `${method} ${url}`;
290
- })
291
- .join(', ');
285
+ const requests = this.open.map(describeRequest).join(', ');
292
286
  message += ` Requests received are: ${requests}.`;
293
287
  }
294
288
  throw new Error(message);
@@ -318,12 +312,7 @@ class HttpClientTestingBackend {
318
312
  }
319
313
  if (open.length > 0) {
320
314
  // Show the methods and URLs of open requests in the error, for convenience.
321
- const requests = open.map(testReq => {
322
- const url = testReq.request.urlWithParams.split('?')[0];
323
- const method = testReq.request.method;
324
- return `${method} ${url}`;
325
- })
326
- .join(', ');
315
+ const requests = open.map(describeRequest).join(', ');
327
316
  throw new Error(`Expected no open requests, found ${open.length}: ${requests}`);
328
317
  }
329
318
  }
@@ -341,11 +330,16 @@ class HttpClientTestingBackend {
341
330
  }
342
331
  }
343
332
  }
344
- HttpClientTestingBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
345
- HttpClientTestingBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientTestingBackend });
346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
333
+ HttpClientTestingBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientTestingBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
334
+ HttpClientTestingBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientTestingBackend });
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientTestingBackend, decorators: [{
347
336
  type: Injectable
348
337
  }] });
338
+ function describeRequest(testRequest) {
339
+ const url = testRequest.request.urlWithParams;
340
+ const method = testRequest.request.method;
341
+ return `${method} ${url}`;
342
+ }
349
343
 
350
344
  /**
351
345
  * @license
@@ -363,16 +357,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0",
363
357
  */
364
358
  class HttpClientTestingModule {
365
359
  }
366
- HttpClientTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
367
- HttpClientTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] });
368
- HttpClientTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientTestingModule, providers: [
360
+ HttpClientTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
361
+ HttpClientTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientTestingModule, imports: [HttpClientModule] });
362
+ HttpClientTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientTestingModule, providers: [
369
363
  HttpClientTestingBackend,
370
364
  { provide: HttpBackend, useExisting: HttpClientTestingBackend },
371
365
  { provide: HttpTestingController, useExisting: HttpClientTestingBackend },
372
366
  ], imports: [[
373
367
  HttpClientModule,
374
368
  ]] });
375
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientTestingModule, decorators: [{
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientTestingModule, decorators: [{
376
370
  type: NgModule,
377
371
  args: [{
378
372
  imports: [
@@ -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/module.ts","../../../../../../../packages/common/http/testing/public_api.ts","../../../../../../../packages/common/http/testing/index.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(match: string|RequestMatch|((req: HttpRequest<any>) => boolean)): 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(matchFn: ((req: HttpRequest<any>) => boolean), 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): 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), description?: string): 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 {HttpErrorResponse, HttpEvent, HttpHeaders, HttpRequest, HttpResponse, HttpStatusCode} 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(public request: HttpRequest<any>, private observer: Observer<HttpEvent<any>>) {}\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: ArrayBuffer|Blob|boolean|string|number|Object|(boolean|string|number|Object|null)[]|\n null,\n opts: {\n headers?: HttpHeaders|{[name: string]: string | string[]},\n status?: number,\n statusText?: string,\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 = statusText || 'No Content';\n } else {\n statusText = 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(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 * 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/**\n * Helper function to convert a response body to an ArrayBuffer.\n */\nfunction _toArrayBufferBody(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): 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(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): 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: ArrayBuffer|Blob|boolean|string|number|Object|\n (boolean | string | number | Object | null)[],\n format: string = 'JSON'): 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 (typeof body === 'string' || typeof body === 'number' || typeof body === 'object' ||\n typeof body === 'boolean' || Array.isArray(body)) {\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(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): 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)[]|\n null): 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/**\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(match: string|RequestMatch|((req: HttpRequest<any>) => boolean)): 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 => (!match.method || testReq.request.method === match.method.toUpperCase()) &&\n (!match.url || testReq.request.urlWithParams === match.url));\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(match: string|RequestMatch|((req: HttpRequest<any>) => boolean), description?: string):\n TestRequest {\n description = description || this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 1) {\n throw new Error(`Expected one matching request for criteria \"${description}\", found ${\n matches.length} requests.`);\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\n .map(testReq => {\n const url = testReq.request.urlWithParams;\n const method = testReq.request.method;\n return `${method} ${url}`;\n })\n .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(match: string|RequestMatch|((req: HttpRequest<any>) => boolean), description?: string):\n void {\n description = description || this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 0) {\n throw new Error(`Expected zero matching requests for criteria \"${description}\", found ${\n matches.length}.`);\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(testReq => {\n const url = testReq.request.urlWithParams.split('?')[0];\n const method = testReq.request.method;\n return `${method} ${url}`;\n })\n .join(', ');\n throw new Error(`Expected no open requests, found ${open.length}: ${requests}`);\n }\n }\n\n private descriptionFromMatcher(matcher: string|RequestMatch|\n ((req: HttpRequest<any>) => boolean)): 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","/**\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, HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\n\nimport {HttpTestingController} from './api';\nimport {HttpClientTestingBackend} from './backend';\n\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: [\n HttpClientModule,\n ],\n providers: [\n HttpClientTestingBackend,\n {provide: HttpBackend, useExisting: HttpClientTestingBackend},\n {provide: HttpTestingController, useExisting: HttpClientTestingBackend},\n ],\n})\nexport class HttpClientTestingModule {\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\nexport {HttpTestingController, RequestMatch} from './src/api';\nexport {HttpClientTestingModule} from './src/module';\nexport {TestRequest} from './src/request';\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\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;AAsBA;;;;;;MAMsB,qBAAqB;;;AC5B3C;;;;;;;AAqBA;;;;;;;;MAQa,WAAW;IAatB,YAAmB,OAAyB,EAAU,QAAkC;QAArE,YAAO,GAAP,OAAO,CAAkB;QAAU,aAAQ,GAAR,QAAQ,CAA0B;;;;QAFxF,eAAU,GAAG,KAAK,CAAC;KAEyE;;;;IAT5F,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;KACxB;;;;;;;;;IAiBD,KAAK,CACD,IACI,EACJ,OAII,EAAE;QACR,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;QACvC,MAAM,OAAO,GACT,CAAC,IAAI,CAAC,OAAO,YAAY,WAAW,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzF,IAAI,GAAG,iBAAiB,CAAC,IA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K,CAAC,oCAAoC,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC,CAAC;SACjF;KACF;IAEO,sBAAsB,CAAC,OACoC;QACjE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,OAAO,cAAc,OAAO,EAAE,CAAC;SAChC;aAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YACtC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC;YACzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC;YACnC,OAAO,iBAAiB,MAAM,UAAU,GAAG,EAAE,CAAC;SAC/C;aAAM;YACL,OAAO,sBAAsB,OAAO,CAAC,IAAI,EAAE,CAAC;SAC7C;KACF;;gIAlIU,wBAAwB;oIAAxB,wBAAwB;sGAAxB,wBAAwB;kBADpC,UAAU;;;AC3BX;;;;;;;AAeA;;;;;;;MAiBa,uBAAuB;;+HAAvB,uBAAuB;gIAAvB,uBAAuB,YARhC,gBAAgB;gIAQP,uBAAuB,aANvB;QACT,wBAAwB;QACxB,EAAC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAC;QAC7D,EAAC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,wBAAwB,EAAC;KACxE,YAPQ;YACP,gBAAgB;SACjB;sGAOU,uBAAuB;kBAVnC,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,gBAAgB;qBACjB;oBACD,SAAS,EAAE;wBACT,wBAAwB;wBACxB,EAAC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAC;wBAC7D,EAAC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,wBAAwB,EAAC;qBACxE;iBACF;;;AC/BD;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;"}
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/module.ts","../../../../../../../packages/common/http/testing/public_api.ts","../../../../../../../packages/common/http/testing/index.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(match: string|RequestMatch|((req: HttpRequest<any>) => boolean)): 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(matchFn: ((req: HttpRequest<any>) => boolean), 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): 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), description?: string): 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 {HttpErrorResponse, HttpEvent, HttpHeaders, HttpRequest, HttpResponse, HttpStatusCode} 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(public request: HttpRequest<any>, private observer: Observer<HttpEvent<any>>) {}\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: ArrayBuffer|Blob|boolean|string|number|Object|(boolean|string|number|Object|null)[]|\n null,\n opts: {\n headers?: HttpHeaders|{[name: string]: string | string[]},\n status?: number,\n statusText?: string,\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 = statusText || 'No Content';\n } else {\n statusText = 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(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 * 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/**\n * Helper function to convert a response body to an ArrayBuffer.\n */\nfunction _toArrayBufferBody(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): 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(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): 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: ArrayBuffer|Blob|boolean|string|number|Object|\n (boolean | string | number | Object | null)[],\n format: string = 'JSON'): 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 (typeof body === 'string' || typeof body === 'number' || typeof body === 'object' ||\n typeof body === 'boolean' || Array.isArray(body)) {\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(body: ArrayBuffer|Blob|string|number|Object|\n (string | number | Object | null)[]): 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)[]|\n null): 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/**\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(match: string|RequestMatch|((req: HttpRequest<any>) => boolean)): 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 => (!match.method || testReq.request.method === match.method.toUpperCase()) &&\n (!match.url || testReq.request.urlWithParams === match.url));\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(match: string|RequestMatch|((req: HttpRequest<any>) => boolean), description?: string):\n TestRequest {\n description = description || this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 1) {\n throw new Error(`Expected one matching request for criteria \"${description}\", found ${\n matches.length} requests.`);\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(match: string|RequestMatch|((req: HttpRequest<any>) => boolean), description?: string):\n void {\n description = description || this.descriptionFromMatcher(match);\n const matches = this.match(match);\n if (matches.length > 0) {\n throw new Error(`Expected zero matching requests for criteria \"${description}\", found ${\n matches.length}.`);\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(matcher: string|RequestMatch|\n ((req: HttpRequest<any>) => boolean)): 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, HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\n\nimport {HttpTestingController} from './api';\nimport {HttpClientTestingBackend} from './backend';\n\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: [\n HttpClientModule,\n ],\n providers: [\n HttpClientTestingBackend,\n {provide: HttpBackend, useExisting: HttpClientTestingBackend},\n {provide: HttpTestingController, useExisting: HttpClientTestingBackend},\n ],\n})\nexport class HttpClientTestingModule {\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\nexport {HttpTestingController, RequestMatch} from './src/api';\nexport {HttpClientTestingModule} from './src/module';\nexport {TestRequest} from './src/request';\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\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;AAMG;AAgBH;;;;;AAKG;MACmB,qBAAqB,CAAA;AAwF1C;;ACpHD;;;;;;AAMG;AAeH;;;;;;;AAOG;MACU,WAAW,CAAA;IAatB,WAAmB,CAAA,OAAyB,EAAU,QAAkC,EAAA;QAArE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAkB;QAAU,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAA0B;AALxF;;AAEG;QACH,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;KAEyE;AAZ5F;;AAEG;AACH,IAAA,IAAI,SAAS,GAAA;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;KACxB;AASD;;;;;;;AAOG;AACH,IAAA,KAAK,CACD,IACI,EACJ,IAAA,GAII,EAAE,EAAA;QACR,IAAI,IAAI,CAAC,SAAS,EAAE;AAClB,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,iCAAA,CAAmC,CAAC,CAAC;AACtD,SAAA;AACD,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;QACvC,MAAM,OAAO,GACT,CAAC,IAAI,CAAC,OAAO,YAAY,WAAW,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzF,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAC1D,QAAA,IAAI,UAAU,GAAqB,IAAI,CAAC,UAAU,CAAC;AACnD,QAAA,IAAI,MAAM,GAAW,IAAI,CAAC,MAAM,KAAK,SAAS,GAAG,IAAI,CAAC,MAAM,gBAAqB;AACjF,QAA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A;AACR,oBAAA,OAAO,EAAE;wBACP,gBAAgB;AACjB,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,wBAAwB;AACxB,wBAAA,EAAC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAC;AAC7D,wBAAA,EAAC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,wBAAwB,EAAC;AACxE,qBAAA;AACF,iBAAA,CAAA;;;AC/BD;;;;;;AAMG;;ACNH;;;;;;AAMG;;ACNH;;AAEG;;;;"}
package/fesm2020/http.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.0
2
+ * @license Angular v14.0.0-next.11
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1398,9 +1398,9 @@ class HttpClient {
1398
1398
  return this.request('PUT', url, addBody(options, body));
1399
1399
  }
1400
1400
  }
1401
- HttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
1402
- HttpClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClient });
1403
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClient, decorators: [{
1401
+ HttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
1402
+ HttpClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClient });
1403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClient, decorators: [{
1404
1404
  type: Injectable
1405
1405
  }], ctorParameters: function () { return [{ type: HttpHandler }]; } });
1406
1406
 
@@ -1437,9 +1437,9 @@ class NoopInterceptor {
1437
1437
  return next.handle(req);
1438
1438
  }
1439
1439
  }
1440
- NoopInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: NoopInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1441
- NoopInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: NoopInterceptor });
1442
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: NoopInterceptor, decorators: [{
1440
+ NoopInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: NoopInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1441
+ NoopInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: NoopInterceptor });
1442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: NoopInterceptor, decorators: [{
1443
1443
  type: Injectable
1444
1444
  }] });
1445
1445
 
@@ -1455,6 +1455,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0",
1455
1455
  // from that. The next id to be assigned is tracked in a global variable here that
1456
1456
  // is shared among all applications on the page.
1457
1457
  let nextRequestId = 0;
1458
+ /**
1459
+ * When a pending <script> is unsubscribed we'll move it to this document, so it won't be
1460
+ * executed.
1461
+ */
1462
+ let foreignDocument;
1458
1463
  // Error text given when a JSONP script is injected, but doesn't invoke the callback
1459
1464
  // passed in its URL.
1460
1465
  const JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';
@@ -1462,6 +1467,9 @@ const JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';
1462
1467
  // have a request method JSONP.
1463
1468
  const JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';
1464
1469
  const JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';
1470
+ // Error text given when a request is passed to the JsonpClientBackend that has
1471
+ // headers set
1472
+ const JSONP_ERR_HEADERS_NOT_SUPPORTED = 'JSONP requests do not support headers.';
1465
1473
  /**
1466
1474
  * DI token/abstract type representing a map of JSONP callbacks.
1467
1475
  *
@@ -1509,6 +1517,11 @@ class JsonpClientBackend {
1509
1517
  else if (req.responseType !== 'json') {
1510
1518
  throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);
1511
1519
  }
1520
+ // Check the request headers. JSONP doesn't support headers and
1521
+ // cannot set any that were supplied.
1522
+ if (req.headers.keys().length > 0) {
1523
+ throw new Error(JSONP_ERR_HEADERS_NOT_SUPPORTED);
1524
+ }
1512
1525
  // Everything else happens inside the Observable boundary.
1513
1526
  return new Observable((observer) => {
1514
1527
  // The first step to make a request is to generate the callback name, and replace the
@@ -1525,19 +1538,12 @@ class JsonpClientBackend {
1525
1538
  let body = null;
1526
1539
  // Whether the response callback has been called.
1527
1540
  let finished = false;
1528
- // Whether the request has been cancelled (and thus any other callbacks)
1529
- // should be ignored.
1530
- let cancelled = false;
1531
1541
  // Set the response callback in this.callbackMap (which will be the window
1532
1542
  // object in the browser. The script being loaded via the <script> tag will
1533
1543
  // eventually call this callback.
1534
1544
  this.callbackMap[callback] = (data) => {
1535
1545
  // Data has been received from the JSONP script. Firstly, delete this callback.
1536
1546
  delete this.callbackMap[callback];
1537
- // Next, make sure the request wasn't cancelled in the meantime.
1538
- if (cancelled) {
1539
- return;
1540
- }
1541
1547
  // Set state to indicate data was received.
1542
1548
  body = data;
1543
1549
  finished = true;
@@ -1559,10 +1565,6 @@ class JsonpClientBackend {
1559
1565
  // If something went wrong, onLoad() may run without the response callback
1560
1566
  // having been invoked.
1561
1567
  const onLoad = (event) => {
1562
- // Do nothing if the request has been cancelled.
1563
- if (cancelled) {
1564
- return;
1565
- }
1566
1568
  // We wrap it in an extra Promise, to ensure the microtask
1567
1569
  // is scheduled after the loaded endpoint has executed any potential microtask itself,
1568
1570
  // which is not guaranteed in Internet Explorer and EdgeHTML. See issue #39496
@@ -1597,10 +1599,6 @@ class JsonpClientBackend {
1597
1599
  // a Javascript error. It emits the error via the Observable error channel as
1598
1600
  // a HttpErrorResponse.
1599
1601
  const onError = (error) => {
1600
- // If the request was already cancelled, no need to emit anything.
1601
- if (cancelled) {
1602
- return;
1603
- }
1604
1602
  cleanup();
1605
1603
  // Wrap the error in a HttpErrorResponse.
1606
1604
  observer.error(new HttpErrorResponse({
@@ -1619,20 +1617,27 @@ class JsonpClientBackend {
1619
1617
  observer.next({ type: HttpEventType.Sent });
1620
1618
  // Cancellation handler.
1621
1619
  return () => {
1622
- // Track the cancellation so event listeners won't do anything even if already scheduled.
1623
- cancelled = true;
1624
- // Remove the event listeners so they won't run if the events later fire.
1625
- node.removeEventListener('load', onLoad);
1626
- node.removeEventListener('error', onError);
1620
+ if (!finished) {
1621
+ this.removeListeners(node);
1622
+ }
1627
1623
  // And finally, clean up the page.
1628
1624
  cleanup();
1629
1625
  };
1630
1626
  });
1631
1627
  }
1628
+ removeListeners(script) {
1629
+ // Issue #34818
1630
+ // Changing <script>'s ownerDocument will prevent it from execution.
1631
+ // https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
1632
+ if (!foreignDocument) {
1633
+ foreignDocument = this.document.implementation.createHTMLDocument();
1634
+ }
1635
+ foreignDocument.adoptNode(script);
1636
+ }
1632
1637
  }
1633
- JsonpClientBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1634
- JsonpClientBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: JsonpClientBackend });
1635
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: JsonpClientBackend, decorators: [{
1638
+ JsonpClientBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1639
+ JsonpClientBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: JsonpClientBackend });
1640
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: JsonpClientBackend, decorators: [{
1636
1641
  type: Injectable
1637
1642
  }], ctorParameters: function () { return [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
1638
1643
  type: Inject,
@@ -1665,9 +1670,9 @@ class JsonpInterceptor {
1665
1670
  return next.handle(req);
1666
1671
  }
1667
1672
  }
1668
- JsonpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: JsonpInterceptor, deps: [{ token: JsonpClientBackend }], target: i0.ɵɵFactoryTarget.Injectable });
1669
- JsonpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: JsonpInterceptor });
1670
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: JsonpInterceptor, decorators: [{
1673
+ JsonpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: JsonpInterceptor, deps: [{ token: JsonpClientBackend }], target: i0.ɵɵFactoryTarget.Injectable });
1674
+ JsonpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: JsonpInterceptor });
1675
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: JsonpInterceptor, decorators: [{
1671
1676
  type: Injectable
1672
1677
  }], ctorParameters: function () { return [{ type: JsonpClientBackend }]; } });
1673
1678
 
@@ -1761,8 +1766,6 @@ class HttpXhrBackend {
1761
1766
  if (headerResponse !== null) {
1762
1767
  return headerResponse;
1763
1768
  }
1764
- // Read status and normalize an IE9 bug (https://bugs.jquery.com/ticket/1450).
1765
- const status = xhr.status === 1223 ? 204 /* NoContent */ : xhr.status;
1766
1769
  const statusText = xhr.statusText || 'OK';
1767
1770
  // Parse headers from XMLHttpRequest - this step is lazy.
1768
1771
  const headers = new HttpHeaders(xhr.getAllResponseHeaders());
@@ -1770,7 +1773,7 @@ class HttpXhrBackend {
1770
1773
  // request URL.
1771
1774
  const url = getResponseUrl(xhr) || req.url;
1772
1775
  // Construct the HttpHeaderResponse and memoize it.
1773
- headerResponse = new HttpHeaderResponse({ headers, status, statusText, url });
1776
+ headerResponse = new HttpHeaderResponse({ headers, status: xhr.status, statusText, url });
1774
1777
  return headerResponse;
1775
1778
  };
1776
1779
  // Next, a few closures are defined for the various events which XMLHttpRequest can
@@ -1945,9 +1948,9 @@ class HttpXhrBackend {
1945
1948
  });
1946
1949
  }
1947
1950
  }
1948
- HttpXhrBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
1949
- HttpXhrBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXhrBackend });
1950
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXhrBackend, decorators: [{
1951
+ HttpXhrBackend.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXhrBackend, deps: [{ token: i1.XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
1952
+ HttpXhrBackend.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXhrBackend });
1953
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXhrBackend, decorators: [{
1951
1954
  type: Injectable
1952
1955
  }], ctorParameters: function () { return [{ type: i1.XhrFactory }]; } });
1953
1956
 
@@ -1995,9 +1998,9 @@ class HttpXsrfCookieExtractor {
1995
1998
  return this.lastToken;
1996
1999
  }
1997
2000
  }
1998
- HttpXsrfCookieExtractor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
1999
- HttpXsrfCookieExtractor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXsrfCookieExtractor });
2000
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
2001
+ HttpXsrfCookieExtractor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
2002
+ HttpXsrfCookieExtractor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXsrfCookieExtractor });
2003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
2001
2004
  type: Injectable
2002
2005
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2003
2006
  type: Inject,
@@ -2035,9 +2038,9 @@ class HttpXsrfInterceptor {
2035
2038
  return next.handle(req);
2036
2039
  }
2037
2040
  }
2038
- HttpXsrfInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: HttpXsrfTokenExtractor }, { token: XSRF_HEADER_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
2039
- HttpXsrfInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXsrfInterceptor });
2040
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
2041
+ HttpXsrfInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: HttpXsrfTokenExtractor }, { token: XSRF_HEADER_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
2042
+ HttpXsrfInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXsrfInterceptor });
2043
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
2041
2044
  type: Injectable
2042
2045
  }], ctorParameters: function () { return [{ type: HttpXsrfTokenExtractor }, { type: undefined, decorators: [{
2043
2046
  type: Inject,
@@ -2074,9 +2077,9 @@ class HttpInterceptingHandler {
2074
2077
  return this.chain.handle(req);
2075
2078
  }
2076
2079
  }
2077
- HttpInterceptingHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpInterceptingHandler, deps: [{ token: HttpBackend }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
2078
- HttpInterceptingHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpInterceptingHandler });
2079
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpInterceptingHandler, decorators: [{
2080
+ HttpInterceptingHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpInterceptingHandler, deps: [{ token: HttpBackend }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
2081
+ HttpInterceptingHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpInterceptingHandler });
2082
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpInterceptingHandler, decorators: [{
2080
2083
  type: Injectable
2081
2084
  }], ctorParameters: function () { return [{ type: HttpBackend }, { type: i0.Injector }]; } });
2082
2085
  /**
@@ -2149,16 +2152,16 @@ class HttpClientXsrfModule {
2149
2152
  };
2150
2153
  }
2151
2154
  }
2152
- HttpClientXsrfModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2153
- HttpClientXsrfModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientXsrfModule });
2154
- HttpClientXsrfModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientXsrfModule, providers: [
2155
+ HttpClientXsrfModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2156
+ HttpClientXsrfModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientXsrfModule });
2157
+ HttpClientXsrfModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientXsrfModule, providers: [
2155
2158
  HttpXsrfInterceptor,
2156
2159
  { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
2157
2160
  { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
2158
2161
  { provide: XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' },
2159
2162
  { provide: XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' },
2160
2163
  ] });
2161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
2164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
2162
2165
  type: NgModule,
2163
2166
  args: [{
2164
2167
  providers: [
@@ -2181,9 +2184,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0",
2181
2184
  */
2182
2185
  class HttpClientModule {
2183
2186
  }
2184
- HttpClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2185
- HttpClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientModule, imports: [HttpClientXsrfModule] });
2186
- HttpClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientModule, providers: [
2187
+ HttpClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2188
+ HttpClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientModule, imports: [HttpClientXsrfModule] });
2189
+ HttpClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientModule, providers: [
2187
2190
  HttpClient,
2188
2191
  { provide: HttpHandler, useClass: HttpInterceptingHandler },
2189
2192
  HttpXhrBackend,
@@ -2194,7 +2197,7 @@ HttpClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versio
2194
2197
  headerName: 'X-XSRF-TOKEN',
2195
2198
  }),
2196
2199
  ]] });
2197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientModule, decorators: [{
2200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientModule, decorators: [{
2198
2201
  type: NgModule,
2199
2202
  args: [{
2200
2203
  /**
@@ -2231,14 +2234,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0",
2231
2234
  */
2232
2235
  class HttpClientJsonpModule {
2233
2236
  }
2234
- HttpClientJsonpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2235
- HttpClientJsonpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientJsonpModule });
2236
- HttpClientJsonpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientJsonpModule, providers: [
2237
+ HttpClientJsonpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2238
+ HttpClientJsonpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientJsonpModule });
2239
+ HttpClientJsonpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientJsonpModule, providers: [
2237
2240
  JsonpClientBackend,
2238
2241
  { provide: JsonpCallbackContext, useFactory: jsonpCallbackContext },
2239
2242
  { provide: HTTP_INTERCEPTORS, useClass: JsonpInterceptor, multi: true },
2240
2243
  ] });
2241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
2244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
2242
2245
  type: NgModule,
2243
2246
  args: [{
2244
2247
  providers: [