@alterior/http 3.13.3 → 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 +9 -9
- package/tsconfig.esm.tsbuildinfo +1 -0
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -8046
package/dist/interceptor.d.ts
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
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 { HttpRequest } from './request';
|
|
12
|
-
import { HttpEvent } from './response';
|
|
13
|
-
/**
|
|
14
|
-
* Intercepts `HttpRequest` and handles them.
|
|
15
|
-
*
|
|
16
|
-
* Most interceptors will transform the outgoing request before passing it to the
|
|
17
|
-
* next interceptor in the chain, by calling `next.handle(transformedReq)`.
|
|
18
|
-
*
|
|
19
|
-
* In rare cases, interceptors may wish to completely handle a request themselves,
|
|
20
|
-
* and not delegate to the remainder of the chain. This behavior is allowed.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
export interface HttpInterceptor {
|
|
25
|
-
/**
|
|
26
|
-
* Intercept an outgoing `HttpRequest` and optionally transform it or the
|
|
27
|
-
* response.
|
|
28
|
-
*
|
|
29
|
-
* Typically an interceptor will transform the outgoing request before returning
|
|
30
|
-
* `next.handle(transformedReq)`. An interceptor may choose to transform the
|
|
31
|
-
* response event stream as well, by applying additional Rx operators on the stream
|
|
32
|
-
* returned by `next.handle()`.
|
|
33
|
-
*
|
|
34
|
-
* More rarely, an interceptor may choose to completely handle the request itself,
|
|
35
|
-
* and compose a new event stream instead of invoking `next.handle()`. This is
|
|
36
|
-
* acceptable behavior, but keep in mind further interceptors will be skipped entirely.
|
|
37
|
-
*
|
|
38
|
-
* It is also rare but valid for an interceptor to return multiple responses on the
|
|
39
|
-
* event stream for a single request.
|
|
40
|
-
*/
|
|
41
|
-
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
export declare class HttpInterceptorHandler implements HttpHandler {
|
|
49
|
-
private next;
|
|
50
|
-
private interceptor;
|
|
51
|
-
constructor(next: HttpHandler, interceptor: HttpInterceptor);
|
|
52
|
-
handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* A multi-provider token which represents the array of `HttpInterceptor`s that
|
|
56
|
-
* are registered.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
export declare const HTTP_INTERCEPTORS: InjectionToken<HttpInterceptor[]>;
|
|
61
|
-
export declare class NoopInterceptor implements HttpInterceptor {
|
|
62
|
-
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
63
|
-
}
|
|
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 { HttpRequest } from './request';
|
|
12
|
+
import { HttpEvent } from './response';
|
|
13
|
+
/**
|
|
14
|
+
* Intercepts `HttpRequest` and handles them.
|
|
15
|
+
*
|
|
16
|
+
* Most interceptors will transform the outgoing request before passing it to the
|
|
17
|
+
* next interceptor in the chain, by calling `next.handle(transformedReq)`.
|
|
18
|
+
*
|
|
19
|
+
* In rare cases, interceptors may wish to completely handle a request themselves,
|
|
20
|
+
* and not delegate to the remainder of the chain. This behavior is allowed.
|
|
21
|
+
*
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export interface HttpInterceptor {
|
|
25
|
+
/**
|
|
26
|
+
* Intercept an outgoing `HttpRequest` and optionally transform it or the
|
|
27
|
+
* response.
|
|
28
|
+
*
|
|
29
|
+
* Typically an interceptor will transform the outgoing request before returning
|
|
30
|
+
* `next.handle(transformedReq)`. An interceptor may choose to transform the
|
|
31
|
+
* response event stream as well, by applying additional Rx operators on the stream
|
|
32
|
+
* returned by `next.handle()`.
|
|
33
|
+
*
|
|
34
|
+
* More rarely, an interceptor may choose to completely handle the request itself,
|
|
35
|
+
* and compose a new event stream instead of invoking `next.handle()`. This is
|
|
36
|
+
* acceptable behavior, but keep in mind further interceptors will be skipped entirely.
|
|
37
|
+
*
|
|
38
|
+
* It is also rare but valid for an interceptor to return multiple responses on the
|
|
39
|
+
* event stream for a single request.
|
|
40
|
+
*/
|
|
41
|
+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
|
|
45
|
+
*
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
export declare class HttpInterceptorHandler implements HttpHandler {
|
|
49
|
+
private next;
|
|
50
|
+
private interceptor;
|
|
51
|
+
constructor(next: HttpHandler, interceptor: HttpInterceptor);
|
|
52
|
+
handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A multi-provider token which represents the array of `HttpInterceptor`s that
|
|
56
|
+
* are registered.
|
|
57
|
+
*
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
export declare const HTTP_INTERCEPTORS: InjectionToken<HttpInterceptor[]>;
|
|
61
|
+
export declare class NoopInterceptor implements HttpInterceptor {
|
|
62
|
+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
63
|
+
}
|
|
64
64
|
//# sourceMappingURL=interceptor.d.ts.map
|
package/dist/interceptor.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
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.NoopInterceptor = exports.HTTP_INTERCEPTORS = exports.HttpInterceptorHandler = void 0;
|
|
11
|
-
const tslib_1 = require("tslib");
|
|
12
|
-
const di_1 = require("@alterior/di");
|
|
13
|
-
/**
|
|
14
|
-
* `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
class HttpInterceptorHandler {
|
|
19
|
-
constructor(next, interceptor) {
|
|
20
|
-
this.next = next;
|
|
21
|
-
this.interceptor = interceptor;
|
|
22
|
-
}
|
|
23
|
-
handle(req) {
|
|
24
|
-
return this.interceptor.intercept(req, this.next);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.HttpInterceptorHandler = HttpInterceptorHandler;
|
|
28
|
-
/**
|
|
29
|
-
* A multi-provider token which represents the array of `HttpInterceptor`s that
|
|
30
|
-
* are registered.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
exports.HTTP_INTERCEPTORS = new di_1.InjectionToken('HTTP_INTERCEPTORS');
|
|
35
|
-
let NoopInterceptor = class NoopInterceptor {
|
|
36
|
-
intercept(req, next) {
|
|
37
|
-
return next.handle(req);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
NoopInterceptor =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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.NoopInterceptor = exports.HTTP_INTERCEPTORS = exports.HttpInterceptorHandler = void 0;
|
|
11
|
+
const tslib_1 = require("tslib");
|
|
12
|
+
const di_1 = require("@alterior/di");
|
|
13
|
+
/**
|
|
14
|
+
* `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
class HttpInterceptorHandler {
|
|
19
|
+
constructor(next, interceptor) {
|
|
20
|
+
this.next = next;
|
|
21
|
+
this.interceptor = interceptor;
|
|
22
|
+
}
|
|
23
|
+
handle(req) {
|
|
24
|
+
return this.interceptor.intercept(req, this.next);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.HttpInterceptorHandler = HttpInterceptorHandler;
|
|
28
|
+
/**
|
|
29
|
+
* A multi-provider token which represents the array of `HttpInterceptor`s that
|
|
30
|
+
* are registered.
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
exports.HTTP_INTERCEPTORS = new di_1.InjectionToken('HTTP_INTERCEPTORS');
|
|
35
|
+
let NoopInterceptor = class NoopInterceptor {
|
|
36
|
+
intercept(req, next) {
|
|
37
|
+
return next.handle(req);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.NoopInterceptor = NoopInterceptor;
|
|
41
|
+
exports.NoopInterceptor = NoopInterceptor = tslib_1.__decorate([
|
|
42
|
+
(0, di_1.Injectable)()
|
|
43
|
+
], NoopInterceptor);
|
|
44
44
|
//# sourceMappingURL=interceptor.js.map
|
package/dist/interceptor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptor.js","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,qCAAwD;AAsCxD;;;;GAIG;AACH,MAAa,sBAAsB;IACjC,YAAoB,IAAiB,EAAU,WAA4B;QAAvD,SAAI,GAAJ,IAAI,CAAa;QAAU,gBAAW,GAAX,WAAW,CAAiB;IAAG,CAAC;IAE/E,MAAM,CAAC,GAAqB;QAC1B,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;CACF;AAND,wDAMC;AAED;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,IAAI,mBAAc,CAAoB,mBAAmB,CAAC,CAAC;AAGrF,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,SAAS,CAAC,GAAqB,EAAE,IAAiB;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACF,CAAA;AAJY,eAAe;IAD3B,IAAA,eAAU,GAAE;GACA,eAAe,CAI3B
|
|
1
|
+
{"version":3,"file":"interceptor.js","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,qCAAwD;AAsCxD;;;;GAIG;AACH,MAAa,sBAAsB;IACjC,YAAoB,IAAiB,EAAU,WAA4B;QAAvD,SAAI,GAAJ,IAAI,CAAa;QAAU,gBAAW,GAAX,WAAW,CAAiB;IAAG,CAAC;IAE/E,MAAM,CAAC,GAAqB;QAC1B,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;CACF;AAND,wDAMC;AAED;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,IAAI,mBAAc,CAAoB,mBAAmB,CAAC,CAAC;AAGrF,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,SAAS,CAAC,GAAqB,EAAE,IAAiB;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACF,CAAA;AAJY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,eAAU,GAAE;GACA,eAAe,CAI3B"}
|
package/dist/module.d.ts
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
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 { ConfiguredModule, Injector } from '@alterior/di';
|
|
9
|
-
import { Observable } from 'rxjs';
|
|
10
|
-
import { HttpBackend, HttpHandler } from './backend';
|
|
11
|
-
import { HttpInterceptor } from './interceptor';
|
|
12
|
-
import { HttpRequest } from './request';
|
|
13
|
-
import { HttpEvent } from './response';
|
|
14
|
-
/**
|
|
15
|
-
* An injectable `HttpHandler` that applies multiple interceptors
|
|
16
|
-
* to a request before passing it to the given `HttpBackend`.
|
|
17
|
-
*
|
|
18
|
-
* The interceptors are loaded lazily from the injector, to allow
|
|
19
|
-
* interceptors to themselves inject classes depending indirectly
|
|
20
|
-
* on `HttpInterceptingHandler` itself.
|
|
21
|
-
* @see `HttpInterceptor`
|
|
22
|
-
*/
|
|
23
|
-
export declare class HttpInterceptingHandler implements HttpHandler {
|
|
24
|
-
private backend;
|
|
25
|
-
private injector;
|
|
26
|
-
private chain;
|
|
27
|
-
constructor(backend: HttpBackend, injector: Injector);
|
|
28
|
-
handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Constructs an `HttpHandler` that applies interceptors
|
|
32
|
-
* to a request before passing it to the given `HttpBackend`.
|
|
33
|
-
*
|
|
34
|
-
* Use as a factory function within `HttpClientModule`.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
export declare function interceptingHandler(backend: HttpBackend, interceptors?: HttpInterceptor[] | null): HttpHandler;
|
|
39
|
-
/**
|
|
40
|
-
* Factory function that determines where to store JSONP callbacks.
|
|
41
|
-
*
|
|
42
|
-
* Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
|
|
43
|
-
* in test environments. In that case, callbacks are stored on an anonymous object instead.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
|
-
export declare function jsonpCallbackContext(): Object;
|
|
48
|
-
/**
|
|
49
|
-
* An NgModule that adds XSRF protection support to outgoing requests.
|
|
50
|
-
*
|
|
51
|
-
* For a server that supports a cookie-based XSRF protection system,
|
|
52
|
-
* use directly to configure XSRF protection with the correct
|
|
53
|
-
* cookie and header names.
|
|
54
|
-
*
|
|
55
|
-
* If no names are supplied, the default cookie name is `XSRF-TOKEN`
|
|
56
|
-
* and the default header name is `X-XSRF-TOKEN`.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
export declare class HttpClientXsrfModule {
|
|
61
|
-
/**
|
|
62
|
-
* Disable the default XSRF protection.
|
|
63
|
-
*/
|
|
64
|
-
static disable(): ConfiguredModule;
|
|
65
|
-
/**
|
|
66
|
-
* Configure XSRF protection.
|
|
67
|
-
* @param options An object that can specify either or both
|
|
68
|
-
* cookie name or header name.
|
|
69
|
-
* - Cookie name default is `XSRF-TOKEN`.
|
|
70
|
-
* - Header name default is `X-XSRF-TOKEN`.
|
|
71
|
-
*
|
|
72
|
-
*/
|
|
73
|
-
static withOptions(options?: {
|
|
74
|
-
cookieName?: string;
|
|
75
|
-
headerName?: string;
|
|
76
|
-
}): ConfiguredModule;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* An NgModule that provides the `HttpClient` and associated services.
|
|
80
|
-
*
|
|
81
|
-
* Interceptors can be added to the chain behind `HttpClient` by binding them
|
|
82
|
-
* to the multiprovider for `HTTP_INTERCEPTORS`.
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*/
|
|
86
|
-
export declare class HttpClientModule {
|
|
87
|
-
static forRoot(config?: HttpClientConfig): {
|
|
88
|
-
$module: typeof HttpClientModule;
|
|
89
|
-
providers: any[];
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
export interface HttpClientConfig {
|
|
93
|
-
/**
|
|
94
|
-
* Which HTTP client implementation should be used?
|
|
95
|
-
* Use 'server' to use the `xhr2` NPM module. Use `browser` to
|
|
96
|
-
* use the browser-side `XMLHttpRequest`, and set to `null`
|
|
97
|
-
* to disable loading a built-in implementation (so you can
|
|
98
|
-
* provide your own).
|
|
99
|
-
*/
|
|
100
|
-
platform?: 'server' | 'browser' | null;
|
|
101
|
-
}
|
|
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 { ConfiguredModule, Injector } from '@alterior/di';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
import { HttpBackend, HttpHandler } from './backend';
|
|
11
|
+
import { HttpInterceptor } from './interceptor';
|
|
12
|
+
import { HttpRequest } from './request';
|
|
13
|
+
import { HttpEvent } from './response';
|
|
14
|
+
/**
|
|
15
|
+
* An injectable `HttpHandler` that applies multiple interceptors
|
|
16
|
+
* to a request before passing it to the given `HttpBackend`.
|
|
17
|
+
*
|
|
18
|
+
* The interceptors are loaded lazily from the injector, to allow
|
|
19
|
+
* interceptors to themselves inject classes depending indirectly
|
|
20
|
+
* on `HttpInterceptingHandler` itself.
|
|
21
|
+
* @see `HttpInterceptor`
|
|
22
|
+
*/
|
|
23
|
+
export declare class HttpInterceptingHandler implements HttpHandler {
|
|
24
|
+
private backend;
|
|
25
|
+
private injector;
|
|
26
|
+
private chain;
|
|
27
|
+
constructor(backend: HttpBackend, injector: Injector);
|
|
28
|
+
handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Constructs an `HttpHandler` that applies interceptors
|
|
32
|
+
* to a request before passing it to the given `HttpBackend`.
|
|
33
|
+
*
|
|
34
|
+
* Use as a factory function within `HttpClientModule`.
|
|
35
|
+
*
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export declare function interceptingHandler(backend: HttpBackend, interceptors?: HttpInterceptor[] | null): HttpHandler;
|
|
39
|
+
/**
|
|
40
|
+
* Factory function that determines where to store JSONP callbacks.
|
|
41
|
+
*
|
|
42
|
+
* Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
|
|
43
|
+
* in test environments. In that case, callbacks are stored on an anonymous object instead.
|
|
44
|
+
*
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
export declare function jsonpCallbackContext(): Object;
|
|
48
|
+
/**
|
|
49
|
+
* An NgModule that adds XSRF protection support to outgoing requests.
|
|
50
|
+
*
|
|
51
|
+
* For a server that supports a cookie-based XSRF protection system,
|
|
52
|
+
* use directly to configure XSRF protection with the correct
|
|
53
|
+
* cookie and header names.
|
|
54
|
+
*
|
|
55
|
+
* If no names are supplied, the default cookie name is `XSRF-TOKEN`
|
|
56
|
+
* and the default header name is `X-XSRF-TOKEN`.
|
|
57
|
+
*
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
export declare class HttpClientXsrfModule {
|
|
61
|
+
/**
|
|
62
|
+
* Disable the default XSRF protection.
|
|
63
|
+
*/
|
|
64
|
+
static disable(): ConfiguredModule;
|
|
65
|
+
/**
|
|
66
|
+
* Configure XSRF protection.
|
|
67
|
+
* @param options An object that can specify either or both
|
|
68
|
+
* cookie name or header name.
|
|
69
|
+
* - Cookie name default is `XSRF-TOKEN`.
|
|
70
|
+
* - Header name default is `X-XSRF-TOKEN`.
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
static withOptions(options?: {
|
|
74
|
+
cookieName?: string;
|
|
75
|
+
headerName?: string;
|
|
76
|
+
}): ConfiguredModule;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* An NgModule that provides the `HttpClient` and associated services.
|
|
80
|
+
*
|
|
81
|
+
* Interceptors can be added to the chain behind `HttpClient` by binding them
|
|
82
|
+
* to the multiprovider for `HTTP_INTERCEPTORS`.
|
|
83
|
+
*
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
export declare class HttpClientModule {
|
|
87
|
+
static forRoot(config?: HttpClientConfig): {
|
|
88
|
+
$module: typeof HttpClientModule;
|
|
89
|
+
providers: any[];
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export interface HttpClientConfig {
|
|
93
|
+
/**
|
|
94
|
+
* Which HTTP client implementation should be used?
|
|
95
|
+
* Use 'server' to use the `xhr2` NPM module. Use `browser` to
|
|
96
|
+
* use the browser-side `XMLHttpRequest`, and set to `null`
|
|
97
|
+
* to disable loading a built-in implementation (so you can
|
|
98
|
+
* provide your own).
|
|
99
|
+
*/
|
|
100
|
+
platform?: 'server' | 'browser' | null;
|
|
101
|
+
}
|
|
102
102
|
//# sourceMappingURL=module.d.ts.map
|