@trivikr-test/node-http-handler
Advanced tools
Comparing version 3.58.0 to 3.170.0-es2015
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NodeHttpHandler = void 0; | ||
const protocol_http_1 = require("@aws-sdk/protocol-http"); | ||
const querystring_builder_1 = require("@aws-sdk/querystring-builder"); | ||
const protocol_http_1 = require("@trivikr-test/protocol-http"); | ||
const querystring_builder_1 = require("@trivikr-test/querystring-builder"); | ||
const http_1 = require("http"); | ||
@@ -16,10 +16,14 @@ const https_1 = require("https"); | ||
this.metadata = { handlerProtocol: "http/1.1" }; | ||
if (typeof options === "function") { | ||
this.configProvider = async () => { | ||
return this.resolveDefaultConfig(await options()); | ||
}; | ||
} | ||
else { | ||
this.config = this.resolveDefaultConfig(options); | ||
} | ||
this.configProvider = new Promise((resolve, reject) => { | ||
if (typeof options === "function") { | ||
options() | ||
.then((_options) => { | ||
resolve(this.resolveDefaultConfig(_options)); | ||
}) | ||
.catch(reject); | ||
} | ||
else { | ||
resolve(this.resolveDefaultConfig(options)); | ||
} | ||
}); | ||
} | ||
@@ -43,4 +47,4 @@ resolveDefaultConfig(options) { | ||
async handle(request, { abortSignal } = {}) { | ||
if (!this.config && this.configProvider) { | ||
this.config = await this.configProvider(); | ||
if (!this.config) { | ||
this.config = await this.configProvider; | ||
} | ||
@@ -47,0 +51,0 @@ return new Promise((resolve, reject) => { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NodeHttp2Handler = void 0; | ||
const protocol_http_1 = require("@aws-sdk/protocol-http"); | ||
const querystring_builder_1 = require("@aws-sdk/querystring-builder"); | ||
const protocol_http_1 = require("@trivikr-test/protocol-http"); | ||
const querystring_builder_1 = require("@trivikr-test/querystring-builder"); | ||
const http2_1 = require("http2"); | ||
@@ -10,7 +10,16 @@ const get_transformed_headers_1 = require("./get-transformed-headers"); | ||
class NodeHttp2Handler { | ||
constructor({ requestTimeout, sessionTimeout, disableConcurrentStreams } = {}) { | ||
constructor(options) { | ||
this.metadata = { handlerProtocol: "h2" }; | ||
this.requestTimeout = requestTimeout; | ||
this.sessionTimeout = sessionTimeout; | ||
this.disableConcurrentStreams = disableConcurrentStreams; | ||
this.configProvider = new Promise((resolve, reject) => { | ||
if (typeof options === "function") { | ||
options() | ||
.then((opts) => { | ||
resolve(opts || {}); | ||
}) | ||
.catch(reject); | ||
} | ||
else { | ||
resolve(options || {}); | ||
} | ||
}); | ||
this.sessionCache = new Map(); | ||
@@ -24,3 +33,7 @@ } | ||
} | ||
handle(request, { abortSignal } = {}) { | ||
async handle(request, { abortSignal } = {}) { | ||
if (!this.config) { | ||
this.config = await this.configProvider; | ||
} | ||
const { requestTimeout, disableConcurrentStreams } = this.config; | ||
return new Promise((resolve, rejectOriginal) => { | ||
@@ -37,5 +50,5 @@ let fulfilled = false; | ||
const authority = `${protocol}//${hostname}${port ? `:${port}` : ""}`; | ||
const session = this.getSession(authority, this.disableConcurrentStreams || false); | ||
const session = this.getSession(authority, disableConcurrentStreams || false); | ||
const reject = (err) => { | ||
if (this.disableConcurrentStreams) { | ||
if (disableConcurrentStreams) { | ||
this.destroySession(session); | ||
@@ -52,2 +65,3 @@ } | ||
}); | ||
session.ref(); | ||
req.on("response", (headers) => { | ||
@@ -61,3 +75,3 @@ const httpResponse = new protocol_http_1.HttpResponse({ | ||
resolve({ response: httpResponse }); | ||
if (this.disableConcurrentStreams) { | ||
if (disableConcurrentStreams) { | ||
session.close(); | ||
@@ -67,3 +81,2 @@ this.deleteSessionFromCache(authority, session); | ||
}); | ||
const requestTimeout = this.requestTimeout; | ||
if (requestTimeout) { | ||
@@ -93,3 +106,4 @@ req.setTimeout(requestTimeout, () => { | ||
req.on("close", () => { | ||
if (this.disableConcurrentStreams) { | ||
session.unref(); | ||
if (disableConcurrentStreams) { | ||
session.destroy(); | ||
@@ -105,2 +119,3 @@ } | ||
getSession(authority, disableConcurrentStreams) { | ||
var _a; | ||
const sessionCache = this.sessionCache; | ||
@@ -111,2 +126,3 @@ const existingSessions = sessionCache.get(authority) || []; | ||
const newSession = (0, http2_1.connect)(authority); | ||
newSession.unref(); | ||
const destroySessionCb = () => { | ||
@@ -119,5 +135,5 @@ this.destroySession(newSession); | ||
newSession.on("frameError", destroySessionCb); | ||
const sessionTimeout = this.sessionTimeout; | ||
if (sessionTimeout) { | ||
newSession.setTimeout(sessionTimeout, destroySessionCb); | ||
newSession.on("close", () => this.deleteSessionFromCache(authority, newSession)); | ||
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionTimeout) { | ||
newSession.setTimeout(this.config.sessionTimeout, destroySessionCb); | ||
} | ||
@@ -124,0 +140,0 @@ existingSessions.push(newSession); |
@@ -1,1 +0,1 @@ | ||
export var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; | ||
export const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; |
@@ -1,21 +0,9 @@ | ||
import { __values } from "tslib"; | ||
var getTransformedHeaders = function (headers) { | ||
var e_1, _a; | ||
var transformedHeaders = {}; | ||
try { | ||
for (var _b = __values(Object.keys(headers)), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var name = _c.value; | ||
var headerValues = headers[name]; | ||
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; | ||
} | ||
const getTransformedHeaders = (headers) => { | ||
const transformedHeaders = {}; | ||
for (const name of Object.keys(headers)) { | ||
const headerValues = headers[name]; | ||
transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
return transformedHeaders; | ||
}; | ||
export { getTransformedHeaders }; |
@@ -1,4 +0,4 @@ | ||
import { __awaiter, __generator } from "tslib"; | ||
import { HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { buildQueryString } from "@aws-sdk/querystring-builder"; | ||
import { __awaiter } from "tslib"; | ||
import { HttpResponse } from "@trivikr-test/protocol-http"; | ||
import { buildQueryString } from "@trivikr-test/querystring-builder"; | ||
import { Agent as hAgent, request as hRequest } from "http"; | ||
@@ -11,108 +11,90 @@ import { Agent as hsAgent, request as hsRequest } from "https"; | ||
import { writeRequestBody } from "./write-request-body"; | ||
var NodeHttpHandler = (function () { | ||
function NodeHttpHandler(options) { | ||
var _this = this; | ||
export class NodeHttpHandler { | ||
constructor(options) { | ||
this.metadata = { handlerProtocol: "http/1.1" }; | ||
if (typeof options === "function") { | ||
this.configProvider = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a = this.resolveDefaultConfig; | ||
return [4, options()]; | ||
case 1: return [2, _a.apply(this, [_b.sent()])]; | ||
} | ||
}); | ||
}); }; | ||
} | ||
else { | ||
this.config = this.resolveDefaultConfig(options); | ||
} | ||
this.configProvider = new Promise((resolve, reject) => { | ||
if (typeof options === "function") { | ||
options() | ||
.then((_options) => { | ||
resolve(this.resolveDefaultConfig(_options)); | ||
}) | ||
.catch(reject); | ||
} | ||
else { | ||
resolve(this.resolveDefaultConfig(options)); | ||
} | ||
}); | ||
} | ||
NodeHttpHandler.prototype.resolveDefaultConfig = function (options) { | ||
var _a = options || {}, connectionTimeout = _a.connectionTimeout, socketTimeout = _a.socketTimeout, httpAgent = _a.httpAgent, httpsAgent = _a.httpsAgent; | ||
var keepAlive = true; | ||
var maxSockets = 50; | ||
resolveDefaultConfig(options) { | ||
const { connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options || {}; | ||
const keepAlive = true; | ||
const maxSockets = 50; | ||
return { | ||
connectionTimeout: connectionTimeout, | ||
socketTimeout: socketTimeout, | ||
httpAgent: httpAgent || new hAgent({ keepAlive: keepAlive, maxSockets: maxSockets }), | ||
httpsAgent: httpsAgent || new hsAgent({ keepAlive: keepAlive, maxSockets: maxSockets }), | ||
connectionTimeout, | ||
socketTimeout, | ||
httpAgent: httpAgent || new hAgent({ keepAlive, maxSockets }), | ||
httpsAgent: httpsAgent || new hsAgent({ keepAlive, maxSockets }), | ||
}; | ||
}; | ||
NodeHttpHandler.prototype.destroy = function () { | ||
} | ||
destroy() { | ||
var _a, _b, _c, _d; | ||
(_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.httpAgent) === null || _b === void 0 ? void 0 : _b.destroy(); | ||
(_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.httpsAgent) === null || _d === void 0 ? void 0 : _d.destroy(); | ||
}; | ||
NodeHttpHandler.prototype.handle = function (request, _a) { | ||
var _b = _a === void 0 ? {} : _a, abortSignal = _b.abortSignal; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _c; | ||
var _this = this; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: | ||
if (!(!this.config && this.configProvider)) return [3, 2]; | ||
_c = this; | ||
return [4, this.configProvider()]; | ||
case 1: | ||
_c.config = _d.sent(); | ||
_d.label = 2; | ||
case 2: return [2, new Promise(function (resolve, reject) { | ||
if (!_this.config) { | ||
throw new Error("Node HTTP request handler config is not resolved"); | ||
} | ||
if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { | ||
var abortError = new Error("Request aborted"); | ||
abortError.name = "AbortError"; | ||
reject(abortError); | ||
return; | ||
} | ||
var isSSL = request.protocol === "https:"; | ||
var queryString = buildQueryString(request.query || {}); | ||
var nodeHttpsOptions = { | ||
headers: request.headers, | ||
host: request.hostname, | ||
method: request.method, | ||
path: queryString ? "".concat(request.path, "?").concat(queryString) : request.path, | ||
port: request.port, | ||
agent: isSSL ? _this.config.httpsAgent : _this.config.httpAgent, | ||
}; | ||
var requestFunc = isSSL ? hsRequest : hRequest; | ||
var req = requestFunc(nodeHttpsOptions, function (res) { | ||
var httpResponse = new HttpResponse({ | ||
statusCode: res.statusCode || -1, | ||
headers: getTransformedHeaders(res.headers), | ||
body: res, | ||
}); | ||
resolve({ response: httpResponse }); | ||
}); | ||
req.on("error", function (err) { | ||
if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { | ||
reject(Object.assign(err, { name: "TimeoutError" })); | ||
} | ||
else { | ||
reject(err); | ||
} | ||
}); | ||
setConnectionTimeout(req, reject, _this.config.connectionTimeout); | ||
setSocketTimeout(req, reject, _this.config.socketTimeout); | ||
if (abortSignal) { | ||
abortSignal.onabort = function () { | ||
req.abort(); | ||
var abortError = new Error("Request aborted"); | ||
abortError.name = "AbortError"; | ||
reject(abortError); | ||
}; | ||
} | ||
writeRequestBody(req, request); | ||
})]; | ||
} | ||
handle(request, { abortSignal } = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (!this.config) { | ||
this.config = yield this.configProvider; | ||
} | ||
return new Promise((resolve, reject) => { | ||
if (!this.config) { | ||
throw new Error("Node HTTP request handler config is not resolved"); | ||
} | ||
if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { | ||
const abortError = new Error("Request aborted"); | ||
abortError.name = "AbortError"; | ||
reject(abortError); | ||
return; | ||
} | ||
const isSSL = request.protocol === "https:"; | ||
const queryString = buildQueryString(request.query || {}); | ||
const nodeHttpsOptions = { | ||
headers: request.headers, | ||
host: request.hostname, | ||
method: request.method, | ||
path: queryString ? `${request.path}?${queryString}` : request.path, | ||
port: request.port, | ||
agent: isSSL ? this.config.httpsAgent : this.config.httpAgent, | ||
}; | ||
const requestFunc = isSSL ? hsRequest : hRequest; | ||
const req = requestFunc(nodeHttpsOptions, (res) => { | ||
const httpResponse = new HttpResponse({ | ||
statusCode: res.statusCode || -1, | ||
headers: getTransformedHeaders(res.headers), | ||
body: res, | ||
}); | ||
resolve({ response: httpResponse }); | ||
}); | ||
req.on("error", (err) => { | ||
if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { | ||
reject(Object.assign(err, { name: "TimeoutError" })); | ||
} | ||
else { | ||
reject(err); | ||
} | ||
}); | ||
setConnectionTimeout(req, reject, this.config.connectionTimeout); | ||
setSocketTimeout(req, reject, this.config.socketTimeout); | ||
if (abortSignal) { | ||
abortSignal.onabort = () => { | ||
req.abort(); | ||
const abortError = new Error("Request aborted"); | ||
abortError.name = "AbortError"; | ||
reject(abortError); | ||
}; | ||
} | ||
writeRequestBody(req, request); | ||
}); | ||
}); | ||
}; | ||
return NodeHttpHandler; | ||
}()); | ||
export { NodeHttpHandler }; | ||
} | ||
} |
@@ -1,117 +0,118 @@ | ||
import { __assign, __values } from "tslib"; | ||
import { HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { buildQueryString } from "@aws-sdk/querystring-builder"; | ||
import { __awaiter } from "tslib"; | ||
import { HttpResponse } from "@trivikr-test/protocol-http"; | ||
import { buildQueryString } from "@trivikr-test/querystring-builder"; | ||
import { connect, constants } from "http2"; | ||
import { getTransformedHeaders } from "./get-transformed-headers"; | ||
import { writeRequestBody } from "./write-request-body"; | ||
var NodeHttp2Handler = (function () { | ||
function NodeHttp2Handler(_a) { | ||
var _b = _a === void 0 ? {} : _a, requestTimeout = _b.requestTimeout, sessionTimeout = _b.sessionTimeout, disableConcurrentStreams = _b.disableConcurrentStreams; | ||
export class NodeHttp2Handler { | ||
constructor(options) { | ||
this.metadata = { handlerProtocol: "h2" }; | ||
this.requestTimeout = requestTimeout; | ||
this.sessionTimeout = sessionTimeout; | ||
this.disableConcurrentStreams = disableConcurrentStreams; | ||
this.configProvider = new Promise((resolve, reject) => { | ||
if (typeof options === "function") { | ||
options() | ||
.then((opts) => { | ||
resolve(opts || {}); | ||
}) | ||
.catch(reject); | ||
} | ||
else { | ||
resolve(options || {}); | ||
} | ||
}); | ||
this.sessionCache = new Map(); | ||
} | ||
NodeHttp2Handler.prototype.destroy = function () { | ||
var e_1, _a; | ||
var _this = this; | ||
try { | ||
for (var _b = __values(this.sessionCache.values()), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var sessions = _c.value; | ||
sessions.forEach(function (session) { return _this.destroySession(session); }); | ||
} | ||
destroy() { | ||
for (const sessions of this.sessionCache.values()) { | ||
sessions.forEach((session) => this.destroySession(session)); | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
this.sessionCache.clear(); | ||
}; | ||
NodeHttp2Handler.prototype.handle = function (request, _a) { | ||
var _this = this; | ||
var _b = _a === void 0 ? {} : _a, abortSignal = _b.abortSignal; | ||
return new Promise(function (resolve, rejectOriginal) { | ||
var _a; | ||
var fulfilled = false; | ||
if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { | ||
fulfilled = true; | ||
var abortError = new Error("Request aborted"); | ||
abortError.name = "AbortError"; | ||
rejectOriginal(abortError); | ||
return; | ||
} | ||
handle(request, { abortSignal } = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (!this.config) { | ||
this.config = yield this.configProvider; | ||
} | ||
var hostname = request.hostname, method = request.method, port = request.port, protocol = request.protocol, path = request.path, query = request.query; | ||
var authority = "".concat(protocol, "//").concat(hostname).concat(port ? ":".concat(port) : ""); | ||
var session = _this.getSession(authority, _this.disableConcurrentStreams || false); | ||
var reject = function (err) { | ||
if (_this.disableConcurrentStreams) { | ||
_this.destroySession(session); | ||
const { requestTimeout, disableConcurrentStreams } = this.config; | ||
return new Promise((resolve, rejectOriginal) => { | ||
let fulfilled = false; | ||
if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { | ||
fulfilled = true; | ||
const abortError = new Error("Request aborted"); | ||
abortError.name = "AbortError"; | ||
rejectOriginal(abortError); | ||
return; | ||
} | ||
fulfilled = true; | ||
rejectOriginal(err); | ||
}; | ||
var queryString = buildQueryString(query || {}); | ||
var req = session.request(__assign(__assign({}, request.headers), (_a = {}, _a[constants.HTTP2_HEADER_PATH] = queryString ? "".concat(path, "?").concat(queryString) : path, _a[constants.HTTP2_HEADER_METHOD] = method, _a))); | ||
req.on("response", function (headers) { | ||
var httpResponse = new HttpResponse({ | ||
statusCode: headers[":status"] || -1, | ||
headers: getTransformedHeaders(headers), | ||
body: req, | ||
const { hostname, method, port, protocol, path, query } = request; | ||
const authority = `${protocol}//${hostname}${port ? `:${port}` : ""}`; | ||
const session = this.getSession(authority, disableConcurrentStreams || false); | ||
const reject = (err) => { | ||
if (disableConcurrentStreams) { | ||
this.destroySession(session); | ||
} | ||
fulfilled = true; | ||
rejectOriginal(err); | ||
}; | ||
const queryString = buildQueryString(query || {}); | ||
const req = session.request(Object.assign(Object.assign({}, request.headers), { [constants.HTTP2_HEADER_PATH]: queryString ? `${path}?${queryString}` : path, [constants.HTTP2_HEADER_METHOD]: method })); | ||
session.ref(); | ||
req.on("response", (headers) => { | ||
const httpResponse = new HttpResponse({ | ||
statusCode: headers[":status"] || -1, | ||
headers: getTransformedHeaders(headers), | ||
body: req, | ||
}); | ||
fulfilled = true; | ||
resolve({ response: httpResponse }); | ||
if (disableConcurrentStreams) { | ||
session.close(); | ||
this.deleteSessionFromCache(authority, session); | ||
} | ||
}); | ||
fulfilled = true; | ||
resolve({ response: httpResponse }); | ||
if (_this.disableConcurrentStreams) { | ||
session.close(); | ||
_this.deleteSessionFromCache(authority, session); | ||
if (requestTimeout) { | ||
req.setTimeout(requestTimeout, () => { | ||
req.close(); | ||
const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`); | ||
timeoutError.name = "TimeoutError"; | ||
reject(timeoutError); | ||
}); | ||
} | ||
}); | ||
var requestTimeout = _this.requestTimeout; | ||
if (requestTimeout) { | ||
req.setTimeout(requestTimeout, function () { | ||
req.close(); | ||
var timeoutError = new Error("Stream timed out because of no activity for ".concat(requestTimeout, " ms")); | ||
timeoutError.name = "TimeoutError"; | ||
reject(timeoutError); | ||
if (abortSignal) { | ||
abortSignal.onabort = () => { | ||
req.close(); | ||
const abortError = new Error("Request aborted"); | ||
abortError.name = "AbortError"; | ||
reject(abortError); | ||
}; | ||
} | ||
req.on("frameError", (type, code, id) => { | ||
reject(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); | ||
}); | ||
} | ||
if (abortSignal) { | ||
abortSignal.onabort = function () { | ||
req.close(); | ||
var abortError = new Error("Request aborted"); | ||
abortError.name = "AbortError"; | ||
reject(abortError); | ||
}; | ||
} | ||
req.on("frameError", function (type, code, id) { | ||
reject(new Error("Frame type id ".concat(type, " in stream id ").concat(id, " has failed with code ").concat(code, "."))); | ||
req.on("error", reject); | ||
req.on("aborted", () => { | ||
reject(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)); | ||
}); | ||
req.on("close", () => { | ||
session.unref(); | ||
if (disableConcurrentStreams) { | ||
session.destroy(); | ||
} | ||
if (!fulfilled) { | ||
reject(new Error("Unexpected error: http2 request did not get a response")); | ||
} | ||
}); | ||
writeRequestBody(req, request); | ||
}); | ||
req.on("error", reject); | ||
req.on("aborted", function () { | ||
reject(new Error("HTTP/2 stream is abnormally aborted in mid-communication with result code ".concat(req.rstCode, "."))); | ||
}); | ||
req.on("close", function () { | ||
if (_this.disableConcurrentStreams) { | ||
session.destroy(); | ||
} | ||
if (!fulfilled) { | ||
reject(new Error("Unexpected error: http2 request did not get a response")); | ||
} | ||
}); | ||
writeRequestBody(req, request); | ||
}); | ||
}; | ||
NodeHttp2Handler.prototype.getSession = function (authority, disableConcurrentStreams) { | ||
var _this = this; | ||
var sessionCache = this.sessionCache; | ||
var existingSessions = sessionCache.get(authority) || []; | ||
} | ||
getSession(authority, disableConcurrentStreams) { | ||
var _a; | ||
const sessionCache = this.sessionCache; | ||
const existingSessions = sessionCache.get(authority) || []; | ||
if (existingSessions.length > 0 && !disableConcurrentStreams) | ||
return existingSessions[0]; | ||
var newSession = connect(authority); | ||
var destroySessionCb = function () { | ||
_this.destroySession(newSession); | ||
_this.deleteSessionFromCache(authority, newSession); | ||
const newSession = connect(authority); | ||
newSession.unref(); | ||
const destroySessionCb = () => { | ||
this.destroySession(newSession); | ||
this.deleteSessionFromCache(authority, newSession); | ||
}; | ||
@@ -121,5 +122,5 @@ newSession.on("goaway", destroySessionCb); | ||
newSession.on("frameError", destroySessionCb); | ||
var sessionTimeout = this.sessionTimeout; | ||
if (sessionTimeout) { | ||
newSession.setTimeout(sessionTimeout, destroySessionCb); | ||
newSession.on("close", () => this.deleteSessionFromCache(authority, newSession)); | ||
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.sessionTimeout) { | ||
newSession.setTimeout(this.config.sessionTimeout, destroySessionCb); | ||
} | ||
@@ -129,17 +130,15 @@ existingSessions.push(newSession); | ||
return newSession; | ||
}; | ||
NodeHttp2Handler.prototype.destroySession = function (session) { | ||
} | ||
destroySession(session) { | ||
if (!session.destroyed) { | ||
session.destroy(); | ||
} | ||
}; | ||
NodeHttp2Handler.prototype.deleteSessionFromCache = function (authority, session) { | ||
var existingSessions = this.sessionCache.get(authority) || []; | ||
} | ||
deleteSessionFromCache(authority, session) { | ||
const existingSessions = this.sessionCache.get(authority) || []; | ||
if (!existingSessions.includes(session)) { | ||
return; | ||
} | ||
this.sessionCache.set(authority, existingSessions.filter(function (s) { return s !== session; })); | ||
}; | ||
return NodeHttp2Handler; | ||
}()); | ||
export { NodeHttp2Handler }; | ||
this.sessionCache.set(authority, existingSessions.filter((s) => s !== session)); | ||
} | ||
} |
@@ -1,13 +0,10 @@ | ||
import { __extends } from "tslib"; | ||
import { Readable } from "stream"; | ||
var ReadFromBuffers = (function (_super) { | ||
__extends(ReadFromBuffers, _super); | ||
function ReadFromBuffers(options) { | ||
var _this = _super.call(this, options) || this; | ||
_this.numBuffersRead = 0; | ||
_this.buffersToRead = options.buffers; | ||
_this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1; | ||
return _this; | ||
export class ReadFromBuffers extends Readable { | ||
constructor(options) { | ||
super(options); | ||
this.numBuffersRead = 0; | ||
this.buffersToRead = options.buffers; | ||
this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1; | ||
} | ||
ReadFromBuffers.prototype._read = function () { | ||
_read() { | ||
if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) { | ||
@@ -21,5 +18,3 @@ this.emit("error", new Error("Mock Error")); | ||
return this.push(this.buffersToRead[this.numBuffersRead++]); | ||
}; | ||
return ReadFromBuffers; | ||
}(Readable)); | ||
export { ReadFromBuffers }; | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
import { __read, __values } from "tslib"; | ||
import { readFileSync } from "fs"; | ||
@@ -8,20 +7,9 @@ import { createServer as createHttpServer } from "http"; | ||
import { Readable } from "stream"; | ||
var fixturesDir = join(__dirname, "..", "fixtures"); | ||
var setResponseHeaders = function (response, headers) { | ||
var e_1, _a; | ||
try { | ||
for (var _b = __values(Object.entries(headers)), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var _d = __read(_c.value, 2), key = _d[0], value = _d[1]; | ||
response.setHeader(key, value); | ||
} | ||
const fixturesDir = join(__dirname, "..", "fixtures"); | ||
const setResponseHeaders = (response, headers) => { | ||
for (const [key, value] of Object.entries(headers)) { | ||
response.setHeader(key, value); | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
}; | ||
var setResponseBody = function (response, body) { | ||
const setResponseBody = (response, body) => { | ||
if (body instanceof Readable) { | ||
@@ -34,20 +22,20 @@ body.pipe(response); | ||
}; | ||
export var createResponseFunction = function (httpResp) { return function (request, response) { | ||
export const createResponseFunction = (httpResp) => (request, response) => { | ||
response.statusCode = httpResp.statusCode; | ||
setResponseHeaders(response, httpResp.headers); | ||
setResponseBody(response, httpResp.body); | ||
}; }; | ||
export var createResponseFunctionWithDelay = function (httpResp, delay) { return function (request, response) { | ||
}; | ||
export const createResponseFunctionWithDelay = (httpResp, delay) => (request, response) => { | ||
response.statusCode = httpResp.statusCode; | ||
setResponseHeaders(response, httpResp.headers); | ||
setTimeout(function () { return setResponseBody(response, httpResp.body); }, delay); | ||
}; }; | ||
export var createContinueResponseFunction = function (httpResp) { return function (request, response) { | ||
setTimeout(() => setResponseBody(response, httpResp.body), delay); | ||
}; | ||
export const createContinueResponseFunction = (httpResp) => (request, response) => { | ||
response.writeContinue(); | ||
setTimeout(function () { | ||
setTimeout(() => { | ||
createResponseFunction(httpResp)(request, response); | ||
}, 100); | ||
}; }; | ||
export var createMockHttpsServer = function () { | ||
var server = createHttpsServer({ | ||
}; | ||
export const createMockHttpsServer = () => { | ||
const server = createHttpsServer({ | ||
key: readFileSync(join(fixturesDir, "test-server-key.pem")), | ||
@@ -58,9 +46,9 @@ cert: readFileSync(join(fixturesDir, "test-server-cert.pem")), | ||
}; | ||
export var createMockHttpServer = function () { | ||
var server = createHttpServer(); | ||
export const createMockHttpServer = () => { | ||
const server = createHttpServer(); | ||
return server; | ||
}; | ||
export var createMockHttp2Server = function () { | ||
var server = createHttp2Server(); | ||
export const createMockHttp2Server = () => { | ||
const server = createHttp2Server(); | ||
return server; | ||
}; |
@@ -1,16 +0,15 @@ | ||
export var setConnectionTimeout = function (request, reject, timeoutInMs) { | ||
if (timeoutInMs === void 0) { timeoutInMs = 0; } | ||
export const setConnectionTimeout = (request, reject, timeoutInMs = 0) => { | ||
if (!timeoutInMs) { | ||
return; | ||
} | ||
request.on("socket", function (socket) { | ||
request.on("socket", (socket) => { | ||
if (socket.connecting) { | ||
var timeoutId_1 = setTimeout(function () { | ||
const timeoutId = setTimeout(() => { | ||
request.destroy(); | ||
reject(Object.assign(new Error("Socket timed out without establishing a connection within ".concat(timeoutInMs, " ms")), { | ||
reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { | ||
name: "TimeoutError", | ||
})); | ||
}, timeoutInMs); | ||
socket.on("connect", function () { | ||
clearTimeout(timeoutId_1); | ||
socket.on("connect", () => { | ||
clearTimeout(timeoutId); | ||
}); | ||
@@ -17,0 +16,0 @@ } |
@@ -1,7 +0,6 @@ | ||
export var setSocketTimeout = function (request, reject, timeoutInMs) { | ||
if (timeoutInMs === void 0) { timeoutInMs = 0; } | ||
request.setTimeout(timeoutInMs, function () { | ||
export const setSocketTimeout = (request, reject, timeoutInMs = 0) => { | ||
request.setTimeout(timeoutInMs, () => { | ||
request.destroy(); | ||
reject(Object.assign(new Error("Connection timed out after ".concat(timeoutInMs, " ms")), { name: "TimeoutError" })); | ||
reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); | ||
}); | ||
}; |
@@ -1,16 +0,11 @@ | ||
import { __extends } from "tslib"; | ||
import { Writable } from "stream"; | ||
var Collector = (function (_super) { | ||
__extends(Collector, _super); | ||
function Collector() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.bufferedBytes = []; | ||
return _this; | ||
export class Collector extends Writable { | ||
constructor() { | ||
super(...arguments); | ||
this.bufferedBytes = []; | ||
} | ||
Collector.prototype._write = function (chunk, encoding, callback) { | ||
_write(chunk, encoding, callback) { | ||
this.bufferedBytes.push(chunk); | ||
callback(); | ||
}; | ||
return Collector; | ||
}(Writable)); | ||
export { Collector }; | ||
} | ||
} |
import { Collector } from "./collector"; | ||
export var streamCollector = function (stream) { | ||
return new Promise(function (resolve, reject) { | ||
var collector = new Collector(); | ||
stream.pipe(collector); | ||
stream.on("error", function (err) { | ||
collector.end(); | ||
reject(err); | ||
}); | ||
collector.on("error", reject); | ||
collector.on("finish", function () { | ||
var bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); | ||
resolve(bytes); | ||
}); | ||
export const streamCollector = (stream) => new Promise((resolve, reject) => { | ||
const collector = new Collector(); | ||
stream.pipe(collector); | ||
stream.on("error", (err) => { | ||
collector.end(); | ||
reject(err); | ||
}); | ||
}; | ||
collector.on("error", reject); | ||
collector.on("finish", function () { | ||
const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); | ||
resolve(bytes); | ||
}); | ||
}); |
@@ -1,13 +0,10 @@ | ||
import { __extends } from "tslib"; | ||
import { Readable } from "stream"; | ||
var ReadFromBuffers = (function (_super) { | ||
__extends(ReadFromBuffers, _super); | ||
function ReadFromBuffers(options) { | ||
var _this = _super.call(this, options) || this; | ||
_this.numBuffersRead = 0; | ||
_this.buffersToRead = options.buffers; | ||
_this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1; | ||
return _this; | ||
export class ReadFromBuffers extends Readable { | ||
constructor(options) { | ||
super(options); | ||
this.numBuffersRead = 0; | ||
this.buffersToRead = options.buffers; | ||
this.errorAfter = typeof options.errorAfter === "number" ? options.errorAfter : -1; | ||
} | ||
ReadFromBuffers.prototype._read = function (size) { | ||
_read(size) { | ||
if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) { | ||
@@ -21,5 +18,3 @@ this.emit("error", new Error("Mock Error")); | ||
return this.push(this.buffersToRead[this.numBuffersRead++]); | ||
}; | ||
return ReadFromBuffers; | ||
}(Readable)); | ||
export { ReadFromBuffers }; | ||
} | ||
} |
import { Readable } from "stream"; | ||
export function writeRequestBody(httpRequest, request) { | ||
var expect = request.headers["Expect"] || request.headers["expect"]; | ||
const expect = request.headers["Expect"] || request.headers["expect"]; | ||
if (expect === "100-continue") { | ||
httpRequest.on("continue", function () { | ||
httpRequest.on("continue", () => { | ||
writeBody(httpRequest, request.body); | ||
@@ -7,0 +7,0 @@ }); |
@@ -1,4 +0,4 @@ | ||
import { HeaderBag } from "@aws-sdk/types"; | ||
import { HeaderBag } from "@trivikr-test/types"; | ||
import { IncomingHttpHeaders } from "http2"; | ||
declare const getTransformedHeaders: (headers: IncomingHttpHeaders) => HeaderBag; | ||
export { getTransformedHeaders }; |
/// <reference types="node" /> | ||
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { HttpHandlerOptions, Provider } from "@aws-sdk/types"; | ||
import { HttpHandler, HttpRequest, HttpResponse } from "@trivikr-test/protocol-http"; | ||
import { HttpHandlerOptions, Provider } from "@trivikr-test/types"; | ||
import { Agent as hAgent } from "http"; | ||
@@ -25,3 +25,3 @@ import { Agent as hsAgent } from "https"; | ||
private config?; | ||
private readonly configProvider?; | ||
private readonly configProvider; | ||
readonly metadata: { | ||
@@ -28,0 +28,0 @@ handlerProtocol: string; |
@@ -1,3 +0,3 @@ | ||
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { HttpHandlerOptions } from "@aws-sdk/types"; | ||
import { HttpHandler, HttpRequest, HttpResponse } from "@trivikr-test/protocol-http"; | ||
import { HttpHandlerOptions, Provider } from "@trivikr-test/types"; | ||
/** | ||
@@ -27,5 +27,4 @@ * Represents the http2 options that can be passed to a node http2 client. | ||
export declare class NodeHttp2Handler implements HttpHandler { | ||
private readonly requestTimeout?; | ||
private readonly sessionTimeout?; | ||
private readonly disableConcurrentStreams?; | ||
private config?; | ||
private readonly configProvider; | ||
readonly metadata: { | ||
@@ -35,3 +34,3 @@ handlerProtocol: string; | ||
private sessionCache; | ||
constructor({ requestTimeout, sessionTimeout, disableConcurrentStreams }?: NodeHttp2HandlerOptions); | ||
constructor(options?: NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>); | ||
destroy(): void; | ||
@@ -38,0 +37,0 @@ handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{ |
@@ -1,2 +0,2 @@ | ||
import { HttpResponse } from "@aws-sdk/types"; | ||
import { HttpResponse } from "@trivikr-test/types"; | ||
import { IncomingMessage, Server as HttpServer, ServerResponse } from "http"; | ||
@@ -3,0 +3,0 @@ import { Http2Server } from "http2"; |
@@ -1,2 +0,2 @@ | ||
import { StreamCollector } from "@aws-sdk/types"; | ||
import { StreamCollector } from "@trivikr-test/types"; | ||
export declare const streamCollector: StreamCollector; |
@@ -1,2 +0,1 @@ | ||
export declare const NODEJS_TIMEOUT_ERROR_CODES: string[]; |
@@ -1,4 +0,6 @@ | ||
import { HeaderBag } from "@aws-sdk/types"; | ||
import { HeaderBag } from "@trivikr-test/types"; | ||
import { IncomingHttpHeaders } from "http2"; | ||
declare const getTransformedHeaders: (headers: IncomingHttpHeaders) => HeaderBag; | ||
declare const getTransformedHeaders: ( | ||
headers: IncomingHttpHeaders | ||
) => HeaderBag; | ||
export { getTransformedHeaders }; |
export * from "./node-http-handler"; | ||
export * from "./node-http2-handler"; | ||
export * from "./stream-collector"; |
@@ -1,4 +0,7 @@ | ||
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { HttpHandlerOptions, Provider } from "@aws-sdk/types"; | ||
import { | ||
HttpHandler, | ||
HttpRequest, | ||
HttpResponse, | ||
} from "@trivikr-test/protocol-http"; | ||
import { HttpHandlerOptions, Provider } from "@trivikr-test/types"; | ||
import { Agent as hAgent } from "http"; | ||
@@ -8,21 +11,25 @@ import { Agent as hsAgent } from "https"; | ||
export interface NodeHttpHandlerOptions { | ||
connectionTimeout?: number; | ||
socketTimeout?: number; | ||
httpAgent?: hAgent; | ||
httpsAgent?: hsAgent; | ||
connectionTimeout?: number; | ||
socketTimeout?: number; | ||
httpAgent?: hAgent; | ||
httpsAgent?: hsAgent; | ||
} | ||
export declare class NodeHttpHandler implements HttpHandler { | ||
private config?; | ||
private readonly configProvider?; | ||
readonly metadata: { | ||
handlerProtocol: string; | ||
}; | ||
constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>); | ||
private resolveDefaultConfig; | ||
destroy(): void; | ||
handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{ | ||
response: HttpResponse; | ||
}>; | ||
private config?; | ||
private readonly configProvider; | ||
readonly metadata: { | ||
handlerProtocol: string; | ||
}; | ||
constructor( | ||
options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void> | ||
); | ||
private resolveDefaultConfig; | ||
destroy(): void; | ||
handle( | ||
request: HttpRequest, | ||
{ abortSignal }?: HttpHandlerOptions | ||
): Promise<{ | ||
response: HttpResponse; | ||
}>; | ||
} |
@@ -1,31 +0,38 @@ | ||
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { HttpHandlerOptions } from "@aws-sdk/types"; | ||
import { | ||
HttpHandler, | ||
HttpRequest, | ||
HttpResponse, | ||
} from "@trivikr-test/protocol-http"; | ||
import { HttpHandlerOptions, Provider } from "@trivikr-test/types"; | ||
export interface NodeHttp2HandlerOptions { | ||
requestTimeout?: number; | ||
sessionTimeout?: number; | ||
disableConcurrentStreams?: boolean; | ||
requestTimeout?: number; | ||
sessionTimeout?: number; | ||
disableConcurrentStreams?: boolean; | ||
} | ||
export declare class NodeHttp2Handler implements HttpHandler { | ||
private readonly requestTimeout?; | ||
private readonly sessionTimeout?; | ||
private readonly disableConcurrentStreams?; | ||
readonly metadata: { | ||
handlerProtocol: string; | ||
}; | ||
private sessionCache; | ||
constructor({ requestTimeout, sessionTimeout, disableConcurrentStreams }?: NodeHttp2HandlerOptions); | ||
destroy(): void; | ||
handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{ | ||
response: HttpResponse; | ||
}>; | ||
private getSession; | ||
private destroySession; | ||
private deleteSessionFromCache; | ||
private config?; | ||
private readonly configProvider; | ||
readonly metadata: { | ||
handlerProtocol: string; | ||
}; | ||
private sessionCache; | ||
constructor( | ||
options?: NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void> | ||
); | ||
destroy(): void; | ||
handle( | ||
request: HttpRequest, | ||
{ abortSignal }?: HttpHandlerOptions | ||
): Promise<{ | ||
response: HttpResponse; | ||
}>; | ||
private getSession; | ||
private destroySession; | ||
private deleteSessionFromCache; | ||
} |
@@ -1,13 +0,12 @@ | ||
import { Readable, ReadableOptions } from "stream"; | ||
export interface ReadFromBuffersOptions extends ReadableOptions { | ||
buffers: Buffer[]; | ||
errorAfter?: number; | ||
buffers: Buffer[]; | ||
errorAfter?: number; | ||
} | ||
export declare class ReadFromBuffers extends Readable { | ||
private buffersToRead; | ||
private numBuffersRead; | ||
private errorAfter; | ||
constructor(options: ReadFromBuffersOptions); | ||
_read(): boolean | undefined; | ||
private buffersToRead; | ||
private numBuffersRead; | ||
private errorAfter; | ||
constructor(options: ReadFromBuffersOptions); | ||
_read(): boolean | undefined; | ||
} |
@@ -1,10 +0,17 @@ | ||
import { HttpResponse } from "@aws-sdk/types"; | ||
import { HttpResponse } from "@trivikr-test/types"; | ||
import { IncomingMessage, Server as HttpServer, ServerResponse } from "http"; | ||
import { Http2Server } from "http2"; | ||
import { Server as HttpsServer } from "https"; | ||
export declare const createResponseFunction: (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => void; | ||
export declare const createResponseFunctionWithDelay: (httpResp: HttpResponse, delay: number) => (request: IncomingMessage, response: ServerResponse) => void; | ||
export declare const createContinueResponseFunction: (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => void; | ||
export declare const createResponseFunction: ( | ||
httpResp: HttpResponse | ||
) => (request: IncomingMessage, response: ServerResponse) => void; | ||
export declare const createResponseFunctionWithDelay: ( | ||
httpResp: HttpResponse, | ||
delay: number | ||
) => (request: IncomingMessage, response: ServerResponse) => void; | ||
export declare const createContinueResponseFunction: ( | ||
httpResp: HttpResponse | ||
) => (request: IncomingMessage, response: ServerResponse) => void; | ||
export declare const createMockHttpsServer: () => HttpsServer; | ||
export declare const createMockHttpServer: () => HttpServer; | ||
export declare const createMockHttp2Server: () => Http2Server; |
import { ClientRequest } from "http"; | ||
export declare const setConnectionTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number) => void; | ||
export declare const setConnectionTimeout: ( | ||
request: ClientRequest, | ||
reject: (err: Error) => void, | ||
timeoutInMs?: number | ||
) => void; |
import { ClientRequest } from "http"; | ||
export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number) => void; | ||
export declare const setSocketTimeout: ( | ||
request: ClientRequest, | ||
reject: (err: Error) => void, | ||
timeoutInMs?: number | ||
) => void; |
@@ -1,6 +0,9 @@ | ||
import { Writable } from "stream"; | ||
export declare class Collector extends Writable { | ||
readonly bufferedBytes: Buffer[]; | ||
_write(chunk: Buffer, encoding: string, callback: (err?: Error) => void): void; | ||
readonly bufferedBytes: Buffer[]; | ||
_write( | ||
chunk: Buffer, | ||
encoding: string, | ||
callback: (err?: Error) => void | ||
): void; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { StreamCollector } from "@aws-sdk/types"; | ||
import { StreamCollector } from "@trivikr-test/types"; | ||
export declare const streamCollector: StreamCollector; |
@@ -1,13 +0,12 @@ | ||
import { Readable, ReadableOptions } from "stream"; | ||
export interface ReadFromBuffersOptions extends ReadableOptions { | ||
buffers: Buffer[]; | ||
errorAfter?: number; | ||
buffers: Buffer[]; | ||
errorAfter?: number; | ||
} | ||
export declare class ReadFromBuffers extends Readable { | ||
private buffersToRead; | ||
private numBuffersRead; | ||
private errorAfter; | ||
constructor(options: ReadFromBuffersOptions); | ||
_read(size: number): boolean | undefined; | ||
private buffersToRead; | ||
private numBuffersRead; | ||
private errorAfter; | ||
constructor(options: ReadFromBuffersOptions); | ||
_read(size: number): boolean | undefined; | ||
} |
@@ -1,5 +0,7 @@ | ||
import { HttpRequest } from "@aws-sdk/types"; | ||
import { HttpRequest } from "@trivikr-test/types"; | ||
import { ClientRequest } from "http"; | ||
import { ClientHttp2Stream } from "http2"; | ||
export declare function writeRequestBody(httpRequest: ClientRequest | ClientHttp2Stream, request: HttpRequest): void; | ||
export declare function writeRequestBody( | ||
httpRequest: ClientRequest | ClientHttp2Stream, | ||
request: HttpRequest | ||
): void; |
/// <reference types="node" /> | ||
import { HttpRequest } from "@aws-sdk/types"; | ||
import { HttpRequest } from "@trivikr-test/types"; | ||
import { ClientRequest } from "http"; | ||
import { ClientHttp2Stream } from "http2"; | ||
export declare function writeRequestBody(httpRequest: ClientRequest | ClientHttp2Stream, request: HttpRequest): void; |
{ | ||
"name": "@trivikr-test/node-http-handler", | ||
"version": "3.58.0", | ||
"version": "3.170.0-es2015", | ||
"description": "Provides a way to make requests", | ||
@@ -9,2 +9,3 @@ "scripts": { | ||
"build:es": "tsc -p tsconfig.es.json", | ||
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", | ||
"build:types": "tsc -p tsconfig.types.json", | ||
@@ -25,6 +26,6 @@ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", | ||
"dependencies": { | ||
"@trivikr-test/abort-controller": "3.55.0", | ||
"@trivikr-test/protocol-http": "3.58.0", | ||
"@trivikr-test/querystring-builder": "3.55.0", | ||
"@trivikr-test/types": "3.55.0", | ||
"@trivikr-test/abort-controller": "3.170.0-es2015", | ||
"@trivikr-test/protocol-http": "3.170.0-es2015", | ||
"@trivikr-test/querystring-builder": "3.170.0-es2015", | ||
"@trivikr-test/types": "3.170.0-es2015", | ||
"tslib": "^2.3.1" | ||
@@ -36,3 +37,3 @@ }, | ||
"concurrently": "7.0.0", | ||
"downlevel-dts": "0.7.0", | ||
"downlevel-dts": "0.10.1", | ||
"rimraf": "3.0.2", | ||
@@ -42,8 +43,2 @@ "typedoc": "0.19.2", | ||
}, | ||
"jest": { | ||
"coveragePathIgnorePatterns": [ | ||
"/node_modules/", | ||
"<rootDir>/*.mock.ts" | ||
] | ||
}, | ||
"engines": { | ||
@@ -50,0 +45,0 @@ "node": ">= 12.0.0" |
@@ -1,4 +0,1 @@ | ||
# @aws-sdk/node-http-handler | ||
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/node-http-handler/latest.svg)](https://www.npmjs.com/package/@aws-sdk/node-http-handler) | ||
[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/node-http-handler.svg)](https://www.npmjs.com/package/@aws-sdk/node-http-handler) | ||
Please refer [README.md](https://github.com/aws/aws-sdk-js-v3/blob/v3.170.0/packages/node-http-handler/README.md) for v3.170.0. |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
60051
1183
2
2
+ Added@trivikr-test/abort-controller@3.170.0-es2015(transitive)
+ Added@trivikr-test/protocol-http@3.170.0-es2015(transitive)
+ Added@trivikr-test/querystring-builder@3.170.0-es2015(transitive)
+ Added@trivikr-test/types@3.170.0-es2015(transitive)
+ Added@trivikr-test/util-uri-escape@3.170.0-es2015(transitive)
- Removed@trivikr-test/abort-controller@3.55.0(transitive)
- Removed@trivikr-test/protocol-http@3.58.0(transitive)
- Removed@trivikr-test/querystring-builder@3.55.0(transitive)
- Removed@trivikr-test/types@3.55.0(transitive)
- Removed@trivikr-test/util-uri-escape@3.55.0(transitive)