@angular/common 20.2.0-next.0 → 20.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common_module.d.d.ts +1 -1
- package/fesm2022/common.mjs +14 -14
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/common_module.mjs +86 -86
- package/fesm2022/http/testing.mjs +8 -8
- package/fesm2022/http.mjs +3 -1
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/location.mjs +16 -16
- package/fesm2022/module.mjs +41 -40
- package/fesm2022/module.mjs.map +1 -1
- package/fesm2022/platform_navigation.mjs +4 -4
- package/fesm2022/testing.mjs +13 -13
- package/fesm2022/upgrade.mjs +5 -5
- package/fesm2022/xhr.mjs +1 -1
- package/http/index.d.ts +134 -1
- package/http/testing/index.d.ts +1 -1
- package/index.d.ts +1 -1
- package/module.d.d.ts +1 -1
- package/package.json +2 -2
- package/platform_location.d.d.ts +1 -1
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
- package/xhr.d.d.ts +1 -1
package/fesm2022/http.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/packages/common/http/src/resource.ts","../../../../../k8-fastbuild-ST-46c76129e412/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?.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 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 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 injector,\n );\n this.client = injector.get(HttpClient);\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 * @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 note**: 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 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 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 */\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 // TODO: create Error guide for this warning\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":["ResourceImpl","encapsulateResourceError","ɵRuntimeError","RuntimeError","performanceMarkFeature","truncateMiddle","formatRuntimeError"],"mappings":";;;;;;;;;;;;;AAyMA;;;;;;;;AAQG;AACU,MAAA,YAAY,GAAmB,CAAC,MAAK;AAChD,IAAA,MAAM,MAAM,GAAG,kBAAkB,CAAU,MAAM,CAAmB;AACpE,IAAA,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAc,aAAa,CAAC;AACnE,IAAA,MAAM,CAAC,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC;AACxC,IAAA,MAAM,CAAC,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC;AACxC,IAAA,OAAO,MAAM;AACf,CAAC;AAWD,SAAS,kBAAkB,CAAO,YAA0B,EAAA;AAC1D,IAAA,OAAO,SAAS,YAAY,CAC1B,OAAuB,EACvB,OAA4C,EAAA;AAE5C,QAAA,IAAI,SAAS,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE;YACnC,wBAAwB,CAAC,YAAY,CAAC;;QAExC,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC;QACtD,OAAO,IAAI,gBAAgB,CACzB,QAAQ,EACR,MAAM,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,EAC7C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,KAAoC,EAC7C,OAAO,EAAE,KAAiC,CACf;AAC/B,KAAC;AACH;AAEA,SAAS,gBAAgB,CACvB,OAAuB,EACvB,YAA0B,EAAA;AAE1B,IAAA,IAAI,gBAAgB,GAAG,OAAO,OAAO,KAAK,UAAU,GAAG,OAAO,EAAE,GAAG,OAAO;AAC1E,IAAA,IAAI,gBAAgB,KAAK,SAAS,EAAE;AAClC,QAAA,OAAO,SAAS;;AACX,SAAA,IAAI,OAAO,gBAAgB,KAAK,QAAQ,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AAA,CACxC,CACF;;;gBAIH,OAAQ,KAAkB,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC;AACxD,aAAC;SACF;AACF,KAAA,CAAC;AACJ;AAEA,SAAS,mBAAmB,CAAC,GAAW,EAAE,SAAiC,EAAA;IACzE,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,MAAM;AAChD,IAAA,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC;IACtC,IAAI,CAAC,YAAY,EAAE;AACjB,QAAA,OAAO,GAAG;;AAGZ,IAAA,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,EAAE;QACjD,kBAAkB,CAAC,YAAY,CAAC;;IAGlC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC;AAC1C;AAEA,SAAS,kBAAkB,CAAC,GAAW,EAAA;AACrC,IAAA,IAAI,IAAI,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,QAAQ,KAAK,GAAG,EAAE;QAC/C,MAAM,IAAIH,aAAY,CAAA,IAAA,uDAEpB,2EAA2E;AACzE,YAAA,CAAA,0CAAA,EAA6C,GAAG,CAAwC,sCAAA,CAAA;AACxF,YAAA,6BAA6B,CAChC;;AAEL;;;;"}
|
|
1
|
+
{"version":3,"file":"http.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/packages/common/http/src/resource.ts","../../../../../k8-fastbuild-ST-46c76129e412/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?.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 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 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 injector,\n );\n this.client = injector.get(HttpClient);\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 * @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 note**: 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 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 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 */\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 // TODO: create Error guide for this warning\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":["ResourceImpl","encapsulateResourceError","ɵRuntimeError","RuntimeError","performanceMarkFeature","truncateMiddle","formatRuntimeError"],"mappings":";;;;;;;;;;;;;AAyMA;;;;;;;;AAQG;AACU,MAAA,YAAY,GAAmB,CAAC,MAAK;AAChD,IAAA,MAAM,MAAM,GAAG,kBAAkB,CAAU,MAAM,CAAmB;AACpE,IAAA,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAc,aAAa,CAAC;AACnE,IAAA,MAAM,CAAC,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC;AACxC,IAAA,MAAM,CAAC,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC;AACxC,IAAA,OAAO,MAAM;AACf,CAAC;AAWD,SAAS,kBAAkB,CAAO,YAA0B,EAAA;AAC1D,IAAA,OAAO,SAAS,YAAY,CAC1B,OAAuB,EACvB,OAA4C,EAAA;AAE5C,QAAA,IAAI,SAAS,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE;YACnC,wBAAwB,CAAC,YAAY,CAAC;;QAExC,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC;QACtD,OAAO,IAAI,gBAAgB,CACzB,QAAQ,EACR,MAAM,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,EAC7C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,KAAoC,EAC7C,OAAO,EAAE,KAAiC,CACf;AAC/B,KAAC;AACH;AAEA,SAAS,gBAAgB,CACvB,OAAuB,EACvB,YAA0B,EAAA;AAE1B,IAAA,IAAI,gBAAgB,GAAG,OAAO,OAAO,KAAK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
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -50,10 +50,10 @@ class PlatformLocation {
|
|
|
50
50
|
historyGo(relativePosition) {
|
|
51
51
|
throw new Error(ngDevMode ? 'Not implemented' : '');
|
|
52
52
|
}
|
|
53
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
54
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: PlatformLocation, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
54
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: PlatformLocation, providedIn: 'platform', useFactory: () => inject(BrowserPlatformLocation) });
|
|
55
55
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: PlatformLocation, decorators: [{
|
|
57
57
|
type: Injectable,
|
|
58
58
|
args: [{ providedIn: 'platform', useFactory: () => inject(BrowserPlatformLocation) }]
|
|
59
59
|
}] });
|
|
@@ -135,10 +135,10 @@ class BrowserPlatformLocation extends PlatformLocation {
|
|
|
135
135
|
getState() {
|
|
136
136
|
return this._history.state;
|
|
137
137
|
}
|
|
138
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
139
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
138
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: BrowserPlatformLocation, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
139
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: BrowserPlatformLocation, providedIn: 'platform', useFactory: () => new BrowserPlatformLocation() });
|
|
140
140
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: BrowserPlatformLocation, decorators: [{
|
|
142
142
|
type: Injectable,
|
|
143
143
|
args: [{
|
|
144
144
|
providedIn: 'platform',
|
|
@@ -219,10 +219,10 @@ class LocationStrategy {
|
|
|
219
219
|
historyGo(relativePosition) {
|
|
220
220
|
throw new Error(ngDevMode ? 'Not implemented' : '');
|
|
221
221
|
}
|
|
222
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
223
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
222
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: LocationStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
223
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: LocationStrategy, providedIn: 'root', useFactory: () => inject(PathLocationStrategy) });
|
|
224
224
|
}
|
|
225
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: LocationStrategy, decorators: [{
|
|
226
226
|
type: Injectable,
|
|
227
227
|
args: [{ providedIn: 'root', useFactory: () => inject(PathLocationStrategy) }]
|
|
228
228
|
}] });
|
|
@@ -334,10 +334,10 @@ class PathLocationStrategy extends LocationStrategy {
|
|
|
334
334
|
historyGo(relativePosition = 0) {
|
|
335
335
|
this._platformLocation.historyGo?.(relativePosition);
|
|
336
336
|
}
|
|
337
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
338
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
337
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: PathLocationStrategy, deps: [{ token: PlatformLocation }, { token: APP_BASE_HREF, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
338
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: PathLocationStrategy, providedIn: 'root' });
|
|
339
339
|
}
|
|
340
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: PathLocationStrategy, decorators: [{
|
|
341
341
|
type: Injectable,
|
|
342
342
|
args: [{ providedIn: 'root' }]
|
|
343
343
|
}], ctorParameters: () => [{ type: PlatformLocation }, { type: undefined, decorators: [{
|
|
@@ -592,10 +592,10 @@ class Location {
|
|
|
592
592
|
* @returns The URL string, modified if needed.
|
|
593
593
|
*/
|
|
594
594
|
static stripTrailingSlash = stripTrailingSlash;
|
|
595
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
596
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
595
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: Location, deps: [{ token: LocationStrategy }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
596
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: Location, providedIn: 'root', useFactory: createLocation });
|
|
597
597
|
}
|
|
598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: Location, decorators: [{
|
|
599
599
|
type: Injectable,
|
|
600
600
|
args: [{
|
|
601
601
|
providedIn: 'root',
|
package/fesm2022/module.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.2.0-next.
|
|
2
|
+
* @license Angular v20.2.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -904,8 +904,7 @@ class HttpRequest {
|
|
|
904
904
|
if (typeof options.timeout === 'number') {
|
|
905
905
|
// XHR will ignore any value below 1. AbortSignals only accept unsigned integers.
|
|
906
906
|
if (options.timeout < 1 || !Number.isInteger(options.timeout)) {
|
|
907
|
-
|
|
908
|
-
throw new Error(ngDevMode ? '`timeout` must be a positive integer value' : '');
|
|
907
|
+
throw new _RuntimeError(2822 /* RuntimeErrorCode.INVALID_TIMEOUT_VALUE */, ngDevMode ? '`timeout` must be a positive integer value' : '');
|
|
909
908
|
}
|
|
910
909
|
this.timeout = options.timeout;
|
|
911
910
|
}
|
|
@@ -1375,6 +1374,7 @@ function addBody(options, body) {
|
|
|
1375
1374
|
responseType: options.responseType,
|
|
1376
1375
|
withCredentials: options.withCredentials,
|
|
1377
1376
|
transferCache: options.transferCache,
|
|
1377
|
+
timeout: options.timeout,
|
|
1378
1378
|
keepalive: options.keepalive,
|
|
1379
1379
|
priority: options.priority,
|
|
1380
1380
|
cache: options.cache,
|
|
@@ -1514,6 +1514,7 @@ class HttpClient {
|
|
|
1514
1514
|
credentials: options.credentials,
|
|
1515
1515
|
referrer: options.referrer,
|
|
1516
1516
|
integrity: options.integrity,
|
|
1517
|
+
timeout: options.timeout,
|
|
1517
1518
|
});
|
|
1518
1519
|
}
|
|
1519
1520
|
// Start with an Observable.of() the initial request, and run the handler (which
|
|
@@ -1668,10 +1669,10 @@ class HttpClient {
|
|
|
1668
1669
|
put(url, body, options = {}) {
|
|
1669
1670
|
return this.request('PUT', url, addBody(options, body));
|
|
1670
1671
|
}
|
|
1671
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
1672
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
1672
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1673
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClient });
|
|
1673
1674
|
}
|
|
1674
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
1675
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClient, decorators: [{
|
|
1675
1676
|
type: Injectable
|
|
1676
1677
|
}], ctorParameters: () => [{ type: HttpHandler }] });
|
|
1677
1678
|
|
|
@@ -1946,10 +1947,10 @@ class FetchBackend {
|
|
|
1946
1947
|
}
|
|
1947
1948
|
return chunksAll;
|
|
1948
1949
|
}
|
|
1949
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
1950
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
1950
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1951
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: FetchBackend });
|
|
1951
1952
|
}
|
|
1952
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
1953
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: FetchBackend, decorators: [{
|
|
1953
1954
|
type: Injectable
|
|
1954
1955
|
}], ctorParameters: () => [] });
|
|
1955
1956
|
/**
|
|
@@ -2093,10 +2094,10 @@ class HttpInterceptorHandler extends HttpHandler {
|
|
|
2093
2094
|
return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
|
|
2094
2095
|
}
|
|
2095
2096
|
}
|
|
2096
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2097
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2097
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2098
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpInterceptorHandler });
|
|
2098
2099
|
}
|
|
2099
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
|
|
2100
2101
|
type: Injectable
|
|
2101
2102
|
}], ctorParameters: () => [{ type: HttpBackend }, { type: i0.EnvironmentInjector }] });
|
|
2102
2103
|
|
|
@@ -2298,10 +2299,10 @@ class JsonpClientBackend {
|
|
|
2298
2299
|
foreignDocument ??= this.document.implementation.createHTMLDocument();
|
|
2299
2300
|
foreignDocument.adoptNode(script);
|
|
2300
2301
|
}
|
|
2301
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2302
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2302
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2303
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: JsonpClientBackend });
|
|
2303
2304
|
}
|
|
2304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: JsonpClientBackend, decorators: [{
|
|
2305
2306
|
type: Injectable
|
|
2306
2307
|
}], ctorParameters: () => [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
|
|
2307
2308
|
type: Inject,
|
|
@@ -2340,10 +2341,10 @@ class JsonpInterceptor {
|
|
|
2340
2341
|
intercept(initialRequest, next) {
|
|
2341
2342
|
return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
|
|
2342
2343
|
}
|
|
2343
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2344
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2344
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2345
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: JsonpInterceptor });
|
|
2345
2346
|
}
|
|
2346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: JsonpInterceptor, decorators: [{
|
|
2347
2348
|
type: Injectable
|
|
2348
2349
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
2349
2350
|
|
|
@@ -2403,7 +2404,7 @@ function validateXhrCompatibility(req) {
|
|
|
2403
2404
|
];
|
|
2404
2405
|
// Check each unsupported option and warn if present
|
|
2405
2406
|
for (const { property, errorCode } of unsupportedOptions) {
|
|
2406
|
-
if (property
|
|
2407
|
+
if (req[property]) {
|
|
2407
2408
|
console.warn(_formatRuntimeError(errorCode, `Angular detected that a \`HttpClient\` request with the \`${property}\` option was sent using XHR, which does not support it. To use the \`${property}\` option, enable Fetch API support by passing \`withFetch()\` as an argument to \`provideHttpClient()\`.`));
|
|
2408
2409
|
}
|
|
2409
2410
|
}
|
|
@@ -2695,10 +2696,10 @@ class HttpXhrBackend {
|
|
|
2695
2696
|
});
|
|
2696
2697
|
}));
|
|
2697
2698
|
}
|
|
2698
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2699
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2699
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXhrBackend, deps: [{ token: XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2700
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXhrBackend });
|
|
2700
2701
|
}
|
|
2701
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2702
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXhrBackend, decorators: [{
|
|
2702
2703
|
type: Injectable
|
|
2703
2704
|
}], ctorParameters: () => [{ type: XhrFactory }] });
|
|
2704
2705
|
|
|
@@ -2748,10 +2749,10 @@ class HttpXsrfCookieExtractor {
|
|
|
2748
2749
|
}
|
|
2749
2750
|
return this.lastToken;
|
|
2750
2751
|
}
|
|
2751
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2752
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2752
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2753
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXsrfCookieExtractor });
|
|
2753
2754
|
}
|
|
2754
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
|
|
2755
2756
|
type: Injectable
|
|
2756
2757
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2757
2758
|
type: Inject,
|
|
@@ -2792,10 +2793,10 @@ class HttpXsrfInterceptor {
|
|
|
2792
2793
|
intercept(initialRequest, next) {
|
|
2793
2794
|
return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
|
|
2794
2795
|
}
|
|
2795
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2796
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2796
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2797
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXsrfInterceptor });
|
|
2797
2798
|
}
|
|
2798
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
2799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
|
|
2799
2800
|
type: Injectable
|
|
2800
2801
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
2801
2802
|
|
|
@@ -3061,9 +3062,9 @@ class HttpClientXsrfModule {
|
|
|
3061
3062
|
providers: withXsrfConfiguration(options).ɵproviders,
|
|
3062
3063
|
};
|
|
3063
3064
|
}
|
|
3064
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3065
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.
|
|
3066
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3065
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3066
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientXsrfModule });
|
|
3067
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientXsrfModule, providers: [
|
|
3067
3068
|
HttpXsrfInterceptor,
|
|
3068
3069
|
{ provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
|
|
3069
3070
|
{ provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
|
|
@@ -3074,7 +3075,7 @@ class HttpClientXsrfModule {
|
|
|
3074
3075
|
{ provide: XSRF_ENABLED, useValue: true },
|
|
3075
3076
|
] });
|
|
3076
3077
|
}
|
|
3077
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
|
|
3078
3079
|
type: NgModule,
|
|
3079
3080
|
args: [{
|
|
3080
3081
|
providers: [
|
|
@@ -3100,11 +3101,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0",
|
|
|
3100
3101
|
* @deprecated use `provideHttpClient(withInterceptorsFromDi())` as providers instead
|
|
3101
3102
|
*/
|
|
3102
3103
|
class HttpClientModule {
|
|
3103
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3104
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.
|
|
3105
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3105
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientModule });
|
|
3106
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] });
|
|
3106
3107
|
}
|
|
3107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientModule, decorators: [{
|
|
3108
3109
|
type: NgModule,
|
|
3109
3110
|
args: [{
|
|
3110
3111
|
/**
|
|
@@ -3124,11 +3125,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0",
|
|
|
3124
3125
|
* @deprecated `withJsonpSupport()` as providers instead
|
|
3125
3126
|
*/
|
|
3126
3127
|
class HttpClientJsonpModule {
|
|
3127
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3128
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.
|
|
3129
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3128
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3129
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientJsonpModule });
|
|
3130
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] });
|
|
3130
3131
|
}
|
|
3131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.
|
|
3132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.1", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
|
|
3132
3133
|
type: NgModule,
|
|
3133
3134
|
args: [{
|
|
3134
3135
|
providers: [withJsonpSupport().ɵproviders],
|