@aws-sdk/xhr-http-handler 3.1068.0 → 3.1070.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 +5 -7
- package/package.json +5 -5
package/dist-cjs/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var protocols = require('@smithy/core/protocols');
|
|
4
|
-
var events = require('events');
|
|
1
|
+
const { buildQueryString, HttpResponse } = require("@smithy/core/protocols");
|
|
2
|
+
const { EventEmitter } = require("events");
|
|
5
3
|
|
|
6
4
|
const requestTimeout = (timeoutInMs = 0) => new Promise((resolve, reject) => {
|
|
7
5
|
if (timeoutInMs) {
|
|
@@ -27,7 +25,7 @@ const EVENTS = {
|
|
|
27
25
|
return "before.xhr.send";
|
|
28
26
|
},
|
|
29
27
|
};
|
|
30
|
-
class XhrHttpHandler extends
|
|
28
|
+
class XhrHttpHandler extends EventEmitter {
|
|
31
29
|
static EVENTS = EVENTS;
|
|
32
30
|
static ERROR_IDENTIFIER = "XHR_HTTP_HANDLER_ERROR";
|
|
33
31
|
config;
|
|
@@ -72,7 +70,7 @@ class XhrHttpHandler extends events.EventEmitter {
|
|
|
72
70
|
}
|
|
73
71
|
let path = request.path;
|
|
74
72
|
if (request.query) {
|
|
75
|
-
const queryString =
|
|
73
|
+
const queryString = buildQueryString(request.query);
|
|
76
74
|
if (queryString) {
|
|
77
75
|
path += `?${queryString}`;
|
|
78
76
|
}
|
|
@@ -128,7 +126,7 @@ class XhrHttpHandler extends events.EventEmitter {
|
|
|
128
126
|
reject(new Error(`Unexpected XHR response type ${xhr.responseType}. Expected string or arraybuffer.`));
|
|
129
127
|
})();
|
|
130
128
|
resolve({
|
|
131
|
-
response: new
|
|
129
|
+
response: new HttpResponse({
|
|
132
130
|
headers: this.responseHeaders(xhr.getAllResponseHeaders()),
|
|
133
131
|
statusCode: xhr.status,
|
|
134
132
|
body,
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/xhr-http-handler",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1070.0",
|
|
4
4
|
"description": "Provides a way to make requests using XMLHttpRequest",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
8
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
8
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
9
9
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
10
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
10
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
11
11
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
12
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
12
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
13
13
|
"extract:docs": "api-extractor run --local",
|
|
14
14
|
"test": "yarn g:vitest run",
|
|
15
15
|
"test:watch": "yarn g:vitest watch"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"module": "./dist-es/index.js",
|
|
25
25
|
"types": "./dist-types/index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@aws-sdk/types": "^3.973.
|
|
27
|
+
"@aws-sdk/types": "^3.973.13",
|
|
28
28
|
"@smithy/core": "^3.24.6",
|
|
29
29
|
"@smithy/types": "^4.14.3",
|
|
30
30
|
"events": "3.3.0",
|