@elastic/elasticsearch-canary
Advanced tools
Comparing version 8.0.0-canary.18 to 8.0.0-canary.19
@@ -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() | ||
@@ -188,2 +189,3 @@ this.nodeFilter = opts.nodeFilter || defaultNodeFilter | ||
if (meta.aborted === true) { | ||
this.emit('request', new RequestAbortedError(), result) | ||
return process.nextTick(callback, new RequestAbortedError(), result) | ||
@@ -427,4 +429,2 @@ } | ||
if (options.asStream === true) params.asStream = true | ||
meta.request.params = params | ||
meta.request.options = options | ||
@@ -460,2 +460,4 @@ // handle compression | ||
meta.request.params = params | ||
meta.request.options = options | ||
// still need to check the product or waiting for the check to finish | ||
@@ -468,3 +470,3 @@ if (this[kProductCheck] === 0 || this[kProductCheck] === 1) { | ||
// wait for product check to finish | ||
productCheckEmitter.once('product-check', (error, status) => { | ||
this[kEventEmitter].once('product-check', (error, status) => { | ||
if (status === false) { | ||
@@ -573,6 +575,6 @@ const err = error || new ProductNotSupportedError(result) | ||
) | ||
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) | ||
} | ||
@@ -583,3 +585,3 @@ } else { | ||
debug('Can\'t access Elasticsearch version') | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} | ||
@@ -591,7 +593,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) | ||
} | ||
@@ -601,3 +603,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) | ||
} | ||
@@ -608,3 +610,3 @@ | ||
this[kProductCheck] = 4 | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} | ||
@@ -614,3 +616,3 @@ } else { | ||
debug('x-elastic-product not recognized') | ||
return productCheckEmitter.emit('product-check', null, false) | ||
return this[kEventEmitter].emit('product-check', null, false) | ||
} | ||
@@ -620,3 +622,3 @@ } | ||
this[kProductCheck] = 2 | ||
productCheckEmitter.emit('product-check', null, true) | ||
this[kEventEmitter].emit('product-check', null, true) | ||
} | ||
@@ -623,0 +625,0 @@ }) |
@@ -14,4 +14,4 @@ { | ||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html", | ||
"version": "8.0.0-canary.18", | ||
"versionCanary": "8.0.0-canary.18", | ||
"version": "8.0.0-canary.19", | ||
"versionCanary": "8.0.0-canary.19", | ||
"keywords": [ | ||
@@ -107,3 +107,3 @@ "elasticsearch", | ||
}, | ||
"commitHash": "a0dcace7" | ||
"commitHash": "470bc84e" | ||
} |
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
106
36096
2159555