@aws-sdk/protocol-http
Advanced tools
Comparing version 1.0.0-alpha.3 to 1.0.0-alpha.4
@@ -20,5 +20,3 @@ import { HttpMessage, Endpoint, QueryParameterBag, HeaderBag, HttpRequest as IHttpRequest } from "@aws-sdk/types"; | ||
clone(): HttpRequest; | ||
private cloneQuery; | ||
private buildQueryString; | ||
} | ||
export {}; |
@@ -41,3 +41,3 @@ "use strict"; | ||
} | ||
var queryString = this.query ? this.buildQueryString() : ""; | ||
var queryString = this.query ? buildQueryString(this.query) : ""; | ||
if (queryString && queryString[0] !== "?") { | ||
@@ -51,46 +51,43 @@ queryString = "?" + queryString; | ||
if (cloned.query) | ||
cloned.query = this.cloneQuery(cloned.query); | ||
cloned.query = cloneQuery(cloned.query); | ||
return cloned; | ||
}; | ||
HttpRequest.prototype.cloneQuery = function (query) { | ||
return Object.keys(query).reduce(function (carry, paramName) { | ||
var _a; | ||
var param = query[paramName]; | ||
return tslib_1.__assign({}, carry, (_a = {}, _a[paramName] = Array.isArray(param) ? tslib_1.__spread(param) : param, _a)); | ||
}, {}); | ||
}; | ||
HttpRequest.prototype.buildQueryString = function () { | ||
var e_1, _a; | ||
var parts = []; | ||
try { | ||
for (var _b = tslib_1.__values(Object.keys(this.query || {}).sort()), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var key = _c.value; | ||
var value = this.query[key]; | ||
key = util_uri_escape_1.escapeUri(key); | ||
if (Array.isArray(value)) { | ||
for (var i = 0, iLen = value.length; i < iLen; i++) { | ||
parts.push(key + "=" + util_uri_escape_1.escapeUri(value[i])); | ||
} | ||
} | ||
else { | ||
var qsEntry = key; | ||
if (value || typeof value === "string") { | ||
qsEntry += "=" + util_uri_escape_1.escapeUri(value); | ||
} | ||
parts.push(qsEntry); | ||
} | ||
} | ||
return HttpRequest; | ||
}()); | ||
exports.HttpRequest = HttpRequest; | ||
function cloneQuery(query) { | ||
return Object.keys(query).reduce(function (carry, paramName) { | ||
var _a; | ||
var param = query[paramName]; | ||
return tslib_1.__assign({}, carry, (_a = {}, _a[paramName] = Array.isArray(param) ? tslib_1.__spread(param) : param, _a)); | ||
}, {}); | ||
} | ||
function buildQueryString(query) { | ||
var queryEntries = Object.entries(query || {}) | ||
.map(function (_a) { | ||
var _b = tslib_1.__read(_a, 2), key = _b[0], value = _b[1]; | ||
return [ | ||
util_uri_escape_1.escapeUri(key), | ||
value | ||
]; | ||
}) | ||
.map(function (_a) { | ||
var _b = tslib_1.__read(_a, 2), key = _b[0], value = _b[1]; | ||
if (Array.isArray(value)) { | ||
return value.map(function (val) { return key + "=" + util_uri_escape_1.escapeUri(val); }); | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
else { | ||
var qsEntry = key; | ||
if (value || typeof value === "string") { | ||
qsEntry += "=" + util_uri_escape_1.escapeUri(value); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
return [qsEntry]; | ||
} | ||
return parts.join("&"); | ||
}; | ||
return HttpRequest; | ||
}()); | ||
exports.HttpRequest = HttpRequest; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cFJlcXVlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaHR0cFJlcXVlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNERBQXFEO0FBY3JEO0lBVUUscUJBQVksT0FBMkI7UUFDckMsSUFBSSxDQUFDLE1BQU0sR0FBRyxPQUFPLENBQUMsTUFBTSxJQUFJLEtBQUssQ0FBQztRQUN0QyxJQUFJLENBQUMsUUFBUSxHQUFHLE9BQU8sQ0FBQyxRQUFRLElBQUksV0FBVyxDQUFDO1FBQ2hELElBQUksQ0FBQyxJQUFJLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQztRQUN6QixJQUFJLENBQUMsS0FBSyxHQUFHLE9BQU8sQ0FBQy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4gICAgICB9IGVsc2Uge1xuICAgICAgICBsZXQgcXNFbnRyeSA9IGtleTtcbiAgICAgICAgaWYgKHZhbHVlIHx8IHR5cGVvZiB2YWx1ZSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgIHFzRW50cnkgKz0gYD0ke2VzY2FwZVVyaSh2YWx1ZSl9YDtcbiAgICAgICAgfVxuICAgICAgICBwYXJ0cy5wdXNoKHFzRW50cnkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBwYXJ0cy5qb2luKFwiJlwiKTtcbiAgfVxufVxuIl19 | ||
}) | ||
.reduce(function (accummulator, entry) { | ||
accummulator.push.apply(accummulator, tslib_1.__spread(entry)); | ||
return accummulator; | ||
}, []); | ||
return queryEntries.join("&"); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cFJlcXVlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaHR0cFJlcXVlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNERBQXFEO0FBY3JEO0lBVUUscUJBQVksT0FBMkI7UUFDckMsSUFBSSxDQUFDLE1BQU0sR0FBRyxPQUFPLENBQUMsTUFBTSxJQUFJLEtBQUssQ0FBQztRQUN0QyxJQUFJLENBQUMsUUFBUSxHQUFHLE9BQU8sQ0FBQyxRQUFRLElBQUksV0FBVyxDQUFDO1FBQ2hELElBQUksQ0FBQyxJQUFJLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQztRQUN6QixJQUFJLENBQUMsS0FBSyxHQUFHLE9BQU8sQ0FBQyxLQUFLLElBQUksRUFBRSxDQUFDO1FBQ2pDLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sSUFBSSxFQUFFLENBQUM7UUFDckMsSUFBSSxDQUFDLElBQUksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDO1FBQ3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gICAgIHFzRW50cnkgKz0gYD0ke2VzY2FwZVVyaSh2YWx1ZSl9YDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gW3FzRW50cnldO1xuICAgICAgfVxuICAgIH0pXG4gICAgLnJlZHVjZSgoYWNjdW1tdWxhdG9yLCBlbnRyeSkgPT4ge1xuICAgICAgYWNjdW1tdWxhdG9yLnB1c2goLi4uZW50cnkpO1xuICAgICAgcmV0dXJuIGFjY3VtbXVsYXRvcjtcbiAgICB9LCBbXSBhcyBBcnJheTxTdHJpbmc+KTtcblxuICByZXR1cm4gcXVlcnlFbnRyaWVzLmpvaW4oXCImXCIpO1xufVxuIl19 |
@@ -6,2 +6,39 @@ # Change Log | ||
# 1.0.0-alpha.4 (2020-01-16) | ||
### Bug Fixes | ||
* remove private members in HttpRequest and HttpResponse ([#737](https://github.com/aws/aws-sdk-js-v3/issues/737)) ([d5602dc](https://github.com/aws/aws-sdk-js-v3/commit/d5602dc)) | ||
# 1.0.0-alpha.1 (2020-01-10) | ||
### Bug Fixes | ||
* request/response object validation ([#709](https://github.com/aws/aws-sdk-js-v3/issues/709)) ([f6f8256](https://github.com/aws/aws-sdk-js-v3/commit/f6f8256)) | ||
# 0.9.0 (2020-01-09) | ||
### Bug Fixes | ||
* support custom agent in node http handler ([#489](https://github.com/aws/aws-sdk-js-v3/issues/489)) ([9c6cde8](https://github.com/aws/aws-sdk-js-v3/commit/9c6cde8)) | ||
* update updated types ([#474](https://github.com/aws/aws-sdk-js-v3/issues/474)) ([9efac3e](https://github.com/aws/aws-sdk-js-v3/commit/9efac3e)) | ||
### Features | ||
* apply protocol and middleware update ([0de0a22](https://github.com/aws/aws-sdk-js-v3/commit/0de0a22)) | ||
* remove protocol rest json class ([#438](https://github.com/aws/aws-sdk-js-v3/issues/438)) ([7ec275a](https://github.com/aws/aws-sdk-js-v3/commit/7ec275a)) | ||
* use flag to replace httprequest instanceof ([b584032](https://github.com/aws/aws-sdk-js-v3/commit/b584032)) | ||
# 1.0.0-alpha.3 (2020-01-10) | ||
@@ -8,0 +45,0 @@ |
{ | ||
"name": "@aws-sdk/protocol-http", | ||
"version": "1.0.0-alpha.3", | ||
"version": "1.0.0-alpha.4", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "prepublishOnly": "tsc", |
33810
180