@angular/common 21.0.4 → 21.0.6
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/fesm2022/_common_module-chunk.mjs +86 -86
- package/fesm2022/_common_module-chunk.mjs.map +1 -1
- package/fesm2022/_location-chunk.mjs +10 -10
- package/fesm2022/_location-chunk.mjs.map +1 -1
- package/fesm2022/_module-chunk.mjs +46 -48
- package/fesm2022/_module-chunk.mjs.map +1 -1
- package/fesm2022/_platform_location-chunk.mjs +7 -7
- package/fesm2022/_platform_location-chunk.mjs.map +1 -1
- package/fesm2022/_platform_navigation-chunk.mjs +4 -4
- package/fesm2022/_platform_navigation-chunk.mjs.map +1 -1
- package/fesm2022/_xhr-chunk.mjs +1 -1
- package/fesm2022/_xhr-chunk.mjs.map +1 -1
- package/fesm2022/common.mjs +17 -17
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http-testing.mjs +8 -8
- package/fesm2022/http-testing.mjs.map +1 -1
- package/fesm2022/http.mjs +1 -1
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/testing.mjs +13 -14
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +5 -5
- package/fesm2022/upgrade.mjs.map +1 -1
- package/package.json +2 -2
- package/types/_common_module-chunk.d.ts +1 -1
- package/types/_module-chunk.d.ts +1 -1
- package/types/_platform_location-chunk.d.ts +1 -1
- package/types/_xhr-chunk.d.ts +1 -1
- package/types/common.d.ts +1 -1
- package/types/http-testing.d.ts +1 -1
- package/types/http.d.ts +1 -1
- package/types/testing.d.ts +1 -1
- package/types/upgrade.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.
|
|
2
|
+
* @license Angular v21.0.6
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -227,7 +227,7 @@ class HttpClientTestingBackend {
|
|
|
227
227
|
}
|
|
228
228
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
229
229
|
minVersion: "12.0.0",
|
|
230
|
-
version: "21.0.
|
|
230
|
+
version: "21.0.6",
|
|
231
231
|
ngImport: i0,
|
|
232
232
|
type: HttpClientTestingBackend,
|
|
233
233
|
deps: [],
|
|
@@ -235,14 +235,14 @@ class HttpClientTestingBackend {
|
|
|
235
235
|
});
|
|
236
236
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
237
237
|
minVersion: "12.0.0",
|
|
238
|
-
version: "21.0.
|
|
238
|
+
version: "21.0.6",
|
|
239
239
|
ngImport: i0,
|
|
240
240
|
type: HttpClientTestingBackend
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
243
|
i0.ɵɵngDeclareClassMetadata({
|
|
244
244
|
minVersion: "12.0.0",
|
|
245
|
-
version: "21.0.
|
|
245
|
+
version: "21.0.6",
|
|
246
246
|
ngImport: i0,
|
|
247
247
|
type: HttpClientTestingBackend,
|
|
248
248
|
decorators: [{
|
|
@@ -271,7 +271,7 @@ function provideHttpClientTesting() {
|
|
|
271
271
|
class HttpClientTestingModule {
|
|
272
272
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
273
273
|
minVersion: "12.0.0",
|
|
274
|
-
version: "21.0.
|
|
274
|
+
version: "21.0.6",
|
|
275
275
|
ngImport: i0,
|
|
276
276
|
type: HttpClientTestingModule,
|
|
277
277
|
deps: [],
|
|
@@ -279,14 +279,14 @@ class HttpClientTestingModule {
|
|
|
279
279
|
});
|
|
280
280
|
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
281
281
|
minVersion: "14.0.0",
|
|
282
|
-
version: "21.0.
|
|
282
|
+
version: "21.0.6",
|
|
283
283
|
ngImport: i0,
|
|
284
284
|
type: HttpClientTestingModule,
|
|
285
285
|
imports: [HttpClientModule]
|
|
286
286
|
});
|
|
287
287
|
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
288
288
|
minVersion: "12.0.0",
|
|
289
|
-
version: "21.0.
|
|
289
|
+
version: "21.0.6",
|
|
290
290
|
ngImport: i0,
|
|
291
291
|
type: HttpClientTestingModule,
|
|
292
292
|
providers: [provideHttpClientTesting()],
|
|
@@ -295,7 +295,7 @@ class HttpClientTestingModule {
|
|
|
295
295
|
}
|
|
296
296
|
i0.ɵɵngDeclareClassMetadata({
|
|
297
297
|
minVersion: "12.0.0",
|
|
298
|
-
version: "21.0.
|
|
298
|
+
version: "21.0.6",
|
|
299
299
|
ngImport: i0,
|
|
300
300
|
type: HttpClientTestingModule,
|
|
301
301
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/api.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/request.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/backend.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/provider.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/module.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.dev/license\n */\n\nimport {HttpRequest} from '../../index';\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.dev/license\n */\n\nimport {\n HttpErrorResponse,\n HttpEvent,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n HttpStatusCode,\n} from '../../index';\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 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.dev/license\n */\n\nimport {HttpBackend, HttpEvent, HttpEventType, HttpRequest} from '../../index';\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 * Used when checking if we need to throw the NOT_USING_FETCH_BACKEND_IN_SSR error\n */\n private isTestingBackend = true;\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.dev/license\n */\n\nimport {HttpBackend, ɵREQUESTS_CONTRIBUTE_TO_STABILITY} from '../../index';\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.dev/license\n */\n\nimport {HttpClientModule} from '../../index';\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"],"names":["HttpTestingController","TestRequest","request","observer","cancelled","_cancelled","constructor","flush","body","opts","Error","url","urlWithParams","headers","HttpHeaders","_maybeConvertBody","responseType","statusText","status","undefined","HttpStatusCode","Ok","NoContent","next","HttpResponse","complete","error","HttpErrorResponse","event","_toArrayBufferBody","ArrayBuffer","_toBlob","Blob","_toJsonBody","format","Array","isArray","_toTextBody","JSON","stringify","HttpClientTestingBackend","open","isTestingBackend","handle","req","Observable","testReq","push","type","HttpEventType","Sent","_match","match","filter","method","toUpperCase","results","forEach","result","index","indexOf","splice","expectOne","description","descriptionFromMatcher","matches","length","message","requests","map","describeRequest","join","expectNone","verify","ignoreCancelled","matcher","name","deps","target","i0","ɵɵFactoryTarget","Injectable","decorators","testRequest","provideHttpClientTesting","provide","HttpBackend","useExisting","ɵREQUESTS_CONTRIBUTE_TO_STABILITY","useValue","HttpClientTestingModule","NgModule","ɵmod","ɵɵngDeclareNgModule","minVersion","version","ngImport","HttpClientModule","ɵinj","ɵɵngDeclareInjector","args","imports","providers"],"mappings":";;;;;;;;;;;;;;MA4BsBA,qBAAqB,CAAA;;MCQ9BC,WAAW,CAAA;EAcbC,OAAA;EACCC,QAAA;EAXV,IAAIC,SAASA,GAAA;IACX,OAAO,IAAI,CAACC,UAAU;AACxB;AAKAA,EAAAA,UAAU,GAAG,KAAK;AAElBC,EAAAA,WACSA,CAAAJ,OAAyB,EACxBC,QAAkC,EAAA;IADnC,IAAO,CAAAD,OAAA,GAAPA,OAAO;IACN,IAAQ,CAAAC,QAAA,GAARA,QAAQ;AACf;AAUHI,EAAAA,KAAKA,CACHC,IAQQ,EACRC,IAAA,GAII,EAAE,EAAA;IAEN,IAAI,IAAI,CAACL,SAAS,EAAE;AAClB,MAAA,MAAM,IAAIM,KAAK,CAAC,CAAA,iCAAA,CAAmC,CAAC;AACtD;AACA,IAAA,MAAMC,GAAG,GAAG,IAAI,CAACT,OAAO,CAACU,aAAa;AACtC,IAAA,MAAMC,OAAO,GACXJ,IAAI,CAACI,OAAO,YAAYC,WAAW,GAAGL,IAAI,CAACI,OAAO,GAAG,IAAIC,WAAW,CAACL,IAAI,CAACI,OAAO,CAAC;IACpFL,IAAI,GAAGO,iBAAiB,CAAC,IAAI,CAACb,OAAO,CAACc,YAAY,EAAER,IAAI,CAAC;AACzD,IAAA,IAAIS,UAAU,GAAuBR,IAAI,CAACQ,UAAU;AACpD,IAAA,IAAIC,MAAM,GAAWT,IAAI,CAACS,MAAM,KAAKC,SAAS,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EAAE/C;AAAyB,GAAA,EACvE;AAAC6C,IAAAA,OAAO,EAAEG,gCAAiC;AAAEC,IAAAA,QAAQ,EAAE;AAAM,GAAA,CAC9D;AACH;;MCKaC,uBAAuB,CAAA;;;;;UAAvBA,uBAAuB;AAAAb,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAW;AAAA,GAAA,CAAA;AAAvB,EAAA,OAAAC,IAAA,GAAAb,EAAA,CAAAc,mBAAA,CAAA;AAAAC,IAAAA,UAAA,EAAA,QAAA;AAAAC,IAAAA,OAAA,EAAA,mBAAA;AAAAC,IAAAA,QAAA,EAAAjB,EAAA;AAAA/B,IAAAA,IAAA,EAAA0C,uBAAuB;cAHxBO,gBAAgB;AAAA,GAAA,CAAA;AAGf,EAAA,OAAAC,IAAA,GAAAnB,EAAA,CAAAoB,mBAAA,CAAA;AAAAL,IAAAA,UAAA,EAAA,QAAA;AAAAC,IAAAA,OAAA,EAAA,mBAAA;AAAAC,IAAAA,QAAA,EAAAjB,EAAA;AAAA/B,IAAAA,IAAA,EAAA0C,uBAAuB;eAFvB,CAACN,wBAAwB,EAAE,CAAC;cAD7Ba,gBAAgB;AAAA,GAAA,CAAA;;;;;;QAGfP,uBAAuB;AAAAR,EAAAA,UAAA,EAAA,CAAA;UAJnCS,QAAQ;AAACS,IAAAA,IAAA,EAAA,CAAA;MACRC,OAAO,EAAE,CAACJ,gBAAgB,CAAC;AAC3BK,MAAAA,SAAS,EAAE,CAAClB,wBAAwB,EAAE;KACvC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"http-testing.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/api.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/request.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/backend.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/provider.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/testing/src/module.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.dev/license\n */\n\nimport {HttpRequest} from '../../index';\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.dev/license\n */\n\nimport {\n HttpErrorResponse,\n HttpEvent,\n HttpHeaders,\n HttpRequest,\n HttpResponse,\n HttpStatusCode,\n} from '../../index';\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 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.dev/license\n */\n\nimport {HttpBackend, HttpEvent, HttpEventType, HttpRequest} from '../../index';\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 * Used when checking if we need to throw the NOT_USING_FETCH_BACKEND_IN_SSR error\n */\n private isTestingBackend = true;\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.dev/license\n */\n\nimport {HttpBackend, ɵREQUESTS_CONTRIBUTE_TO_STABILITY} from '../../index';\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.dev/license\n */\n\nimport {HttpClientModule} from '../../index';\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"],"names":["HttpTestingController","TestRequest","request","observer","cancelled","_cancelled","constructor","flush","body","opts","Error","url","urlWithParams","headers","HttpHeaders","_maybeConvertBody","responseType","statusText","status","undefined","HttpStatusCode","Ok","NoContent","next","HttpResponse","complete","error","HttpErrorResponse","event","_toArrayBufferBody","ArrayBuffer","_toBlob","Blob","_toJsonBody","format","Array","isArray","_toTextBody","JSON","stringify","HttpClientTestingBackend","open","isTestingBackend","handle","req","Observable","testReq","push","type","HttpEventType","Sent","_match","match","filter","method","toUpperCase","results","forEach","result","index","indexOf","splice","expectOne","description","descriptionFromMatcher","matches","length","message","requests","map","describeRequest","join","expectNone","verify","ignoreCancelled","matcher","name","deps","target","i0","ɵɵFactoryTarget","Injectable","decorators","testRequest","provideHttpClientTesting","provide","HttpBackend","useExisting","ɵREQUESTS_CONTRIBUTE_TO_STABILITY","useValue","HttpClientTestingModule","NgModule","ɵmod","ɵɵngDeclareNgModule","minVersion","version","ngImport","HttpClientModule","ɵinj","ɵɵngDeclareInjector","args","imports","providers"],"mappings":";;;;;;;;;;;;;;MA4BsBA,qBAAqB,CAAA;;MCQ9BC,WAAW,CAAA;EAcbC,OAAA;EACCC,QAAA;EAXV,IAAIC,SAASA,GAAA;IACX,OAAO,IAAI,CAACC,UAAU;AACxB;AAKAA,EAAAA,UAAU,GAAG,KAAK;AAElBC,EAAAA,WACSA,CAAAJ,OAAyB,EACxBC,QAAkC,EAAA;IADnC,IAAO,CAAAD,OAAA,GAAPA,OAAO;IACN,IAAQ,CAAAC,QAAA,GAARA,QAAQ;AACf;AAUHI,EAAAA,KAAKA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EAAA0C,uBAAuB;eAFvB,CAACN,wBAAwB,EAAE,CAAC;cAD7Ba,gBAAgB;AAAA,GAAA,CAAA;;;;;;QAGfP,uBAAuB;AAAAR,EAAAA,UAAA,EAAA,CAAA;UAJnCS,QAAQ;AAACS,IAAAA,IAAA,EAAA,CAAA;MACRC,OAAO,EAAE,CAACJ,gBAAgB,CAAC;AAC3BK,MAAAA,SAAS,EAAE,CAAClB,wBAAwB,EAAE;KACvC;;;;;;"}
|
package/fesm2022/http.mjs
CHANGED
package/fesm2022/http.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/resource.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/transfer_cache.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.dev/license\n */\n\nimport {\n Injector,\n Signal,\n ɵResourceImpl as ResourceImpl,\n inject,\n linkedSignal,\n assertInInjectionContext,\n signal,\n computed,\n ResourceStreamItem,\n type ValueEqualityFn,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n ɵencapsulateResourceError as encapsulateResourceError,\n} from '@angular/core';\nimport type {Subscription} from 'rxjs';\n\nimport {HttpRequest} from './request';\nimport {HttpClient} from './client';\nimport {HttpErrorResponse, HttpEventType, HttpProgressEvent, HttpResponseBase} from './response';\nimport {HttpHeaders} from './headers';\nimport {HttpParams} from './params';\nimport {HttpResourceRef, HttpResourceOptions, HttpResourceRequest} from './resource_api';\n\n/**\n * Type for the `httpRequest` top-level function, which includes the call signatures for the JSON-\n * based `httpRequest` as well as sub-functions for `ArrayBuffer`, `Blob`, and `string` type\n * requests.\n *\n * @experimental 19.2\n */\nexport interface HttpResourceFn {\n /**\n * Create a `Resource` that fetches data with an HTTP GET request to the given URL.\n *\n * The resource will update when the URL changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as JSON by default - use a sub-function of\n * `httpResource`, such as `httpResource.text()`, to parse the response differently.\n *\n * @experimental 19.2\n */\n <TResult = unknown>(\n url: () => string | undefined,\n options: HttpResourceOptions<TResult, unknown> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n /**\n * Create a `Resource` that fetches data with an HTTP GET request to the given URL.\n *\n * The resource will update when the URL changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as JSON by default - use a sub-function of\n * `httpResource`, such as `httpResource.text()`, to parse the response differently.\n *\n * @experimental 19.2\n */\n <TResult = unknown>(\n url: () => string | undefined,\n options?: HttpResourceOptions<TResult, unknown>,\n ): HttpResourceRef<TResult | undefined>;\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as JSON by default - use a sub-function of\n * `httpResource`, such as `httpResource.text()`, to parse the response differently.\n *\n * @experimental 19.2\n */\n <TResult = unknown>(\n request: () => HttpResourceRequest | undefined,\n options: HttpResourceOptions<TResult, unknown> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as JSON by default - use a sub-function of\n * `httpResource`, such as `httpResource.text()`, to parse the response differently.\n *\n * @experimental 19.2\n */\n <TResult = unknown>(\n request: () => HttpResourceRequest | undefined,\n options?: HttpResourceOptions<TResult, unknown>,\n ): HttpResourceRef<TResult | undefined>;\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the URL or request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed into an `ArrayBuffer`.\n *\n * @experimental 19.2\n */\n arrayBuffer: {\n <TResult = ArrayBuffer>(\n url: () => string | undefined,\n options: HttpResourceOptions<TResult, ArrayBuffer> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = ArrayBuffer>(\n url: () => string | undefined,\n options?: HttpResourceOptions<TResult, ArrayBuffer>,\n ): HttpResourceRef<TResult | undefined>;\n\n <TResult = ArrayBuffer>(\n request: () => HttpResourceRequest | undefined,\n options: HttpResourceOptions<TResult, ArrayBuffer> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = ArrayBuffer>(\n request: () => HttpResourceRequest | undefined,\n options?: HttpResourceOptions<TResult, ArrayBuffer>,\n ): HttpResourceRef<TResult | undefined>;\n };\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the URL or request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed into a `Blob`.\n *\n * @experimental 19.2\n */\n blob: {\n <TResult = Blob>(\n url: () => string | undefined,\n options: HttpResourceOptions<TResult, Blob> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = Blob>(\n url: () => string | undefined,\n options?: HttpResourceOptions<TResult, Blob>,\n ): HttpResourceRef<TResult | undefined>;\n\n <TResult = Blob>(\n request: () => HttpResourceRequest | undefined,\n options: HttpResourceOptions<TResult, Blob> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = Blob>(\n request: () => HttpResourceRequest | undefined,\n options?: HttpResourceOptions<TResult, Blob>,\n ): HttpResourceRef<TResult | undefined>;\n };\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the URL or request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as a `string`.\n *\n * @experimental 19.2\n */\n text: {\n <TResult = string>(\n url: () => string | undefined,\n options: HttpResourceOptions<TResult, string> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = string>(\n url: () => string | undefined,\n options?: HttpResourceOptions<TResult, string>,\n ): HttpResourceRef<TResult | undefined>;\n\n <TResult = string>(\n request: () => HttpResourceRequest | undefined,\n options: HttpResourceOptions<TResult, string> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = string>(\n request: () => HttpResourceRequest | undefined,\n options?: HttpResourceOptions<TResult, string>,\n ): HttpResourceRef<TResult | undefined>;\n };\n}\n\n/**\n * `httpResource` makes a reactive HTTP request and exposes the request status and response value as\n * a `WritableResource`. By default, it assumes that the backend will return JSON data. To make a\n * request that expects a different kind of data, you can use a sub-constructor of `httpResource`,\n * such as `httpResource.text`.\n *\n * @experimental 19.2\n * @initializerApiFunction\n */\nexport const httpResource: HttpResourceFn = (() => {\n const jsonFn = makeHttpResourceFn<unknown>('json') as HttpResourceFn;\n jsonFn.arrayBuffer = makeHttpResourceFn<ArrayBuffer>('arraybuffer');\n jsonFn.blob = makeHttpResourceFn('blob');\n jsonFn.text = makeHttpResourceFn('text');\n return jsonFn;\n})();\n\n/**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n */\ntype ResponseType = 'arraybuffer' | 'blob' | 'json' | 'text';\ntype RawRequestType = (() => string | undefined) | (() => HttpResourceRequest | undefined);\n\nfunction makeHttpResourceFn<TRaw>(responseType: ResponseType) {\n return function httpResource<TResult = TRaw>(\n request: RawRequestType,\n options?: HttpResourceOptions<TResult, TRaw>,\n ): HttpResourceRef<TResult> {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(httpResource);\n }\n const injector = options?.injector ?? inject(Injector);\n return new HttpResourceImpl(\n injector,\n () => normalizeRequest(request, responseType),\n options?.defaultValue,\n options?.debugName,\n options?.parse as (value: unknown) => TResult,\n options?.equal as ValueEqualityFn<unknown>,\n ) as HttpResourceRef<TResult>;\n };\n}\n\nfunction normalizeRequest(\n request: RawRequestType,\n responseType: ResponseType,\n): HttpRequest<unknown> | undefined {\n let unwrappedRequest = typeof request === 'function' ? request() : request;\n if (unwrappedRequest === undefined) {\n return undefined;\n } else if (typeof unwrappedRequest === 'string') {\n unwrappedRequest = {url: unwrappedRequest};\n }\n\n const headers =\n unwrappedRequest.headers instanceof HttpHeaders\n ? unwrappedRequest.headers\n : new HttpHeaders(\n unwrappedRequest.headers as\n | Record<string, string | number | Array<string | number>>\n | undefined,\n );\n\n const params =\n unwrappedRequest.params instanceof HttpParams\n ? unwrappedRequest.params\n : new HttpParams({fromObject: unwrappedRequest.params});\n\n return new HttpRequest(\n unwrappedRequest.method ?? 'GET',\n unwrappedRequest.url,\n unwrappedRequest.body ?? null,\n {\n headers,\n params,\n reportProgress: unwrappedRequest.reportProgress,\n withCredentials: unwrappedRequest.withCredentials,\n keepalive: unwrappedRequest.keepalive,\n cache: unwrappedRequest.cache as RequestCache,\n priority: unwrappedRequest.priority as RequestPriority,\n mode: unwrappedRequest.mode as RequestMode,\n redirect: unwrappedRequest.redirect as RequestRedirect,\n responseType,\n context: unwrappedRequest.context,\n transferCache: unwrappedRequest.transferCache,\n credentials: unwrappedRequest.credentials as RequestCredentials,\n referrer: unwrappedRequest.referrer,\n referrerPolicy: unwrappedRequest.referrerPolicy as ReferrerPolicy,\n integrity: unwrappedRequest.integrity,\n timeout: unwrappedRequest.timeout,\n },\n );\n}\nclass HttpResourceImpl<T>\n extends ResourceImpl<T, HttpRequest<unknown> | undefined>\n implements HttpResourceRef<T>\n{\n private client!: HttpClient;\n private _headers = linkedSignal({\n source: this.extRequest,\n computation: () => undefined as HttpHeaders | undefined,\n });\n private _progress = linkedSignal({\n source: this.extRequest,\n computation: () => undefined as HttpProgressEvent | undefined,\n });\n private _statusCode = linkedSignal({\n source: this.extRequest,\n computation: () => undefined as number | undefined,\n });\n\n readonly headers = computed(() =>\n this.status() === 'resolved' || this.status() === 'error' ? this._headers() : undefined,\n );\n readonly progress = this._progress.asReadonly();\n readonly statusCode = this._statusCode.asReadonly();\n\n constructor(\n injector: Injector,\n request: () => HttpRequest<T> | undefined,\n defaultValue: T,\n debugName?: string,\n parse?: (value: unknown) => T,\n equal?: ValueEqualityFn<unknown>,\n ) {\n super(\n request,\n ({params: request, abortSignal}) => {\n let sub: Subscription;\n\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub.unsubscribe();\n abortSignal.addEventListener('abort', onAbort);\n\n // Start off stream as undefined.\n const stream = signal<ResourceStreamItem<T>>({value: undefined as T});\n let resolve: ((value: Signal<ResourceStreamItem<T>>) => void) | undefined;\n const promise = new Promise<Signal<ResourceStreamItem<T>>>((r) => (resolve = r));\n\n const send = (value: ResourceStreamItem<T>): void => {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n };\n\n sub = this.client.request(request!).subscribe({\n next: (event) => {\n switch (event.type) {\n case HttpEventType.Response:\n this._headers.set(event.headers);\n this._statusCode.set(event.status);\n try {\n send({value: parse ? parse(event.body) : (event.body as T)});\n } catch (error) {\n send({error: encapsulateResourceError(error)});\n }\n break;\n case HttpEventType.DownloadProgress:\n this._progress.set(event);\n break;\n }\n },\n error: (error) => {\n if (error instanceof HttpErrorResponse) {\n this._headers.set(error.headers);\n this._statusCode.set(error.status);\n }\n\n send({error});\n abortSignal.removeEventListener('abort', onAbort);\n },\n complete: () => {\n if (resolve) {\n send({\n error: new ɵRuntimeError(\n ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE,\n ngDevMode && 'Resource completed before producing a value',\n ),\n });\n }\n abortSignal.removeEventListener('abort', onAbort);\n },\n });\n\n return promise;\n },\n defaultValue,\n equal,\n debugName,\n injector,\n );\n this.client = injector.get(HttpClient);\n }\n\n override set(value: T): void {\n super.set(value);\n\n this._headers.set(undefined);\n this._progress.set(undefined);\n this._statusCode.set(undefined);\n }\n\n // This is a type only override of the method\n declare hasValue: () => this is HttpResourceRef<Exclude<T, undefined>>;\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.dev/license\n */\n\nimport {\n APP_BOOTSTRAP_LISTENER,\n ApplicationRef,\n inject,\n InjectionToken,\n makeStateKey,\n Provider,\n StateKey,\n TransferState,\n ɵformatRuntimeError as formatRuntimeError,\n ɵperformanceMarkFeature as performanceMarkFeature,\n ɵtruncateMiddle as truncateMiddle,\n ɵRuntimeError as RuntimeError,\n} from '@angular/core';\nimport {Observable, of} from 'rxjs';\nimport {tap} from 'rxjs/operators';\n\nimport {RuntimeErrorCode} from './errors';\nimport {HttpHeaders} from './headers';\nimport {HTTP_ROOT_INTERCEPTOR_FNS, HttpHandlerFn} from './interceptor';\nimport {HttpRequest} from './request';\nimport {HttpEvent, HttpResponse} from './response';\nimport {HttpParams} from './params';\n\n/**\n * Options to configure how TransferCache should be used to cache requests made via HttpClient.\n *\n * @param includeHeaders Specifies which headers should be included into cached responses. No\n * headers are included by default.\n * @param filter A function that receives a request as an argument and returns a boolean to indicate\n * whether a request should be included into the cache.\n * @param includePostRequests Enables caching for POST requests. By default, only GET and HEAD\n * requests are cached. This option can be enabled if POST requests are used to retrieve data\n * (for example using GraphQL).\n * @param includeRequestsWithAuthHeaders Enables caching of requests containing either `Authorization`\n * or `Proxy-Authorization` headers. By default, these requests are excluded from caching.\n *\n * @see [Configuring the caching options](guide/ssr#configuring-the-caching-options)\n *\n * @publicApi\n */\nexport type HttpTransferCacheOptions = {\n includeHeaders?: string[];\n filter?: (req: HttpRequest<unknown>) => boolean;\n includePostRequests?: boolean;\n includeRequestsWithAuthHeaders?: boolean;\n};\n\n/**\n * If your application uses different HTTP origins to make API calls (via `HttpClient`) on the server and\n * on the client, the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token allows you to establish a mapping\n * between those origins, so that `HttpTransferCache` feature can recognize those requests as the same\n * ones and reuse the data cached on the server during hydration on the client.\n *\n * IMPORTANT: The `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token should *only* be provided in\n * the *server* code of your application (typically in the `app.server.config.ts` script). Angular throws an\n * error if it detects that the token is defined while running on the client.\n *\n * @usageNotes\n *\n * When the same API endpoint is accessed via `http://internal-domain.com:8080` on the server and\n * via `https://external-domain.com` on the client, you can use the following configuration:\n * ```ts\n * // in app.server.config.ts\n * {\n * provide: HTTP_TRANSFER_CACHE_ORIGIN_MAP,\n * useValue: {\n * 'http://internal-domain.com:8080': 'https://external-domain.com'\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport const HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken<Record<string, string>>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_TRANSFER_CACHE_ORIGIN_MAP' : '',\n);\n\n/**\n * Keys within cached response data structure.\n */\n\nexport const BODY = 'b';\nexport const HEADERS = 'h';\nexport const STATUS = 's';\nexport const STATUS_TEXT = 'st';\nexport const REQ_URL = 'u';\nexport const RESPONSE_TYPE = 'rt';\n\ninterface TransferHttpResponse {\n /** body */\n [BODY]: any;\n /** headers */\n [HEADERS]: Record<string, string[]>;\n /** status */\n [STATUS]?: number;\n /** statusText */\n [STATUS_TEXT]?: string;\n /** url */\n [REQ_URL]?: string;\n /** responseType */\n [RESPONSE_TYPE]?: HttpRequest<unknown>['responseType'];\n}\n\ninterface CacheOptions extends HttpTransferCacheOptions {\n isCacheActive: boolean;\n}\n\nconst CACHE_OPTIONS = new InjectionToken<CacheOptions>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_TRANSFER_STATE_CACHE_OPTIONS' : '',\n);\n\n/**\n * A list of allowed HTTP methods to cache.\n */\nconst ALLOWED_METHODS = ['GET', 'HEAD'];\n\nexport function transferCacheInterceptorFn(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n): Observable<HttpEvent<unknown>> {\n const {isCacheActive, ...globalOptions} = inject(CACHE_OPTIONS);\n const {transferCache: requestOptions, method: requestMethod} = req;\n\n // In the following situations we do not want to cache the request\n if (\n !isCacheActive ||\n requestOptions === false ||\n // POST requests are allowed either globally or at request level\n (requestMethod === 'POST' && !globalOptions.includePostRequests && !requestOptions) ||\n (requestMethod !== 'POST' && !ALLOWED_METHODS.includes(requestMethod)) ||\n // Do not cache request that require authorization when includeRequestsWithAuthHeaders is falsey\n (!globalOptions.includeRequestsWithAuthHeaders && hasAuthHeaders(req)) ||\n globalOptions.filter?.(req) === false\n ) {\n return next(req);\n }\n\n const transferState = inject(TransferState);\n\n const originMap: Record<string, string> | null = inject(HTTP_TRANSFER_CACHE_ORIGIN_MAP, {\n optional: true,\n });\n\n if (typeof ngServerMode !== 'undefined' && !ngServerMode && originMap) {\n throw new RuntimeError(\n RuntimeErrorCode.HTTP_ORIGIN_MAP_USED_IN_CLIENT,\n ngDevMode &&\n 'Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and ' +\n 'present in the client side code. Please ensure that this token is only provided in the ' +\n 'server code of the application.',\n );\n }\n\n const requestUrl =\n typeof ngServerMode !== 'undefined' && ngServerMode && originMap\n ? mapRequestOriginUrl(req.url, originMap)\n : req.url;\n\n const storeKey = makeCacheKey(req, requestUrl);\n const response = transferState.get(storeKey, null);\n\n let headersToInclude = globalOptions.includeHeaders;\n if (typeof requestOptions === 'object' && requestOptions.includeHeaders) {\n // Request-specific config takes precedence over the global config.\n headersToInclude = requestOptions.includeHeaders;\n }\n\n if (response) {\n const {\n [BODY]: undecodedBody,\n [RESPONSE_TYPE]: responseType,\n [HEADERS]: httpHeaders,\n [STATUS]: status,\n [STATUS_TEXT]: statusText,\n [REQ_URL]: url,\n } = response;\n // Request found in cache. Respond using it.\n let body: ArrayBuffer | Blob | string | undefined = undecodedBody;\n\n switch (responseType) {\n case 'arraybuffer':\n body = new TextEncoder().encode(undecodedBody).buffer;\n break;\n case 'blob':\n body = new Blob([undecodedBody]);\n break;\n }\n\n // We want to warn users accessing a header provided from the cache\n // That HttpTransferCache alters the headers\n // The warning will be logged a single time by HttpHeaders instance\n let headers = new HttpHeaders(httpHeaders);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Append extra logic in dev mode to produce a warning when a header\n // that was not transferred to the client is accessed in the code via `get`\n // and `has` calls.\n headers = appendMissingHeadersDetection(req.url, headers, headersToInclude ?? []);\n }\n\n return of(\n new HttpResponse({\n body,\n headers,\n status,\n statusText,\n url,\n }),\n );\n }\n\n const event$ = next(req);\n\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // Request not found in cache. Make the request and cache it if on the server.\n return event$.pipe(\n tap((event: HttpEvent<unknown>) => {\n // Only cache successful HTTP responses.\n if (event instanceof HttpResponse) {\n transferState.set<TransferHttpResponse>(storeKey, {\n [BODY]: event.body,\n [HEADERS]: getFilteredHeaders(event.headers, headersToInclude),\n [STATUS]: event.status,\n [STATUS_TEXT]: event.statusText,\n [REQ_URL]: requestUrl,\n [RESPONSE_TYPE]: req.responseType,\n });\n }\n }),\n );\n }\n\n return event$;\n}\n\n/** @returns true when the requests contains autorization related headers. */\nfunction hasAuthHeaders(req: HttpRequest<unknown>): boolean {\n return req.headers.has('authorization') || req.headers.has('proxy-authorization');\n}\n\nfunction getFilteredHeaders(\n headers: HttpHeaders,\n includeHeaders: string[] | undefined,\n): Record<string, string[]> {\n if (!includeHeaders) {\n return {};\n }\n\n const headersMap: Record<string, string[]> = {};\n for (const key of includeHeaders) {\n const values = headers.getAll(key);\n if (values !== null) {\n headersMap[key] = values;\n }\n }\n\n return headersMap;\n}\n\nfunction sortAndConcatParams(params: HttpParams | URLSearchParams): string {\n return [...params.keys()]\n .sort()\n .map((k) => `${k}=${params.getAll(k)}`)\n .join('&');\n}\n\nfunction makeCacheKey(\n request: HttpRequest<any>,\n mappedRequestUrl: string,\n): StateKey<TransferHttpResponse> {\n // make the params encoded same as a url so it's easy to identify\n const {params, method, responseType} = request;\n const encodedParams = sortAndConcatParams(params);\n\n let serializedBody = request.serializeBody();\n if (serializedBody instanceof URLSearchParams) {\n serializedBody = sortAndConcatParams(serializedBody);\n } else if (typeof serializedBody !== 'string') {\n serializedBody = '';\n }\n\n const key = [method, responseType, mappedRequestUrl, serializedBody, encodedParams].join('|');\n const hash = generateHash(key);\n\n return makeStateKey(hash);\n}\n\n/**\n * A method that returns a hash representation of a string using a variant of DJB2 hash\n * algorithm.\n *\n * This is the same hashing logic that is used to generate component ids.\n */\nfunction generateHash(value: string): string {\n let hash = 0;\n\n for (const char of value) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) << 0;\n }\n\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n\n return hash.toString();\n}\n\n/**\n * Returns the DI providers needed to enable HTTP transfer cache.\n *\n * By default, when using server rendering, requests are performed twice: once on the server and\n * other one on the browser.\n *\n * When these providers are added, requests performed on the server are cached and reused during the\n * bootstrapping of the application in the browser thus avoiding duplicate requests and reducing\n * load time.\n *\n * @see [Caching data when using HttpClient](guide/ssr#configuring-the-caching-options)\n *\n */\nexport function withHttpTransferCache(cacheOptions: HttpTransferCacheOptions): Provider[] {\n return [\n {\n provide: CACHE_OPTIONS,\n useFactory: (): CacheOptions => {\n performanceMarkFeature('NgHttpTransferCache');\n return {isCacheActive: true, ...cacheOptions};\n },\n },\n {\n provide: HTTP_ROOT_INTERCEPTOR_FNS,\n useValue: transferCacheInterceptorFn,\n multi: true,\n },\n {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: () => {\n const appRef = inject(ApplicationRef);\n const cacheState = inject(CACHE_OPTIONS);\n\n return () => {\n appRef.whenStable().then(() => {\n cacheState.isCacheActive = false;\n });\n };\n },\n },\n ];\n}\n\n/**\n * This function will add a proxy to an HttpHeader to intercept calls to get/has\n * and log a warning if the header entry requested has been removed\n */\nfunction appendMissingHeadersDetection(\n url: string,\n headers: HttpHeaders,\n headersToInclude: string[],\n): HttpHeaders {\n const warningProduced = new Set();\n return new Proxy<HttpHeaders>(headers, {\n get(target: HttpHeaders, prop: keyof HttpHeaders): unknown {\n const value = Reflect.get(target, prop);\n const methods: Set<keyof HttpHeaders> = new Set(['get', 'has', 'getAll']);\n\n if (typeof value !== 'function' || !methods.has(prop)) {\n return value;\n }\n\n return (headerName: string) => {\n // We log when the key has been removed and a warning hasn't been produced for the header\n const key = (prop + ':' + headerName).toLowerCase(); // e.g. `get:cache-control`\n if (!headersToInclude.includes(headerName) && !warningProduced.has(key)) {\n warningProduced.add(key);\n const truncatedUrl = truncateMiddle(url);\n\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.HEADERS_ALTERED_BY_TRANSFER_CACHE,\n `Angular detected that the \\`${headerName}\\` header is accessed, but the value of the header ` +\n `was not transferred from the server to the client by the HttpTransferCache. ` +\n `To include the value of the \\`${headerName}\\` header for the \\`${truncatedUrl}\\` request, ` +\n `use the \\`includeHeaders\\` list. The \\`includeHeaders\\` can be defined either ` +\n `on a request level by adding the \\`transferCache\\` parameter, or on an application ` +\n `level by adding the \\`httpCacheTransfer.includeHeaders\\` argument to the ` +\n `\\`provideClientHydration()\\` call. `,\n ),\n );\n }\n\n // invoking the original method\n return (value as Function).apply(target, [headerName]);\n };\n },\n });\n}\n\nfunction mapRequestOriginUrl(url: string, originMap: Record<string, string>): string {\n const origin = new URL(url, 'resolve://').origin;\n const mappedOrigin = originMap[origin];\n if (!mappedOrigin) {\n return url;\n }\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n verifyMappedOrigin(mappedOrigin);\n }\n\n return url.replace(origin, mappedOrigin);\n}\n\nfunction verifyMappedOrigin(url: string): void {\n if (new URL(url, 'resolve://').pathname !== '/') {\n throw new RuntimeError(\n RuntimeErrorCode.HTTP_ORIGIN_MAP_CONTAINS_PATH,\n 'Angular detected a URL with a path segment in the value provided for the ' +\n `\\`HTTP_TRANSFER_CACHE_ORIGIN_MAP\\` token: ${url}. The map should only contain origins ` +\n 'without any other segments.',\n );\n }\n}\n"],"names":["httpResource","jsonFn","makeHttpResourceFn","arrayBuffer","blob","text","responseType","request","options","ngDevMode","injector","assertInInjectionContext","inject","Injector","HttpResourceImpl","normalizeRequest","defaultValue","debugName","parse","equal","unwrappedRequest","undefined","url","headers","HttpHeaders","params","HttpParams","fromObject","HttpRequest","method","body","reportProgress","withCredentials","keepalive","cache","priority","mode","redirect","context","transferCache","credentials","referrer","referrerPolicy","integrity","timeout","ResourceImpl","client","_headers","linkedSignal","source","extRequest","computation","_progress","_statusCode","computed","status","progress","asReadonly","statusCode","constructor","abortSignal","sub","onAbort","unsubscribe","addEventListener","stream","signal","value","resolve","promise","Promise","r","send","set","subscribe","next","event","type","HttpEventType","Response","error","encapsulateResourceError","DownloadProgress","HttpErrorResponse","removeEventListener","complete","ɵRuntimeError","get","HttpClient","HTTP_TRANSFER_CACHE_ORIGIN_MAP","InjectionToken","BODY","HEADERS","STATUS","STATUS_TEXT","REQ_URL","RESPONSE_TYPE","CACHE_OPTIONS","ALLOWED_METHODS","transferCacheInterceptorFn","req","isCacheActive","globalOptions","requestOptions","requestMethod","includePostRequests","includes","includeRequestsWithAuthHeaders","hasAuthHeaders","filter","transferState","TransferState","originMap","optional","ngServerMode","RuntimeError","requestUrl","mapRequestOriginUrl","storeKey","makeCacheKey","response","headersToInclude","includeHeaders","undecodedBody","httpHeaders","statusText","TextEncoder","encode","buffer","Blob","appendMissingHeadersDetection","of","HttpResponse","event$","pipe","tap","getFilteredHeaders","has","headersMap","key","values","getAll","sortAndConcatParams","keys","sort","map","k","join","mappedRequestUrl","encodedParams","serializedBody","serializeBody","URLSearchParams","hash","generateHash","makeStateKey","char","Math","imul","charCodeAt","toString","withHttpTransferCache","cacheOptions","provide","useFactory","performanceMarkFeature","HTTP_ROOT_INTERCEPTOR_FNS","useValue","multi","APP_BOOTSTRAP_LISTENER","appRef","ApplicationRef","cacheState","whenStable","then","warningProduced","Set","Proxy","target","prop","Reflect","methods","headerName","toLowerCase","add","truncatedUrl","truncateMiddle","console","warn","formatRuntimeError","apply","origin","URL","mappedOrigin","verifyMappedOrigin","replace","pathname"],"mappings":";;;;;;;;;;;;;;AAkNaA,MAAAA,YAAY,GAAmB,CAAC,MAAK;AAChD,EAAA,MAAMC,MAAM,GAAGC,kBAAkB,CAAU,MAAM,CAAmB;AACpED,EAAAA,MAAM,CAACE,WAAW,GAAGD,kBAAkB,CAAc,aAAa,CAAC;AACnED,EAAAA,MAAM,CAACG,IAAI,GAAGF,kBAAkB,CAAC,MAAM,CAAC;AACxCD,EAAAA,MAAM,CAACI,IAAI,GAAGH,kBAAkB,CAAC,MAAM,CAAC;AACxC,EAAA,OAAOD,MAAM;AACf,CAAC;AAWD,SAASC,kBAAkBA,CAAOI,YAA0B,EAAA;AAC1D,EAAA,OAAO,SAASN,YAAYA,CAC1BO,OAAuB,EACvBC,OAA4C,EAAA;AAE5C,IAAA,IAAIC,SAAS,IAAI,CAACD,OAAO,EAAEE,QAAQ,EAAE;MACnCC,wBAAwB,CAACX,YAAY,CAAC;AACxC;IACA,MAAMU,QAAQ,GAAGF,OAAO,EAAEE,QAAQ,IAAIE,MAAM,CAACC,QAAQ,CAAC;AACtD,IAAA,OAAO,IAAIC,gBAAgB,CACzBJ,QAAQ,EACR,MAAMK,gBAAgB,CAACR,OAAO,EAAED,YAAY,CAAC,EAC7CE,OAAO,EAAEQ,YAAY,EACrBR,OAAO,EAAES,SAAS,EAClBT,OAAO,EAAEU,KAAoC,EAC7CV,OAAO,EAAEW,KAAiC,CACf;GAC9B;AACH;AAEA,SAASJ,gBAAgBA,CACvBR,OAAuB,EACvBD,YAA0B,EAAA;EAE1B,IAAIc,gBAAgB,GAAG,OAAOb,OAAO,KAAK,UAAU,GAAGA,OAAO,EAAE,GAAGA,OAAO;EAC1E,IAAIa,gBAAgB,KAAKC,SAAS,EAAE;AAClC,IAAA,OAAOA,SAAS;AAClB,GAAA,MAAO,IAAI,OAAO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,GAChF,CAAqF,mFAAA,CAAA,GACrF,CAA2E,yEAAA,CAAA,GAC3E,CAAqC,mCAAA,CAAA,CACxC,CACF;AACH;QAGA,OAAQtH,KAAkB,CAAC2H,KAAK,CAACZ,MAAM,EAAE,CAACI,UAAU,CAAC,CAAC;OACvD;AACH;AACD,GAAA,CAAC;AACJ;AAEA,SAASjE,mBAAmBA,CAAC/F,GAAW,EAAE0F,SAAiC,EAAA;EACzE,MAAM+E,MAAM,GAAG,IAAIC,GAAG,CAAC1K,GAAG,EAAE,YAAY,CAAC,CAACyK,MAAM;AAChD,EAAA,MAAME,YAAY,GAAGjF,SAAS,CAAC+E,MAAM,CAAC;EACtC,IAAI,CAACE,YAAY,EAAE;AACjB,IAAA,OAAO3K,GAAG;AACZ;AAEA,EAAA,IAAI,OAAOb,SAAS,KAAK,WAAW,IAAIA,SAAS,EAAE;IACjDyL,kBAAkB,CAACD,YAAY,CAAC;AAClC;AAEA,EAAA,OAAO3K,GAAG,CAAC6K,OAAO,CAACJ,MAAM,EAAEE,YAAY,CAAC;AAC1C;AAEA,SAASC,kBAAkBA,CAAC5K,GAAW,EAAA;EACrC,IAAI,IAAI0K,GAAG,CAAC1K,GAAG,EAAE,YAAY,CAAC,CAAC8K,QAAQ,KAAK,GAAG,EAAE;AAC/C,IAAA,MAAM,IAAIjF,aAAY,CAAA,IAAA,EAEpB,2EAA2E,GACzE,CAAA,0CAAA,EAA6C7F,GAAG,CAAA,sCAAA,CAAwC,GACxF,6BAA6B,CAChC;AACH;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"http.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/resource.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/transfer_cache.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.dev/license\n */\n\nimport {\n Injector,\n Signal,\n ɵResourceImpl as ResourceImpl,\n inject,\n linkedSignal,\n assertInInjectionContext,\n signal,\n computed,\n ResourceStreamItem,\n type ValueEqualityFn,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n ɵencapsulateResourceError as encapsulateResourceError,\n} from '@angular/core';\nimport type {Subscription} from 'rxjs';\n\nimport {HttpRequest} from './request';\nimport {HttpClient} from './client';\nimport {HttpErrorResponse, HttpEventType, HttpProgressEvent, HttpResponseBase} from './response';\nimport {HttpHeaders} from './headers';\nimport {HttpParams} from './params';\nimport {HttpResourceRef, HttpResourceOptions, HttpResourceRequest} from './resource_api';\n\n/**\n * Type for the `httpRequest` top-level function, which includes the call signatures for the JSON-\n * based `httpRequest` as well as sub-functions for `ArrayBuffer`, `Blob`, and `string` type\n * requests.\n *\n * @experimental 19.2\n */\nexport interface HttpResourceFn {\n /**\n * Create a `Resource` that fetches data with an HTTP GET request to the given URL.\n *\n * The resource will update when the URL changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as JSON by default - use a sub-function of\n * `httpResource`, such as `httpResource.text()`, to parse the response differently.\n *\n * @experimental 19.2\n */\n <TResult = unknown>(\n url: () => string | undefined,\n options: HttpResourceOptions<TResult, unknown> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n /**\n * Create a `Resource` that fetches data with an HTTP GET request to the given URL.\n *\n * The resource will update when the URL changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as JSON by default - use a sub-function of\n * `httpResource`, such as `httpResource.text()`, to parse the response differently.\n *\n * @experimental 19.2\n */\n <TResult = unknown>(\n url: () => string | undefined,\n options?: HttpResourceOptions<TResult, unknown>,\n ): HttpResourceRef<TResult | undefined>;\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as JSON by default - use a sub-function of\n * `httpResource`, such as `httpResource.text()`, to parse the response differently.\n *\n * @experimental 19.2\n */\n <TResult = unknown>(\n request: () => HttpResourceRequest | undefined,\n options: HttpResourceOptions<TResult, unknown> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as JSON by default - use a sub-function of\n * `httpResource`, such as `httpResource.text()`, to parse the response differently.\n *\n * @experimental 19.2\n */\n <TResult = unknown>(\n request: () => HttpResourceRequest | undefined,\n options?: HttpResourceOptions<TResult, unknown>,\n ): HttpResourceRef<TResult | undefined>;\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the URL or request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed into an `ArrayBuffer`.\n *\n * @experimental 19.2\n */\n arrayBuffer: {\n <TResult = ArrayBuffer>(\n url: () => string | undefined,\n options: HttpResourceOptions<TResult, ArrayBuffer> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = ArrayBuffer>(\n url: () => string | undefined,\n options?: HttpResourceOptions<TResult, ArrayBuffer>,\n ): HttpResourceRef<TResult | undefined>;\n\n <TResult = ArrayBuffer>(\n request: () => HttpResourceRequest | undefined,\n options: HttpResourceOptions<TResult, ArrayBuffer> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = ArrayBuffer>(\n request: () => HttpResourceRequest | undefined,\n options?: HttpResourceOptions<TResult, ArrayBuffer>,\n ): HttpResourceRef<TResult | undefined>;\n };\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the URL or request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed into a `Blob`.\n *\n * @experimental 19.2\n */\n blob: {\n <TResult = Blob>(\n url: () => string | undefined,\n options: HttpResourceOptions<TResult, Blob> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = Blob>(\n url: () => string | undefined,\n options?: HttpResourceOptions<TResult, Blob>,\n ): HttpResourceRef<TResult | undefined>;\n\n <TResult = Blob>(\n request: () => HttpResourceRequest | undefined,\n options: HttpResourceOptions<TResult, Blob> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = Blob>(\n request: () => HttpResourceRequest | undefined,\n options?: HttpResourceOptions<TResult, Blob>,\n ): HttpResourceRef<TResult | undefined>;\n };\n\n /**\n * Create a `Resource` that fetches data with the configured HTTP request.\n *\n * The resource will update when the URL or request changes via signals.\n *\n * Uses `HttpClient` to make requests and supports interceptors, testing, and the other features\n * of the `HttpClient` API. Data is parsed as a `string`.\n *\n * @experimental 19.2\n */\n text: {\n <TResult = string>(\n url: () => string | undefined,\n options: HttpResourceOptions<TResult, string> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = string>(\n url: () => string | undefined,\n options?: HttpResourceOptions<TResult, string>,\n ): HttpResourceRef<TResult | undefined>;\n\n <TResult = string>(\n request: () => HttpResourceRequest | undefined,\n options: HttpResourceOptions<TResult, string> & {defaultValue: NoInfer<TResult>},\n ): HttpResourceRef<TResult>;\n\n <TResult = string>(\n request: () => HttpResourceRequest | undefined,\n options?: HttpResourceOptions<TResult, string>,\n ): HttpResourceRef<TResult | undefined>;\n };\n}\n\n/**\n * `httpResource` makes a reactive HTTP request and exposes the request status and response value as\n * a `WritableResource`. By default, it assumes that the backend will return JSON data. To make a\n * request that expects a different kind of data, you can use a sub-constructor of `httpResource`,\n * such as `httpResource.text`.\n *\n * @experimental 19.2\n * @initializerApiFunction\n */\nexport const httpResource: HttpResourceFn = (() => {\n const jsonFn = makeHttpResourceFn<unknown>('json') as HttpResourceFn;\n jsonFn.arrayBuffer = makeHttpResourceFn<ArrayBuffer>('arraybuffer');\n jsonFn.blob = makeHttpResourceFn('blob');\n jsonFn.text = makeHttpResourceFn('text');\n return jsonFn;\n})();\n\n/**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n */\ntype ResponseType = 'arraybuffer' | 'blob' | 'json' | 'text';\ntype RawRequestType = (() => string | undefined) | (() => HttpResourceRequest | undefined);\n\nfunction makeHttpResourceFn<TRaw>(responseType: ResponseType) {\n return function httpResource<TResult = TRaw>(\n request: RawRequestType,\n options?: HttpResourceOptions<TResult, TRaw>,\n ): HttpResourceRef<TResult> {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(httpResource);\n }\n const injector = options?.injector ?? inject(Injector);\n return new HttpResourceImpl(\n injector,\n () => normalizeRequest(request, responseType),\n options?.defaultValue,\n options?.debugName,\n options?.parse as (value: unknown) => TResult,\n options?.equal as ValueEqualityFn<unknown>,\n ) as HttpResourceRef<TResult>;\n };\n}\n\nfunction normalizeRequest(\n request: RawRequestType,\n responseType: ResponseType,\n): HttpRequest<unknown> | undefined {\n let unwrappedRequest = typeof request === 'function' ? request() : request;\n if (unwrappedRequest === undefined) {\n return undefined;\n } else if (typeof unwrappedRequest === 'string') {\n unwrappedRequest = {url: unwrappedRequest};\n }\n\n const headers =\n unwrappedRequest.headers instanceof HttpHeaders\n ? unwrappedRequest.headers\n : new HttpHeaders(\n unwrappedRequest.headers as\n | Record<string, string | number | Array<string | number>>\n | undefined,\n );\n\n const params =\n unwrappedRequest.params instanceof HttpParams\n ? unwrappedRequest.params\n : new HttpParams({fromObject: unwrappedRequest.params});\n\n return new HttpRequest(\n unwrappedRequest.method ?? 'GET',\n unwrappedRequest.url,\n unwrappedRequest.body ?? null,\n {\n headers,\n params,\n reportProgress: unwrappedRequest.reportProgress,\n withCredentials: unwrappedRequest.withCredentials,\n keepalive: unwrappedRequest.keepalive,\n cache: unwrappedRequest.cache as RequestCache,\n priority: unwrappedRequest.priority as RequestPriority,\n mode: unwrappedRequest.mode as RequestMode,\n redirect: unwrappedRequest.redirect as RequestRedirect,\n responseType,\n context: unwrappedRequest.context,\n transferCache: unwrappedRequest.transferCache,\n credentials: unwrappedRequest.credentials as RequestCredentials,\n referrer: unwrappedRequest.referrer,\n referrerPolicy: unwrappedRequest.referrerPolicy as ReferrerPolicy,\n integrity: unwrappedRequest.integrity,\n timeout: unwrappedRequest.timeout,\n },\n );\n}\nclass HttpResourceImpl<T>\n extends ResourceImpl<T, HttpRequest<unknown> | undefined>\n implements HttpResourceRef<T>\n{\n private client!: HttpClient;\n private _headers = linkedSignal({\n source: this.extRequest,\n computation: () => undefined as HttpHeaders | undefined,\n });\n private _progress = linkedSignal({\n source: this.extRequest,\n computation: () => undefined as HttpProgressEvent | undefined,\n });\n private _statusCode = linkedSignal({\n source: this.extRequest,\n computation: () => undefined as number | undefined,\n });\n\n readonly headers = computed(() =>\n this.status() === 'resolved' || this.status() === 'error' ? this._headers() : undefined,\n );\n readonly progress = this._progress.asReadonly();\n readonly statusCode = this._statusCode.asReadonly();\n\n constructor(\n injector: Injector,\n request: () => HttpRequest<T> | undefined,\n defaultValue: T,\n debugName?: string,\n parse?: (value: unknown) => T,\n equal?: ValueEqualityFn<unknown>,\n ) {\n super(\n request,\n ({params: request, abortSignal}) => {\n let sub: Subscription;\n\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub.unsubscribe();\n abortSignal.addEventListener('abort', onAbort);\n\n // Start off stream as undefined.\n const stream = signal<ResourceStreamItem<T>>({value: undefined as T});\n let resolve: ((value: Signal<ResourceStreamItem<T>>) => void) | undefined;\n const promise = new Promise<Signal<ResourceStreamItem<T>>>((r) => (resolve = r));\n\n const send = (value: ResourceStreamItem<T>): void => {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n };\n\n sub = this.client.request(request!).subscribe({\n next: (event) => {\n switch (event.type) {\n case HttpEventType.Response:\n this._headers.set(event.headers);\n this._statusCode.set(event.status);\n try {\n send({value: parse ? parse(event.body) : (event.body as T)});\n } catch (error) {\n send({error: encapsulateResourceError(error)});\n }\n break;\n case HttpEventType.DownloadProgress:\n this._progress.set(event);\n break;\n }\n },\n error: (error) => {\n if (error instanceof HttpErrorResponse) {\n this._headers.set(error.headers);\n this._statusCode.set(error.status);\n }\n\n send({error});\n abortSignal.removeEventListener('abort', onAbort);\n },\n complete: () => {\n if (resolve) {\n send({\n error: new ɵRuntimeError(\n ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE,\n ngDevMode && 'Resource completed before producing a value',\n ),\n });\n }\n abortSignal.removeEventListener('abort', onAbort);\n },\n });\n\n return promise;\n },\n defaultValue,\n equal,\n debugName,\n injector,\n );\n this.client = injector.get(HttpClient);\n }\n\n override set(value: T): void {\n super.set(value);\n\n this._headers.set(undefined);\n this._progress.set(undefined);\n this._statusCode.set(undefined);\n }\n\n // This is a type only override of the method\n declare hasValue: () => this is HttpResourceRef<Exclude<T, undefined>>;\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.dev/license\n */\n\nimport {\n APP_BOOTSTRAP_LISTENER,\n ApplicationRef,\n inject,\n InjectionToken,\n makeStateKey,\n Provider,\n StateKey,\n TransferState,\n ɵformatRuntimeError as formatRuntimeError,\n ɵperformanceMarkFeature as performanceMarkFeature,\n ɵtruncateMiddle as truncateMiddle,\n ɵRuntimeError as RuntimeError,\n} from '@angular/core';\nimport {Observable, of} from 'rxjs';\nimport {tap} from 'rxjs/operators';\n\nimport {RuntimeErrorCode} from './errors';\nimport {HttpHeaders} from './headers';\nimport {HTTP_ROOT_INTERCEPTOR_FNS, HttpHandlerFn} from './interceptor';\nimport {HttpRequest} from './request';\nimport {HttpEvent, HttpResponse} from './response';\nimport {HttpParams} from './params';\n\n/**\n * Options to configure how TransferCache should be used to cache requests made via HttpClient.\n *\n * @param includeHeaders Specifies which headers should be included into cached responses. No\n * headers are included by default.\n * @param filter A function that receives a request as an argument and returns a boolean to indicate\n * whether a request should be included into the cache.\n * @param includePostRequests Enables caching for POST requests. By default, only GET and HEAD\n * requests are cached. This option can be enabled if POST requests are used to retrieve data\n * (for example using GraphQL).\n * @param includeRequestsWithAuthHeaders Enables caching of requests containing either `Authorization`\n * or `Proxy-Authorization` headers. By default, these requests are excluded from caching.\n *\n * @see [Configuring the caching options](guide/ssr#configuring-the-caching-options)\n *\n * @publicApi\n */\nexport type HttpTransferCacheOptions = {\n includeHeaders?: string[];\n filter?: (req: HttpRequest<unknown>) => boolean;\n includePostRequests?: boolean;\n includeRequestsWithAuthHeaders?: boolean;\n};\n\n/**\n * If your application uses different HTTP origins to make API calls (via `HttpClient`) on the server and\n * on the client, the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token allows you to establish a mapping\n * between those origins, so that `HttpTransferCache` feature can recognize those requests as the same\n * ones and reuse the data cached on the server during hydration on the client.\n *\n * IMPORTANT: The `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token should *only* be provided in\n * the *server* code of your application (typically in the `app.server.config.ts` script). Angular throws an\n * error if it detects that the token is defined while running on the client.\n *\n * @usageNotes\n *\n * When the same API endpoint is accessed via `http://internal-domain.com:8080` on the server and\n * via `https://external-domain.com` on the client, you can use the following configuration:\n * ```ts\n * // in app.server.config.ts\n * {\n * provide: HTTP_TRANSFER_CACHE_ORIGIN_MAP,\n * useValue: {\n * 'http://internal-domain.com:8080': 'https://external-domain.com'\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport const HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken<Record<string, string>>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_TRANSFER_CACHE_ORIGIN_MAP' : '',\n);\n\n/**\n * Keys within cached response data structure.\n */\n\nexport const BODY = 'b';\nexport const HEADERS = 'h';\nexport const STATUS = 's';\nexport const STATUS_TEXT = 'st';\nexport const REQ_URL = 'u';\nexport const RESPONSE_TYPE = 'rt';\n\ninterface TransferHttpResponse {\n /** body */\n [BODY]: any;\n /** headers */\n [HEADERS]: Record<string, string[]>;\n /** status */\n [STATUS]?: number;\n /** statusText */\n [STATUS_TEXT]?: string;\n /** url */\n [REQ_URL]?: string;\n /** responseType */\n [RESPONSE_TYPE]?: HttpRequest<unknown>['responseType'];\n}\n\ninterface CacheOptions extends HttpTransferCacheOptions {\n isCacheActive: boolean;\n}\n\nconst CACHE_OPTIONS = new InjectionToken<CacheOptions>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_TRANSFER_STATE_CACHE_OPTIONS' : '',\n);\n\n/**\n * A list of allowed HTTP methods to cache.\n */\nconst ALLOWED_METHODS = ['GET', 'HEAD'];\n\nexport function transferCacheInterceptorFn(\n req: HttpRequest<unknown>,\n next: HttpHandlerFn,\n): Observable<HttpEvent<unknown>> {\n const {isCacheActive, ...globalOptions} = inject(CACHE_OPTIONS);\n const {transferCache: requestOptions, method: requestMethod} = req;\n\n // In the following situations we do not want to cache the request\n if (\n !isCacheActive ||\n requestOptions === false ||\n // POST requests are allowed either globally or at request level\n (requestMethod === 'POST' && !globalOptions.includePostRequests && !requestOptions) ||\n (requestMethod !== 'POST' && !ALLOWED_METHODS.includes(requestMethod)) ||\n // Do not cache request that require authorization when includeRequestsWithAuthHeaders is falsey\n (!globalOptions.includeRequestsWithAuthHeaders && hasAuthHeaders(req)) ||\n globalOptions.filter?.(req) === false\n ) {\n return next(req);\n }\n\n const transferState = inject(TransferState);\n\n const originMap: Record<string, string> | null = inject(HTTP_TRANSFER_CACHE_ORIGIN_MAP, {\n optional: true,\n });\n\n if (typeof ngServerMode !== 'undefined' && !ngServerMode && originMap) {\n throw new RuntimeError(\n RuntimeErrorCode.HTTP_ORIGIN_MAP_USED_IN_CLIENT,\n ngDevMode &&\n 'Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and ' +\n 'present in the client side code. Please ensure that this token is only provided in the ' +\n 'server code of the application.',\n );\n }\n\n const requestUrl =\n typeof ngServerMode !== 'undefined' && ngServerMode && originMap\n ? mapRequestOriginUrl(req.url, originMap)\n : req.url;\n\n const storeKey = makeCacheKey(req, requestUrl);\n const response = transferState.get(storeKey, null);\n\n let headersToInclude = globalOptions.includeHeaders;\n if (typeof requestOptions === 'object' && requestOptions.includeHeaders) {\n // Request-specific config takes precedence over the global config.\n headersToInclude = requestOptions.includeHeaders;\n }\n\n if (response) {\n const {\n [BODY]: undecodedBody,\n [RESPONSE_TYPE]: responseType,\n [HEADERS]: httpHeaders,\n [STATUS]: status,\n [STATUS_TEXT]: statusText,\n [REQ_URL]: url,\n } = response;\n // Request found in cache. Respond using it.\n let body: ArrayBuffer | Blob | string | undefined = undecodedBody;\n\n switch (responseType) {\n case 'arraybuffer':\n body = new TextEncoder().encode(undecodedBody).buffer;\n break;\n case 'blob':\n body = new Blob([undecodedBody]);\n break;\n }\n\n // We want to warn users accessing a header provided from the cache\n // That HttpTransferCache alters the headers\n // The warning will be logged a single time by HttpHeaders instance\n let headers = new HttpHeaders(httpHeaders);\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Append extra logic in dev mode to produce a warning when a header\n // that was not transferred to the client is accessed in the code via `get`\n // and `has` calls.\n headers = appendMissingHeadersDetection(req.url, headers, headersToInclude ?? []);\n }\n\n return of(\n new HttpResponse({\n body,\n headers,\n status,\n statusText,\n url,\n }),\n );\n }\n\n const event$ = next(req);\n\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n // Request not found in cache. Make the request and cache it if on the server.\n return event$.pipe(\n tap((event: HttpEvent<unknown>) => {\n // Only cache successful HTTP responses.\n if (event instanceof HttpResponse) {\n transferState.set<TransferHttpResponse>(storeKey, {\n [BODY]: event.body,\n [HEADERS]: getFilteredHeaders(event.headers, headersToInclude),\n [STATUS]: event.status,\n [STATUS_TEXT]: event.statusText,\n [REQ_URL]: requestUrl,\n [RESPONSE_TYPE]: req.responseType,\n });\n }\n }),\n );\n }\n\n return event$;\n}\n\n/** @returns true when the requests contains autorization related headers. */\nfunction hasAuthHeaders(req: HttpRequest<unknown>): boolean {\n return req.headers.has('authorization') || req.headers.has('proxy-authorization');\n}\n\nfunction getFilteredHeaders(\n headers: HttpHeaders,\n includeHeaders: string[] | undefined,\n): Record<string, string[]> {\n if (!includeHeaders) {\n return {};\n }\n\n const headersMap: Record<string, string[]> = {};\n for (const key of includeHeaders) {\n const values = headers.getAll(key);\n if (values !== null) {\n headersMap[key] = values;\n }\n }\n\n return headersMap;\n}\n\nfunction sortAndConcatParams(params: HttpParams | URLSearchParams): string {\n return [...params.keys()]\n .sort()\n .map((k) => `${k}=${params.getAll(k)}`)\n .join('&');\n}\n\nfunction makeCacheKey(\n request: HttpRequest<any>,\n mappedRequestUrl: string,\n): StateKey<TransferHttpResponse> {\n // make the params encoded same as a url so it's easy to identify\n const {params, method, responseType} = request;\n const encodedParams = sortAndConcatParams(params);\n\n let serializedBody = request.serializeBody();\n if (serializedBody instanceof URLSearchParams) {\n serializedBody = sortAndConcatParams(serializedBody);\n } else if (typeof serializedBody !== 'string') {\n serializedBody = '';\n }\n\n const key = [method, responseType, mappedRequestUrl, serializedBody, encodedParams].join('|');\n const hash = generateHash(key);\n\n return makeStateKey(hash);\n}\n\n/**\n * A method that returns a hash representation of a string using a variant of DJB2 hash\n * algorithm.\n *\n * This is the same hashing logic that is used to generate component ids.\n */\nfunction generateHash(value: string): string {\n let hash = 0;\n\n for (const char of value) {\n hash = (Math.imul(31, hash) + char.charCodeAt(0)) << 0;\n }\n\n // Force positive number hash.\n // 2147483647 = equivalent of Integer.MAX_VALUE.\n hash += 2147483647 + 1;\n\n return hash.toString();\n}\n\n/**\n * Returns the DI providers needed to enable HTTP transfer cache.\n *\n * By default, when using server rendering, requests are performed twice: once on the server and\n * other one on the browser.\n *\n * When these providers are added, requests performed on the server are cached and reused during the\n * bootstrapping of the application in the browser thus avoiding duplicate requests and reducing\n * load time.\n *\n * @see [Caching data when using HttpClient](guide/ssr#configuring-the-caching-options)\n *\n */\nexport function withHttpTransferCache(cacheOptions: HttpTransferCacheOptions): Provider[] {\n return [\n {\n provide: CACHE_OPTIONS,\n useFactory: (): CacheOptions => {\n performanceMarkFeature('NgHttpTransferCache');\n return {isCacheActive: true, ...cacheOptions};\n },\n },\n {\n provide: HTTP_ROOT_INTERCEPTOR_FNS,\n useValue: transferCacheInterceptorFn,\n multi: true,\n },\n {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: () => {\n const appRef = inject(ApplicationRef);\n const cacheState = inject(CACHE_OPTIONS);\n\n return () => {\n appRef.whenStable().then(() => {\n cacheState.isCacheActive = false;\n });\n };\n },\n },\n ];\n}\n\n/**\n * This function will add a proxy to an HttpHeader to intercept calls to get/has\n * and log a warning if the header entry requested has been removed\n */\nfunction appendMissingHeadersDetection(\n url: string,\n headers: HttpHeaders,\n headersToInclude: string[],\n): HttpHeaders {\n const warningProduced = new Set();\n return new Proxy<HttpHeaders>(headers, {\n get(target: HttpHeaders, prop: keyof HttpHeaders): unknown {\n const value = Reflect.get(target, prop);\n const methods: Set<keyof HttpHeaders> = new Set(['get', 'has', 'getAll']);\n\n if (typeof value !== 'function' || !methods.has(prop)) {\n return value;\n }\n\n return (headerName: string) => {\n // We log when the key has been removed and a warning hasn't been produced for the header\n const key = (prop + ':' + headerName).toLowerCase(); // e.g. `get:cache-control`\n if (!headersToInclude.includes(headerName) && !warningProduced.has(key)) {\n warningProduced.add(key);\n const truncatedUrl = truncateMiddle(url);\n\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.HEADERS_ALTERED_BY_TRANSFER_CACHE,\n `Angular detected that the \\`${headerName}\\` header is accessed, but the value of the header ` +\n `was not transferred from the server to the client by the HttpTransferCache. ` +\n `To include the value of the \\`${headerName}\\` header for the \\`${truncatedUrl}\\` request, ` +\n `use the \\`includeHeaders\\` list. The \\`includeHeaders\\` can be defined either ` +\n `on a request level by adding the \\`transferCache\\` parameter, or on an application ` +\n `level by adding the \\`httpCacheTransfer.includeHeaders\\` argument to the ` +\n `\\`provideClientHydration()\\` call. `,\n ),\n );\n }\n\n // invoking the original method\n return (value as Function).apply(target, [headerName]);\n };\n },\n });\n}\n\nfunction mapRequestOriginUrl(url: string, originMap: Record<string, string>): string {\n const origin = new URL(url, 'resolve://').origin;\n const mappedOrigin = originMap[origin];\n if (!mappedOrigin) {\n return url;\n }\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n verifyMappedOrigin(mappedOrigin);\n }\n\n return url.replace(origin, mappedOrigin);\n}\n\nfunction verifyMappedOrigin(url: string): void {\n if (new URL(url, 'resolve://').pathname !== '/') {\n throw new RuntimeError(\n RuntimeErrorCode.HTTP_ORIGIN_MAP_CONTAINS_PATH,\n 'Angular detected a URL with a path segment in the value provided for the ' +\n `\\`HTTP_TRANSFER_CACHE_ORIGIN_MAP\\` token: ${url}. The map should only contain origins ` +\n 'without any other segments.',\n );\n }\n}\n"],"names":["httpResource","jsonFn","makeHttpResourceFn","arrayBuffer","blob","text","responseType","request","options","ngDevMode","injector","assertInInjectionContext","inject","Injector","HttpResourceImpl","normalizeRequest","defaultValue","debugName","parse","equal","unwrappedRequest","undefined","url","headers","HttpHeaders","params","HttpParams","fromObject","HttpRequest","method","body","reportProgress","withCredentials","keepalive","cache","priority","mode","redirect","context","transferCache","credentials","referrer","referrerPolicy","integrity","timeout","ResourceImpl","client","_headers","linkedSignal","source","extRequest","computation","_progress","_statusCode","computed","status","progress","asReadonly","statusCode","constructor","abortSignal","sub","onAbort","unsubscribe","addEventListener","stream","signal","value","resolve","promise","Promise","r","send","set","subscribe","next","event","type","HttpEventType","Response","error","encapsulateResourceError","DownloadProgress","HttpErrorResponse","removeEventListener","complete","ɵRuntimeError","get","HttpClient","HTTP_TRANSFER_CACHE_ORIGIN_MAP","InjectionToken","BODY","HEADERS","STATUS","STATUS_TEXT","REQ_URL","RESPONSE_TYPE","CACHE_OPTIONS","ALLOWED_METHODS","transferCacheInterceptorFn","req","isCacheActive","globalOptions","requestOptions","requestMethod","includePostRequests","includes","includeRequestsWithAuthHeaders","hasAuthHeaders","filter","transferState","TransferState","originMap","optional","ngServerMode","RuntimeError","requestUrl","mapRequestOriginUrl","storeKey","makeCacheKey","response","headersToInclude","includeHeaders","undecodedBody","httpHeaders","statusText","TextEncoder","encode","buffer","Blob","appendMissingHeadersDetection","of","HttpResponse","event$","pipe","tap","getFilteredHeaders","has","headersMap","key","values","getAll","sortAndConcatParams","keys","sort","map","k","join","mappedRequestUrl","encodedParams","serializedBody","serializeBody","URLSearchParams","hash","generateHash","makeStateKey","char","Math","imul","charCodeAt","toString","withHttpTransferCache","cacheOptions","provide","useFactory","performanceMarkFeature","HTTP_ROOT_INTERCEPTOR_FNS","useValue","multi","APP_BOOTSTRAP_LISTENER","appRef","ApplicationRef","cacheState","whenStable","then","warningProduced","Set","Proxy","target","prop","Reflect","methods","headerName","toLowerCase","add","truncatedUrl","truncateMiddle","console","warn","formatRuntimeError","apply","origin","URL","mappedOrigin","verifyMappedOrigin","replace","pathname"],"mappings":";;;;;;;;;;;;;;AAkNaA,MAAAA,YAAY,GAAmB,CAAC,MAAK;AAChD,EAAA,MAAMC,MAAM,GAAGC,kBAAkB,CAAU,MAAM,CAAmB;AACpED,EAAAA,MAAM,CAACE,WAAW,GAAGD,kBAAkB,CAAc,aAAa,CAAC;AACnED,EAAAA,MAAM,CAACG,IAAI,GAAGF,kBAAkB,CAAC,MAAM,CAAC;AACxCD,EAAAA,MAAM,CAACI,IAAI,GAAGH,kBAAkB,CAAC,MAAM,CAAC;AACxC,EAAA,OAAOD,MAAM;AACf,CAAC;AAWD,SAASC,kBAAkBA,CAAOI,YAA0B,EAAA;AAC1D,EAAA,OAAO,SAASN,YAAYA,CAC1BO,OAAuB,EACvBC,OAA4C,EAAA;AAE5C,IAAA,IAAIC,SAAS,IAAI,CAACD,OAAO,EAAEE,QAAQ,EAAE;MACnCC,wBAAwB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;AAEA,SAASC,kBAAkBA,CAAC5K,GAAW,EAAA;EACrC,IAAI,IAAI0K,GAAG,CAAC1K,GAAG,EAAE,YAAY,CAAC,CAAC8K,QAAQ,KAAK,GAAG,EAAE;AAC/C,IAAA,MAAM,IAAIjF,aAAY,CAAA,IAAA,EAEpB,2EAA2E,GACzE,CAAA,0CAAA,EAA6C7F,GAAG,CAAA,sCAAA,CAAwC,GACxF,6BAA6B,CAChC;AACH;AACF;;;;"}
|
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.
|
|
2
|
+
* @license Angular v21.0.6
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -202,7 +202,7 @@ class MockPlatformLocation {
|
|
|
202
202
|
}
|
|
203
203
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
204
204
|
minVersion: "12.0.0",
|
|
205
|
-
version: "21.0.
|
|
205
|
+
version: "21.0.6",
|
|
206
206
|
ngImport: i0,
|
|
207
207
|
type: MockPlatformLocation,
|
|
208
208
|
deps: [{
|
|
@@ -213,14 +213,14 @@ class MockPlatformLocation {
|
|
|
213
213
|
});
|
|
214
214
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
215
215
|
minVersion: "12.0.0",
|
|
216
|
-
version: "21.0.
|
|
216
|
+
version: "21.0.6",
|
|
217
217
|
ngImport: i0,
|
|
218
218
|
type: MockPlatformLocation
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
i0.ɵɵngDeclareClassMetadata({
|
|
222
222
|
minVersion: "12.0.0",
|
|
223
|
-
version: "21.0.
|
|
223
|
+
version: "21.0.6",
|
|
224
224
|
ngImport: i0,
|
|
225
225
|
type: MockPlatformLocation,
|
|
226
226
|
decorators: [{
|
|
@@ -300,7 +300,7 @@ class FakeNavigationPlatformLocation {
|
|
|
300
300
|
}
|
|
301
301
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
302
302
|
minVersion: "12.0.0",
|
|
303
|
-
version: "21.0.
|
|
303
|
+
version: "21.0.6",
|
|
304
304
|
ngImport: i0,
|
|
305
305
|
type: FakeNavigationPlatformLocation,
|
|
306
306
|
deps: [],
|
|
@@ -308,14 +308,14 @@ class FakeNavigationPlatformLocation {
|
|
|
308
308
|
});
|
|
309
309
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
310
310
|
minVersion: "12.0.0",
|
|
311
|
-
version: "21.0.
|
|
311
|
+
version: "21.0.6",
|
|
312
312
|
ngImport: i0,
|
|
313
313
|
type: FakeNavigationPlatformLocation
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
i0.ɵɵngDeclareClassMetadata({
|
|
317
317
|
minVersion: "12.0.0",
|
|
318
|
-
version: "21.0.
|
|
318
|
+
version: "21.0.6",
|
|
319
319
|
ngImport: i0,
|
|
320
320
|
type: FakeNavigationPlatformLocation,
|
|
321
321
|
decorators: [{
|
|
@@ -325,7 +325,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
325
325
|
});
|
|
326
326
|
|
|
327
327
|
const FAKE_NAVIGATION = new InjectionToken('fakeNavigation', {
|
|
328
|
-
providedIn: 'root',
|
|
329
328
|
factory: () => {
|
|
330
329
|
const config = inject(MOCK_PLATFORM_LOCATION_CONFIG, {
|
|
331
330
|
optional: true
|
|
@@ -499,7 +498,7 @@ class SpyLocation {
|
|
|
499
498
|
}
|
|
500
499
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
501
500
|
minVersion: "12.0.0",
|
|
502
|
-
version: "21.0.
|
|
501
|
+
version: "21.0.6",
|
|
503
502
|
ngImport: i0,
|
|
504
503
|
type: SpyLocation,
|
|
505
504
|
deps: [],
|
|
@@ -507,14 +506,14 @@ class SpyLocation {
|
|
|
507
506
|
});
|
|
508
507
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
509
508
|
minVersion: "12.0.0",
|
|
510
|
-
version: "21.0.
|
|
509
|
+
version: "21.0.6",
|
|
511
510
|
ngImport: i0,
|
|
512
511
|
type: SpyLocation
|
|
513
512
|
});
|
|
514
513
|
}
|
|
515
514
|
i0.ɵɵngDeclareClassMetadata({
|
|
516
515
|
minVersion: "12.0.0",
|
|
517
|
-
version: "21.0.
|
|
516
|
+
version: "21.0.6",
|
|
518
517
|
ngImport: i0,
|
|
519
518
|
type: SpyLocation,
|
|
520
519
|
decorators: [{
|
|
@@ -595,7 +594,7 @@ class MockLocationStrategy extends LocationStrategy {
|
|
|
595
594
|
}
|
|
596
595
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
597
596
|
minVersion: "12.0.0",
|
|
598
|
-
version: "21.0.
|
|
597
|
+
version: "21.0.6",
|
|
599
598
|
ngImport: i0,
|
|
600
599
|
type: MockLocationStrategy,
|
|
601
600
|
deps: [],
|
|
@@ -603,14 +602,14 @@ class MockLocationStrategy extends LocationStrategy {
|
|
|
603
602
|
});
|
|
604
603
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
605
604
|
minVersion: "12.0.0",
|
|
606
|
-
version: "21.0.
|
|
605
|
+
version: "21.0.6",
|
|
607
606
|
ngImport: i0,
|
|
608
607
|
type: MockLocationStrategy
|
|
609
608
|
});
|
|
610
609
|
}
|
|
611
610
|
i0.ɵɵngDeclareClassMetadata({
|
|
612
611
|
minVersion: "12.0.0",
|
|
613
|
-
version: "21.0.
|
|
612
|
+
version: "21.0.6",
|
|
614
613
|
ngImport: i0,
|
|
615
614
|
type: MockLocationStrategy,
|
|
616
615
|
decorators: [{
|