@angular/common 20.1.0 → 20.2.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.1.0
2
+ * @license Angular v20.2.0-next.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -810,6 +810,17 @@ class HttpRequest {
810
810
  * This can affect whether the request follows redirects automatically, or if it fails when a redirect occurs.
811
811
  */
812
812
  redirect;
813
+ /**
814
+ * The referrer of the request, which can be used to indicate the origin of the request.
815
+ * This is useful for security and analytics purposes.
816
+ * Value is a same-origin URL, "about:client", or the empty string, to set request's referrer.
817
+ */
818
+ referrer;
819
+ /**
820
+ * The integrity metadata of the request, which can be used to ensure the request is made with the expected content.
821
+ * A cryptographic hash of the resource to be fetched by request
822
+ */
823
+ integrity;
813
824
  /**
814
825
  * The expected response type of the server.
815
826
  *
@@ -904,6 +915,12 @@ class HttpRequest {
904
915
  if (options.redirect) {
905
916
  this.redirect = options.redirect;
906
917
  }
918
+ if (options.integrity) {
919
+ this.integrity = options.integrity;
920
+ }
921
+ if (options.referrer) {
922
+ this.referrer = options.referrer;
923
+ }
907
924
  // We do want to assign transferCache even if it's falsy (false is valid value)
908
925
  this.transferCache = options.transferCache;
909
926
  }
@@ -1023,6 +1040,8 @@ class HttpRequest {
1023
1040
  const mode = update.mode || this.mode;
1024
1041
  const redirect = update.redirect || this.redirect;
1025
1042
  const credentials = update.credentials || this.credentials;
1043
+ const referrer = update.referrer || this.referrer;
1044
+ const integrity = update.integrity || this.integrity;
1026
1045
  // Carefully handle the transferCache to differentiate between
1027
1046
  // `false` and `undefined` in the update args.
1028
1047
  const transferCache = update.transferCache ?? this.transferCache;
@@ -1068,6 +1087,8 @@ class HttpRequest {
1068
1087
  mode,
1069
1088
  redirect,
1070
1089
  credentials,
1090
+ referrer,
1091
+ integrity,
1071
1092
  });
1072
1093
  }
1073
1094
  }
@@ -1491,6 +1512,8 @@ class HttpClient {
1491
1512
  mode: options.mode,
1492
1513
  redirect: options.redirect,
1493
1514
  credentials: options.credentials,
1515
+ referrer: options.referrer,
1516
+ integrity: options.integrity,
1494
1517
  });
1495
1518
  }
1496
1519
  // Start with an Observable.of() the initial request, and run the handler (which
@@ -1645,10 +1668,10 @@ class HttpClient {
1645
1668
  put(url, body, options = {}) {
1646
1669
  return this.request('PUT', url, addBody(options, body));
1647
1670
  }
1648
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
1649
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClient });
1671
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClient, deps: [{ token: HttpHandler }], target: i0.ɵɵFactoryTarget.Injectable });
1672
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClient });
1650
1673
  }
1651
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClient, decorators: [{
1674
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClient, decorators: [{
1652
1675
  type: Injectable
1653
1676
  }], ctorParameters: () => [{ type: HttpHandler }] });
1654
1677
 
@@ -1910,6 +1933,8 @@ class FetchBackend {
1910
1933
  priority: req.priority,
1911
1934
  mode: req.mode,
1912
1935
  redirect: req.redirect,
1936
+ referrer: req.referrer,
1937
+ integrity: req.integrity,
1913
1938
  };
1914
1939
  }
1915
1940
  concatChunks(chunks, totalLength) {
@@ -1921,10 +1946,10 @@ class FetchBackend {
1921
1946
  }
1922
1947
  return chunksAll;
1923
1948
  }
1924
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1925
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: FetchBackend });
1949
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: FetchBackend, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1950
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: FetchBackend });
1926
1951
  }
1927
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: FetchBackend, decorators: [{
1952
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: FetchBackend, decorators: [{
1928
1953
  type: Injectable
1929
1954
  }], ctorParameters: () => [] });
1930
1955
  /**
@@ -2068,10 +2093,10 @@ class HttpInterceptorHandler extends HttpHandler {
2068
2093
  return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
2069
2094
  }
2070
2095
  }
2071
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2072
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpInterceptorHandler });
2096
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpInterceptorHandler, deps: [{ token: HttpBackend }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2097
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpInterceptorHandler });
2073
2098
  }
2074
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
2099
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpInterceptorHandler, decorators: [{
2075
2100
  type: Injectable
2076
2101
  }], ctorParameters: () => [{ type: HttpBackend }, { type: i0.EnvironmentInjector }] });
2077
2102
 
@@ -2273,10 +2298,10 @@ class JsonpClientBackend {
2273
2298
  foreignDocument ??= this.document.implementation.createHTMLDocument();
2274
2299
  foreignDocument.adoptNode(script);
2275
2300
  }
2276
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2277
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: JsonpClientBackend });
2301
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: JsonpClientBackend, deps: [{ token: JsonpCallbackContext }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2302
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: JsonpClientBackend });
2278
2303
  }
2279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: JsonpClientBackend, decorators: [{
2304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: JsonpClientBackend, decorators: [{
2280
2305
  type: Injectable
2281
2306
  }], ctorParameters: () => [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{
2282
2307
  type: Inject,
@@ -2315,10 +2340,10 @@ class JsonpInterceptor {
2315
2340
  intercept(initialRequest, next) {
2316
2341
  return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
2317
2342
  }
2318
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2319
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: JsonpInterceptor });
2343
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: JsonpInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2344
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: JsonpInterceptor });
2320
2345
  }
2321
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: JsonpInterceptor, decorators: [{
2346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: JsonpInterceptor, decorators: [{
2322
2347
  type: Injectable
2323
2348
  }], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
2324
2349
 
@@ -2367,6 +2392,14 @@ function validateXhrCompatibility(req) {
2367
2392
  property: 'credentials',
2368
2393
  errorCode: 2818 /* RuntimeErrorCode.CREDENTIALS_NOT_SUPPORTED_WITH_XHR */,
2369
2394
  },
2395
+ {
2396
+ property: 'integrity',
2397
+ errorCode: 2820 /* RuntimeErrorCode.INTEGRITY_NOT_SUPPORTED_WITH_XHR */,
2398
+ },
2399
+ {
2400
+ property: 'referrer',
2401
+ errorCode: 2821 /* RuntimeErrorCode.REFERRER_NOT_SUPPORTED_WITH_XHR */,
2402
+ },
2370
2403
  ];
2371
2404
  // Check each unsupported option and warn if present
2372
2405
  for (const { property, errorCode } of unsupportedOptions) {
@@ -2662,10 +2695,10 @@ class HttpXhrBackend {
2662
2695
  });
2663
2696
  }));
2664
2697
  }
2665
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXhrBackend, deps: [{ token: XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
2666
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXhrBackend });
2698
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXhrBackend, deps: [{ token: XhrFactory }], target: i0.ɵɵFactoryTarget.Injectable });
2699
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXhrBackend });
2667
2700
  }
2668
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXhrBackend, decorators: [{
2701
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXhrBackend, decorators: [{
2669
2702
  type: Injectable
2670
2703
  }], ctorParameters: () => [{ type: XhrFactory }] });
2671
2704
 
@@ -2715,10 +2748,10 @@ class HttpXsrfCookieExtractor {
2715
2748
  }
2716
2749
  return this.lastToken;
2717
2750
  }
2718
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
2719
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXsrfCookieExtractor });
2751
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXsrfCookieExtractor, deps: [{ token: DOCUMENT }, { token: XSRF_COOKIE_NAME }], target: i0.ɵɵFactoryTarget.Injectable });
2752
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXsrfCookieExtractor });
2720
2753
  }
2721
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
2754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXsrfCookieExtractor, decorators: [{
2722
2755
  type: Injectable
2723
2756
  }], ctorParameters: () => [{ type: undefined, decorators: [{
2724
2757
  type: Inject,
@@ -2759,10 +2792,10 @@ class HttpXsrfInterceptor {
2759
2792
  intercept(initialRequest, next) {
2760
2793
  return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
2761
2794
  }
2762
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2763
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXsrfInterceptor });
2795
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXsrfInterceptor, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
2796
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXsrfInterceptor });
2764
2797
  }
2765
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
2798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpXsrfInterceptor, decorators: [{
2766
2799
  type: Injectable
2767
2800
  }], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
2768
2801
 
@@ -3028,9 +3061,9 @@ class HttpClientXsrfModule {
3028
3061
  providers: withXsrfConfiguration(options).ɵproviders,
3029
3062
  };
3030
3063
  }
3031
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3032
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.0", ngImport: i0, type: HttpClientXsrfModule });
3033
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientXsrfModule, providers: [
3064
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientXsrfModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3065
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientXsrfModule });
3066
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientXsrfModule, providers: [
3034
3067
  HttpXsrfInterceptor,
3035
3068
  { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true },
3036
3069
  { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor },
@@ -3041,7 +3074,7 @@ class HttpClientXsrfModule {
3041
3074
  { provide: XSRF_ENABLED, useValue: true },
3042
3075
  ] });
3043
3076
  }
3044
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
3077
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientXsrfModule, decorators: [{
3045
3078
  type: NgModule,
3046
3079
  args: [{
3047
3080
  providers: [
@@ -3067,11 +3100,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
3067
3100
  * @deprecated use `provideHttpClient(withInterceptorsFromDi())` as providers instead
3068
3101
  */
3069
3102
  class HttpClientModule {
3070
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3071
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.0", ngImport: i0, type: HttpClientModule });
3072
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] });
3103
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3104
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientModule });
3105
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientModule, providers: [provideHttpClient(withInterceptorsFromDi())] });
3073
3106
  }
3074
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientModule, decorators: [{
3107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientModule, decorators: [{
3075
3108
  type: NgModule,
3076
3109
  args: [{
3077
3110
  /**
@@ -3091,11 +3124,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
3091
3124
  * @deprecated `withJsonpSupport()` as providers instead
3092
3125
  */
3093
3126
  class HttpClientJsonpModule {
3094
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3095
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.0", ngImport: i0, type: HttpClientJsonpModule });
3096
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] });
3127
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientJsonpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3128
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientJsonpModule });
3129
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientJsonpModule, providers: [withJsonpSupport().ɵproviders] });
3097
3130
  }
3098
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
3131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.0", ngImport: i0, type: HttpClientJsonpModule, decorators: [{
3099
3132
  type: NgModule,
3100
3133
  args: [{
3101
3134
  providers: [withJsonpSupport().ɵproviders],