@elastic/elasticsearch
Advanced tools
Comparing version 7.14.0 to 7.14.1
@@ -39,3 +39,2 @@ /* | ||
const productCheckEmitter = new EventEmitter() | ||
const clientVersion = require('../package.json').version | ||
@@ -47,2 +46,3 @@ const userAgent = `elasticsearch-js/${clientVersion} (${os.platform()} ${os.release()}-${os.arch()}; Node.js ${process.version})` | ||
const kApiVersioning = Symbol('api versioning') | ||
const kEventEmitter = Symbol('event emitter') | ||
@@ -76,2 +76,3 @@ class Transport { | ||
this[kApiVersioning] = process.env.ELASTIC_CLIENT_APIVERSIONING === 'true' | ||
this[kEventEmitter] = new EventEmitter() | ||
@@ -461,3 +462,3 @@ this.nodeFilter = opts.nodeFilter || defaultNodeFilter | ||
// wait for product check to finish | ||
productCheckEmitter.once('product-check', (error, status) => { | ||
this[kEventEmitter].once('product-check', (error, status) => { | ||
if (status === false) { | ||
@@ -563,6 +564,6 @@ const err = error || new ProductNotSupportedError(result) | ||
process.emitWarning('The client is unable to verify that the server is Elasticsearch due to security privileges on the server side. Some functionality may not be compatible if the server is running an unsupported product.') | ||
productCheckEmitter.emit('product-check', null, true) | ||
this[kEventEmitter].emit('product-check', null, true) | ||
} else { | ||
this[kProductCheck] = 0 | ||
productCheckEmitter.emit('product-check', err, false) | ||
this[kEventEmitter].emit('product-check', err, false) | ||
} | ||
@@ -573,3 +574,3 @@ } else { | ||
debug('Can\'t access Elasticsearch version') | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} | ||
@@ -581,7 +582,7 @@ const tagline = result.body.tagline | ||
if (major < 6) { | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} else if (major >= 6 && major < 7) { | ||
if (tagline !== 'You Know, for Search') { | ||
debug('Bad tagline') | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} | ||
@@ -591,3 +592,3 @@ } else if (major === 7 && minor < 14) { | ||
debug('Bad tagline') | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} | ||
@@ -598,3 +599,3 @@ | ||
this[kProductCheck] = 4 | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} | ||
@@ -604,3 +605,3 @@ } else { | ||
debug('x-elastic-product not recognized') | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} | ||
@@ -610,3 +611,3 @@ } | ||
this[kProductCheck] = 2 | ||
productCheckEmitter.emit('product-check', null, true) | ||
this[kEventEmitter].emit('product-check', null, true) | ||
} | ||
@@ -613,0 +614,0 @@ }) |
@@ -14,3 +14,3 @@ { | ||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html", | ||
"version": "7.14.0", | ||
"version": "7.14.1", | ||
"versionCanary": "7.14.0-canary.7", | ||
@@ -17,0 +17,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2126752
35442
103