Skip to content

Commit 3a1bb93

Browse files
committed
Merge branch 'master' into 7.x
2 parents e185a0b + 46bd14a commit 3a1bb93

File tree

270 files changed

+1805
-2800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+1805
-2800
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- job:
3+
name: elastic+elasticsearch-js+5.x
4+
display-name: 'elastic / elasticsearch-js # 5.x'
5+
description: Testing the elasticsearch-js 5.x branch.
6+
parameters:
7+
- string:
8+
name: branch_specifier
9+
default: refs/heads/5.x
10+
description: the Git branch specifier to build (<branchName>, <tagName>,
11+
<commitId>, etc.)
12+
triggers:
13+
- github
14+
- timed: '@weekly'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- job:
3+
name: elastic+elasticsearch-js+6.x
4+
display-name: 'elastic / elasticsearch-js # 6.x'
5+
description: Testing the elasticsearch-js 6.x branch.
6+
parameters:
7+
- string:
8+
name: branch_specifier
9+
default: refs/heads/6.x
10+
description: the Git branch specifier to build (<branchName>, <tagName>,
11+
<commitId>, etc.)
12+
triggers:
13+
- github
14+
- timed: '@weekly'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- job:
3+
name: elastic+elasticsearch-js+7.x
4+
display-name: 'elastic / elasticsearch-js # 7.x'
5+
description: Testing the elasticsearch-js 7.x branch.
6+
parameters:
7+
- string:
8+
name: branch_specifier
9+
default: refs/heads/7.x
10+
description: the Git branch specifier to build (<branchName>, <tagName>,
11+
<commitId>, etc.)
12+
triggers:
13+
- github
14+
- timed: '@weekly'

.ci/jobs/elastic+elasticsearch-js+next.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/ISSUE_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 👉 [Please follow one of these issue templates](https://github.com/elastic/elasticsearch-js/issues/new/choose) 👈
2+
3+
#### You have already researched for similar issues?
4+
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
5+
6+
#### Are you sure this is an issue with @elastic/elasticsearch or are you just looking for some help?
7+
8+
Issues should only be posted in this repository after you have been able to reproduce them and confirm that they are a bug or incorrect/missing information in the [docs](https://github.com/elastic/elasticsearch-js/docs).
9+
10+
If you have a question related to Elasticsearch itself, please consider open a question on [discuss.elastic.co](https://discuss.elastic.co/).

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: 🐛 Bug report
3+
about: Create a report to help us improve
4+
---
5+
6+
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
7+
8+
**Please read this entire template before posting any issue. If you ignore these instructions
9+
and post an issue here that does not follow the instructions, your issue might be closed,
10+
locked, and assigned the `not reproducible` label.**
11+
12+
## 🐛 Bug Report
13+
14+
A clear and concise description of what the bug is.
15+
16+
## To Reproduce
17+
18+
Steps to reproduce the behavior:
19+
20+
Paste your code here:
21+
22+
```js
23+
24+
```
25+
26+
## Expected behavior
27+
28+
A clear and concise description of what you expected to happen.
29+
30+
Paste the results here:
31+
32+
```js
33+
34+
```
35+
36+
## Your Environment
37+
38+
- *node version*: 6,8,10
39+
- *@elastic/elasticsearch version*: >=7.0.0
40+
- *os*: Mac, Windows, Linux
41+
- *any other relevant information*

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: 🚀 Feature Proposal
3+
about: Submit a proposal for a new feature
4+
---
5+
6+
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
7+
8+
**Please read this entire template before posting any issue. If you ignore these instructions
9+
and post an issue here that does not follow the instructions, your issue might be closed,
10+
locked, and assigned the `invalid` label.**
11+
12+
## 🚀 Feature Proposal
13+
14+
A clear and concise description of what the feature is.
15+
16+
## Motivation
17+
18+
Please outline the motivation for the proposal.
19+
20+
## Example
21+
22+
Please provide an example for how this feature would be used.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: 💬 Questions / Help
3+
about: If you have questions, please check our Gitter or Help repo
4+
---
5+
6+
## 💬 Questions and Help
7+
8+
### Please note that this issue tracker is not a help forum and this issue may be closed.
9+
10+
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.

.github/ISSUE_TEMPLATE/regression.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: 💥 Regression Report
3+
about: Report unexpected behavior that worked in previous versions
4+
---
5+
6+
It's not uncommon that somebody already opened an issue or in the best case it's already fixed but not merged. That's the reason why you should [search](https://github.com/elastic/elasticsearch-js/issues) at first before submitting a new one.
7+
8+
**Please read this entire template before posting any issue. If you ignore these instructions
9+
and post an issue here that does not follow the instructions, your issue might be closed,
10+
locked, and assigned the `invalid` label.**
11+
12+
## 💥 Regression Report
13+
14+
A clear and concise description of what the regression is.
15+
16+
## Last working version
17+
18+
Worked up to version:
19+
20+
Stopped working in version:
21+
22+
## To Reproduce
23+
24+
Steps to reproduce the behavior:
25+
26+
Paste your code here:
27+
28+
```js
29+
30+
```
31+
32+
## Expected behavior
33+
34+
A clear and concise description of what you expected to happen.
35+
36+
Paste the results here:
37+
38+
```js
39+
40+
```
41+
42+
## Your Environment
43+
44+
- *node version*: 6,8,10
45+
- *@elastic/elasticsearch version*: >=7.0.0
46+
- *os*: Mac, Windows, Linux
47+
- *any other relevant information*

.github/ISSUE_TEMPLATE/security.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
name: 👮 Security Issue
3+
about: Responsible Disclosure
4+
---
5+
6+
If you want to report a security issue, please take a look at [elastic/security](https://www.elastic.co/community/security).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--
2+
3+
Hello there!
4+
5+
Thank you for opening a pull request!
6+
Please remember to always tag the relative issue (if any) and give a brief explanation on what your changes are doing.
7+
8+
If you are patching a security issue, please take a look at https://www.elastic.co/community/security
9+
10+
Finally, please make sure you have signed the Contributor License Agreement
11+
We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction.
12+
We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
13+
https://www.elastic.co/contributor-agreement/
14+
15+
Happy coding!
16+
17+
-->

.github/stale.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 15
3+
4+
# Number of days of inactivity before a stale issue is closed
5+
daysUntilClose: 7
6+
7+
# Issues with these labels will never be considered stale
8+
exemptLabels:
9+
- "discussion"
10+
- "feature request"
11+
- "bug"
12+
13+
# Label to use when marking an issue as stale
14+
staleLabel: stale
15+
16+
# Comment to post when marking an issue as stale. Set to `false` to disable
17+
markComment: |
18+
We understand that this might be important for you, but this issue has been automatically marked as stale because it has not had recent activity either from our end or yours.
19+
It will be closed if no further activity occurs, please write a comment if you would like to keep this going.
20+
21+
Note: in the past months we have built a new client, that has just landed in master. If you want to open an issue or a pr for the legacy client, you should do that in https://github.com/elastic/elasticsearch-js-legacy
22+
23+
# Comment to post when closing a stale issue. Set to `false` to disable
24+
closeComment: false

api/api/bulk.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
function buildBulk (opts) {
2626
// eslint-disable-next-line no-unused-vars
27-
const { makeRequest, ConfigurationError, result } = opts
27+
const { makeRequest, ConfigurationError, handleError } = opts
2828
/**
2929
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
3030
*
@@ -90,26 +90,20 @@ function buildBulk (opts) {
9090

9191
// check required parameters
9292
if (params['body'] == null) {
93-
return callback(
94-
new ConfigurationError('Missing required parameter: body'),
95-
result
96-
)
93+
const err = new ConfigurationError('Missing required parameter: body')
94+
return handleError(err, callback)
9795
}
9896

9997
// check required url components
10098
if (params['type'] != null && (params['index'] == null)) {
101-
return callback(
102-
new ConfigurationError('Missing required parameter of the url: index'),
103-
result
104-
)
99+
const err = new ConfigurationError('Missing required parameter of the url: index')
100+
return handleError(err, callback)
105101
}
106102

107103
// validate headers object
108104
if (options.headers != null && typeof options.headers !== 'object') {
109-
return callback(
110-
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
111-
result
112-
)
105+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
106+
return handleError(err, callback)
113107
}
114108

115109
var warnings = null

api/api/cat.aliases.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
function buildCatAliases (opts) {
2626
// eslint-disable-next-line no-unused-vars
27-
const { makeRequest, ConfigurationError, result } = opts
27+
const { makeRequest, ConfigurationError, handleError } = opts
2828
/**
2929
* Perform a [cat.aliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html) request
3030
*
@@ -82,18 +82,14 @@ function buildCatAliases (opts) {
8282

8383
// check required parameters
8484
if (params.body != null) {
85-
return callback(
86-
new ConfigurationError('This API does not require a body'),
87-
result
88-
)
85+
const err = new ConfigurationError('This API does not require a body')
86+
return handleError(err, callback)
8987
}
9088

9189
// validate headers object
9290
if (options.headers != null && typeof options.headers !== 'object') {
93-
return callback(
94-
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
95-
result
96-
)
91+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
92+
return handleError(err, callback)
9793
}
9894

9995
var warnings = null

api/api/cat.allocation.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
function buildCatAllocation (opts) {
2626
// eslint-disable-next-line no-unused-vars
27-
const { makeRequest, ConfigurationError, result } = opts
27+
const { makeRequest, ConfigurationError, handleError } = opts
2828
/**
2929
* Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request
3030
*
@@ -84,18 +84,14 @@ function buildCatAllocation (opts) {
8484

8585
// check required parameters
8686
if (params.body != null) {
87-
return callback(
88-
new ConfigurationError('This API does not require a body'),
89-
result
90-
)
87+
const err = new ConfigurationError('This API does not require a body')
88+
return handleError(err, callback)
9189
}
9290

9391
// validate headers object
9492
if (options.headers != null && typeof options.headers !== 'object') {
95-
return callback(
96-
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
97-
result
98-
)
93+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
94+
return handleError(err, callback)
9995
}
10096

10197
var warnings = null

api/api/cat.count.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
function buildCatCount (opts) {
2626
// eslint-disable-next-line no-unused-vars
27-
const { makeRequest, ConfigurationError, result } = opts
27+
const { makeRequest, ConfigurationError, handleError } = opts
2828
/**
2929
* Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request
3030
*
@@ -82,18 +82,14 @@ function buildCatCount (opts) {
8282

8383
// check required parameters
8484
if (params.body != null) {
85-
return callback(
86-
new ConfigurationError('This API does not require a body'),
87-
result
88-
)
85+
const err = new ConfigurationError('This API does not require a body')
86+
return handleError(err, callback)
8987
}
9088

9189
// validate headers object
9290
if (options.headers != null && typeof options.headers !== 'object') {
93-
return callback(
94-
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
95-
result
96-
)
91+
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
92+
return handleError(err, callback)
9793
}
9894

9995
var warnings = null

0 commit comments

Comments
 (0)