Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9892d63
Add data field in serialization errors (#1100)
killua1zoldyck Mar 23, 2020
85674fe
Refactored type definitions (#1119)
delvedor Mar 23, 2020
c1308fe
Client helpers (#1107)
delvedor Mar 23, 2020
97e3615
API generation
delvedor Mar 23, 2020
4fcddcb
Test against Elasticsearch 7.x-SNAPSHOT
delvedor Mar 23, 2020
09fecad
Updated code coverage scripts
delvedor Mar 23, 2020
7c6a33a
Improve code coverage (#1124)
delvedor Mar 24, 2020
846d373
API generation
delvedor Mar 25, 2020
127a78d
Use 7.7 ES image
delvedor Mar 25, 2020
5453a62
API generation
delvedor Mar 26, 2020
008440d
Added expand_wildcards all to test cleanup
delvedor Mar 26, 2020
2d3a6fd
Updated Connections handling (#1127)
delvedor Mar 26, 2020
425f999
Bumped v7.7.0-rc.1
delvedor Mar 26, 2020
b3ac79b
API generation
delvedor Mar 27, 2020
d903441
API generation
delvedor Mar 30, 2020
4a92f0a
Merge branch '7.7' of https://github.com/elastic/elasticsearch-js int…
delvedor Mar 30, 2020
aa29e08
API generation
delvedor Mar 30, 2020
3834b9e
API generation
delvedor Apr 2, 2020
d15bd54
Run workflow also on community pull requests
delvedor Apr 3, 2020
a16d49e
Added async generator support in bulk helper (#1138)
delvedor Apr 3, 2020
d909785
API generation
delvedor Apr 3, 2020
d6689f2
Updated abort behavior (#1141)
delvedor Apr 6, 2020
ac30f26
Do not retry a request if the body is a stream (#1143)
delvedor Apr 6, 2020
6a250e2
Switched request and response generics position (#1132)
delvedor Apr 6, 2020
86082e3
API generation
delvedor Apr 6, 2020
77bd498
Updated TypeScript docs (#1144)
delvedor Apr 6, 2020
ffd5d9b
Bumped v7.7.0-rc.2
delvedor Apr 6, 2020
f9912f6
Updated skip list
delvedor Apr 9, 2020
0e524be
Fix flaky test (#1158)
delvedor Apr 14, 2020
8db517a
Generate junit report (#1165)
delvedor Apr 23, 2020
5bf7791
API generation
delvedor Apr 23, 2020
c5610d7
Introduce changelog (#1173)
delvedor Apr 23, 2020
5fefa33
Add Node.js v14 to test matrix (#1172)
delvedor Apr 23, 2020
478639f
API generation
delvedor May 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

source /usr/local/bin/bash_standard_lib.sh

DOCKER_IMAGES="node:12-alpine
DOCKER_IMAGES="node:14-alpine
node:12-alpine
node:10-alpine
node:8-alpine
"
Expand Down
4 changes: 2 additions & 2 deletions .ci/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ echo -e "\033[1m>>>>> NPM run test:integration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033
repo=$(realpath $(dirname $(realpath -s $0))/../)
run_script_args=""
if [[ "$NODE_JS_VERSION" == "8" ]]; then
run_script_args="-- --node-arg=--harmony-async-iteration"
run_script_args="--harmony-async-iteration"
fi

docker run \
Expand All @@ -43,4 +43,4 @@ docker run \
--name elasticsearch-js \
--rm \
elastic/elasticsearch-js \
npm run test:integration ${run_script_args}
node ${run_script_args} test/integration/index.js
3 changes: 2 additions & 1 deletion .ci/test-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
STACK_VERSION:
- 7.6-SNAPSHOT
- 7.7.0-SNAPSHOT

NODE_JS_VERSION:
- 14
- 12
- 10
- 8
Expand Down
40 changes: 38 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Node CI

on: [push]
on: [push, pull_request]

jobs:
test:
Expand All @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 13.x]
node-version: [10.x, 12.x, 14.x]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down Expand Up @@ -65,6 +65,42 @@ jobs:
run: |
npm run test:unit -- --node-arg=--harmony-async-iteration

helpers-integration-test:
name: Helpers integration test
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144

- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.7.0-SNAPSHOT

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install
run: |
npm install

- name: Integration test
run: |
npm run test:integration:helpers

code-coverage:
name: Code coverage
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ We recommend that you write a lightweight proxy that uses this client instead.
## Documentation

- [Introduction](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html)
- [Changelog](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/changelog-client.html)
- [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-usage.html)
- [Client configuration](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-configuration.html)
- [API reference](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)
Expand All @@ -60,6 +61,7 @@ We recommend that you write a lightweight proxy that uses this client instead.
- [Observability](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html)
- [Creating a child client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/child-client.html)
- [Extend the client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/extend-client.html)
- [Client helpers](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html)
- [Typescript support](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/typescript.html)
- [Examples](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/examples.html)

Expand Down
78 changes: 78 additions & 0 deletions api/api/async_search.delete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

'use strict'

/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */

function buildAsyncSearchDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts

const acceptedQuerystring = [

]

const snakeCase = {

}

/**
* Perform a async_search.delete request
* Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
*/
return function asyncSearchDelete (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}

// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}

// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}

var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)

var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}

var path = ''

if (method == null) method = 'DELETE'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)

// build request object
const request = {
method,
path,
body: body || '',
querystring
}

options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}

module.exports = buildAsyncSearchDelete
82 changes: 82 additions & 0 deletions api/api/async_search.get.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

'use strict'

/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */

function buildAsyncSearchGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts

const acceptedQuerystring = [
'wait_for_completion_timeout',
'keep_alive',
'typed_keys'
]

const snakeCase = {
waitForCompletionTimeout: 'wait_for_completion_timeout',
keepAlive: 'keep_alive',
typedKeys: 'typed_keys'
}

/**
* Perform a async_search.get request
* Retrieves the results of a previously submitted async search request given its ID.
* https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html
*/
return function asyncSearchGet (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}

// check required parameters
if (params['id'] == null) {
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}

// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}

var warnings = []
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring, warnings)

var ignore = options.ignore
if (typeof ignore === 'number') {
options.ignore = [ignore]
}

var path = ''

if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)

// build request object
const request = {
method,
path,
body: null,
querystring
}

options.warnings = warnings.length === 0 ? null : warnings
return makeRequest(request, options, callback)
}
}

module.exports = buildAsyncSearchGet
Loading