@smithy/fetch-http-handler 2.0.4 → 2.1.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.
@@ -93,5 +93,16 @@ class FetchHttpHandler {
93
93
  }
94
94
  return Promise.race(raceOfPromises);
95
95
  }
96
+ updateHttpClientConfig(key, value) {
97
+ this.config = undefined;
98
+ this.configProvider = this.configProvider.then((config) => {
99
+ config[key] = value;
100
+ return config;
101
+ });
102
+ }
103
+ httpHandlerConfigs() {
104
+ var _a;
105
+ return (_a = this.config) !== null && _a !== void 0 ? _a : {};
106
+ }
96
107
  }
97
108
  exports.FetchHttpHandler = FetchHttpHandler;
@@ -89,4 +89,14 @@ export class FetchHttpHandler {
89
89
  }
90
90
  return Promise.race(raceOfPromises);
91
91
  }
92
+ updateHttpClientConfig(key, value) {
93
+ this.config = undefined;
94
+ this.configProvider = this.configProvider.then((config) => {
95
+ config[key] = value;
96
+ return config;
97
+ });
98
+ }
99
+ httpHandlerConfigs() {
100
+ return this.config ?? {};
101
+ }
92
102
  }
@@ -10,12 +10,16 @@ export interface FetchHttpHandlerOptions {
10
10
  */
11
11
  requestTimeout?: number;
12
12
  }
13
- export declare class FetchHttpHandler implements HttpHandler {
13
+ type FetchHttpHandlerConfig = FetchHttpHandlerOptions;
14
+ export declare class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
14
15
  private config?;
15
- private readonly configProvider;
16
+ private configProvider;
16
17
  constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | undefined>);
17
18
  destroy(): void;
18
19
  handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
19
20
  response: HttpResponse;
20
21
  }>;
22
+ updateHttpClientConfig(key: keyof FetchHttpHandlerConfig, value: FetchHttpHandlerConfig[typeof key]): void;
23
+ httpHandlerConfigs(): FetchHttpHandlerConfig;
21
24
  }
25
+ export {};
@@ -10,12 +10,16 @@ export interface FetchHttpHandlerOptions {
10
10
  */
11
11
  requestTimeout?: number;
12
12
  }
13
- export declare class FetchHttpHandler implements HttpHandler {
13
+ type FetchHttpHandlerConfig = FetchHttpHandlerOptions;
14
+ export declare class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
14
15
  private config?;
15
- private readonly configProvider;
16
+ private configProvider;
16
17
  constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | undefined>);
17
18
  destroy(): void;
18
19
  handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
19
20
  response: HttpResponse;
20
21
  }>;
22
+ updateHttpClientConfig(key: keyof FetchHttpHandlerConfig, value: FetchHttpHandlerConfig[typeof key]): void;
23
+ httpHandlerConfigs(): FetchHttpHandlerConfig;
21
24
  }
25
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
@@ -24,14 +24,14 @@
24
24
  "module": "./dist-es/index.js",
25
25
  "types": "./dist-types/index.d.ts",
26
26
  "dependencies": {
27
- "@smithy/protocol-http": "^2.0.4",
28
- "@smithy/querystring-builder": "^2.0.4",
29
- "@smithy/types": "^2.2.1",
27
+ "@smithy/protocol-http": "^3.0.0",
28
+ "@smithy/querystring-builder": "^2.0.6",
29
+ "@smithy/types": "^2.3.0",
30
30
  "@smithy/util-base64": "^2.0.0",
31
31
  "tslib": "^2.5.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@smithy/abort-controller": "^2.0.4",
34
+ "@smithy/abort-controller": "^2.0.6",
35
35
  "@tsconfig/recommended": "1.0.1",
36
36
  "@types/chai-as-promised": "^7.1.2",
37
37
  "chai": "^4.2.0",