Socket
Socket
Sign inDemoInstall

@elastic/transport

Package Overview
Dependencies
Maintainers
75
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic/transport - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

lib/symbols.d.ts

13

lib/connection/BaseConnection.d.ts

@@ -5,9 +5,8 @@ /// <reference types="node" />

import { URL } from 'url';
import { ConnectionOptions as TlsConnectionOptions } from 'tls';
import { ConnectionOptions as TlsConnectionOptions, TLSSocket, DetailedPeerCertificate } from 'tls';
import { Readable as ReadableStream } from 'stream';
import AbortController from 'node-abort-controller';
import Diagnostic from '../Diagnostic';
import { ApiKeyAuth, BasicAuth, HttpAgentOptions, UndiciAgentOptions, agentFn } from '../types';
declare const kStatus: unique symbol;
declare const kDiagnostic: unique symbol;
import { ApiKeyAuth, BasicAuth, BearerAuth, HttpAgentOptions, UndiciAgentOptions, agentFn } from '../types';
import { kStatus, kDiagnostic, kCaFingerprint } from '../symbols';
export interface ConnectionOptions {

@@ -19,3 +18,3 @@ url: URL;

status?: string;
auth?: BasicAuth | ApiKeyAuth;
auth?: BasicAuth | ApiKeyAuth | BearerAuth;
diagnostic?: Diagnostic;

@@ -25,2 +24,3 @@ timeout?: number;

proxy?: string | URL;
caFingerprint?: string;
}

@@ -58,2 +58,3 @@ export interface ConnectionRequestParams {

[kStatus]: string;
[kCaFingerprint]: string | null;
[kDiagnostic]: Diagnostic;

@@ -73,2 +74,2 @@ static statuses: {

}
export {};
export declare function getIssuerCertificate(socket: TLSSocket): DetailedPeerCertificate | null;

@@ -20,4 +20,5 @@ "use strict";

*/
var _a, _b;
var _a, _b, _c;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIssuerCertificate = void 0;
const tslib_1 = require("tslib");

@@ -27,7 +28,6 @@ const util_1 = require("util");

const errors_1 = require("../errors");
const kStatus = Symbol('status');
const kDiagnostic = Symbol('diagnostics');
const symbols_1 = require("../symbols");
class BaseConnection {
constructor(opts) {
var _c, _d, _e, _f, _g;
var _d, _e, _f, _g, _h, _j;
Object.defineProperty(this, "url", {

@@ -99,7 +99,13 @@ enumerable: true,

});
Object.defineProperty(this, _c, {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.url = opts.url;
this.ssl = (_c = opts.ssl) !== null && _c !== void 0 ? _c : null;
this.id = (_d = opts.id) !== null && _d !== void 0 ? _d : stripAuth(opts.url.href);
this.ssl = (_d = opts.ssl) !== null && _d !== void 0 ? _d : null;
this.id = (_e = opts.id) !== null && _e !== void 0 ? _e : stripAuth(opts.url.href);
this.headers = prepareHeaders(opts.headers, opts.auth);
this.timeout = (_e = opts.timeout) !== null && _e !== void 0 ? _e : 30000;
this.timeout = (_f = opts.timeout) !== null && _f !== void 0 ? _f : 30000;
this.deadCount = 0;

@@ -109,4 +115,5 @@ this.resurrectTimeout = 0;

this._openRequests = 0;
this[kStatus] = (_f = opts.status) !== null && _f !== void 0 ? _f : BaseConnection.statuses.ALIVE;
this[kDiagnostic] = (_g = opts.diagnostic) !== null && _g !== void 0 ? _g : new Diagnostic_1.default();
this[symbols_1.kStatus] = (_g = opts.status) !== null && _g !== void 0 ? _g : BaseConnection.statuses.ALIVE;
this[symbols_1.kDiagnostic] = (_h = opts.diagnostic) !== null && _h !== void 0 ? _h : new Diagnostic_1.default();
this[symbols_1.kCaFingerprint] = (_j = opts.caFingerprint) !== null && _j !== void 0 ? _j : null;
if (!['http:', 'https:'].includes(this.url.protocol)) {

@@ -117,3 +124,3 @@ throw new errors_1.ConfigurationError(`Invalid protocol: '${this.url.protocol}'`);

get status() {
return this[kStatus];
return this[symbols_1.kStatus];
}

@@ -124,6 +131,6 @@ set status(status) {

}
this[kStatus] = status;
this[symbols_1.kStatus] = status;
}
get diagnostic() {
return this[kDiagnostic];
return this[symbols_1.kDiagnostic];
}

@@ -142,3 +149,3 @@ /* istanbul ignore next */

// access them with `instance.agent` and `instance.ssl`.
[(_a = kStatus, _b = kDiagnostic, util_1.inspect.custom)](depth, options) {
[(_a = symbols_1.kStatus, _b = symbols_1.kCaFingerprint, _c = symbols_1.kDiagnostic, util_1.inspect.custom)](depth, options) {
const { authorization, ...headers } = this.headers;

@@ -191,2 +198,5 @@ return {

}
else if (isBearerAuth(auth)) {
headers.authorization = `Bearer ${auth.bearer}`;
}
else if (auth.username != null && auth.password != null) {

@@ -201,2 +211,23 @@ headers.authorization = 'Basic ' + Buffer.from(`${auth.username}:${auth.password}`).toString('base64');

}
function isBearerAuth(auth) {
return auth.bearer != null;
}
function getIssuerCertificate(socket) {
let certificate = socket.getPeerCertificate(true);
while (certificate !== null && Object.keys(certificate).length > 0) {
// invalid certificate
if (certificate.issuerCertificate == null) {
return null;
}
// We have reached the root certificate.
// In case of self-signed certificates, `issuerCertificate` may be a circular reference.
if (certificate.fingerprint256 === certificate.issuerCertificate.fingerprint256) {
break;
}
// continue the loop
certificate = certificate.issuerCertificate;
}
return certificate;
}
exports.getIssuerCertificate = getIssuerCertificate;
//# sourceMappingURL=BaseConnection.js.map

@@ -28,3 +28,4 @@ "use strict";

const util_1 = require("util");
const BaseConnection_1 = tslib_1.__importDefault(require("./BaseConnection"));
const BaseConnection_1 = tslib_1.__importStar(require("./BaseConnection"));
const symbols_1 = require("../symbols");
const stream_1 = require("stream");

@@ -103,3 +104,3 @@ const errors_1 = require("../errors");

const onResponse = (response) => {
var _a;
var _a, _b;
cleanListeners();

@@ -109,2 +110,3 @@ this._openRequests--;

const isCompressed = contentEncoding.includes('gzip') || contentEncoding.includes('deflate');
const isVectorTile = ((_b = response.headers['content-type']) !== null && _b !== void 0 ? _b : '').includes('application/vnd.mapbox-vector-tile');
/* istanbul ignore else */

@@ -124,4 +126,4 @@ if (response.headers['content-length'] !== undefined) {

// as buffer for allowing decompression later
let payload = isCompressed ? new Array() : '';
const onData = isCompressed
let payload = isCompressed || isVectorTile ? new Array() : '';
const onData = isCompressed || isVectorTile
? (chunk) => { payload.push(chunk); }

@@ -138,3 +140,3 @@ : (chunk) => { payload = `${payload}${chunk}`; };

resolve({
body: isCompressed ? Buffer.concat(payload) : payload,
body: isCompressed || isVectorTile ? Buffer.concat(payload) : payload,
statusCode: response.statusCode,

@@ -148,3 +150,3 @@ headers: response.headers

};
if (!isCompressed) {
if (!isCompressed && !isVectorTile) {
response.setEncoding('utf8');

@@ -177,2 +179,23 @@ }

};
const onSocket = (socket) => {
/* istanbul ignore else */
if (!socket.isSessionReused()) {
socket.once('secureConnect', () => {
const issuerCertificate = BaseConnection_1.getIssuerCertificate(socket);
/* istanbul ignore next */
if (issuerCertificate == null) {
onError(new Error('Invalid or malformed certificate'));
request.once('error', () => { }); // we need to catch the request aborted error
return request.abort();
}
// Check if fingerprint matches
/* istanbul ignore else */
if (this[symbols_1.kCaFingerprint] !== issuerCertificate.fingerprint256) {
onError(new Error('Server certificate CA fingerprint does not match the value configured in caFingerprint'));
request.once('error', () => { }); // we need to catch the request aborted error
return request.abort();
}
});
}
};
request.on('response', onResponse);

@@ -182,2 +205,5 @@ request.on('timeout', onTimeout);

request.on('abort', onAbort);
if (this[symbols_1.kCaFingerprint] != null && requestParams.protocol === 'https:') {
request.on('socket', onSocket);
}
// Disables the Nagle algorithm

@@ -205,2 +231,3 @@ request.setNoDelay(true);

request.removeListener('abort', onAbort);
request.removeListener('socket', onSocket);
cleanedListeners = true;

@@ -207,0 +234,0 @@ }

@@ -5,3 +5,3 @@ /// <reference types="node" />

import { Pool } from 'undici';
declare const kEmitter: unique symbol;
import { kEmitter } from '../symbols';
export default class Connection extends BaseConnection {

@@ -14,2 +14,1 @@ pool: Pool;

}
export {};

@@ -26,5 +26,6 @@ "use strict";

const buffer_1 = tslib_1.__importDefault(require("buffer"));
const BaseConnection_1 = tslib_1.__importDefault(require("./BaseConnection"));
const BaseConnection_1 = tslib_1.__importStar(require("./BaseConnection"));
const undici_1 = require("undici");
const errors_1 = require("../errors");
const symbols_1 = require("../symbols");
const debug = debug_1.default('elasticsearch');

@@ -34,5 +35,5 @@ const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/;

const MAX_STRING_LENGTH = buffer_1.default.constants.MAX_STRING_LENGTH;
const kEmitter = Symbol('event emitter');
class Connection extends BaseConnection_1.default {
constructor(opts) {
var _b;
super(opts);

@@ -60,5 +61,4 @@ Object.defineProperty(this, "pool", {

}
this[kEmitter] = new events_1.EventEmitter();
this.pool = new undici_1.Pool(this.url.toString(), {
tls: this.ssl,
this[symbols_1.kEmitter] = new events_1.EventEmitter();
const undiciOptions = {
keepAliveTimeout: 4000,

@@ -71,9 +71,38 @@ keepAliveMaxTimeout: 600e3,

headersTimeout: this.timeout,
// @ts-expect-error
bodyTimeout: this.timeout,
...opts.agent
});
};
if (this[symbols_1.kCaFingerprint] !== null) {
const caFingerprint = this[symbols_1.kCaFingerprint];
const connector = undici_1.buildConnector(((_b = this.ssl) !== null && _b !== void 0 ? _b : {}));
undiciOptions.connect = function (opts, cb) {
connector(opts, (err, socket) => {
if (err != null) {
return cb(err, null);
}
if (caFingerprint !== null && isTlsSocket(opts, socket)) {
const issuerCertificate = BaseConnection_1.getIssuerCertificate(socket);
/* istanbul ignore next */
if (issuerCertificate == null) {
socket.destroy();
return cb(new Error('Invalid or malformed certificate'), null);
}
// Check if fingerprint matches
/* istanbul ignore else */
if (caFingerprint !== issuerCertificate.fingerprint256) {
socket.destroy();
return cb(new Error('Server certificate CA fingerprint does not match the value configured in caFingerprint'), null);
}
}
return cb(null, socket);
});
};
}
else if (this.ssl !== null) {
undiciOptions.connect = this.ssl;
}
this.pool = new undici_1.Pool(this.url.toString(), undiciOptions);
}
async request(params, options) {
var _b, _c, _d;
var _b, _c, _d, _e;
const requestParams = {

@@ -84,3 +113,3 @@ method: params.method,

body: params.body,
signal: (_c = (_b = params.abortController) === null || _b === void 0 ? void 0 : _b.signal) !== null && _c !== void 0 ? _c : this[kEmitter]
signal: (_c = (_b = params.abortController) === null || _b === void 0 ? void 0 : _b.signal) !== null && _c !== void 0 ? _c : this[symbols_1.kEmitter]
};

@@ -102,3 +131,3 @@ // undici does not support per-request timeouts,

else {
this[kEmitter].emit('abort');
this[symbols_1.kEmitter].emit('abort');
}

@@ -132,2 +161,3 @@ }, params.timeout);

const isCompressed = contentEncoding.includes('gzip') || contentEncoding.includes('deflate');
const isVectorTile = ((_e = response.headers['content-type']) !== null && _e !== void 0 ? _e : '').includes('application/vnd.mapbox-vector-tile');
/* istanbul ignore else */

@@ -147,3 +177,3 @@ if (response.headers['content-length'] !== undefined) {

try {
if (isCompressed) {
if (isCompressed || isVectorTile) {
const payload = [];

@@ -182,3 +212,3 @@ for await (const chunk of response.body) {

exports.default = Connection;
_a = kEmitter;
_a = symbols_1.kEmitter;
/* istanbul ignore next */

@@ -200,2 +230,5 @@ function isUndiciAgentOptions(opts) {

}
function isTlsSocket(opts, socket) {
return socket !== null && opts.protocol === 'https:';
}
//# sourceMappingURL=UndiciConnection.js.map

@@ -5,2 +5,3 @@ /// <reference types="node" />

import { ConnectionRequestOptions } from './connection';
import { ResurrectEvent } from './pool';
import { DiagnosticResult } from './types';

@@ -10,2 +11,3 @@ export declare type DiagnosticListener = (err: ElasticsearchClientError | null, meta: any | null) => void;

export declare type DiagnosticListenerLight = (err: ElasticsearchClientError | null, meta: ConnectionRequestOptions | null) => void;
export declare type DiagnosticListenerResurrect = (err: ElasticsearchClientError | null, meta: ResurrectEvent | null) => void;
export declare enum events {

@@ -25,3 +27,3 @@ RESPONSE = "response",

on(event: events.DESERIALIZATION, listener: DiagnosticListenerLight): this;
on(event: events.RESURRECT, listener: DiagnosticListenerLight): this;
on(event: events.RESURRECT, listener: DiagnosticListenerResurrect): this;
once(event: events.REQUEST, listener: DiagnosticListenerFull): this;

@@ -32,4 +34,4 @@ once(event: events.RESPONSE, listener: DiagnosticListenerFull): this;

once(event: events.DESERIALIZATION, listener: DiagnosticListenerLight): this;
once(event: events.RESURRECT, listener: DiagnosticListenerLight): this;
once(event: events.RESURRECT, listener: DiagnosticListenerResurrect): this;
off(event: string, listener: DiagnosticListener): this;
}

@@ -41,1 +41,5 @@ /// <reference types="node" />

}
export declare class ProductNotSupportedError extends ElasticsearchClientError {
meta?: DiagnosticResult;
constructor(product: string, meta?: DiagnosticResult);
}

@@ -21,3 +21,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.RequestAbortedError = exports.ResponseError = exports.ConfigurationError = exports.DeserializationError = exports.SerializationError = exports.NoLivingConnectionsError = exports.ConnectionError = exports.TimeoutError = exports.ElasticsearchClientError = void 0;
exports.ProductNotSupportedError = exports.RequestAbortedError = exports.ResponseError = exports.ConfigurationError = exports.DeserializationError = exports.SerializationError = exports.NoLivingConnectionsError = exports.ConnectionError = exports.TimeoutError = exports.ElasticsearchClientError = void 0;
class ElasticsearchClientError extends Error {

@@ -121,3 +121,3 @@ constructor(message) {

constructor(meta) {
var _a, _b, _c;
var _a;
super('Response Error');

@@ -132,5 +132,18 @@ Object.defineProperty(this, "meta", {

this.name = 'ResponseError';
this.message = isObject(meta.body)
? (_c = (_b = (_a = meta.body) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : 'Response Error'
: 'Response Error';
// TODO: this is for Elasticsearch
if (isObject(meta.body) && meta.body.error != null && meta.body.error.type != null) {
if (Array.isArray(meta.body.error.root_cause)) {
this.message = meta.body.error.type + ': ';
this.message += meta.body.error.root_cause.map((entry) => `[${entry.type}] Reason: ${entry.reason}`).join('; ');
}
else {
this.message = meta.body.error.type;
}
}
else if (typeof meta.body === 'object' && meta.body != null) {
this.message = JSON.stringify(meta.body);
}
else {
this.message = (_a = meta.body) !== null && _a !== void 0 ? _a : 'Response Error';
}
this.meta = meta;

@@ -168,2 +181,18 @@ }

exports.RequestAbortedError = RequestAbortedError;
class ProductNotSupportedError extends ElasticsearchClientError {
constructor(product, meta) {
super('Product Not Supported Error');
Object.defineProperty(this, "meta", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Error.captureStackTrace(this, ProductNotSupportedError);
this.name = 'ProductNotSupportedError';
this.message = `The client noticed that the server is not ${product} and we do not support this unknown product.`;
this.meta = meta;
}
}
exports.ProductNotSupportedError = ProductNotSupportedError;
function isObject(obj) {

@@ -170,0 +199,0 @@ return typeof obj === 'object';

@@ -5,4 +5,5 @@ /// <reference types="node" />

import Diagnostic from '../Diagnostic';
import { kCaFingerprint } from '../symbols';
import { Connection, ConnectionOptions, BaseConnection } from '../connection';
import { HttpAgentOptions, UndiciAgentOptions, agentFn, ApiKeyAuth, BasicAuth, nodeFilterFn, nodeSelectorFn } from '../types';
import { HttpAgentOptions, UndiciAgentOptions, agentFn, ApiKeyAuth, BasicAuth, BearerAuth, nodeFilterFn, nodeSelectorFn } from '../types';
declare type AddConnectionOptions = string | ConnectionOptions;

@@ -13,3 +14,3 @@ export interface ConnectionPoolOptions {

proxy?: string | URL;
auth?: BasicAuth | ApiKeyAuth;
auth?: BasicAuth | ApiKeyAuth | BearerAuth;
diagnostic?: Diagnostic;

@@ -19,2 +20,3 @@ Connection: typeof BaseConnection;

resurrectStrategy?: 'none' | 'ping' | 'optimistic';
caFingerprint?: string;
}

@@ -34,6 +36,7 @@ export interface GetConnectionOptions {

diagnostic: Diagnostic;
auth?: BasicAuth | ApiKeyAuth;
auth?: BasicAuth | ApiKeyAuth | BearerAuth;
_agent?: HttpAgentOptions | UndiciAgentOptions | agentFn;
_proxy?: string | URL;
_ssl?: TlsConnectionOptions;
[kCaFingerprint]?: string;
constructor(opts: ConnectionPoolOptions);

@@ -40,0 +43,0 @@ markAlive(connection: Connection): this;

@@ -20,2 +20,3 @@ "use strict";

*/
var _a;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -26,2 +27,3 @@ const tslib_1 = require("tslib");

const Diagnostic_1 = tslib_1.__importDefault(require("../Diagnostic"));
const symbols_1 = require("../symbols");
const connection_1 = require("../connection");

@@ -32,3 +34,3 @@ const errors_1 = require("../errors");

constructor(opts) {
var _a;
var _b;
Object.defineProperty(this, "connections", {

@@ -82,2 +84,8 @@ enumerable: true,

});
Object.defineProperty(this, _a, {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
// list of nodes and weights

@@ -88,3 +96,3 @@ this.connections = [];

this.Connection = opts.Connection;
this.diagnostic = (_a = opts.diagnostic) !== null && _a !== void 0 ? _a : new Diagnostic_1.default();
this.diagnostic = (_b = opts.diagnostic) !== null && _b !== void 0 ? _b : new Diagnostic_1.default();
this.auth = opts.auth;

@@ -94,2 +102,3 @@ this._ssl = opts.ssl;

this._proxy = opts.proxy;
this[symbols_1.kCaFingerprint] = opts.caFingerprint;
}

@@ -135,2 +144,5 @@ markAlive(connection) {

opts.diagnostic = this.diagnostic;
/* istanbul ignore else */
if (opts.caFingerprint == null)
opts.caFingerprint = this[symbols_1.kCaFingerprint];
const connection = new this.Connection(opts);

@@ -284,2 +296,3 @@ for (const conn of this.connections) {

exports.default = BaseConnectionPool;
_a = symbols_1.kCaFingerprint;
//# sourceMappingURL=BaseConnectionPool.js.map

@@ -9,2 +9,11 @@ import BaseConnectionPool, { ConnectionPoolOptions, GetConnectionOptions } from './BaseConnectionPool';

}
export interface ResurrectEvent {
strategy: string;
name: string;
request: {
id: string;
};
isAlive: boolean;
connection: Connection;
}
export default class ClusterConnectionPool extends BaseConnectionPool {

@@ -11,0 +20,0 @@ dead: string[];

@@ -169,3 +169,10 @@ "use strict";

.catch((err) => {
this.diagnostic.emit('resurrect', err, null);
this.markDead(connection);
this.diagnostic.emit('resurrect', err, {
strategy: 'ping',
name: opts.name,
request: { id: opts.requestId },
isAlive: false,
connection
});
});

@@ -172,0 +179,0 @@ // optimistic strategy

@@ -6,2 +6,3 @@ import BaseConnectionPool from './BaseConnectionPool';

export type { ConnectionPoolOptions, GetConnectionOptions } from './BaseConnectionPool';
export type { ResurrectEvent, ResurrectOptions } from './ClusterConnectionPool';
export { BaseConnectionPool, WeightedConnectionPool, ClusterConnectionPool, CloudConnectionPool };

@@ -0,2 +1,11 @@

import { kJsonOptions } from './symbols';
export interface SerializerOptions {
enablePrototypePoisoningProtection?: boolean | 'proto' | 'constructor';
}
export default class Serializer {
[kJsonOptions]: {
protoAction: string;
constructorAction: string;
};
constructor(opts?: SerializerOptions);
serialize(object: Record<string, any>): string;

@@ -3,0 +12,0 @@ deserialize<T = unknown>(json: string): T;

@@ -20,2 +20,3 @@ "use strict";

*/
var _a;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,7 +26,21 @@ const tslib_1 = require("tslib");

const debug_1 = tslib_1.__importDefault(require("debug"));
// @ts-expect-error
const secure_json_parse_1 = tslib_1.__importDefault(require("secure-json-parse"));
const errors_1 = require("./errors");
const symbols_1 = require("./symbols");
const debug = debug_1.default('elasticsearch');
class Serializer {
constructor(opts = {}) {
var _b;
Object.defineProperty(this, _a, {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
const enabled = (_b = opts.enablePrototypePoisoningProtection) !== null && _b !== void 0 ? _b : false;
this[symbols_1.kJsonOptions] = {
protoAction: enabled === true || enabled === 'proto' ? 'error' : 'ignore',
constructorAction: enabled === true || enabled === 'constructor' ? 'error' : 'ignore'
};
}
serialize(object) {

@@ -46,3 +61,4 @@ debug('Serializing', object);

try {
object = secure_json_parse_1.default.parse(json);
// @ts-expect-error
object = secure_json_parse_1.default.parse(json, this[symbols_1.kJsonOptions]);
}

@@ -93,2 +109,3 @@ catch (err) {

exports.default = Serializer;
_a = symbols_1.kJsonOptions;
//# sourceMappingURL=Serializer.js.map

@@ -9,21 +9,3 @@ /// <reference types="node" />

import { nodeFilterFn, nodeSelectorFn, generateRequestIdFn, RequestBody, RequestNDBody, TransportResult, Context } from './types';
declare const kSniffEnabled: unique symbol;
declare const kNextSniff: unique symbol;
declare const kIsSniffing: unique symbol;
declare const kSniffInterval: unique symbol;
declare const kSniffOnConnectionFault: unique symbol;
declare const kSniffEndpoint: unique symbol;
declare const kRequestTimeout: unique symbol;
declare const kCompression: unique symbol;
declare const kMaxRetries: unique symbol;
declare const kName: unique symbol;
declare const kOpaqueIdPrefix: unique symbol;
declare const kGenerateRequestId: unique symbol;
declare const kContext: unique symbol;
declare const kConnectionPool: unique symbol;
declare const kSerializer: unique symbol;
declare const kDiagnostic: unique symbol;
declare const kHeaders: unique symbol;
declare const kNodeFilter: unique symbol;
declare const kNodeSelector: unique symbol;
import { kSniffEnabled, kNextSniff, kIsSniffing, kSniffInterval, kSniffOnConnectionFault, kSniffEndpoint, kRequestTimeout, kCompression, kMaxRetries, kName, kOpaqueIdPrefix, kGenerateRequestId, kContext, kConnectionPool, kSerializer, kDiagnostic, kHeaders, kNodeFilter, kNodeSelector, kProductCheck } from './symbols';
export interface TransportOptions {

@@ -48,2 +30,3 @@ diagnostic?: Diagnostic;

context?: Context;
productCheck?: string;
}

@@ -127,2 +110,3 @@ export interface TransportRequestParams {

[kSniffEndpoint]: string | null;
[kProductCheck]: string | null;
static sniffReasons: {

@@ -148,2 +132,3 @@ SNIFF_ON_START: string;

}
export {};
export declare function generateRequestId(): generateRequestIdFn;
export declare function lowerCaseHeaders(oldHeaders?: http.IncomingHttpHeaders): http.IncomingHttpHeaders | null;

@@ -20,4 +20,5 @@ "use strict";

*/
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
Object.defineProperty(exports, "__esModule", { value: true });
exports.lowerCaseHeaders = exports.generateRequestId = void 0;
const tslib_1 = require("tslib");

@@ -32,2 +33,3 @@ const debug_1 = tslib_1.__importDefault(require("debug"));

const Serializer_1 = tslib_1.__importDefault(require("./Serializer"));
const symbols_1 = require("./symbols");
const { version: clientVersion } = require('../package.json'); // eslint-disable-line

@@ -38,25 +40,6 @@ const debug = debug_1.default('elasticsearch');

const { createGzip } = zlib_1.default;
const kSniffEnabled = Symbol('sniff enabled');
const kNextSniff = Symbol('next sniff');
const kIsSniffing = Symbol('is sniffing');
const kSniffInterval = Symbol('sniff interval');
const kSniffOnConnectionFault = Symbol('sniff on connection fault');
const kSniffEndpoint = Symbol('sniff endpoint');
const kRequestTimeout = Symbol('request timeout');
const kCompression = Symbol('compression');
const kMaxRetries = Symbol('max retries');
const kName = Symbol('name');
const kOpaqueIdPrefix = Symbol('opaque id prefix');
const kGenerateRequestId = Symbol('generate request id');
const kContext = Symbol('context');
const kConnectionPool = Symbol('connection pool');
const kSerializer = Symbol('serializer');
const kDiagnostic = Symbol('diagnostics');
const kHeaders = Symbol('headers');
const kNodeFilter = Symbol('node filter');
const kNodeSelector = Symbol('node selector');
const userAgent = `elastic-transport-js/${clientVersion} (${os_1.default.platform()} ${os_1.default.release()}-${os_1.default.arch()}; Node.js ${process.version})`; // eslint-disable-line
class Transport {
constructor(opts) {
var _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
var _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
Object.defineProperty(this, _a, {

@@ -176,2 +159,8 @@ enumerable: true,

});
Object.defineProperty(this, _v, {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
if (opts.connectionPool == null) {

@@ -187,26 +176,27 @@ throw new errors_1.ConfigurationError('The Connection Pool option is not defined');

}
this[kNodeFilter] = (_v = opts.nodeFilter) !== null && _v !== void 0 ? _v : defaultNodeFilter;
this[kNodeSelector] = (_w = opts.nodeSelector) !== null && _w !== void 0 ? _w : roundRobinSelector();
this[kHeaders] = Object.assign({}, { 'user-agent': userAgent }, opts.compression === true ? { 'accept-encoding': 'gzip,deflate' } : null, lowerCaseHeaders(opts.headers));
this[kDiagnostic] = (_x = opts.diagnostic) !== null && _x !== void 0 ? _x : new Diagnostic_1.default();
this[kConnectionPool] = opts.connectionPool;
this[kSerializer] = (_y = opts.serializer) !== null && _y !== void 0 ? _y : new Serializer_1.default();
this[kContext] = (_z = opts.context) !== null && _z !== void 0 ? _z : null;
this[kGenerateRequestId] = (_0 = opts.generateRequestId) !== null && _0 !== void 0 ? _0 : generateRequestId();
this[kOpaqueIdPrefix] = (_1 = opts.opaqueIdPrefix) !== null && _1 !== void 0 ? _1 : null;
this[kName] = (_2 = opts.name) !== null && _2 !== void 0 ? _2 : 'elastic-transport-js';
this[kMaxRetries] = typeof opts.maxRetries === 'number' ? opts.maxRetries : 3;
this[kCompression] = opts.compression === true;
this[kRequestTimeout] = opts.requestTimeout != null ? toMs(opts.requestTimeout) : 30000;
this[kSniffInterval] = (_3 = opts.sniffInterval) !== null && _3 !== void 0 ? _3 : false;
this[kSniffEnabled] = typeof this[kSniffInterval] === 'number';
this[kNextSniff] = this[kSniffEnabled] ? (Date.now() + this[kSniffInterval]) : 0;
this[kIsSniffing] = false;
this[kSniffOnConnectionFault] = (_4 = opts.sniffOnConnectionFault) !== null && _4 !== void 0 ? _4 : false;
this[kSniffEndpoint] = (_5 = opts.sniffEndpoint) !== null && _5 !== void 0 ? _5 : null;
this[symbols_1.kNodeFilter] = (_w = opts.nodeFilter) !== null && _w !== void 0 ? _w : defaultNodeFilter;
this[symbols_1.kNodeSelector] = (_x = opts.nodeSelector) !== null && _x !== void 0 ? _x : roundRobinSelector();
this[symbols_1.kHeaders] = Object.assign({}, { 'user-agent': userAgent, accept: 'application/vnd.elasticsearch+json; compatible-with=8' }, opts.compression === true ? { 'accept-encoding': 'gzip,deflate' } : null, lowerCaseHeaders(opts.headers));
this[symbols_1.kDiagnostic] = (_y = opts.diagnostic) !== null && _y !== void 0 ? _y : new Diagnostic_1.default();
this[symbols_1.kConnectionPool] = opts.connectionPool;
this[symbols_1.kSerializer] = (_z = opts.serializer) !== null && _z !== void 0 ? _z : new Serializer_1.default();
this[symbols_1.kContext] = (_0 = opts.context) !== null && _0 !== void 0 ? _0 : null;
this[symbols_1.kGenerateRequestId] = (_1 = opts.generateRequestId) !== null && _1 !== void 0 ? _1 : generateRequestId();
this[symbols_1.kOpaqueIdPrefix] = (_2 = opts.opaqueIdPrefix) !== null && _2 !== void 0 ? _2 : null;
this[symbols_1.kName] = (_3 = opts.name) !== null && _3 !== void 0 ? _3 : 'elastic-transport-js';
this[symbols_1.kMaxRetries] = typeof opts.maxRetries === 'number' ? opts.maxRetries : 3;
this[symbols_1.kCompression] = opts.compression === true;
this[symbols_1.kRequestTimeout] = opts.requestTimeout != null ? toMs(opts.requestTimeout) : 30000;
this[symbols_1.kSniffInterval] = (_4 = opts.sniffInterval) !== null && _4 !== void 0 ? _4 : false;
this[symbols_1.kSniffEnabled] = typeof this[symbols_1.kSniffInterval] === 'number';
this[symbols_1.kNextSniff] = this[symbols_1.kSniffEnabled] ? (Date.now() + this[symbols_1.kSniffInterval]) : 0;
this[symbols_1.kIsSniffing] = false;
this[symbols_1.kSniffOnConnectionFault] = (_5 = opts.sniffOnConnectionFault) !== null && _5 !== void 0 ? _5 : false;
this[symbols_1.kSniffEndpoint] = (_6 = opts.sniffEndpoint) !== null && _6 !== void 0 ? _6 : null;
this[symbols_1.kProductCheck] = (_7 = opts.productCheck) !== null && _7 !== void 0 ? _7 : null;
if (opts.sniffOnStart === true) {
this.sniff({
reason: Transport.sniffReasons.SNIFF_ON_START,
requestId: `sniff-on-start-${Math.random()}`,
context: this[kContext]
requestId: this[symbols_1.kGenerateRequestId]({ method: 'GET', path: this[symbols_1.kSniffEndpoint] }, { context: this[symbols_1.kContext] }),
context: this[symbols_1.kContext]
});

@@ -216,15 +206,15 @@ }

get connectionPool() {
return this[kConnectionPool];
return this[symbols_1.kConnectionPool];
}
get sniffEnabled() {
return this[kSniffEnabled];
return this[symbols_1.kSniffEnabled];
}
get nextSniff() {
return this[kNextSniff];
return this[symbols_1.kNextSniff];
}
get sniffEndpoint() {
return this[kSniffEndpoint];
return this[symbols_1.kSniffEndpoint];
}
get isSniffing() {
return this[kIsSniffing];
return this[symbols_1.kIsSniffing];
}

@@ -235,9 +225,9 @@ set isSniffing(val) {

}
this[kIsSniffing] = val;
this[symbols_1.kIsSniffing] = val;
}
get diagnostic() {
return this[kDiagnostic];
return this[symbols_1.kDiagnostic];
}
async request(params, options = {}) {
var _v, _w, _x, _y, _z, _0, _1, _2;
var _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
const meta = {

@@ -248,5 +238,5 @@ context: null,

options: options,
id: (_v = options.id) !== null && _v !== void 0 ? _v : this[kGenerateRequestId](params, options)
id: (_w = options.id) !== null && _w !== void 0 ? _w : this[symbols_1.kGenerateRequestId](params, options)
},
name: this[kName],
name: this[symbols_1.kName],
connection: null,

@@ -256,8 +246,8 @@ attempts: 0,

};
const returnMeta = (_w = options.meta) !== null && _w !== void 0 ? _w : false;
if (this[kContext] != null && options.context != null) {
meta.context = Object.assign({}, this[kContext], options.context);
const returnMeta = (_x = options.meta) !== null && _x !== void 0 ? _x : false;
if (this[symbols_1.kContext] != null && options.context != null) {
meta.context = Object.assign({}, this[symbols_1.kContext], options.context);
}
else if (this[kContext] !== null) {
meta.context = this[kContext];
else if (this[symbols_1.kContext] !== null) {
meta.context = this[symbols_1.kContext];
}

@@ -275,4 +265,4 @@ else if (options.context != null) {

get warnings() {
var _v;
return ((_v = this.headers) === null || _v === void 0 ? void 0 : _v.warning) != null
var _w;
return ((_w = this.headers) === null || _w === void 0 ? void 0 : _w.warning) != null
? this.headers.warning.split(/(?!\B"[^"]*),(?![^"]*"\B)/)

@@ -290,10 +280,10 @@ : null;

// Furthermore, copying everytime the stream is very a expensive operation.
const maxRetries = isStream((_x = params.body) !== null && _x !== void 0 ? _x : params.bulkBody) ? 0 : (typeof options.maxRetries === 'number' ? options.maxRetries : this[kMaxRetries]);
const compression = typeof options.compression === 'boolean' ? options.compression : this[kCompression];
const abortController = (_y = options.abortController) !== null && _y !== void 0 ? _y : null;
this[kDiagnostic].emit('serialization', null, result);
const headers = Object.assign({}, this[kHeaders], lowerCaseHeaders(options.headers));
const maxRetries = isStream((_y = params.body) !== null && _y !== void 0 ? _y : params.bulkBody) ? 0 : (typeof options.maxRetries === 'number' ? options.maxRetries : this[symbols_1.kMaxRetries]);
const compression = typeof options.compression === 'boolean' ? options.compression : this[symbols_1.kCompression];
const abortController = (_z = options.abortController) !== null && _z !== void 0 ? _z : null;
this[symbols_1.kDiagnostic].emit('serialization', null, result);
const headers = Object.assign({}, this[symbols_1.kHeaders], lowerCaseHeaders(options.headers));
if (options.opaqueId !== undefined) {
headers['x-opaque-id'] = typeof this[kOpaqueIdPrefix] === 'string'
? this[kOpaqueIdPrefix] + options.opaqueId // eslint-disable-line
headers['x-opaque-id'] = typeof this[symbols_1.kOpaqueIdPrefix] === 'string'
? this[symbols_1.kOpaqueIdPrefix] + options.opaqueId // eslint-disable-line
: options.opaqueId;

@@ -305,6 +295,6 @@ }

try {
connectionParams.body = this[kSerializer].serialize(params.body);
connectionParams.body = this[symbols_1.kSerializer].serialize(params.body);
}
catch (err) {
this[kDiagnostic].emit('request', err, result);
this[symbols_1.kDiagnostic].emit('request', err, result);
throw err;

@@ -317,3 +307,3 @@ }

if (params.body !== '') {
headers['content-type'] = (_z = headers['content-type']) !== null && _z !== void 0 ? _z : 'application/json';
headers['content-type'] = (_0 = headers['content-type']) !== null && _0 !== void 0 ? _0 : 'application/vnd.elasticsearch+json; compatible-with=8';
}

@@ -325,6 +315,6 @@ // handle ndjson body

try {
connectionParams.body = this[kSerializer].ndserialize(params.bulkBody);
connectionParams.body = this[symbols_1.kSerializer].ndserialize(params.bulkBody);
}
catch (err) {
this[kDiagnostic].emit('request', err, result);
this[symbols_1.kDiagnostic].emit('request', err, result);
throw err;

@@ -337,3 +327,3 @@ }

if (connectionParams.body !== '') {
headers['content-type'] = (_0 = headers['content-type']) !== null && _0 !== void 0 ? _0 : 'application/x-ndjson';
headers['content-type'] = (_1 = headers['content-type']) !== null && _1 !== void 0 ? _1 : 'application/vnd.elasticsearch+x-ndjson; compatible-with=8';
}

@@ -344,9 +334,9 @@ }

if (options.querystring == null) {
connectionParams.querystring = this[kSerializer].qserialize(params.querystring);
connectionParams.querystring = this[symbols_1.kSerializer].qserialize(params.querystring);
}
else {
connectionParams.querystring = this[kSerializer].qserialize(Object.assign({}, params.querystring, options.querystring));
connectionParams.querystring = this[symbols_1.kSerializer].qserialize(Object.assign({}, params.querystring, options.querystring));
}
// handles request timeout
connectionParams.timeout = toMs(options.requestTimeout != null ? options.requestTimeout : this[kRequestTimeout]);
connectionParams.timeout = toMs(options.requestTimeout != null ? options.requestTimeout : this[symbols_1.kRequestTimeout]);
// TODO: fixme

@@ -370,3 +360,3 @@ // if (options.asStream === true) params.asStream = true

/* istanbul ignore next */
this[kDiagnostic].emit('request', err, result);
this[symbols_1.kDiagnostic].emit('request', err, result);
/* istanbul ignore next */

@@ -394,7 +384,7 @@ throw err;

}
this[kDiagnostic].emit('request', null, result);
this[symbols_1.kDiagnostic].emit('request', null, result);
// perform the actual http request
let { statusCode, headers, body } = await meta.connection.request(connectionParams, {
requestId: meta.request.id,
name: this[kName],
name: this[symbols_1.kName],
context: meta.context

@@ -404,7 +394,11 @@ });

result.headers = headers;
const contentEncoding = ((_1 = headers['content-encoding']) !== null && _1 !== void 0 ? _1 : '').toLowerCase();
if (this[symbols_1.kProductCheck] != null && headers['x-elastic-product'] !== this[symbols_1.kProductCheck]) {
throw new errors_1.ProductNotSupportedError(this[symbols_1.kProductCheck], result);
}
const contentEncoding = ((_2 = headers['content-encoding']) !== null && _2 !== void 0 ? _2 : '').toLowerCase();
if (contentEncoding.includes('gzip') || contentEncoding.includes('deflate')) {
body = await unzip(body);
}
if (Buffer.isBuffer(body)) {
const isVectorTile = ((_3 = headers['content-type']) !== null && _3 !== void 0 ? _3 : '').includes('application/vnd.mapbox-vector-tile');
if (Buffer.isBuffer(body) && !isVectorTile) {
body = body.toString();

@@ -423,8 +417,11 @@ }

// - the payload is not an empty string
if (((_2 = headers['content-type']) === null || _2 === void 0 ? void 0 : _2.includes('application/json')) && !isHead && body !== '') { // eslint-disable-line
result.body = this[kSerializer].deserialize(body);
if (headers['content-type'] !== undefined &&
(((_4 = headers['content-type']) === null || _4 === void 0 ? void 0 : _4.includes('application/json')) ||
((_5 = headers['content-type']) === null || _5 === void 0 ? void 0 : _5.includes('application/vnd.elasticsearch+json'))) &&
!isHead && body !== '') { // eslint-disable-line
result.body = this[symbols_1.kSerializer].deserialize(body);
}
else {
// cast to boolean if the request method was HEAD
result.body = isHead ? true : body;
// cast to boolean if the request method was HEAD and there was no error
result.body = isHead && statusCode < 400 ? true : body;
}

@@ -438,3 +435,3 @@ // we should ignore the statusCode if the user has configured the `ignore` field with

// and mark the connection as dead
this[kConnectionPool].markDead(meta.connection);
this[symbols_1.kConnectionPool].markDead(meta.connection);
// retry logic

@@ -450,3 +447,3 @@ if (meta.attempts < maxRetries) {

// the connection as alive (or confirm it)
this[kConnectionPool].markAlive(meta.connection);
this[symbols_1.kConnectionPool].markAlive(meta.connection);
}

@@ -461,3 +458,3 @@ if (!ignoreStatusCode && statusCode >= 400) {

}
this[kDiagnostic].emit('response', null, result);
this[symbols_1.kDiagnostic].emit('response', null, result);
return returnMeta ? result : result.body;

@@ -469,6 +466,7 @@ }

// should not retry
case 'ProductNotSupportedError':
case 'NoLivingConnectionsError':
case 'DeserializationError':
case 'ResponseError':
this[kDiagnostic].emit('response', error, result);
this[symbols_1.kDiagnostic].emit('response', error, result);
throw error;

@@ -479,3 +477,3 @@ case 'RequestAbortedError': {

const wrappedError = new errors_1.RequestAbortedError(error.message, result);
this[kDiagnostic].emit('response', wrappedError, result);
this[symbols_1.kDiagnostic].emit('response', wrappedError, result);
throw wrappedError;

@@ -488,4 +486,4 @@ }

// let's mark the connection as dead
this[kConnectionPool].markDead(meta.connection);
if (this[kSniffOnConnectionFault]) {
this[symbols_1.kConnectionPool].markDead(meta.connection);
if (this[symbols_1.kSniffOnConnectionFault]) {
this.sniff({

@@ -507,3 +505,3 @@ reason: Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT,

: new errors_1.ConnectionError(error.message, result);
this[kDiagnostic].emit('response', wrappedError, result);
this[symbols_1.kDiagnostic].emit('response', wrappedError, result);
throw wrappedError;

@@ -513,3 +511,3 @@ }

default:
this[kDiagnostic].emit('response', error, result);
this[symbols_1.kDiagnostic].emit('response', error, result);
throw error;

@@ -523,4 +521,4 @@ }

const now = Date.now();
if (this[kSniffEnabled] && now > this[kNextSniff]) {
this[kNextSniff] = now + this[kSniffInterval];
if (this[symbols_1.kSniffEnabled] && now > this[symbols_1.kNextSniff]) {
this[symbols_1.kNextSniff] = now + this[symbols_1.kSniffInterval];
this.sniff({

@@ -532,7 +530,7 @@ reason: Transport.sniffReasons.SNIFF_INTERVAL,

}
return this[kConnectionPool].getConnection({
filter: this[kNodeFilter],
selector: this[kNodeSelector],
return this[symbols_1.kConnectionPool].getConnection({
filter: this[symbols_1.kNodeFilter],
selector: this[symbols_1.kNodeSelector],
requestId: opts.requestId,
name: this[kName],
name: this[symbols_1.kName],
context: opts.context,

@@ -546,3 +544,3 @@ now

exports.default = Transport;
_a = kNodeFilter, _b = kNodeSelector, _c = kHeaders, _d = kDiagnostic, _e = kConnectionPool, _f = kSerializer, _g = kContext, _h = kGenerateRequestId, _j = kOpaqueIdPrefix, _k = kName, _l = kMaxRetries, _m = kCompression, _o = kRequestTimeout, _p = kSniffEnabled, _q = kNextSniff, _r = kIsSniffing, _s = kSniffInterval, _t = kSniffOnConnectionFault, _u = kSniffEndpoint;
_a = symbols_1.kNodeFilter, _b = symbols_1.kNodeSelector, _c = symbols_1.kHeaders, _d = symbols_1.kDiagnostic, _e = symbols_1.kConnectionPool, _f = symbols_1.kSerializer, _g = symbols_1.kContext, _h = symbols_1.kGenerateRequestId, _j = symbols_1.kOpaqueIdPrefix, _k = symbols_1.kName, _l = symbols_1.kMaxRetries, _m = symbols_1.kCompression, _o = symbols_1.kRequestTimeout, _p = symbols_1.kSniffEnabled, _q = symbols_1.kNextSniff, _r = symbols_1.kIsSniffing, _s = symbols_1.kSniffInterval, _t = symbols_1.kSniffOnConnectionFault, _u = symbols_1.kSniffEndpoint, _v = symbols_1.kProductCheck;
Object.defineProperty(Transport, "sniffReasons", {

@@ -592,2 +590,3 @@ enumerable: true,

}
exports.generateRequestId = generateRequestId;
function lowerCaseHeaders(oldHeaders) {

@@ -603,2 +602,3 @@ if (oldHeaders == null)

}
exports.lowerCaseHeaders = lowerCaseHeaders;
//# sourceMappingURL=Transport.js.map

@@ -64,4 +64,7 @@ /// <reference types="node" />

}
export interface BearerAuth {
bearer: string;
}
export declare type nodeSelectorFn = (connections: Connection[]) => Connection;
export declare type nodeFilterFn = (connection: Connection) => boolean;
export declare type generateRequestIdFn = (params: TransportRequestParams, options: TransportRequestOptions) => any;
{
"name": "@elastic/transport",
"version": "0.0.1",
"version": "0.0.2",
"description": "Transport classes and utilities shared among Node.js Elastic client libraries",

@@ -41,10 +41,11 @@ "main": "index.js",

"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1",
"@types/debug": "^4.1.5",
"@types/debug": "^4.1.6",
"@types/ms": "^0.7.31",
"@types/node": "^14.14.31",
"@types/stoppable": "^1.1.0",
"@types/tap": "^14.10.2",
"@types/node": "^16.4.1",
"@types/sinonjs__fake-timers": "^6.0.3",
"@types/stoppable": "^1.1.1",
"@types/tap": "^15.0.5",
"into-stream": "^6.0.0",
"license-checker": "^25.0.1",
"node-abort-controller": "^1.1.0",
"node-abort-controller": "^2.0.0",
"proxy": "^1.0.2",

@@ -54,23 +55,23 @@ "rimraf": "^3.0.2",

"stoppable": "^1.1.0",
"tap": "^14.11.0",
"ts-node": "^9.1.1",
"tap": "^15.0.9",
"ts-node": "^10.1.0",
"ts-standard": "^10.0.0",
"typescript": "^4.1.5",
"typescript": "^4.3.5",
"workq": "^3.0.0"
},
"dependencies": {
"debug": "^4.3.1",
"hpagent": "^0.1.1",
"debug": "^4.3.2",
"hpagent": "^0.1.2",
"ms": "^2.1.3",
"secure-json-parse": "^2.3.1",
"tslib": "^2.1.0",
"undici": "^3.3.3"
"secure-json-parse": "^2.4.0",
"tslib": "^2.3.0",
"undici": "^4.3.1"
},
"tap": {
"esm": false,
"ts": true,
"jsx": false,
"flow": false,
"coverage": false
"coverage": false,
"check-coverage": false
}
}
<img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png">
# Elasticsearch Node.js Transport
# Elastic Node.js Transport

@@ -5,0 +5,0 @@ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Node CI](https://github.com/elastic/elastic-transport-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/elastic/elastic-transport-js/actions/workflows/nodejs.yml) [![codecov](https://codecov.io/gh/elastic/elastic-transport-js/branch/master/graph/badge.svg?token=4CU5AeB3FW)](https://codecov.io/gh/elastic/elastic-transport-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/transport.svg?style=flat)](https://www.npmjs.com/package/@elastic/transport)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc