@aws-sdk/xhr-http-handler 3.408.0 → 3.410.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.
@@ -30,6 +30,17 @@ class XhrHttpHandler extends events_1.EventEmitter {
30
30
  this.configProvider = Promise.resolve(this.config);
31
31
  }
32
32
  }
33
+ updateHttpClientConfig(key, value) {
34
+ this.config = undefined;
35
+ this.configProvider = this.configProvider.then((config) => {
36
+ config[key] = value;
37
+ return config;
38
+ });
39
+ }
40
+ httpHandlerConfigs() {
41
+ var _a;
42
+ return (_a = this.config) !== null && _a !== void 0 ? _a : {};
43
+ }
33
44
  destroy() {
34
45
  }
35
46
  async handle(request, { abortSignal } = {}) {
@@ -27,6 +27,16 @@ export class XhrHttpHandler extends EventEmitter {
27
27
  this.configProvider = Promise.resolve(this.config);
28
28
  }
29
29
  }
30
+ updateHttpClientConfig(key, value) {
31
+ this.config = undefined;
32
+ this.configProvider = this.configProvider.then((config) => {
33
+ config[key] = value;
34
+ return config;
35
+ });
36
+ }
37
+ httpHandlerConfigs() {
38
+ return this.config ?? {};
39
+ }
30
40
  destroy() {
31
41
  }
32
42
  async handle(request, { abortSignal } = {}) {
@@ -12,15 +12,20 @@ export type XhrHttpHandlerEvents = {
12
12
  };
13
13
  export declare class XhrHttpHandler
14
14
  extends EventEmitter
15
- implements HttpHandler
15
+ implements HttpHandler<XhrHttpHandlerOptions>
16
16
  {
17
17
  static readonly EVENTS: XhrHttpHandlerEvents;
18
18
  static readonly ERROR_IDENTIFIER = "XHR_HTTP_HANDLER_ERROR";
19
19
  private config?;
20
- private readonly configProvider;
20
+ private configProvider;
21
21
  constructor(
22
22
  options?: XhrHttpHandlerOptions | Provider<XhrHttpHandlerOptions>
23
23
  );
24
+ updateHttpClientConfig(
25
+ key: keyof XhrHttpHandlerOptions,
26
+ value: XhrHttpHandlerOptions[typeof key]
27
+ ): void;
28
+ httpHandlerConfigs(): XhrHttpHandlerOptions;
24
29
  destroy(): void;
25
30
  handle(
26
31
  request: HttpRequest,
@@ -43,12 +43,14 @@ export type XhrHttpHandlerEvents = {
43
43
  * An implementation of HttpHandler that uses XMLHttpRequest, which is
44
44
  * traditionally associated with browsers.
45
45
  */
46
- export declare class XhrHttpHandler extends EventEmitter implements HttpHandler {
46
+ export declare class XhrHttpHandler extends EventEmitter implements HttpHandler<XhrHttpHandlerOptions> {
47
47
  static readonly EVENTS: XhrHttpHandlerEvents;
48
48
  static readonly ERROR_IDENTIFIER = "XHR_HTTP_HANDLER_ERROR";
49
49
  private config?;
50
- private readonly configProvider;
50
+ private configProvider;
51
51
  constructor(options?: XhrHttpHandlerOptions | Provider<XhrHttpHandlerOptions>);
52
+ updateHttpClientConfig(key: keyof XhrHttpHandlerOptions, value: XhrHttpHandlerOptions[typeof key]): void;
53
+ httpHandlerConfigs(): XhrHttpHandlerOptions;
52
54
  destroy(): void;
53
55
  handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
54
56
  response: HttpResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/xhr-http-handler",
3
- "version": "3.408.0",
3
+ "version": "3.410.0",
4
4
  "description": "Provides a way to make requests using XMLHttpRequest",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
@@ -19,10 +19,10 @@
19
19
  "module": "./dist-es/index.js",
20
20
  "types": "./dist-types/index.d.ts",
21
21
  "dependencies": {
22
- "@aws-sdk/types": "3.408.0",
23
- "@smithy/protocol-http": "^2.0.5",
24
- "@smithy/querystring-builder": "^2.0.5",
25
- "@smithy/types": "^2.2.2",
22
+ "@aws-sdk/types": "3.410.0",
23
+ "@smithy/protocol-http": "^3.0.2",
24
+ "@smithy/querystring-builder": "^2.0.6",
25
+ "@smithy/types": "^2.3.0",
26
26
  "events": "3.3.0",
27
27
  "tslib": "^2.5.0"
28
28
  },