@alterior/http 3.11.1 → 3.13.4
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/dist/backend.d.ts +38 -38
- package/dist/backend.js +38 -38
- package/dist/client.d.ts +2108 -2108
- package/dist/client.js +265 -265
- package/dist/client.js.map +1 -1
- package/dist/headers.d.ts +57 -57
- package/dist/headers.js +187 -187
- package/dist/headers.js.map +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +42 -42
- package/dist/interceptor.d.ts +63 -63
- package/dist/interceptor.js +43 -43
- package/dist/interceptor.js.map +1 -1
- package/dist/module.d.ts +101 -101
- package/dist/module.js +188 -188
- package/dist/module.js.map +1 -1
- package/dist/params.d.ts +98 -98
- package/dist/params.js +184 -184
- package/dist/params.js.map +1 -1
- package/dist/request.d.ts +130 -130
- package/dist/request.js +260 -260
- package/dist/request.js.map +1 -1
- package/dist/response.d.ts +267 -267
- package/dist/response.js +165 -165
- package/dist/response.js.map +1 -1
- package/dist/server.d.ts +28 -28
- package/dist/server.js +119 -119
- package/dist/server.js.map +1 -1
- package/dist/test/client.test.d.ts +8 -8
- package/dist/test/client.test.js +163 -163
- package/dist/test/client.test.js.map +1 -1
- package/dist/test/headers.test.d.ts +1 -1
- package/dist/test/headers.test.js +126 -126
- package/dist/test/module.test.d.ts +1 -1
- package/dist/test/module.test.js +117 -117
- package/dist/test/module.test.js.map +1 -1
- package/dist/test/params.test.d.ts +1 -1
- package/dist/test/params.test.js +63 -63
- package/dist/test/request.test.d.ts +8 -8
- package/dist/test/request.test.js +159 -159
- package/dist/test/request.test.js.map +1 -1
- package/dist/test/response.test.d.ts +1 -1
- package/dist/test/response.test.js +79 -79
- package/dist/test/response.test.js.map +1 -1
- package/dist/test/test.d.ts +1 -1
- package/dist/test/test.js +16 -16
- package/dist/test/xhr.mock.d.ts +48 -48
- package/dist/test/xhr.mock.js +94 -94
- package/dist/test/xhr.mock.js.map +1 -1
- package/dist/test/xhr.test.d.ts +1 -1
- package/dist/test/xhr.test.js +344 -344
- package/dist/test/xhr.test.js.map +1 -1
- package/dist/test/xsrf.test.d.ts +1 -1
- package/dist/test/xsrf.test.js +63 -63
- package/dist/test/xsrf.test.js.map +1 -1
- package/dist/testing/api.d.ts +102 -102
- package/dist/testing/api.js +19 -19
- package/dist/testing/backend.d.ts +63 -63
- package/dist/testing/backend.js +141 -141
- package/dist/testing/backend.js.map +1 -1
- package/dist/testing/index.d.ts +10 -10
- package/dist/testing/index.js +16 -16
- package/dist/testing/module.d.ts +16 -16
- package/dist/testing/module.js +38 -38
- package/dist/testing/module.js.map +1 -1
- package/dist/testing/request.d.ts +56 -56
- package/dist/testing/request.js +177 -177
- package/dist/testing/request.js.map +1 -1
- package/dist/testing/request.test.d.ts +8 -8
- package/dist/testing/request.test.js +24 -24
- package/dist/xhr.d.ts +42 -42
- package/dist/xhr.js +298 -298
- package/dist/xhr.js.map +1 -1
- package/dist/xsrf.d.ts +37 -37
- package/dist/xsrf.js +55 -55
- package/dist/xsrf.js.map +1 -1
- package/dist.esm/backend.d.ts +38 -38
- package/dist.esm/backend.js +33 -33
- package/dist.esm/client.d.ts +2108 -2108
- package/dist.esm/client.js +262 -262
- package/dist.esm/client.js.map +1 -1
- package/dist.esm/headers.d.ts +57 -57
- package/dist.esm/headers.js +183 -183
- package/dist.esm/headers.js.map +1 -1
- package/dist.esm/index.d.ts +18 -18
- package/dist.esm/index.js +18 -18
- package/dist.esm/interceptor.d.ts +63 -63
- package/dist.esm/interceptor.js +39 -39
- package/dist.esm/interceptor.js.map +1 -1
- package/dist.esm/module.d.ts +101 -101
- package/dist.esm/module.js +183 -183
- package/dist.esm/module.js.map +1 -1
- package/dist.esm/params.d.ts +98 -98
- package/dist.esm/params.js +179 -179
- package/dist.esm/params.js.map +1 -1
- package/dist.esm/request.d.ts +130 -130
- package/dist.esm/request.js +256 -256
- package/dist.esm/request.js.map +1 -1
- package/dist.esm/response.d.ts +267 -267
- package/dist.esm/response.js +158 -158
- package/dist.esm/response.js.map +1 -1
- package/dist.esm/server.d.ts +28 -28
- package/dist.esm/server.js +113 -113
- package/dist.esm/server.js.map +1 -1
- package/dist.esm/test/client.test.d.ts +8 -8
- package/dist.esm/test/client.test.js +161 -161
- package/dist.esm/test/client.test.js.map +1 -1
- package/dist.esm/test/headers.test.d.ts +1 -1
- package/dist.esm/test/headers.test.js +124 -124
- package/dist.esm/test/module.test.d.ts +1 -1
- package/dist.esm/test/module.test.js +115 -115
- package/dist.esm/test/module.test.js.map +1 -1
- package/dist.esm/test/params.test.d.ts +1 -1
- package/dist.esm/test/params.test.js +61 -61
- package/dist.esm/test/request.test.d.ts +8 -8
- package/dist.esm/test/request.test.js +157 -157
- package/dist.esm/test/request.test.js.map +1 -1
- package/dist.esm/test/response.test.d.ts +1 -1
- package/dist.esm/test/response.test.js +77 -77
- package/dist.esm/test/response.test.js.map +1 -1
- package/dist.esm/test/test.d.ts +1 -1
- package/dist.esm/test/test.js +14 -14
- package/dist.esm/test/xhr.mock.d.ts +48 -48
- package/dist.esm/test/xhr.mock.js +88 -88
- package/dist.esm/test/xhr.mock.js.map +1 -1
- package/dist.esm/test/xhr.test.d.ts +1 -1
- package/dist.esm/test/xhr.test.js +342 -342
- package/dist.esm/test/xhr.test.js.map +1 -1
- package/dist.esm/test/xsrf.test.d.ts +1 -1
- package/dist.esm/test/xsrf.test.js +61 -61
- package/dist.esm/test/xsrf.test.js.map +1 -1
- package/dist.esm/testing/api.d.ts +102 -102
- package/dist.esm/testing/api.js +15 -15
- package/dist.esm/testing/backend.d.ts +63 -63
- package/dist.esm/testing/backend.js +138 -138
- package/dist.esm/testing/backend.js.map +1 -1
- package/dist.esm/testing/index.d.ts +10 -10
- package/dist.esm/testing/index.js +10 -10
- package/dist.esm/testing/module.d.ts +16 -16
- package/dist.esm/testing/module.js +35 -35
- package/dist.esm/testing/module.js.map +1 -1
- package/dist.esm/testing/request.d.ts +56 -56
- package/dist.esm/testing/request.js +173 -173
- package/dist.esm/testing/request.js.map +1 -1
- package/dist.esm/testing/request.test.d.ts +8 -8
- package/dist.esm/testing/request.test.js +22 -22
- package/dist.esm/xhr.d.ts +42 -42
- package/dist.esm/xhr.js +294 -294
- package/dist.esm/xhr.js.map +1 -1
- package/dist.esm/xsrf.d.ts +37 -37
- package/dist.esm/xsrf.js +51 -51
- package/dist.esm/xsrf.js.map +1 -1
- package/package.json +11 -11
- package/tsconfig.esm.tsbuildinfo +1 -0
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -8046
package/dist/xsrf.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { InjectionToken } from '@alterior/di';
|
|
9
|
-
import { Observable } from 'rxjs';
|
|
10
|
-
import { HttpHandler } from './backend';
|
|
11
|
-
import { HttpInterceptor } from './interceptor';
|
|
12
|
-
import { HttpRequest } from './request';
|
|
13
|
-
import { HttpEvent } from './response';
|
|
14
|
-
export declare const XSRF_COOKIE_NAME: InjectionToken<string>;
|
|
15
|
-
export declare const XSRF_HEADER_NAME: InjectionToken<string>;
|
|
16
|
-
/**
|
|
17
|
-
* Retrieves the current XSRF token to use with the next outgoing request.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class HttpXsrfTokenExtractor {
|
|
22
|
-
/**
|
|
23
|
-
* Get the XSRF token to use with an outgoing request.
|
|
24
|
-
*
|
|
25
|
-
* Will be called for every request, so the token may change between requests.
|
|
26
|
-
*/
|
|
27
|
-
abstract getToken(): string | null;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.
|
|
31
|
-
*/
|
|
32
|
-
export declare class HttpXsrfInterceptor implements HttpInterceptor {
|
|
33
|
-
private tokenService;
|
|
34
|
-
private headerName;
|
|
35
|
-
constructor(tokenService: HttpXsrfTokenExtractor, headerName: string);
|
|
36
|
-
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
37
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { InjectionToken } from '@alterior/di';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
import { HttpHandler } from './backend';
|
|
11
|
+
import { HttpInterceptor } from './interceptor';
|
|
12
|
+
import { HttpRequest } from './request';
|
|
13
|
+
import { HttpEvent } from './response';
|
|
14
|
+
export declare const XSRF_COOKIE_NAME: InjectionToken<string>;
|
|
15
|
+
export declare const XSRF_HEADER_NAME: InjectionToken<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the current XSRF token to use with the next outgoing request.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class HttpXsrfTokenExtractor {
|
|
22
|
+
/**
|
|
23
|
+
* Get the XSRF token to use with an outgoing request.
|
|
24
|
+
*
|
|
25
|
+
* Will be called for every request, so the token may change between requests.
|
|
26
|
+
*/
|
|
27
|
+
abstract getToken(): string | null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.
|
|
31
|
+
*/
|
|
32
|
+
export declare class HttpXsrfInterceptor implements HttpInterceptor {
|
|
33
|
+
private tokenService;
|
|
34
|
+
private headerName;
|
|
35
|
+
constructor(tokenService: HttpXsrfTokenExtractor, headerName: string);
|
|
36
|
+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
37
|
+
}
|
|
38
38
|
//# sourceMappingURL=xsrf.d.ts.map
|
package/dist/xsrf.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.HttpXsrfInterceptor = exports.HttpXsrfTokenExtractor = exports.XSRF_HEADER_NAME = exports.XSRF_COOKIE_NAME = void 0;
|
|
11
|
-
const tslib_1 = require("tslib");
|
|
12
|
-
//import {DOCUMENT, ɵparseCookieValue as parseCookieValue} from '@angular/common';
|
|
13
|
-
const di_1 = require("@alterior/di");
|
|
14
|
-
exports.XSRF_COOKIE_NAME = new di_1.InjectionToken('XSRF_COOKIE_NAME');
|
|
15
|
-
exports.XSRF_HEADER_NAME = new di_1.InjectionToken('XSRF_HEADER_NAME');
|
|
16
|
-
/**
|
|
17
|
-
* Retrieves the current XSRF token to use with the next outgoing request.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
class HttpXsrfTokenExtractor {
|
|
22
|
-
}
|
|
23
|
-
exports.HttpXsrfTokenExtractor = HttpXsrfTokenExtractor;
|
|
24
|
-
/**
|
|
25
|
-
* `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.
|
|
26
|
-
*/
|
|
27
|
-
let HttpXsrfInterceptor = class HttpXsrfInterceptor {
|
|
28
|
-
constructor(tokenService, headerName) {
|
|
29
|
-
this.tokenService = tokenService;
|
|
30
|
-
this.headerName = headerName;
|
|
31
|
-
}
|
|
32
|
-
intercept(req, next) {
|
|
33
|
-
const lcUrl = req.url.toLowerCase();
|
|
34
|
-
// Skip both non-mutating requests and absolute URLs.
|
|
35
|
-
// Non-mutating requests don't require a token, and absolute URLs require special handling
|
|
36
|
-
// anyway as the cookie set
|
|
37
|
-
// on our origin is not the same as the token expected by another origin.
|
|
38
|
-
if (req.method === 'GET' || req.method === 'HEAD' || lcUrl.startsWith('http://') ||
|
|
39
|
-
lcUrl.startsWith('https://')) {
|
|
40
|
-
return next.handle(req);
|
|
41
|
-
}
|
|
42
|
-
const token = this.tokenService.getToken();
|
|
43
|
-
// Be careful not to overwrite an existing header of the same name.
|
|
44
|
-
if (token !== null && !req.headers.has(this.headerName)) {
|
|
45
|
-
req = req.clone({ headers: req.headers.set(this.headerName, token) });
|
|
46
|
-
}
|
|
47
|
-
return next.handle(req);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
HttpXsrfInterceptor =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
tslib_1.
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.HttpXsrfInterceptor = exports.HttpXsrfTokenExtractor = exports.XSRF_HEADER_NAME = exports.XSRF_COOKIE_NAME = void 0;
|
|
11
|
+
const tslib_1 = require("tslib");
|
|
12
|
+
//import {DOCUMENT, ɵparseCookieValue as parseCookieValue} from '@angular/common';
|
|
13
|
+
const di_1 = require("@alterior/di");
|
|
14
|
+
exports.XSRF_COOKIE_NAME = new di_1.InjectionToken('XSRF_COOKIE_NAME');
|
|
15
|
+
exports.XSRF_HEADER_NAME = new di_1.InjectionToken('XSRF_HEADER_NAME');
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the current XSRF token to use with the next outgoing request.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
class HttpXsrfTokenExtractor {
|
|
22
|
+
}
|
|
23
|
+
exports.HttpXsrfTokenExtractor = HttpXsrfTokenExtractor;
|
|
24
|
+
/**
|
|
25
|
+
* `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.
|
|
26
|
+
*/
|
|
27
|
+
let HttpXsrfInterceptor = class HttpXsrfInterceptor {
|
|
28
|
+
constructor(tokenService, headerName) {
|
|
29
|
+
this.tokenService = tokenService;
|
|
30
|
+
this.headerName = headerName;
|
|
31
|
+
}
|
|
32
|
+
intercept(req, next) {
|
|
33
|
+
const lcUrl = req.url.toLowerCase();
|
|
34
|
+
// Skip both non-mutating requests and absolute URLs.
|
|
35
|
+
// Non-mutating requests don't require a token, and absolute URLs require special handling
|
|
36
|
+
// anyway as the cookie set
|
|
37
|
+
// on our origin is not the same as the token expected by another origin.
|
|
38
|
+
if (req.method === 'GET' || req.method === 'HEAD' || lcUrl.startsWith('http://') ||
|
|
39
|
+
lcUrl.startsWith('https://')) {
|
|
40
|
+
return next.handle(req);
|
|
41
|
+
}
|
|
42
|
+
const token = this.tokenService.getToken();
|
|
43
|
+
// Be careful not to overwrite an existing header of the same name.
|
|
44
|
+
if (token !== null && !req.headers.has(this.headerName)) {
|
|
45
|
+
req = req.clone({ headers: req.headers.set(this.headerName, token) });
|
|
46
|
+
}
|
|
47
|
+
return next.handle(req);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.HttpXsrfInterceptor = HttpXsrfInterceptor;
|
|
51
|
+
exports.HttpXsrfInterceptor = HttpXsrfInterceptor = tslib_1.__decorate([
|
|
52
|
+
(0, di_1.Injectable)(),
|
|
53
|
+
tslib_1.__param(1, (0, di_1.Inject)(exports.XSRF_HEADER_NAME)),
|
|
54
|
+
tslib_1.__metadata("design:paramtypes", [HttpXsrfTokenExtractor, String])
|
|
55
|
+
], HttpXsrfInterceptor);
|
|
56
56
|
//# sourceMappingURL=xsrf.js.map
|
package/dist/xsrf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xsrf.js","sourceRoot":"","sources":["../src/xsrf.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,kFAAkF;AAClF,qCAAgE;AAQnD,QAAA,gBAAgB,GAAG,IAAI,mBAAc,CAAS,kBAAkB,CAAC,CAAC;AAClE,QAAA,gBAAgB,GAAG,IAAI,mBAAc,CAAS,kBAAkB,CAAC,CAAC;AAE/E;;;;GAIG;AACH,MAAsB,sBAAsB;CAO3C;AAPD,wDAOC;AAED;;GAEG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACY,YAAoC,EACV,UAAkB;QAD5C,iBAAY,GAAZ,YAAY,CAAwB;QACV,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;IAE5D,SAAS,CAAC,GAAqB,EAAE,IAAiB;QAChD,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACpC,qDAAqD;QACrD,0FAA0F;QAC1F,2BAA2B;QAC3B,yEAAyE;QACzE,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC;YAC5E,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"xsrf.js","sourceRoot":"","sources":["../src/xsrf.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,kFAAkF;AAClF,qCAAgE;AAQnD,QAAA,gBAAgB,GAAG,IAAI,mBAAc,CAAS,kBAAkB,CAAC,CAAC;AAClE,QAAA,gBAAgB,GAAG,IAAI,mBAAc,CAAS,kBAAkB,CAAC,CAAC;AAE/E;;;;GAIG;AACH,MAAsB,sBAAsB;CAO3C;AAPD,wDAOC;AAED;;GAEG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACY,YAAoC,EACV,UAAkB;QAD5C,iBAAY,GAAZ,YAAY,CAAwB;QACV,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;IAE5D,SAAS,CAAC,GAAqB,EAAE,IAAiB;QAChD,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACpC,qDAAqD;QACrD,0FAA0F;QAC1F,2BAA2B;QAC3B,yEAAyE;QACzE,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC;YAC5E,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;QAE3C,mEAAmE;QACnE,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACxD,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,EAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,EAAC,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACF,CAAA;AAvBY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,eAAU,GAAE;IAIN,mBAAA,IAAA,WAAM,EAAC,wBAAgB,CAAC,CAAA;6CADH,sBAAsB;GAFrC,mBAAmB,CAuB/B"}
|
package/dist.esm/backend.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Observable } from 'rxjs';
|
|
9
|
-
import { HttpRequest } from './request';
|
|
10
|
-
import { HttpEvent } from './response';
|
|
11
|
-
/**
|
|
12
|
-
* Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a
|
|
13
|
-
* `HttpResponse`.
|
|
14
|
-
*
|
|
15
|
-
* `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the
|
|
16
|
-
* first interceptor in the chain, which dispatches to the second, etc, eventually reaching the
|
|
17
|
-
* `HttpBackend`.
|
|
18
|
-
*
|
|
19
|
-
* In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
export declare abstract class HttpHandler {
|
|
24
|
-
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.
|
|
28
|
-
*
|
|
29
|
-
* Interceptors sit between the `HttpClient` interface and the `HttpBackend`.
|
|
30
|
-
*
|
|
31
|
-
* When injected, `HttpBackend` dispatches requests directly to the backend, without going
|
|
32
|
-
* through the interceptor chain.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
export declare abstract class HttpBackend implements HttpHandler {
|
|
37
|
-
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
38
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import { Observable } from 'rxjs';
|
|
9
|
+
import { HttpRequest } from './request';
|
|
10
|
+
import { HttpEvent } from './response';
|
|
11
|
+
/**
|
|
12
|
+
* Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a
|
|
13
|
+
* `HttpResponse`.
|
|
14
|
+
*
|
|
15
|
+
* `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the
|
|
16
|
+
* first interceptor in the chain, which dispatches to the second, etc, eventually reaching the
|
|
17
|
+
* `HttpBackend`.
|
|
18
|
+
*
|
|
19
|
+
* In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export declare abstract class HttpHandler {
|
|
24
|
+
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.
|
|
28
|
+
*
|
|
29
|
+
* Interceptors sit between the `HttpClient` interface and the `HttpBackend`.
|
|
30
|
+
*
|
|
31
|
+
* When injected, `HttpBackend` dispatches requests directly to the backend, without going
|
|
32
|
+
* through the interceptor chain.
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export declare abstract class HttpBackend implements HttpHandler {
|
|
37
|
+
abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
38
|
+
}
|
|
39
39
|
//# sourceMappingURL=backend.d.ts.map
|
package/dist.esm/backend.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a
|
|
10
|
-
* `HttpResponse`.
|
|
11
|
-
*
|
|
12
|
-
* `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the
|
|
13
|
-
* first interceptor in the chain, which dispatches to the second, etc, eventually reaching the
|
|
14
|
-
* `HttpBackend`.
|
|
15
|
-
*
|
|
16
|
-
* In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export class HttpHandler {
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.
|
|
24
|
-
*
|
|
25
|
-
* Interceptors sit between the `HttpClient` interface and the `HttpBackend`.
|
|
26
|
-
*
|
|
27
|
-
* When injected, `HttpBackend` dispatches requests directly to the backend, without going
|
|
28
|
-
* through the interceptor chain.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
export class HttpBackend {
|
|
33
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a
|
|
10
|
+
* `HttpResponse`.
|
|
11
|
+
*
|
|
12
|
+
* `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the
|
|
13
|
+
* first interceptor in the chain, which dispatches to the second, etc, eventually reaching the
|
|
14
|
+
* `HttpBackend`.
|
|
15
|
+
*
|
|
16
|
+
* In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export class HttpHandler {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.
|
|
24
|
+
*
|
|
25
|
+
* Interceptors sit between the `HttpClient` interface and the `HttpBackend`.
|
|
26
|
+
*
|
|
27
|
+
* When injected, `HttpBackend` dispatches requests directly to the backend, without going
|
|
28
|
+
* through the interceptor chain.
|
|
29
|
+
*
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export class HttpBackend {
|
|
33
|
+
}
|
|
34
34
|
//# sourceMappingURL=backend.js.map
|