@aws-sdk/xhr-http-handler 3.821.0 → 3.840.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.
package/dist-cjs/index.js CHANGED
@@ -95,11 +95,11 @@ var XhrHttpHandler = class _XhrHttpHandler extends import_events.EventEmitter {
95
95
  }
96
96
  destroy() {
97
97
  }
98
- async handle(request, { abortSignal } = {}) {
98
+ async handle(request, { abortSignal, requestTimeout: requestTimeout2 } = {}) {
99
99
  if (!this.config) {
100
100
  this.config = await this.configProvider;
101
101
  }
102
- const requestTimeoutInMs = Number(this.config.requestTimeout) | 0;
102
+ const requestTimeoutInMs = Number(requestTimeout2 ?? this.config.requestTimeout) | 0;
103
103
  if (abortSignal?.aborted) {
104
104
  const abortError = new Error("Request aborted");
105
105
  abortError.name = "AbortError";
@@ -1,7 +1,7 @@
1
1
  import { HttpResponse } from "@smithy/protocol-http";
2
2
  import { buildQueryString } from "@smithy/querystring-builder";
3
3
  import { EventEmitter } from "events";
4
- import { requestTimeout } from "./request-timeout";
4
+ import { requestTimeout as requestTimeoutFn } from "./request-timeout";
5
5
  const EVENTS = {
6
6
  get PROGRESS() {
7
7
  return "xhr.progress";
@@ -49,11 +49,11 @@ export class XhrHttpHandler extends EventEmitter {
49
49
  }
50
50
  destroy() {
51
51
  }
52
- async handle(request, { abortSignal } = {}) {
52
+ async handle(request, { abortSignal, requestTimeout } = {}) {
53
53
  if (!this.config) {
54
54
  this.config = await this.configProvider;
55
55
  }
56
- const requestTimeoutInMs = Number(this.config.requestTimeout) | 0;
56
+ const requestTimeoutInMs = Number(requestTimeout ?? this.config.requestTimeout) | 0;
57
57
  if (abortSignal?.aborted) {
58
58
  const abortError = new Error("Request aborted");
59
59
  abortError.name = "AbortError";
@@ -135,7 +135,7 @@ export class XhrHttpHandler extends EventEmitter {
135
135
  this.emit(EVENTS.BEFORE_XHR_SEND, xhr);
136
136
  xhr.send(body);
137
137
  }),
138
- requestTimeout(requestTimeoutInMs),
138
+ requestTimeoutFn(requestTimeoutInMs),
139
139
  ];
140
140
  let removeSignalEventListener = () => { };
141
141
  if (abortSignal) {
@@ -32,7 +32,7 @@ export declare class XhrHttpHandler
32
32
  destroy(): void;
33
33
  handle(
34
34
  request: HttpRequest,
35
- { abortSignal }?: HttpHandlerOptions
35
+ { abortSignal, requestTimeout }?: HttpHandlerOptions
36
36
  ): Promise<{
37
37
  response: HttpResponse;
38
38
  }>;
@@ -56,7 +56,7 @@ export declare class XhrHttpHandler extends EventEmitter implements HttpHandler<
56
56
  updateHttpClientConfig(key: keyof XhrHttpHandlerOptions, value: XhrHttpHandlerOptions[typeof key]): void;
57
57
  httpHandlerConfigs(): XhrHttpHandlerOptions;
58
58
  destroy(): void;
59
- handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
59
+ handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
60
60
  response: HttpResponse;
61
61
  }>;
62
62
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/xhr-http-handler",
3
- "version": "3.821.0",
3
+ "version": "3.840.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'",
@@ -20,7 +20,7 @@
20
20
  "module": "./dist-es/index.js",
21
21
  "types": "./dist-types/index.d.ts",
22
22
  "dependencies": {
23
- "@aws-sdk/types": "3.821.0",
23
+ "@aws-sdk/types": "3.840.0",
24
24
  "@smithy/protocol-http": "^5.1.2",
25
25
  "@smithy/querystring-builder": "^4.0.4",
26
26
  "@smithy/types": "^4.3.1",