Compare commits

...

767 Commits
5.x ... v8.16.1

Author SHA1 Message Date
1d2d934b50 Bump to 8.16.1 (#2478) 2024-11-18 12:45:53 -06:00
d0f5ada03d [Backport 8.16] Fix ECMAScript import (#2477) 2024-11-18 12:27:10 -06:00
47de886973 Auto-generated code for 8.16 (#2470) 2024-11-18 11:27:50 -06:00
1e103baec1 Bump version to 8.16.0 (#2464) 2024-11-14 11:50:48 -06:00
7d5f622506 Backport ts-standard upgrade (#2462) 2024-11-13 11:15:54 -06:00
8377b58af3 [Backport 8.16] Address feedback and add clarity (#2452)
Co-authored-by: Marci W <333176+marciw@users.noreply.github.com>
2024-11-12 11:07:38 -06:00
c150efbd21 Auto-generated code for 8.16 (#2442) 2024-11-11 11:04:42 -06:00
e7663aabde [Backport 8.16] Add changelog for 8.15.2 (#2446)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-11 09:52:14 -06:00
c9615dc0ef [Backport 8.16] Add _id to the result of helpers.search (#2435)
Co-authored-by: Rami <72725910+ramikg@users.noreply.github.com>
2024-11-06 12:28:18 -06:00
bb5fb24d73 [Backport 8.16] Add streaming support to Arrow helper (#2430) 2024-11-04 16:20:06 -06:00
38358e20ab Auto-generated code for 8.16 (#2427) 2024-11-04 09:57:37 -06:00
9479d82644 Auto-generated code for 8.16 (#2410)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-28 15:11:56 -05:00
18df52feb4 [Backport 8.16] Skip flaky test (#2419)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-28 11:57:58 -05:00
f72f9e9a5a [Backport 8.16] Don't generate coverage during standard unit test run (#2406)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-24 12:07:48 -05:00
c4151ceb35 [Backport 8.16] Upgrade tap to latest (#2401)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-24 11:38:29 -05:00
f3aedc7ad0 Manual backport of #2375 (#2397) 2024-10-23 08:47:50 -05:00
586c42161d [Backport 8.16] Respect disablePrototypePoisoningProtection option (#2395)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-22 15:03:23 -05:00
9947b0e365 [Backport 8.16] Add doc about timeout best practices (#2393)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-22 15:01:15 -05:00
52b7264b45 [Backport 8.16] Update changelog for 8.15.1 (#2392)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-22 15:00:57 -05:00
fceebae8ae Auto-generated code for 8.x (#2372) 2024-10-14 11:18:55 -05:00
e45ed28c05 Auto-generated code for 8.x (#2369) 2024-09-30 13:41:23 -05:00
58b457eedc Changes to make auto-merge action work (#2360)
Hopefully.
2024-09-03 13:06:50 -05:00
132d6d6062 Auto-generated code for main (#2357) 2024-09-03 09:36:33 -05:00
9e08aaebe2 Add experimental Bun test runner (#2353)
* Add experimental Bun test runner

* Add TypeScript export for Bun

* Clean up tests to prevent TypeScript build warnings

* Use Node.js 22 to run codegen

* Squash a couple TypeScript errors during tests

These are expected errors, to test edge cases for non-TS users

* Ignore Bun lockfile

* Drop unused index.ts

* Move unit test file list to tap config
2024-08-28 12:33:46 -05:00
889fee2316 Revert "Add bun export" (#2354)
This reverts commit 83b32f7ef4.
2024-08-27 13:03:50 -05:00
83b32f7ef4 Add bun export 2024-08-27 13:01:25 -05:00
60aa521b7e Auto-generated code for main (#2351)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-08-26 19:31:53 +00:00
608b517d64 github-actions user is a contributor (#2352) 2024-08-26 14:10:57 -05:00
bf4c57f7bc Make client more ESM-friendly (#2348)
* Use node: prefix for stdlib imports

* Make code more ESM-friendly

* Add missing mjs file

* Drop mjs file from package.json
2024-08-22 11:18:31 -05:00
715292b501 Auto-generated API code (#2344)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-08-19 17:32:21 +00:00
1042a02733 Add collaborator to auto-merge (#2347)
Trying to figure out what type of author association @github-actions
has.
2024-08-19 12:11:03 -05:00
9c959971a5 Adjust author associations for auto-merge (#2346)
* Adjust author associations for auto-merge

* Upgrade outdated actions
2024-08-19 10:44:24 -05:00
e2745b4c75 Migrate issue templates to forms (#2340)
* Migrate feature issue template to a form

* Migrate bug issue template to a form

* Migrate question issue template to a form

* Add support link

* Migrate security issue template to a form
2024-08-14 12:06:03 -05:00
4b8969cc78 Add support for auto-merge (#2336)
* Add support for auto-merge

* Fix bad request-converter version

* Switch back to pull_request

pull_request_target is the wrong trigger for this action
2024-08-12 14:15:55 -05:00
d62d8c9831 Give actions permission to create releases and tags (#2335) 2024-08-12 13:29:08 -05:00
77e2f613f2 Generate documentation example snippets (#2329)
* Update docs example generation script

* Add docs examples generation to codegen job
2024-08-12 13:20:48 -05:00
69b243171b Update changelog for 8.15 (#2332) 2024-08-12 13:07:43 -05:00
37b8a33209 Try running auto-approve after other jobs (#2328) 2024-08-12 12:01:21 -05:00
99cefe8b19 Auto-generated code for main (#2320)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-08-06 11:31:39 -05:00
84ab2a787d Auto-approve codegen PRs (#2323) 2024-08-05 13:12:20 -05:00
f737290d10 Added/updated snippets for docs (#2318) 2024-07-29 17:10:05 -05:00
94da0d241a Auto-generated code for main (#2317) 2024-07-29 10:27:15 -05:00
384debee9e Auto-generated code for main (#2306) 2024-07-24 16:38:52 -05:00
94bf5b2aa7 Documentation for OpenTelemetry support (#2289)
* Documentation for OpenTelemetry support

* Update docs/observability.asciidoc

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>

* Fix docs typo

* Fix bad link references in asciidoc changelog

* Drop link to 8.15 changelog

For now. Link just doesn't work yet.

---------

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
2024-07-01 15:47:50 -05:00
f34bb6aa28 Upgrade transport to 8.7.0 (#2300) 2024-07-01 13:29:55 -05:00
1f9db892ea Drop deprecated use of npm install --production=false (#2298) 2024-07-01 12:36:52 -05:00
069103612a Bump to 8.15 (#2297) 2024-06-28 13:26:09 -05:00
db911746a0 Add GH_TOKEN to release job (#2292) 2024-06-20 14:18:59 -05:00
7b255bed98 Auto-generated code for main (#2291) 2024-06-20 11:15:05 -05:00
74be52ebb1 Auto-generated code for main (#2286)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-06-12 11:07:30 -05:00
0e5beddd65 Rename Buildkite team from clients-team to devtools-team (#2287) 2024-06-12 15:32:41 +04:00
bd89ab5dd7 Auto-generated code for main (#2285) 2024-06-11 11:04:39 -05:00
c202a6bbc5 Run integration tests on 8.14 (#2283) 2024-06-07 11:10:55 -05:00
8e162dd8b8 Auto-generated code for main (#2281) 2024-06-07 10:51:48 -05:00
2b0eebc8fa Update changelog for 8.14.0 (#2279) 2024-06-06 14:23:42 -05:00
f97ba5b02a Bump transport to 8.6.0 (#2277) 2024-06-06 13:39:38 -05:00
72a1114186 Auto-generated code for main (#2275) 2024-06-06 12:12:42 -05:00
542585a5dc Fix typo in documentation (example query) (#2271) 2024-06-05 11:42:31 -05:00
e1de2bd53d Auto-generated code for main (#2262) 2024-06-03 13:31:54 -05:00
4be14a1f6c Auto-generated code for main (#2261) 2024-05-23 10:35:32 -05:00
a71ebb5f68 Auto-generated code for main (#2258) 2024-05-20 11:47:02 -05:00
05f7078534 Stop using matrix for license check (#2254) 2024-05-09 14:53:32 -05:00
b250049ee7 Auto-generated code for main (#2239) 2024-05-09 14:50:16 -05:00
fe2d8c1915 Add Node.js 22 to unit test matrix (#2251) 2024-05-06 15:22:41 -05:00
b9ea8f8906 Add ES|QL helper note to changelog (#2249) 2024-05-06 14:33:03 -05:00
896216860f ES|QL: Object API helper (#2238)
* ESQL toRecord helper

* ESQL helper tests

* Add ESQL object API helper to client meta header

* Add docstring for toRecords

* Include column metadata in toRecords helper

* Add docs for ESQL toRecords helper

* Verify columns in helper return object
2024-05-06 12:30:47 -05:00
45e3c0657a Update asStream code example (#2242)
https://github.com/elastic/elasticsearch-js/issues/2241 notes that there
is no body attribute on a response. This is mostly just a typo in the
example, as `result` itself is a readable stream, unless `meta: true` is
passed, in which case `result.body` will be a readable stream.

Also dropped the callback-style stream processing example as it's a bit
outdated.
2024-04-30 13:17:45 -05:00
b65e468b95 Move make.sh to .github (#2236) 2024-04-24 08:47:07 -05:00
768ba3d8ae Add Date to DateMath type (#2208)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-04-18 14:31:21 -05:00
2da30cd4cd Move regression template to yaml file (#2229) 2024-04-18 12:04:06 -05:00
a13992ec7d Update issue templates to use new labels (#2225)
And experimentally support GitHub issue forms for regression reports.
2024-04-18 11:06:33 -05:00
95fd81a883 Auto-create release tag on publish (#2226) 2024-04-18 11:06:21 -05:00
6f2aaa5c7c docs: fix typo in basic-config.asciidoc (#2222)
LENTGH -> LENGTH
2024-04-17 12:58:53 -05:00
b857d8ee71 Backport changelogs from other minor releases (#2218) 2024-04-09 14:37:07 -05:00
4aa00e03e1 onSuccess function for bulk helper (#2199)
* Bulk helper onSuccess callback

For https://github.com/elastic/elasticsearch-js/issues/2090

Includes refactor of the tryBulk result processing code, to make
iterating over bulk response data easier to understand.

* Add onSuccess tests for each datasource type

* Cleanup, additional comments

* Add documentation for onSuccess callback

* Update changelog

* Drop link to 8.14 release notes.

Page not yet published, breaking docs build.
2024-04-02 14:38:09 -05:00
e2974b0747 Upgrade transport to 8.5.0 (#2202) 2024-04-02 14:32:16 -05:00
3bd7ba95f8 Bump main to 8.14.0 (#2198)
* Improve version bump script's assertion feedback

* Add junit output to gitignore

* Assume x.0 if a patch value is not provided

* Bump package to 8.14
2024-03-28 15:42:43 -05:00
f96aa32345 Stop defaulting to snapshots for integration tests (#2197)
* Run integration tests against non-snapshot on main

Fetching SNAPSHOT artifacts is currently flaky.

* Reduce number of scheduled integration test runs
2024-03-28 13:48:06 -05:00
628254df2d Don't commit .rej files (#2194) 2024-03-27 13:40:50 -05:00
1ef318aded use a repo-scoped personal access token (#2193) 2024-03-27 13:38:29 -05:00
ec9a4dc960 Try using default token (#2192)
Provided token was not able to push a new branch to
elasticsearch-serverless-js
2024-03-27 13:28:25 -05:00
f3d9dfb48e Stop creating a branch before applying patch (#2191) 2024-03-27 13:20:46 -05:00
7f7942e207 Drop branch suffix from patch action (#2190)
drop .rej files and don't use a branch suffix
2024-03-27 13:18:14 -05:00
d584836399 Use relative path for PR action (#2189) 2024-03-27 12:53:46 -05:00
c7cbe941db Write PR body to a file instead of a buggy multi-line echo (#2188) 2024-03-27 10:46:56 -05:00
113b32258d Must set committer info to apply a patch (#2187) 2024-03-27 10:42:53 -05:00
6e63530801 Refactor patch action to use create-pull-request action (#2186) 2024-03-27 10:40:12 -05:00
38c17fd7f3 Set Github token to use Github CLI in an action (#2185) 2024-03-27 09:58:50 -05:00
63eb92b42a Fix bad argument string (#2184) 2024-03-27 09:45:25 -05:00
7475dba8b9 Git config typo (#2183) 2024-03-27 09:41:18 -05:00
3ad00b4a9f Add committer identity to serverless patch action (#2182) 2024-03-27 09:39:19 -05:00
2721008867 Correctly apply and commit patch changes in patch automation workflow (#2181) 2024-03-26 17:19:06 -05:00
c106146d30 More fetch depth fix to patch workflow (#2180) 2024-03-26 13:46:32 -05:00
78dab89db8 More directory fixes to patch workflow (#2179) 2024-03-26 13:39:19 -05:00
af2dbc01d3 Run serverless patch workflow using correct branch of the stack client (#2178) 2024-03-26 13:34:07 -05:00
3ac5a1cc65 Still testing serverless patch workflow (#2177)
* Stray period 🤦

* Fix path
2024-03-26 13:26:01 -05:00
fba3e41862 Continuing to test the serverless patch workflow (#2176) 2024-03-26 13:22:43 -05:00
6a821583c0 Fixes to serverless patch script (#2175) 2024-03-26 12:17:30 -05:00
86d89a47a0 Bump version to 8.13.0 (#2173) 2024-03-26 12:09:39 -05:00
1d84468762 Move between two repositories more cleanly during patch (#2172)
* fix: checkout multiple repos cleanly

* fix: ensure git apply exits cleanly
2024-03-21 16:33:43 -05:00
8afdec052a Check out merge commit before creating patch (#2171) 2024-03-21 16:25:09 -05:00
b77bdf2a79 Ensure patch can generate by checking out main branch (#2170) 2024-03-21 16:20:12 -05:00
d61d54a811 Action to apply stack client patches to serverless (#2169)
* GitHub action for applying stack client patches to serverless

* Drop unnecessary comment
2024-03-21 16:14:53 -05:00
d430aecdbd Move make.sh to .buildkite (#2165) 2024-03-21 12:07:24 -05:00
29a0e53978 Update changelog for 8.13 (#2164) 2024-03-21 09:57:07 -05:00
05e3139f80 Ensure new connections inherit client's set defaults (#2159)
* Add test confirming the issue

See https://github.com/elastic/elasticsearch-js/issues/1791

* fix: ensure new connections inherit the client instance's defaults

for https://github.com/elastic/elasticsearch-js/issues/1791
2024-03-20 16:32:15 -05:00
8b9ca79d5b [Backport main] Update bulk.asciidoc change 'date' property to 'time' to match index creation (#2161)
(cherry picked from commit 747171097d)

Co-authored-by: SuperGingie <Pennington.Joe@gmail.com>
2024-03-20 13:45:16 -05:00
24e1f4fb26 Auto-generated code for main (#2156) 2024-03-19 11:28:02 -05:00
fa33037b86 Auto-generated code for main (#2152) 2024-03-07 13:44:52 -06:00
c2fb0a294f Auto-generated code for main (#2150) 2024-03-06 12:11:52 -06:00
abd15eb111 Auto-generated code for main (#2127) 2024-03-05 13:51:24 -06:00
352f73e7c2 [DOCS] Adds compatibility matrix to docs and readme (#2136)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-02-28 11:54:15 -06:00
1d8da99d5b Update changelog for 8.12.2 (#2139)
* Backport changelog for 8.12.1

* Add changelog for 8.12.2
2024-02-23 14:01:55 -06:00
8df91fce7c Upgrade transport to 8.4.1 (#2137) 2024-02-23 13:18:01 -06:00
1607a0d3f7 Fix hang in bulk helper semaphore when server responses are slower than flushInterval (#2027)
* Set version to 8.10.1

* Add tests for bulk helper with various flush and server timeouts

* Copy and empty bulkBody when flushBytes is reached

Before it was waiting until after semaphore resolved, then sending with
a reference to bulkBody. If flushInterval is reached after `await
semaphore()` but before `send(bulkBody)`, onFlushTimeout is "stealing"
bulkBody so that there is nothing left in bulkBody for the flushBytes
block to send, causing an indefinite hang for a promise that does not
resolve.

* comment typo fixes

---------

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
2024-02-06 09:58:21 +04:00
57ee5cf6c2 8.12.0 changelog (#2125) 2024-01-31 13:37:05 +04:00
6eabf37097 Improved the body BC break description in request/response for 8.x documentation (#2117)
* Improved the body bc break in 8.x documentation

* Removed just in the sentence
2024-01-04 13:13:26 +01:00
5413eb5f35 Add missing snippets (#2113)
For https://github.com/elastic/clients-team/issues/728
2023-12-14 17:19:20 -06:00
4aaf49b6ea Integration test improvements (#2109)
* Improvements to integrations

Borrowed largely from https://github.com/elastic/elasticsearch-serverless-js/pull/38

* Bump all the things to 8.12.0

* Split Dockerfile copy into two layers

* Fix test cron names
2023-12-14 16:35:37 -06:00
d3f22f1e14 Add doc for closing connections (#2104) 2023-12-14 09:46:04 -06:00
51323e769d Github action for publishing to npm with provenance metadata (#2103) 2023-12-13 11:20:04 -06:00
1fb789862d 8.11.0 changelog (#2097)
* Changelog for 8.11.0

* Add redaction docs link to changelog
2023-12-12 16:06:03 -06:00
c2c417a9fd Bump transport to 8.4.0 (#2095)
* Support for transport 8.4.0 redaction functionality

* Docs for `redaction` options
2023-12-12 15:40:47 -06:00
06e3b05077 [DOCS] Adds a signpost for downloading ES or signing-up for ESS (#2084) 2023-11-27 10:46:53 -06:00
426919709f Throw an explicit error when asStream is used with bulk helper (#2078) 2023-11-16 10:14:20 -06:00
b7b16d81ee Fix arg-parsing issue in codegen script (#2068) 2023-11-08 13:07:55 -06:00
845ddaaf34 Auto-generated code for main (#2064) 2023-11-08 11:51:30 -06:00
abd5018cfe Bump version in main to 8.10.3 (#2066) 2023-11-07 12:07:18 -06:00
b47747007b Auto-generated code for main (#2061) 2023-11-06 10:59:55 -06:00
5fb65d07af Update how users/permissions are set up on CI Docker image (#2060) 2023-11-03 15:05:37 -05:00
99bcff02d5 Path filtering improvement (#2059)
* Another attempt at getting path filtering right

* Improve filters
2023-11-03 11:41:53 -05:00
ab10e462e7 Auto-generated code for main (#2058) 2023-11-03 10:39:04 -05:00
3c5178c7ae Stop supporting Node v14 and v16 (#2055) 2023-11-02 13:16:24 -05:00
9e2ff66564 Set module type to commonjs (#2053)
https://github.com/elastic/elasticsearch-js/issues/1281
2023-11-02 11:48:37 -05:00
1adc8c356a Fix version bump script (#2054)
* Fix version bump script failure

It was trying to run `.replace` on a Buffer instead of a string.

* Correctly set Node version in Docker
2023-11-02 11:48:16 -05:00
2d139e512b Improve unit test path filtering rules (#2052)
* Improve path-filtering rules on unit test action

See docs about how jobs that are skipped still report "success", which
is necessary for jobs that are required to succeed based on branch
protection rules.

https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution

* Code must be checked out for paths-filter to run

* Only run on default pull request events

Defaults are that it will run when a PR is opened, reopened, or
synchronized (new commits pushed).
2023-11-02 11:16:39 -05:00
96d0adb715 Action to auto-close stale issues and PRs (#2051) 2023-11-02 10:26:20 -05:00
f1e83ae853 Add more docs about keep-alive connections (#2048) 2023-11-02 10:15:28 -05:00
a6392ebe07 Auto-generated code for main (#2047) 2023-11-01 11:14:57 -05:00
dc7d603f47 Fix unit test workflow (#2045) 2023-10-31 11:53:22 -05:00
84a93c2ebf Skip unit tests for PRs where code did not change (#2041) 2023-10-24 15:40:00 -05:00
f7ed0394bf Add important flag to proxy config docs (#2040) 2023-10-24 15:32:27 -05:00
d194a220ea Fix backport action (#2036)
This should allow us to backport PRs from forks, and gets the action on
a newer commit.
2023-10-24 12:22:31 -05:00
a28a6a3654 Improve proxy configuration docs (#2035) 2023-10-23 14:05:39 -05:00
78cc262939 Auto-generated code for main (#2034) 2023-10-23 12:46:35 -05:00
f7f1d7c52e Auto-generated code for main (#2033) 2023-10-18 10:08:56 -05:00
186692c4b6 Auto-generated code for main (#2030) 2023-10-16 13:03:29 -05:00
85fe814f79 Auto-generated code for main (#2028) 2023-10-04 09:21:33 -05:00
65580b0a2d Auto-generated code for main (#2025) 2023-09-28 11:31:41 -05:00
29960d84a8 Update changelog for 8.10.0 (#2021) 2023-09-26 15:25:45 -05:00
1a9f1003fb Update CONTRIBUTING (#2016) 2023-09-25 11:47:48 -05:00
10f7ba75a3 Auto-generated code for main (#2015) 2023-09-21 14:37:08 -05:00
59caa7be59 [DOCS] Fix welcome-to-elastic link (#2007) 2023-09-13 14:53:09 -05:00
57e84a9114 Upgrade transport: skip adding new nodes that aren't ready yet (#1995) 2023-09-12 11:38:58 -05:00
9e47fe2d3e Auto-generated code for main (#2004) 2023-09-08 13:10:13 -05:00
ff0fb27ebe Auto-generated code for main (#2002) 2023-09-07 09:27:59 -05:00
beaee47ca0 Auto-generated code for main (#2001) 2023-09-06 10:26:15 -05:00
63b4b4c08a Auto-generated code for main (#1998) 2023-09-05 13:28:51 -05:00
a4be77425e Use GitHub admonition for browser support warning (#1997) 2023-08-31 12:24:36 -05:00
516da3a720 Auto-generated code for main (#1996) 2023-08-31 11:47:50 -05:00
49eccfbd00 Auto-generated code for main (#1993) 2023-08-29 10:11:55 -05:00
f72d146b0a Pin untrusted Github Action to a commit hash (#1986) 2023-08-28 10:38:52 -05:00
13923b353b Auto-generated code for main (#1987) 2023-08-28 10:18:09 -05:00
6e1c20989e Auto-generated code for main (#1985) 2023-08-25 09:51:12 -05:00
9da7c44bb0 Auto-generated code for main (#1984) 2023-08-24 09:53:40 -05:00
56b4a380c1 Auto-generated code for main (#1978) 2023-08-23 10:34:02 -05:00
8d5e75d795 Fix branch name checker for automatic codegen script (#1980) 2023-08-22 10:39:51 -05:00
ad86306a47 Updated project metadata to use group name (#1979) 2023-08-21 13:51:32 -05:00
c4c3be17a5 Bump 8.9.1 on main (#1972) 2023-08-17 11:41:58 -05:00
a9bed7eacb Auto-generated code for main (#1946) 2023-08-17 10:12:05 -05:00
787b3b03ef Remove unnecessary code (#1971) 2023-08-15 11:13:50 -05:00
9aaf7585d3 Upgrade transport (#1968) 2023-08-11 12:59:17 -05:00
7320868f62 Fix AnalysisPatternTokenizer definition (#1828) (#1967) 2023-08-09 13:11:15 -05:00
33aae3c99a Changelog for 8.9.0 (#1961) 2023-07-25 16:06:00 -05:00
1049a0ffa0 Update user agent format (#1954) 2023-07-25 11:11:49 -05:00
80ba91645b Add docs for bulk helper improvement (#1951) 2023-07-25 11:05:25 -05:00
6b4cdee53c Allow document to be overwritten in onDocument iteratee of bulk helper (#1732)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2023-07-20 14:33:46 -05:00
5072e4afc3 Update integration test rules (#1948) 2023-07-20 09:30:19 -05:00
296c4d432e [DOCS] Restructures repo README (#1947) 2023-07-19 15:16:59 -05:00
6fef22d387 Update codegen task to be runnable via CI (#1944) 2023-07-17 11:53:37 -05:00
2375059aa3 Include body parameters in generated API reference docs (#1936) 2023-07-06 12:28:43 -05:00
53d3b4a83b [DOCS] Changes getting started button link on landing page (#1933) 2023-07-05 12:57:31 -05:00
b223d8597c [DOCS] Adds getting started content based on the template (#1929)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2023-07-05 09:28:26 -05:00
3bf69c370e Hide arguments heading in docs when there are no arguments (#1928) 2023-06-30 11:15:31 -05:00
960dff37f2 Generate docstrings and better API reference docs (#1922) 2023-06-27 11:51:11 -05:00
0b9be7c179 Add missing header to changelog (#1920) 2023-06-13 13:40:05 -05:00
b717de8f3f Update changelog.asciidoc (#1918) 2023-06-12 18:16:50 -04:00
ac694d3ede Update changelog (#1917) 2023-06-12 16:35:11 -05:00
a2b5e66a46 Add test to verify bulk helper index drift fix (#1912) 2023-06-12 16:03:11 -05:00
f30d06b794 Stop running integration tests on PRs (#1910) 2023-06-08 12:20:43 -05:00
83c3f0c880 Upgrade transport to 8.3.2 (#1902) 2023-06-08 11:42:49 -05:00
0ab63df567 add link to elasticsearch-specification github repository in typescript documentation (#1907) 2023-06-08 11:34:55 -05:00
a89f714900 Fix broken Github action on Node 14.x (#1904) 2023-06-07 14:27:20 -05:00
de17dc050c fix: keep track of indexSlice explicitly in bulk helper response handling loop (#1759)
Co-authored-by: Josh Mock <josh@joshmock.com>
2023-06-06 16:08:21 -05:00
5c4c29f51c More integration test fixes (#1889) 2023-05-30 13:11:28 -05:00
10039d9b8f Update changelog for 8.7 and 8.8 (#1897)
* Update changelog

* Add note about a bugfix for types with a body key
2023-05-26 13:20:02 -05:00
5d37ca6489 Upgrade backport workflow to v2 (#1884) 2023-05-11 12:18:03 -05:00
e73eef084b Update scroll.asciidoc (#1763) 2023-05-11 12:13:08 -05:00
89f7d54398 Fix estypesWithBody definition (#1784) 2023-05-10 14:06:47 -05:00
84c3de1850 Don't run integration tests if no code changes in a PR (#1881) 2023-05-08 16:28:53 -05:00
c55ba915fb Fix stuck clients-ci job removal (#1880) 2023-05-08 12:45:16 -05:00
e8d69cf667 Fix cron schedule again (#1879) 2023-05-08 11:58:13 -05:00
4f9f09cbd4 Fix broken cron schedule (#1878) 2023-05-08 09:57:53 -05:00
4b74e4136e Drop Jenkins jobs (#1877) 2023-05-05 14:30:01 -05:00
c9f31d22fd Buildkite pipeline for integration tests (#1863) 2023-05-05 13:18:20 -05:00
bdb44d6d9a Use correct user-agent header by default (#1865) 2023-05-05 10:48:41 -05:00
b2b54f1ffe Bumps main to 8.9.0 (#1854) 2023-05-02 10:06:57 -05:00
4011f0153f Fix integration test runner for 8.8 (#1859) 2023-05-02 09:57:03 -05:00
19d2ee324f Update APIs from main (#1856) 2023-05-01 16:00:56 -05:00
583b80bdfa Add CI job for 8.8 branch (#1857)
* Add CI automation for 8.8 branch

* Drop tests for old minor versions
2023-05-01 11:14:13 -05:00
41cc5fa4dd Fixes to make.sh (#1850f
* Get make.sh targets running on Node.js v18

* Catch up make.sh to match other clients

* Readability tweaks to make.mjs code
2023-04-19 14:53:52 -05:00
0d4a29171a Bumps main to 8.8.0 (#1851) 2023-04-19 14:49:09 -05:00
230cb77419 Bumps main to 8.7.1 (#1849) 2023-04-19 13:59:03 -05:00
a927c5c14c Canary release script cleanup (#1843)
* add help messaging to canary release script

* Don't require OTP during a dry run

* Linter/whitespace cleanup
2023-04-13 14:52:57 -05:00
c82005855f Integration test cleanup (#1841
* Fix bad sysctl command in README

* Add --suite and --test flags to integration tests

So we can run a single suite or a single test without having to edit
any code.

* Drop several skipped integration tests

Many of these skips are no longer necessary. Didn't do an exhaustive
check of all skipped tests, so this is just a start.

* Simplify cleanup make target
2023-04-13 11:26:29 -05:00
2c277ee2ba Fixes to YAML REST integration test suite runner (#1837)
* Use more inclusive language

* Don't bail on failing tests without --bail

* Skip a few more free suite tests

* Default to https when running platinum tests

* Add make targets for local integration testing

* Linter cleanup

* Skip some platinum integration tests

* Improvements to integration test README

* Another free test to skip for now

* Continue on non-bail test failure

* Output cleanup
2023-04-10 14:24:14 -05:00
a4ceb47e8d Update basic-config.asciidoc (#1832)
* [8.6] Bump `@elastic/transport` to 8.3.1

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>

* [8.6] Add release notes for 8.6.0

Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>

* Update bulk.asciidoc (#1752) (#1807)

Fix typo

Co-authored-by: Ryan Har <31252286+nkwwk@users.noreply.github.com>

* [8.6] [DOCS] Includes source_branch in docs index

* Update basic-config.asciidoc

fix missing comma

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
Co-authored-by: Ryan Har <31252286+nkwwk@users.noreply.github.com>
Co-authored-by: István Zoltán Szabó <szabosteve@gmail.com>
2023-04-05 11:14:43 -05:00
398a8fd0f1 Upgrade deprecated Github action steps (#1836)
checkout@v2 and setup-node@v1 were deprecated as they run on Node.js
v12.
2023-04-04 09:49:41 -05:00
996f818b1a CI updates (#1835
* Add jobs for testing missing 8.x branches

* Drop references to acceptance tests

They were removed in 1a227459f0

* Add myself as a contributor

😎

* Clean up shellcheck warnings
2023-04-04 09:49:07 -05:00
ce37b0fdf1 [DOCS] Creates custom landing page for the JS client book (#1831
* [DOCS] Creates custom landing page for the JS client book.

* [DOCS] Fine-tunes text.

* [DOCS] Updates hero image.

* [DOCS] Changes page file name.

* [DOCS] Adds one-liner to hero.

* [DOCS] Reduces padding.

* [DOCS] Changes section title.

* [DOCS] Fine-tunes text.
2023-03-29 12:00:45 -05:00
948f44a7a0 [DOCS] Includes source_branch in docs index 2023-02-21 10:34:38 -06:00
43ecba4dfa Add Buildkite skeleton (#1812) 2023-02-09 07:31:57 +00:00
f90f4306c2 Update bulk.asciidoc (#1752) (#1806)
Fix typo

Co-authored-by: Ryan Har <31252286+nkwwk@users.noreply.github.com>
2023-01-12 14:52:29 +01:00
c5da6683f7 Add release notes for 8.6.0 2023-01-10 14:14:38 -06:00
09d802a0ac Bump @elastic/transport to 8.3.1 2023-01-05 09:30:06 -06:00
096ef47d6a Bumps main to 8.7.0 2023-01-03 07:47:38 -06:00
38e4b23831 Add a changelog for 8.5.0 2022-11-03 11:06:58 -05:00
04634af552 Update all docs refs to 'current' instead of 'master' 2022-09-28 12:29:57 -05:00
f79f4e8f25 Remove unnecessary ts-expect-error 2022-09-27 06:42:31 -05:00
560dfd3763 Fix docs URLs to use 'current' instead of 'master' 2022-09-27 06:39:47 -05:00
ebbc2961e0 Bumps to version 8.6.0 (#1762) 2022-09-21 09:03:27 -05:00
6ccdab5280 Add changelog for 8.4.0 2022-08-31 14:04:50 -05:00
8f9ed67fda Update APIs to 8.5.0-SNAPSHOT 2022-08-15 10:40:56 -05:00
4ebffbc0e8 Bumps to version 8.5.0 2022-07-28 08:18:46 -05:00
282c76fb6a Change 'current' to 'master' in user profile API links 2022-06-24 15:59:43 -05:00
0a510b15f9 Fix typo in changelog
Fixes a typo: `storngly` -> `strongly`

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2022-06-21 15:49:45 -05:00
24890fd11d Changelog for 8.2.1 (#1703) 2022-05-25 18:15:47 +02:00
be54dcd301 Bumped v8.3.0-canary.1 2022-05-23 16:36:35 +02:00
33e0873ecf API generation 2022-05-23 16:33:56 +02:00
27748779c6 Update CI conf 2022-05-20 14:28:42 +02:00
697b594ea2 Add make.sh workflows (#1696) 2022-05-19 18:23:24 +02:00
911af982b2 Fix integration test (#1689) 2022-05-06 15:15:19 +02:00
651165d842 Updated changelog.asciidoc (#1683) 2022-05-03 19:37:44 +02:00
c58e93a77a Updated dependencies (#1684)
* Updated dependencies

* Updated dependencies
2022-05-03 19:31:42 +02:00
c4e793ca71 Update TypeScript docs and export estypes (#1675)
* Update docs

* Update issue template

* Export estypes
2022-04-12 10:33:54 +02:00
8604da555f Drop Node.js v12 (#1670) 2022-03-31 09:37:50 +02:00
57426c968b Bump versions 2022-03-30 13:39:47 +02:00
96b5b8eaba More lenient parameter checks (#1662) 2022-03-30 13:34:36 +02:00
eac00e1200 Update connecting documentation (#1666) 2022-03-28 12:22:47 +02:00
77c1ef36aa Bumped v8.2.0-canary.2 2022-03-23 11:33:41 +01:00
720b5b449b API generation 2022-03-23 11:31:34 +01:00
a298517692 Updated changelog.asciidoc 2022-03-09 11:49:26 +01:00
53ccd17dbf Changelog for 8.1 (#1657) 2022-03-09 11:43:48 +01:00
f6c14b7268 README: use correct license reference (#1642) 2022-03-04 08:22:53 +01:00
4f1713c894 [DOCS] Add discrete tags to API ref (#1654) 2022-03-03 17:46:45 +01:00
af97ece807 Export SniffingTransport (#1648) 2022-03-03 16:10:32 +01:00
46b2c99b7c Update API reference for v8 (#1646) 2022-03-03 16:08:45 +01:00
e0f54c789b Update v8 changelog (#1647) 2022-03-03 16:07:41 +01:00
6d2774d2a0 [DOCS] Add redirects for authentication and migration guide (#1634)
* [DOCS] Add redirects for authentication and migration guide

* Update auth refs
2022-02-28 15:56:10 +01:00
25d9afbc0b Remove old jobs 2022-02-24 16:06:02 +01:00
d7e5ff5191 Bumped v8.2.0-canary.1 2022-02-24 11:43:14 +01:00
904c3bb28c [DOCS] Fix double backticks for inline code snippets (#1540) 2022-02-24 11:39:49 +01:00
33c4630a34 docs: fix typo (#1628) 2022-02-24 11:38:48 +01:00
3e79c8e825 Remove custom kibana interface (#1633) 2022-02-24 11:37:33 +01:00
d01582803c Fix onFlushTimeout timer not being cleared when upstream errors (#1616) 2022-02-24 11:29:20 +01:00
e7c5b3dafa API generation 2022-02-24 11:11:52 +01:00
10277e217c Bump transport version (#1629) 2022-02-21 19:17:17 +01:00
03ecf707c9 API generation 2022-02-11 14:30:43 +01:00
ca6948fb82 Update docs index 2022-02-11 12:26:05 +01:00
82cf15097d Changelog for 8.0 (#1621) 2022-02-11 12:02:40 +01:00
759138c375 Update docs for v8 (#1572) 2022-02-11 10:23:07 +01:00
a0c5c98a99 Upgrade transport (#1618) 2022-02-11 09:19:34 +01:00
451a805ecd Bumped v8.2.0 2022-02-03 10:52:42 +01:00
071a6ba4bb Updated CI configuration 2022-02-02 17:35:58 +01:00
7985aab860 Updated CI configuration 2022-02-02 10:36:09 +01:00
4643a359fe Add missing files to repo (#1613) 2022-01-24 10:19:30 +01:00
e915e4b9af Updated docs 2022-01-12 11:29:22 +01:00
048ad273b2 API generation 2022-01-12 11:24:26 +01:00
0fbdf10a68 Fix integration test (#1581) 2022-01-12 08:14:19 +01:00
16cefd8383 API generation 2022-01-10 15:52:18 +01:00
f718b22e9b Bumped v8.1.0-canary.2 2021-12-27 09:27:45 +01:00
b3c24659d8 API generation 2021-12-17 10:08:12 +01:00
3cfc31902e Bumped v8.1.0-canary.1 2021-12-16 17:57:27 +01:00
85d1968ce5 Updated transport dependency 2021-12-16 17:56:01 +01:00
7e84827593 Bumped v8.1.0 2021-12-16 17:50:18 +01:00
4ad5daeaf4 Aggregations should be a generic in responses (#1596) 2021-12-16 17:49:05 +01:00
dbfc8fc4d1 Propagate bulk helper document generic (#1606) 2021-12-16 16:45:48 +01:00
194614564a Bumped v8.0.0-canary.37 2021-11-24 10:33:14 +01:00
748b45e2ca Updated imports 2021-11-23 14:10:05 +01:00
fbaee7f54f API generation 2021-11-23 14:08:33 +01:00
e9b905f042 Bumped v8.0.0-canary.36 2021-11-23 14:01:33 +01:00
ae3ea3013f Bumped transport 2021-11-23 12:09:45 +01:00
d6fb2ca569 Bumped v8.0.0-beta.1 2021-11-03 14:29:16 +01:00
288f377dae Bumped transport 2021-11-03 14:28:53 +01:00
76659b604f API generation 2021-11-03 14:28:43 +01:00
88933ad39e Updated Jenkins jobs 2021-10-27 17:06:03 +02:00
bf317be2a7 Bumped v8.0.0-canary.35 2021-10-25 19:08:01 +02:00
853fe27505 Support params.body as string. (#1585) 2021-10-25 19:06:44 +02:00
f53c74e1a2 Bumped v8.0.0-canary.34 2021-10-25 16:57:36 +02:00
a5a0a1c589 Do a shallow clone copy of the body when the body key is defined (#1584) 2021-10-25 16:56:33 +02:00
185697b6fe Bumped v8.0.0-canary.33 2021-10-25 15:59:20 +02:00
78c038d307 Bumped dependencies 2021-10-25 15:58:10 +02:00
a397d708a3 API generation 2021-10-25 15:57:56 +02:00
2a2fa720e4 Bumped v8.0.0-canary.32 2021-10-25 09:39:10 +02:00
8db750d1b0 Bumped dependencies 2021-10-25 09:38:21 +02:00
529742ac1f Updated test 2021-10-25 09:38:16 +02:00
66222f0111 API generation 2021-10-25 09:32:19 +02:00
702e71ec18 Bumped v8.0.0-canary.31 2021-10-22 15:17:10 +02:00
57608103fb Bumped dependencies 2021-10-22 15:16:15 +02:00
0ad96fb921 Bumped v8.0.0-canary.30 2021-10-22 13:19:36 +02:00
a761539ee5 Bumped dependencies 2021-10-22 13:18:24 +02:00
5af2d6cd4d Bumped v8.0.0-alpha.2 2021-10-22 11:06:54 +02:00
8c1504ff01 Bumped v8.0.0-canary.29 2021-10-22 11:06:20 +02:00
9af0ea8e1b Bumped dependencies 2021-10-22 11:05:12 +02:00
3418c2ee6c Merge branch 'main' of https://github.com/elastic/elasticsearch-js into main 2021-10-21 09:54:55 +02:00
5fc8dd9f59 Bumped v8.0.0-canary.28 2021-10-21 09:54:50 +02:00
4cf1fc6cd4 Updated test 2021-10-21 09:53:24 +02:00
79b0a2f13c Bumped dependencies 2021-10-21 09:50:44 +02:00
0b965c8c4d API generation 2021-10-21 09:50:21 +02:00
6dfd66ad06 [DOCS] Update hardcoded 7.x docs links (#1579)
Co-authored-by: Greg Back <1045796+gtback@users.noreply.github.com>
2021-10-20 19:55:09 -04:00
63542d807f Bumped v8.0.0-canary.27 2021-10-20 21:32:08 +02:00
87ce166df1 API generation 2021-10-20 21:31:27 +02:00
4ae687416b Bumped v8.0.0-canary.26 2021-10-20 17:33:15 +02:00
1e1ac6a203 API generation 2021-10-20 17:32:28 +02:00
6aeeb48928 Merge branch 'main' of https://github.com/elastic/elasticsearch-js into main 2021-10-20 09:13:50 +02:00
898fac2ec1 Bumped v8.0.0-alpha.1 2021-10-20 09:13:34 +02:00
875f969ef8 enable type check for d.ts files (#1569) 2021-10-20 09:00:30 +02:00
0e35840e1b Bumped v8.0.0-canary.25 2021-10-20 08:09:16 +02:00
dc74a80402 API generation for v8 (#1571) 2021-10-20 08:08:07 +02:00
23633a1802 Bumped v8.0.0-canary.24 2021-10-18 16:03:38 +02:00
4492532727 Update unknown parameter handling. (#1568) 2021-10-18 16:01:55 +02:00
070b9d75b9 pre-8.0 improvements (#1567) 2021-10-18 12:21:37 +02:00
8fffae2f76 Bumped v8.0.0-canary.23 2021-10-15 09:06:41 +02:00
dfddfecfb2 Fixes in custom Kibana type def (#1559) 2021-10-14 15:15:51 +02:00
a26692c7e4 [DOCS] Retitle Elasticsearch JavaScript Client doc book (#1564) 2021-10-13 14:53:30 +02:00
1a227459f0 Elasticsearch v8 (#1558) 2021-09-30 09:45:04 +02:00
4c72b981cd Bumped v8.0.0-canary.21 2021-09-29 07:26:09 +02:00
3feda5d9f6 Show socket local/remote address in case of ECONNRESET (#1555)
* Show socket local/remote address in case of ECONNRESET

* Fallback if socket or properties are not defined
2021-09-22 10:05:58 +02:00
f28c93fe13 Bumped v8.0.0-canary.20 2021-09-16 08:44:21 +02:00
de99b80816 Update compatibility info (#1550) 2021-09-16 08:20:59 +02:00
212c3c4ffe Add support for maxResponseSize and maxCompressedResponseSize (#1551) 2021-09-16 08:19:57 +02:00
f7b653dff6 [DOCS] Adds a link to the Quick Start section that points to an EC ingest example (#1546) 2021-09-07 09:59:38 +02:00
b67d42cb5f Add test for mocking library (#1545) 2021-08-30 15:36:14 +02:00
f981c273d6 CI: Rename master to main 2021-08-30 10:24:04 +02:00
acb77fa3d1 Bumped v8.0.0-canary.19 2021-08-28 18:25:45 +02:00
470bc84eb7 Do not use a singleton for EE (#1543) 2021-08-28 18:21:32 +02:00
8156252598 Documentation Update for FaaS use cases (#1522) 2021-08-24 14:54:30 +02:00
ee50a8e770 Always emit request aborted event (#1534) 2021-08-24 11:53:14 +02:00
a7658b2a66 Always display request params and options in request event (#1531) 2021-08-24 11:25:48 +02:00
a9b62049cd Fix parcel build (#1535) 2021-08-23 15:29:57 +02:00
5447acb534 Bumped v8.0.0-canary.18 2021-08-20 12:42:53 +02:00
a0dcace7cd Fix isHttpConnection check (#1526) 2021-08-20 12:40:25 +02:00
f161946984 Add warning.name to product check security exception (#1515) 2021-08-20 10:39:38 +02:00
77bf94a500 API generation 2021-08-18 17:52:14 +02:00
f891fd53a2 Updated CI conf 2021-08-18 17:48:38 +02:00
4ae38ca7f0 Update integration test scripts (#1525)
* Updated scripts

* Update runner
2021-08-18 17:47:23 +02:00
969decde28 Bumped v8.0.0-canary.17 2021-08-17 09:56:19 +02:00
08b80844da API generation 2021-08-17 09:53:49 +02:00
5dab5d0abd Update README.md 2021-08-16 11:52:04 +02:00
2e70f7ba81 Bumped v8.0.0-canary.16 2021-08-16 11:28:25 +02:00
7814527439 Updated types 2021-08-16 11:27:58 +02:00
def28e33d1 API generation 2021-08-16 11:27:35 +02:00
498199ca60 Bumped v8.0.0-canary.15 2021-08-11 12:11:07 +02:00
c100edcca2 Updated types 2021-08-11 12:01:03 +02:00
7c59eda3db API generation 2021-08-11 12:00:42 +02:00
516f52e303 Show the body as string if the response error can't be read as ES error (#1509)
* Show the body as string if the response error can't be read as ES error

* Updated test
2021-08-11 09:40:33 +02:00
2d1505eb2b Support CA fingerprint validation (#1499)
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Ioannis Kakavas <ioannis@elastic.co>
2021-08-02 11:20:31 +02:00
b0a7a21f72 Support mapbox content type (#1500) 2021-08-02 11:19:28 +02:00
728868f3ea Add note about prototype poisoning protection perf (#1503) 2021-07-24 17:49:05 +02:00
6686316433 Better message in case of unsupported build flavor (#1498) 2021-07-24 16:54:18 +02:00
28e57dd2e4 Do not check for 100% coverage (#1501) 2021-07-24 14:44:32 +02:00
34571a94f8 Bumped v8.0.0-canary.14 2021-07-19 16:58:03 +02:00
304d251c3f Updated type definitions 2021-07-19 16:49:51 +02:00
ff98e6310c API generation 2021-07-19 16:44:39 +02:00
17c744ed80 Verify connection to Elasticsearch (#1487) 2021-07-19 16:42:04 +02:00
76f5845ac1 Update CI conf 2021-07-16 11:29:04 +02:00
3137780d6b Update integration test (#1493) 2021-07-16 10:00:24 +02:00
d2ce46b8e0 Fix URLs for trained model deployments (#1494) 2021-07-15 21:06:17 +02:00
cab8d8be38 API generation 2021-07-15 18:01:43 +02:00
4073d60b97 Add api compatibility header support (#1478) 2021-07-13 09:47:45 +02:00
101a13f63e Add support for bearer auth (#1488) 2021-07-13 09:39:10 +02:00
f2d8cf7d34 Bulk update improvements (#1428) 2021-07-12 16:04:29 +02:00
9bf3fdf8f1 Fix typo (#1486) 2021-07-12 11:50:13 +02:00
4933e3b9be Bumped v8.0.0-canary.13 2021-06-04 11:38:21 +02:00
249118fac6 Updated type definitions 2021-06-04 11:36:49 +02:00
102520c304 Bumped v8.0.0-canary.12 2021-06-03 18:41:34 +02:00
894a33ce86 Updated type definitions 2021-06-03 18:39:18 +02:00
4e6ae5d2e8 Fix integration test (#1479) 2021-06-03 17:50:16 +02:00
5292fcae03 Bumped v8.0.0-canary.11 2021-05-20 16:20:45 +02:00
c64152b9b3 Drop node v10 support (#1471) 2021-05-20 16:16:45 +02:00
507ed99e74 Update body error check (#1472) 2021-05-20 16:14:51 +02:00
c34a6690ba [DOCS] Removes link from API reference that breaks the docs build (#1470) 2021-05-19 12:55:18 +02:00
b4b45459c8 Bumped v8.0.0-canary.10 2021-05-19 11:18:32 +02:00
728215f3c0 API generation 2021-05-19 11:16:33 +02:00
12ce270239 Updated type definitions 2021-05-19 11:14:31 +02:00
c8851b86f4 Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2021-05-19 11:10:40 +02:00
bf02b3d0e5 Add top level type error to error message (#1468) 2021-05-19 11:09:19 +02:00
8d7136241a Bumped v8.0.0-canary.9 2021-05-12 18:19:10 +02:00
52d68a0e83 Updated type definitions 2021-05-12 17:41:45 +02:00
791f2168a3 API generation 2021-05-12 17:38:05 +02:00
7b87db49ae Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2021-05-12 17:35:43 +02:00
623bd72910 Updated integration test helpers (#1466) 2021-05-12 15:12:49 +02:00
ce6c459eab Bumped v8.0.0-canary.8 2021-05-03 16:56:33 +02:00
d5f61c7833 Catch HEAD errors (#1460) 2021-05-03 16:40:09 +02:00
dc2de57bd3 Improve response error message (#1457) 2021-05-03 16:38:58 +02:00
147560ba44 [DOCS] Reviews Client helpers section in the Node.JS book (#1434)
* [DOCS] Reviews Client helpers section in the Node.JS book.

* [DOCS] Changes link.

* Update docs/index.asciidoc
2021-04-27 11:21:15 +02:00
0d1e1c2613 API generation 2021-04-26 16:50:53 +02:00
265eb2b225 [DOCS] Adds Breaking changes from old client to Introduction. (#1453) 2021-04-26 16:25:40 +02:00
d1a5fc7cfa Bumped v8.0.0-canary.7 2021-04-22 08:09:27 +02:00
04c56fe269 Updated ci configuration 2021-04-21 13:47:19 +02:00
d2f77e9944 Fix type definition 2021-04-19 09:32:32 +02:00
d188e24626 Fix type definition 2021-04-19 07:30:14 +02:00
e3c15d39de Bumped v8.0.0-canary.6 2021-04-15 08:46:59 +02:00
6a6d8bc566 Updated new types export (#1446)
* Updated new types

* Updated new types

* Updated test

* Updated docs
2021-04-15 08:43:58 +02:00
6464fc69f1 Wrap inside array ndjson bodies in integration test (#1444)
* Wrap inside array ndjson bodies

* Fix path

* Use orignal api name
2021-04-08 18:26:45 +02:00
cb78bb408b Bumped v8.0.0-canary.5 2021-04-07 19:39:42 +02:00
b22558f047 API generation 2021-04-07 19:38:41 +02:00
d7d55e1146 Updated code generation (#1441)
* Updated code generation

* Nit
2021-04-07 15:24:45 +02:00
4102a28a0b API generation 2021-04-07 14:15:29 +02:00
7fdfa4834f Expose the new type definition along with the current one (#1440) 2021-04-07 14:08:18 +02:00
052e138fbd Updated integration test cleanup (#1438) 2021-04-02 18:12:12 +02:00
226d0e3498 Move integration test to artifact API (#1436) 2021-03-31 13:57:58 +02:00
9fa1e12bd3 [DOCS] Rearranges Examples section in Node.JS book (#1425) 2021-03-29 11:15:21 +02:00
7a3cfe7e23 Bumped v8.0.0-canary.4 2021-03-24 15:01:54 +01:00
f86a79cb26 New type definitions (#1358) 2021-03-24 14:50:46 +01:00
430de17007 Integration test: Fix yaml parser and crash on failure (#1423)
* Fix yaml parser and crash on failure

* Log response in case of ResponseError

* Updated cleanup

* Updated skip list

* Updated skip list

* Updated skip list
2021-03-24 07:52:54 +01:00
609da06fef [DOCS] Fix readme links (#1421)
* [DOCS] Fix links in README

* [DOCS] Update link to moved Authentication page
2021-03-22 18:08:16 +01:00
c96c41dc43 API generation 2021-03-22 11:55:14 +01:00
ab3e809fc2 fix(TransportRequestPromise): add finally method to TransportRequestP… (#1415)
* fix(TransportRequestPromise): add finally method to TransportRequestPromise interface

* fix(TransportRequestPromise): add finally method to transportReturn object

* fix(TransportRequestPromise): add finally method tests
2021-03-22 11:50:15 +01:00
6a30cd9955 Disable prototype poisoning option (#1414)
* Introduce disablePrototypePoisoningProtection option

* Updated test

* Updated docs

* Fix bundler test
2021-03-15 08:51:45 +01:00
36eaed6466 [DOCS] Adds Integrations section to Node.JS docs (#1407)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2021-03-10 17:13:15 +01:00
22ece32c5c Fix test bundler (#1417)
* Updated .gitignore

* Fix parcel build

* Updated .gitignore
2021-03-10 14:55:55 +01:00
f2204c5722 Update usage link (#1404) (#1413) 2021-03-10 11:07:57 +01:00
059a2c91ce API generation 2021-02-19 08:31:16 +01:00
f150872726 Remove linter ignore configuration 2021-02-19 08:28:17 +01:00
ab5d8997b8 Remove Node.js v8 support (#1402) 2021-02-19 08:27:20 +01:00
7801b2cc13 Add 7.12 to CI jobs 2021-02-18 16:40:42 +01:00
8311a4ad04 Bumped v8.0.0-canary.3 2021-02-18 16:38:28 +01:00
973a98180a [helpers] add support for transport options to all helpers (#1400)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-02-18 16:33:08 +01:00
2b084dbadc Bumped v8.0.0-canary.2 2021-02-17 11:01:00 +01:00
79658b1784 API generation 2021-02-17 09:57:15 +01:00
19acc4f9d0 API generation 2021-02-09 09:56:20 +01:00
2409bd09e4 Fix CI (#1399) 2021-02-09 08:13:42 +01:00
9e3072f621 Added Elasticsearch proxy example (#1398)
Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
2021-02-08 18:14:38 +01:00
2494f08ad2 Updated CI conf 2021-02-08 17:44:28 +01:00
883ef386e3 [DOCS] Adds Configuration section to Node.JS docs (#1391) 2021-02-01 11:03:04 +01:00
618b244473 Prereleases in meta header should be displayed as p (#1381) 2021-01-19 08:10:27 +01:00
b0769bec11 API generation 2021-01-18 17:15:53 +01:00
a91c55b1f8 Added script for releasing canary package (#1338) 2020-12-17 17:33:17 +01:00
5ed2548433 Updated CI jobs 2020-12-16 10:47:03 +01:00
8aedb79419 Fix #1374 (#1376) 2020-12-16 10:42:46 +01:00
61eee69424 Added x-elastic-client-meta header (#1373) 2020-12-16 10:42:26 +01:00
4cace4c234 typo (#1375) 2020-12-16 10:40:59 +01:00
33035901cf Added new observability events (#1365) 2020-12-09 11:43:46 +01:00
9fea1aedc0 API generation 2020-12-09 11:39:40 +01:00
1398086f76 [DOCS] Fixes link in API docs (#1362) 2020-11-24 10:29:22 +01:00
16901798f9 Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2020-11-24 09:50:56 +01:00
8cbb54016a API generation 2020-11-24 09:50:47 +01:00
502509cabc Throw if the content length is too big (#1355) 2020-11-24 09:48:17 +01:00
959aee5903 Updated integration test cleanup code (#1356) 2020-11-19 11:24:50 +01:00
2cf3438cca API generation 2020-11-19 08:14:27 +01:00
90f6003dd7 API generation 2020-11-18 18:06:04 +01:00
66a4739018 API generation 2020-11-12 07:44:33 +01:00
edd4f78bad Handle connectivity issues while reading the body (#1343) 2020-11-10 18:16:25 +01:00
a62e26e901 Add warning log about nodejs version support (#1349) 2020-11-10 18:08:16 +01:00
797ef471f1 Added node.js support doc (#1346)
Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
2020-11-10 17:46:33 +01:00
cf48d9a690 [DOCS] Adds Connecting section to Node.JS docs (#1342) 2020-11-04 16:26:13 +01:00
fc3883a181 API generation 2020-11-02 08:03:45 +01:00
87805fc17f API generation 2020-10-21 11:07:00 +02:00
3d664def25 Fix integration test (#1335) 2020-10-15 08:54:13 +02:00
505f748dba Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2020-10-12 16:10:18 +02:00
580364392e Added 7.10 job 2020-10-12 16:10:10 +02:00
8ec40547fb The agent function should take the Connection contructor options as argument (#1332) 2020-10-12 10:47:10 +02:00
ea009da3b6 Scroll search should clear the scroll at the end (#1331) 2020-10-12 10:46:51 +02:00
5682e680d1 API generation 2020-10-07 11:14:45 +02:00
aaeadee940 Fix request typo and redeclare block-scoped variable 'response' (#1329) 2020-10-05 09:34:31 +02:00
b8940533a9 Skip ulong integration test test (#1325) 2020-09-29 10:25:31 +02:00
f5ea8ff5cd Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2020-09-28 10:19:40 +02:00
37983cba99 Update helpers.asciidoc (#1310) 2020-09-28 10:19:26 +02:00
4792203b8f Test cloud id without kibana component (#1313) 2020-09-28 10:17:00 +02:00
772fad09cc API generation 2020-09-28 10:15:56 +02:00
93990b88fb Adds [discrete] to common parameters and API titles when generating API docs (#1316) 2020-09-28 10:14:53 +02:00
88ef53b0ef [DOCS] Reorganizes Introduction and Installation chapters (#1315) 2020-09-28 10:13:29 +02:00
7b11152a12 Fixed integration test runner (#1318) 2020-09-23 12:38:45 +02:00
a064f0f357 Improve child performances (#1314) 2020-09-23 11:31:09 +02:00
19f570f067 Fix rendering of name field in configuration.md (#1311) 2020-09-21 15:52:38 +02:00
d211a9cb11 API generation 2020-09-15 09:08:58 +02:00
2894f14b7c Improved cleanup yaml tests (#1306) 2020-09-14 17:34:02 +02:00
d6d7aeffb3 Integration test: Parse dates as string (#1305) 2020-09-14 11:51:11 +02:00
147ec0155d Fixed code generation 2020-09-10 15:35:49 +02:00
009ecc442f API generation 2020-09-10 15:35:40 +02:00
7f317d3321 Avoid the release of Zalgo (#1295) 2020-09-10 15:27:27 +02:00
96a54d0539 Fix maxRetries request option handling (#1296) 2020-09-10 15:22:33 +02:00
f15ecd8477 Fix RequestOptions.body type to include null (#1300)
Fixes #1291
2020-09-10 15:21:41 +02:00
e86d38087e API generation 2020-09-01 14:09:43 +02:00
02ed45f76b Updated run-elasticsearch.sh to retry on docker network failures (#1279) 2020-09-01 12:15:58 +02:00
858616d6c6 Helper param fix (#1284)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2020-09-01 12:15:11 +02:00
ba39e8a440 Updated build failure emails recipients (#1285) 2020-08-13 15:28:25 +02:00
cf172d7937 API generation 2020-08-03 11:59:39 +02:00
a4370cb28d Generate response type as boolean if the request is HEAD only (#1275) 2020-08-03 11:45:48 +02:00
26238634a7 Added proxy support (#1260) 2020-08-03 11:39:24 +02:00
629894adba Updated jenkins build frequency 2020-07-27 14:28:00 +02:00
51ab5b0b00 Updated license header (master) (#1266) 2020-07-23 12:26:56 +02:00
944dee219a API generation 2020-07-20 14:08:31 +02:00
58117792de Fix errors in type definitions (#1263) 2020-07-20 14:00:24 +02:00
e6a4050b0b API generation 2020-07-20 12:17:14 +02:00
1e8bcbebfe Fixed type test 2020-07-15 15:48:18 +02:00
5572939268 Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2020-07-15 15:41:09 +02:00
530f50be95 Added 7.9 branch to ci jobs 2020-07-15 15:40:51 +02:00
1592c4d575 Add ability to disable the http agent (#1251) 2020-07-13 15:07:51 +02:00
39cf023426 Add support for a global context option (#1256) 2020-07-13 14:36:53 +02:00
1a7727588e Allow the client name to be a symbol (#1254) 2020-07-13 12:38:16 +02:00
9d30778614 Removed broken links 2020-07-13 11:30:54 +02:00
fa760f44b5 API generation 2020-07-13 11:21:44 +02:00
1a7968aba3 Added sniffing blog post to documentation (#1249) 2020-07-09 10:14:39 +02:00
d6c84f1a5d Updated default http agent configuration (#1242) 2020-07-09 09:01:05 +02:00
34a9176fbf Export a kibana restricted type definition (#1239) 2020-07-06 11:49:12 +02:00
8d7859d2e2 Improve child API (#1245) 2020-07-06 11:39:08 +02:00
8c4042d913 API generation 2020-07-03 08:44:01 +02:00
aa7d7b02ad Fixed transport.request querystring type (#1240) 2020-07-01 10:38:55 +02:00
71a74be321 Fix docs build 2020-06-30 12:13:01 +02:00
33a4e4dc31 API generation 2020-06-30 10:13:55 +02:00
4711cf6d70 Update typescript.asciidoc (#1237) 2020-06-30 08:07:50 +02:00
4b2cbdb809 Fix API example usage (#1234) 2020-06-26 12:00:14 +02:00
d16781e379 ESM support (#1235) 2020-06-26 11:57:43 +02:00
148f2fd864 Added new docs examples (#1233) 2020-06-26 09:24:14 +02:00
83e5147d9d Fixed code snippet 2020-06-15 09:26:41 +02:00
b4d0dc87d3 Reorganized test and force 100% code coverage (#1226) 2020-06-15 08:37:04 +02:00
04d082cb49 Helpers: avoid allocating new timers (#1224) 2020-06-12 10:43:41 +02:00
8e077b46a7 improved test coverage (#1222) 2020-06-08 09:42:59 +02:00
b0e96f9644 migrated to FakeTimers (#1221) 2020-06-08 09:37:29 +02:00
59ab125f48 API generation 2020-06-08 09:30:11 +02:00
3efb63b34e Documentation fixes (#1217) 2020-06-04 13:37:43 +02:00
7dfaa6c5b4 Improve helper concurrency (#1214) 2020-06-04 10:55:51 +02:00
3751f50774 API generation 2020-06-03 10:41:59 +02:00
1d9238b432 Fixed types code generation (#1212) 2020-06-03 10:41:27 +02:00
80817a00f9 Added timeout support in bulk and msearch helpers (#1206) 2020-06-03 10:33:08 +02:00
dbbee273d9 API generation 2020-06-03 09:09:42 +02:00
1a25b623b0 Add multi search helper (#1186) 2020-05-25 15:37:01 +02:00
84217fc737 Use filter_path for improving the search helpers performances (#1199) 2020-05-25 14:25:32 +02:00
d1ad7bd22b Fix docs build 2020-05-18 10:38:03 +02:00
ac2d1dad53 API generation 2020-05-18 09:23:50 +02:00
803739b4cb Added new docs examples (#1189) 2020-05-15 10:34:39 +02:00
4659b9849c [DOCS] Fixes Indices component template link in reference docs (#1197) 2020-05-15 10:34:18 +02:00
8835d5af64 Updated jenkins job configuration 2020-05-15 09:42:10 +02:00
6f4127d87d Updated skip list 2020-05-15 09:40:38 +02:00
e3e4be3a5e API generation 2020-05-14 18:16:26 +02:00
191b8fb9fb Force lowercase in all headers (#1187) 2020-05-14 16:10:18 +02:00
22de806b67 Disable client Helpers in Node.js < 10. (#1194) 2020-05-14 16:03:08 +02:00
b109f60763 API generation 2020-05-07 08:11:36 +02:00
0d5c7a880f API generation 2020-04-30 11:28:37 +02:00
5db574a576 Add Node.js v14 to test matrix (#1172) 2020-04-23 09:04:21 +02:00
292218f946 Generate junit report (#1165)
* Enable junit report

* Added junit reporter utility

* Generate junit report

* junit reporter: store time in seconds

* Added skip reason in junit report

* Added missing end

* Fix skip serialize indentation
2020-04-23 08:25:49 +02:00
9b4d2c13b0 Updated junit report configuration 2020-04-22 09:36:40 +02:00
5cd67ddbe2 one more difference spotted in .ci skeleton (#1169) 2020-04-21 12:48:44 +02:00
50ffb5592f sync defaults with skeleton (#1168) 2020-04-21 11:35:58 +02:00
dc998fdd87 Updated junit report configuration 2020-04-21 10:29:57 +02:00
3ab7712a8b Updated junit glob 2020-04-20 15:07:06 +02:00
ae8ac21060 Enable junit report 2020-04-20 12:12:40 +02:00
17959a41e1 Fix 1153 (#1159)
* Fix #1153

* Updated test
2020-04-14 18:14:27 +02:00
fd8f02b9df Fix flaky test (#1158)
* Fix flaky test

* Fix #1154
2020-04-14 14:39:53 +02:00
203bab278d Added testing documentation (#1150)
* Added testing documentation

* Fix title
2020-04-10 15:32:38 +02:00
cfc21f56c2 API generation 2020-04-10 12:21:27 +02:00
0e659031e3 Added new docs examples (#1149)
* Updated enabled files list

* Added new docs examples
2020-04-10 12:20:25 +02:00
7717799ca6 Fix docs build 2020-04-07 11:49:21 +02:00
8522f303ee API generation 2020-04-07 11:25:25 +02:00
f6677c05cf Updated TypeScript docs (#1144) 2020-04-06 14:19:04 +02:00
6779f3b11a Switched request and response generics position (#1132)
* Updated code generation

* Switched request and response generics position

* Updated test

* API generation

* Removed unused generics

* Test type definitions for callback style API as well

* Fix comments

* Fix conflict

* API generation

* Updated type def
2020-04-06 12:45:27 +02:00
e67b55d163 Do not retry a request if the body is a stream (#1143)
* Do not retry a request if the body is a stream

Refactored the trnasport.request method to not use stream for gzipping
the body, but use the callback API instead. The maxRetries will be 0 in
case of a stream body and cached the Accept-Encoding header.

* Updated dependencies

* Updated test
2020-04-06 12:16:21 +02:00
d10e8bb9f3 API generation 2020-04-06 11:35:59 +02:00
27a8e2a9bf Updated abort behavior (#1141)
* Updated abort behavior

- Support for aborting a request with the promise api
- Aborting a request will cause a RequestAbortedError
- Normalized Connection class errors, now every error returned is
wrapped by the client errors constructors

* Updated test

* Updated docs

* Updated code generation script

* Renamed test

* Code coverage

* Avoid calling twice transport.request
2020-04-06 11:21:19 +02:00
953a8033ab API generation 2020-04-03 09:49:51 +02:00
df17fb99d0 Added async generator support in bulk helper (#1138)
* Added async generator support in bulk helper

* Updated test

* Updated docs

* Improved type definitions

* Updated onDrop callback type definition
2020-04-03 09:46:26 +02:00
bdd38597d8 Run workflow also on community pull requests 2020-04-03 09:00:40 +02:00
bb28276553 API generation 2020-04-02 07:48:45 +02:00
1d24147ada API generation 2020-04-01 10:32:56 +02:00
2963fa6e0b API generation 2020-03-30 14:50:18 +02:00
da35f71f2d API generation 2020-03-27 13:46:30 +01:00
f913f7d2d2 Updated Connections handling (#1127)
* Updated Connections handling

- The ConnectionPool.getConnection method now always returns a connection
- The ConnectionPool.update mehtod now cleans the dead list
- Deprecated the NoLivingConnectionsError

* Updated test

* Updated docs

* The NoLivingConnectionsError can still happen if the filter/selector returns no nodes

* Updated test

* Updated docs

* Catch undefined connections as well

* Updated test

* Updated ApiError type def
2020-03-26 13:41:05 +01:00
85616b07ef Improve code coverage (#1124)
* Helpers: Fixed stats counting

* Improve code coverage
2020-03-24 12:27:05 +01:00
f99fe71b67 API generation 2020-03-24 08:48:18 +01:00
8de88b0154 Updated code coverage scripts 2020-03-23 18:03:42 +01:00
153bc26b39 Added 7.7 branch to ci jobs 2020-03-23 17:52:19 +01:00
d7836a16af Client helpers (#1107)
* Added client helpers

* Updated test

* The search helper should return only the documents

* Added code comments

* Fixed bug

* Updated test

* Removed bulkSize and added flushBytes

* Updated test

* Added concurrency

* Updated test

* Added support for 429 handling in the scroll search helper

* Updated test

* Updated stats count

* Updated test

* Fix test

* Use client maxRetries as default

* Updated type definitions

* Refactored bulk helper to be more consistent with the client api

* Updated test

* Improved error handling, added refreshOnCompletion option and forward additinal options to the bulk api

* Updated type definitions

* Updated test

* Fixed test on Node v8

* Updated test

* Added TODO

* Updated docs

* Added Node v8 note

* Updated scripts

* Removed useless files

* Added helpers to integration test

* Fix cli argument position

* Moar fixes

* Test run elasticsearch in github actions

* Use master action version

* Add vm.max_map_count step

* Test new action setup

* Added Configure sysctl limits step

* Updated action to latest version

* Don't run helpers integration test in jenkins

* Run helpers integratino test also with Node v10

* Updated docs

* Updated docs

* Updated helpers type definitions

* Added test for helpers type definitions

* Added license header
2020-03-23 17:43:10 +01:00
6c82a4967e Refactored type definitions (#1119)
* Updated types generation script

* Refactored api method definitions

* Updated test
- Removed old test code
- Added tsd dev dependency
- Rewritten test with tsd

* Removed unused dependencies

* Fixed definition

* Updated test

* Updated docs

* Improved events type definitions

* Updated test

* Minor fixes in the type definitons

* More type test

* Improved Transport type definitions

* Updated test

* Addressed comments

* Code generation

* Use RequestBody, Response and Context everywhere, also default Context to unknown

* Updated test

* body -> hasBody

* Fixed conflicts

* Updated code generation

* Improved request body type definition

* Updated code generation

* Use BodyType for both request and reponses generics
- Use extends for defining the RequestBody generic to force the user
  following the same shape.
- BodyType and NDBodyType now accepts a generics to allow injecting
  more specific types in the future

* API generation

* Updated test

* Updated docs

* Use BodyType also in ReponseError

* Removed useless client generics

* Renamed generics and types
- prefixed all generics with a T
- BodyType => RequestBody
- NDBodyType => RequestNDBody
- Added ResponseBody

* Updated test

* Updated docs

* Test ResponseBody as well

* Simplify overloads

* API generation

* Updated test

* Updated error types
2020-03-23 11:38:18 +01:00
a80f510a9a Add data field in serialization errors (#1100)
* Add data field in serialization errors

* Add test for data field in serialization errors

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2020-03-23 10:15:34 +01:00
1b638d6992 API generation 2020-03-20 16:54:50 +01:00
354c13c033 Updated skip list 2020-03-20 16:54:09 +01:00
ed74570bc2 Fix docs build 2020-03-20 13:57:41 +01:00
87579e4ca9 API generation 2020-03-20 13:33:56 +01:00
7f19628907 API generation 2020-03-19 08:39:55 +01:00
b374fe9967 [DOCS] Fixes link to cat transforms API (#1120) 2020-03-18 16:23:43 -07:00
7e51d4cd8c API generation 2020-03-18 15:05:03 +01:00
f1fcf4746d API generation 2020-03-17 11:38:44 +01:00
9a9057db9e ApiKey should take precedence over basic auth (#1115)
* ApiKey should take precedence over basic auth

* Updated docs

* Updated test
2020-03-13 13:34:47 +01:00
6bf04473c9 Secure json parsing (#1110)
* Safe json parsing

* Updated test
2020-03-12 16:35:45 +01:00
41cc8a6d04 Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2020-03-12 08:42:36 +01:00
5445f0b22b API generation 2020-03-12 08:42:31 +01:00
030c5e8c43 typo (#1109) 2020-03-11 18:48:46 +01:00
94d4ac7525 Migrate to GitHub Actions (#1104)
* Create nodejs.yml

* Run only on push

* Renamed jobs

* Removed .travis.yml

* Split coverage job and cleanup

* Skip flaky test

* Code coverage reporting

* Renamed codecov file

* Added backport action

* Updated integration test configuration

* Removed unused dependencies

* Fixes
2020-03-10 09:03:26 +01:00
58a2618f4c Updates .ci folder to latest incarnation (#1103)
* Updates .ci folder to latest incarnation

The .ci folder cleanup some of its cleanup/wait routines so that they
can be reused. It also significantly reduced the available environment
variable toggles. In lieu of those toggles `run-repository.sh` can now
start multiple nodes using `NUMBER_OF_NODES`

* update certs
2020-03-09 17:23:51 +01:00
54ec923491 Updated skip list 2020-03-09 15:37:18 +01:00
1c03ccc7af Updated skip list 2020-03-09 14:40:10 +01:00
43ee0445fc Updated skip list 2020-03-09 12:33:56 +01:00
0f2b79159e Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2020-03-04 11:03:42 +01:00
db89df7b5c Updated LICENSE 2020-03-04 11:03:02 +01:00
508aa362e6 Added new docs examples (#1101)
* Added new docs examples

* Updated enabled files list
2020-03-04 09:20:27 +01:00
7b7c9130f3 [DOCS] Fixes out-dated monitoring links (#1096) 2020-03-04 09:20:00 +01:00
6d50c9fa30 API generation 2020-03-04 09:19:06 +01:00
32f3fef14f API generation 2020-02-26 12:12:45 +01:00
15ba60a0ec Updated skip list 2020-02-26 12:12:06 +01:00
fec4e837ac Skip broken test 2020-02-25 15:05:23 +01:00
18a87fca82 Fixed integration test 2020-02-25 14:31:54 +01:00
6261dd7909 API generation 2020-02-25 10:26:24 +01:00
d621d31d39 API generation 2020-02-19 11:55:45 +01:00
b2c85f7797 Update integration test runner (#1085)
* Improved user and roles handling

* Avoid deleting internal indices

* Updated skip version handling

* Fix leftover

* Improved indices and aliases cleanup

* Clean also internal indices

* Restore previous index/alias cleanup

* Ignore 404
2020-02-11 10:49:49 +01:00
0c4875aa6d API generation 2020-02-10 12:05:42 +01:00
6e7385a478 Added integration test stats (#1083) 2020-02-06 12:04:55 +01:00
28205e97cf Update docs examples (#1081)
* Updated enabled files list

* Generated docs examples

* Generated docs examples
2020-02-06 12:04:29 +01:00
41927914bb API generation 2020-02-06 09:16:30 +01:00
d701516dda Skip compression in case of empty string body (#1080)
* Fix #1069

* Updated test

* Updated test
2020-02-04 10:28:42 +01:00
4b54013248 [DOCS] Fine-tunes the Node.Js client Typescript and examples se… (#1078)
* [DOCS] Fine-tunes the Node.Js client Typescript and examples sections.

* [DOCS] Fixes merge conflict.
2020-02-03 17:48:13 +01:00
d2bc399d9b Add examples to reference (#1076)
* Updated examples urls

* Added links to examples

* Updated docs generation script to include code examples

* Fixes

* Skip index api

* Fix link

* Fix url generation

* API generation

* Fix new line

* API generation

* Fix leftover

* API generation
2020-02-03 17:23:49 +01:00
87ccc196a0 Merge branch 'master' of https://github.com/elastic/elasticsearch-js 2020-02-03 11:00:30 +01:00
93d24dcc5b API generation 2020-02-03 11:00:17 +01:00
7945b68693 Fix typo in NoLivingConnectionsError (#1045)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2020-02-03 10:34:23 +01:00
ebb96e95bf API generation 2020-01-31 15:27:34 +01:00
5f1edbb199 [DOCS] Fine-tunes the Node.Js client extend the client section (#1064) 2020-01-29 18:09:34 +01:00
416ace2e30 Renamed log skip function (#1061) 2020-01-23 09:24:03 +01:00
01b233428f Improve integration test execution time (#1005)
* Integration test: Add limit of 3 minutes per yaml file

* Monitor all test files that take more than 1m to execute

* Set the threshold to 30s

* Refactored integration test runner

* Better time reporting

* Updated test time limits

* Updated CI script

* Run oss only in oss build

* Run only oss test

* Revert "Run only oss test"

This reverts commit fd3a07d42d.
2020-01-23 08:25:51 +01:00
bc970a75f3 [DOCS] Updated xrefs to SLM API docs. (#1008) 2020-01-22 23:08:41 -08:00
acff983fc0 [DOCS] Fine-tunes the Node.Js client observability section. (#1055) 2020-01-16 14:31:54 +01:00
b18cc25a0f [DOCS] Fine-tunes the Node.Js client child client section. (#1057) 2020-01-16 14:30:52 +01:00
f3ccf7baa3 Updated reserved user list 2020-01-16 09:24:18 +01:00
3953a2c542 Change TransportRequestOptions.ignore to number[] (#1053) 2020-01-15 18:25:06 +01:00
ec81ee40f8 Move to latest .ci script structure (#1042)
Introduces a dedicated `run-repository.sh` for the repository custom
bits.

This allows us to keep `run-elasticsearch.sh` and `run-tests` in sync
through file copying or patches easier.

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2020-01-15 16:09:29 +01:00
daf30653f1 Updated skip list
- With https://github.com/elastic/elasticsearch/pull/50977 this skips are no longer valid
2020-01-15 09:55:33 +01:00
2e33680047 Updated skip list 2020-01-13 12:45:41 +01:00
7478913d6c API generation 2020-01-13 12:23:10 +01:00
436f1c891d Updated api reference header comment (#1049) 2020-01-13 12:21:39 +01:00
c548055886 Added new examples (#1031)
* Added new examples

* Fixed examples links
2020-01-13 10:57:46 +01:00
fc5156dbff Removed indices.flushSynced from API reference
- Fix for https://github.com/elastic/elasticsearch/pull/50882
2020-01-13 09:34:20 +01:00
8e113271b5 Updated skip list 2020-01-08 10:21:47 +01:00
2abd2a8e7f Updated skip list 2020-01-08 08:53:23 +01:00
8215327a03 Updated skip list 2020-01-07 19:19:07 +01:00
185cfa394b ClientOptions["cloud"] should have optional auth fields (#1032) 2020-01-07 12:08:57 +01:00
6cef0aff18 API generation 2020-01-07 11:08:28 +01:00
59559f7200 Return super in example Transport subclass (#980)
If called without a callback, the request method returns a Promise, so
when calling into super.request, the result should be returned to
maintain promise behavior.
2019-12-19 13:36:42 +01:00
01e045f491 Update docs examples (#1024)
* Updated generate-docs-examples script

* Updated docs examples
2019-12-19 09:29:15 +01:00
c69db0ba08 [DOCS] Fine-tunes the Node.Js client authentication section. (#1017) 2019-12-13 10:57:28 +01:00
e2ba0634bf API generation 2019-12-13 09:03:01 +01:00
a174ea4721 [DOCS] Fine-tunes the Node.Js client breaking changes section (#1012) 2019-12-05 13:20:42 +01:00
bb4b40b3fd API generation 2019-12-03 14:38:19 +01:00
0f1746014c X-Opaque-Id support (#997)
* Added X-Opaque-Id support

* Updated type definitions

* Updated test

* Updated docs
2019-12-02 09:21:03 +01:00
1e1252383d Added doc examples (#1011)
* Added generate-docs-examples script

* Added doc_examples folder wth the initial examples
2019-11-29 14:40:05 +01:00
177aae20e6 [DOCS] Fine-tunes the Node.js client API reference section. (#1006) 2019-11-26 08:26:57 +01:00
c40eaab038 API generation 2019-11-25 17:04:37 +01:00
e8aebeef57 Removed ml api from reference.asciidoc to fix CI in https://github.com/elastic/elasticsearch/pull/49455 2019-11-22 17:19:44 +01:00
f3b044e60c API generation 2019-11-19 19:35:07 +01:00
b439b6cb5a [DOCS] Fine-tunes the Node.js client configuration section (#998) 2019-10-30 14:45:21 +01:00
def4be92c6 API generation 2019-10-30 09:50:17 +01:00
850a40b116 Updated jobs/defaults.yml to use the new job matrix 2019-10-28 12:57:31 +01:00
7ab9813995 New CI configuration (#996)
* Removed old files

* Updated README

* New CI configuration

* Updated run-test script
2019-10-28 12:50:44 +01:00
28c3cd6f49 Move back to jjbb (#995)
* Removed Jenkins pipelines configuration

* Restored jjbb definitions
2019-10-25 10:55:45 +02:00
9866153ae7 Updated integration test helpers 2019-10-24 13:29:47 +02:00
99ba31df84 Fixed types test 2019-10-24 09:59:55 +02:00
e098f77a23 API generation 2019-10-24 09:54:18 +02:00
7ab5894331 [DOCS] Fine-tunes the Node.js client usage section (#988) 2019-10-15 15:10:16 +02:00
5263c56fda [DOCS] Fine-tunes the Node.js client introduction (#985) 2019-10-10 10:18:21 +02:00
82b6c2005b API generation 2019-10-01 10:07:23 +02:00
c13d7c7847 [DOCS] Update docs for 'synced flush' and 'SLM' APIs (#972) 2019-09-26 20:14:38 +02:00
7fef37cf90 Fix issue; node roles are defaulting to true when undefined (fal… (#967)
* Fix issue; nodeFilter was unable to filter because master, data, and ingest role were true if even they were false on the node.

* Test nodesToHost of BaseConnectionPool correctly maps node roles
2019-09-18 08:45:47 +02:00
90ad163151 Fix inaccurate description sniffEndpoint (#959) 2019-09-16 17:43:24 +02:00
ce584b3211 Updated API reference doc (#945)
* Updated API reference doc

* Updated docs script
2019-09-16 17:41:36 +02:00
69247496ce Update code generation (#969)
* Updated code generation scripts to use the new spec

* API generation

* Fix bad link
2019-09-16 16:55:23 +02:00
4ff1bd5110 Add body and querystring to RequestOptions (#957) 2019-09-11 11:29:40 +02:00
f7be49f2ba API generation 2019-08-14 08:57:25 +02:00
ce90db86cf Updated cron job definition (#939)
* Updated cron job definition

* Update .ci/Jenkinsfile

Co-Authored-By: Victor Martinez <victormartinezrubio@gmail.com>
2019-08-13 10:54:44 +02:00
dde40511cc Add again defaults.yml file 2019-08-09 15:35:49 +02:00
af6ea76a13 Updated .travis.yml (#938) 2019-08-09 14:07:47 +02:00
57ef613d9c Updated build badge 2019-08-09 12:22:37 +02:00
34e440b9f8 Use Jenkins pipelines (#937) 2019-08-09 12:11:47 +02:00
4c1eaa5a54 Updated job definiton 2019-08-07 15:02:06 +02:00
2d2aea25ac Updated stale bot 2019-08-02 14:30:43 +02:00
aab74299b4 Disable travis cache (#929) 2019-08-02 11:49:21 +02:00
9142b27d9e Updated error handling in bulk example (#927) 2019-08-01 12:20:29 +02:00
2e77a7d042 Removed branch 7.3 from CI testing 2019-08-01 11:47:22 +02:00
1f1b4c29fa API generation 2019-07-29 11:39:50 +02:00
a948a98be6 Refactored connection pool (#913)
* Refactored ConnectionPool
- Created BaseConnectionPool class
- Created CloudConnectionPool
- connection pool updates are immutable
- resurrect now happens inside getConnection()

* Rewritten connection pool(s) type definitions

* Updated test

* Fixed test

* Fix if check

* Removed old files

* Improve code coverage

* Updated license header

* Fix if check

* Improve code coverage

* Updated coverage script
2019-07-26 11:43:48 +02:00
fa07de3284 Master API generation (#922) 2019-07-25 13:03:24 +02:00
dd8491d723 Better reference code examples (#920)
* Updated documentation genertation script to build small code snippets

* Updated docs reference

* Removed slm doc

* Add commas and remove empty objects
2019-07-25 11:08:18 +02:00
032ec73dbd Updated automatically the main typings file with the generated t… (#919)
* Updated automatically the main typings file with the generated types

* Removed useless log
2019-07-25 10:57:47 +02:00
0039fad487 Revert "API generation"
This reverts commit 7c5992131b.
2019-07-24 14:12:47 +02:00
7c5992131b API generation 2019-07-24 10:58:54 +02:00
db3ff14680 Jenkins pipeline testing fixes (#916) 2019-07-22 14:08:08 +02:00
36a1666cc8 Updated license header (#915) 2019-07-22 11:46:59 +02:00
35b54bb673 Added job configuration for Jenkins pipelines (#911)
* Added job configuration for Jenkins pipelines

* Added job name
2019-07-22 10:42:07 +02:00
e93f94521c fix(Typings): sniffInterval can also be boolean (#914) 2019-07-22 10:39:42 +02:00
0ebbd71e9a Improve authentication handling (#908) 2019-07-18 10:33:11 +02:00
24e674469e Removed branch 6.9 from ci jobs 2019-07-18 10:19:16 +02:00
62e7ba5653 Updated ci jobs definitions 2019-07-17 18:44:44 +02:00
2bd1c66e6d Fix typo in comments (#912) 2019-07-17 17:04:01 +02:00
a752ea7403 Improve README (#909)
* Updated README

* Updated asciidoc intro

* Updated intro title

* Update README.md

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Update README.md

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Update README.md

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Update README.md

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Update README.md

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Update docs/introduction.asciidoc

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Update docs/introduction.asciidoc

Co-Authored-By: Lisa Cawley <lcawley@elastic.co>

* Updated asciidoc intro
2019-07-17 10:28:31 +02:00
45672e89f7 Added support for arbitrary_key (#910) 2019-07-16 12:21:01 +02:00
b66064358a Update deepmerge requirement from ^3.2.0 to ^4.0.0 (#898) 2019-07-15 14:24:43 +02:00
56931a426b Update tap requirement from ^13.0.1 to ^14.4.1 (#900) 2019-07-15 14:21:36 +02:00
6e3f88906b Update @types/node requirement from ^11.13.7 to ^12.6.2 (#899) 2019-07-15 14:20:37 +02:00
ce16f28e8f Update standard requirement from ^12.0.1 to ^13.0.2 (#906) 2019-07-15 14:20:21 +02:00
33bc37b34c [DOCS] Fix broken links (#903) 2019-07-12 15:00:21 -04:00
6c8b99f78a Improve integration test (#859)
* CI: Added junit plugin

* Updated .gitignore

* Added integration test reporter

* Updated integration testing suite

* Updated ci config

* Updated report file path

* Use refresh 'true' instead of 'wait_for'

* Disable junit reporting

* Refresh one single time

* Update security index name

* Updated skip test handling and use class syntax

* Updated test script

* Disable test timeout

* Added command to automatically remove an old snapshot

* Disable timeout in integration test script

* Updated logs and cleaned up git handling

* Fixed shouldSkip utility

* Updated cleanup code

* Updated cleanup code pt 2

* Rename Platinum to XPack
2019-07-10 15:27:44 +02:00
ea3cd7dd58 API generation 2019-07-08 16:31:46 +02:00
a3eb4d2874 Updated travis configuration (#894)
* Updated travis configuration

* Run license checker only in Linux

* Fixed script

* Fix windows test
2019-07-08 16:29:10 +02:00
1a3dbeb94b Remove auth data from inspect and toJSON in connection class (#887)
* Remove auth data from inspect and toJSON in connection class

* Updated test
2019-07-04 13:56:06 +02:00
d00564722e API generation 2019-07-04 12:11:34 +02:00
eadf9a77e8 Updated test blacklist 2019-07-01 14:19:10 +02:00
2186396570 API generation 2019-07-01 12:41:44 +02:00
ca50f580f4 Updated type definitions (#882)
* Updated type definitions

* Updated test
2019-06-19 09:14:19 +02:00
a1ca9cdda0 Added cloud configuration example (#880)
* Added cloud configuration example

* Used cloud example from auth docs and added link
2019-06-14 10:13:32 +02:00
097ecc5159 [DOCS] Fixes typo (#877) 2019-06-12 08:39:57 +02:00
f037e8115e API generation (#875) 2019-06-11 21:02:36 +02:00
ff9904da03 Docs: added missing configuration options (#870) 2019-06-03 12:24:42 +02:00
930703b9eb Updated stale bot configuration 2019-05-30 13:53:57 +02:00
95007b8c9d Support for non-friendly chars in url username and password (#858)
* Support for non-friendly chars in url username and password
- Added auth option to Connection class
- Updated pool.addConnection

* Updated test
2019-05-20 11:09:33 -04:00
844206ec9d Patch deprecated parameters (#851)
* Updated code generation

* API generation

* API generation

* Updated code generation
2019-05-16 16:52:15 -04:00
ea1ecad13c missing comma (#854) 2019-05-16 09:39:41 -04:00
7f77250ed5 Added toJSON method to Connection class (#849)
* Added toJSON method to Connection class

* Updated test

* Updated typings
2019-05-14 12:00:27 -04:00
c76d0249c0 Fix #803 (#846) 2019-05-14 11:19:08 -04:00
2f92b28bce Updated issue templates 2019-05-10 14:17:24 +02:00
37f11281aa Fix 843 (#845)
* Fix #843

* Updated test
2019-05-10 10:55:28 +02:00
bde19d604d Bumped v8.0.0-SNAPSHOT.9f33e3c7 2019-05-09 15:57:16 +02:00
24bfff5e69 Bumped v8.0.0-snapshot.9f33e3c7 2019-05-09 15:33:18 +02:00
82a0a110b5 Fix 841 (#842)
* Added errors to exported members

* Updated test
2019-05-09 14:57:04 +02:00
4fc4699a4d Updated installation instructions (#840) 2019-05-06 12:01:36 +02:00
27610a76de Bumped version 2019-05-06 10:01:34 +02:00
802f7902a4 Added User-Agent header (#807)
* Added User-Agent header

* Updated test

* Updated user-agent format

* Updated test
2019-05-06 09:59:22 +02:00
215cc036c3 Simplify API wrappers (#839)
* Updated code generation

* API generation

* Updated test

* Updated code generation

* API generation

* API generation
2019-05-03 19:02:10 +02:00
269c0fc96a Improve observability (#834)
* API generation

* Added correlation id support

* Updated docs

* Updated test

* Updated code generation

* API generation

* Updated code generation

* Added support for client name and custom context object

* Updated docs

* Updated test

* Fix docs

* Updated docs

* Added id support also for sniffing

* Updated test

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Apply suggestions

* Update docs/configuration.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/configuration.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Update docs/observability.asciidoc

Co-Authored-By: delvedor <delvedor@users.noreply.github.com>

* Apply suggestions

* Updated README.md

* Fixed test

* Addressed suggestions
2019-05-03 17:23:40 +02:00
1261e60d41 Better handling of hostname/ip:port format (#837)
* Better handling of hostname/ip:port format

* Updated test
2019-05-03 14:36:17 +02:00
6f4fb16200 Updated installation instructions (#835)
* Updated installation instructions

* Added a note about Elasticsearch master
2019-05-02 11:59:06 +02:00
9320ef939d Fix resurrect timeout formula (#833)
* Fixes #827

* Updated test
2019-04-29 09:18:38 +02:00
8e8b7fbdee Node v12 and bumped dependencies (#832)
* Node v12

* Bumped dependencies

* Disable automatic code coverage
2019-04-26 17:24:54 +02:00
2f76b366ce Updated .travis.yml (#831) 2019-04-26 15:01:14 +02:00
349b832d2b Support for deprecated paths (#828)
* Updated code generation

* API generation

* Updated test
2019-04-26 09:25:34 +02:00
928746d19f Updated test 2019-04-24 10:55:14 +02:00
e3a0e9ed56 API generation 2019-04-24 10:22:37 +02:00
c35eb421cb Update RequestEvent to use parameterized type T (#822)
Updated `RequestEvent` to use parameterized type `T`.  In reference to:

https://github.com/elastic/elasticsearch-js/pull/819#issuecomment-484594841
2019-04-19 10:06:20 +02:00
2f665054f1 API generation 2019-04-17 11:28:12 +02:00
c6ce062822 Updated typings (#819) 2019-04-17 11:23:15 +02:00
72fda2bdd5 Drop Node.js v6 support (#818)
Node.js v6 will go EOL at the end of April 2019, and already two of the production dependencies of the client have already dropped support for it, and soon others will do *(as well as development dependencies)*.

Furthermore, since Node.js will go in EOL it will never get security patches, plus, also OpenSSL-1.0.2 will go EOL [this year](https://github.com/nodejs/Release#release-schedule); to avoid risks for the client users it is better to drop support for Node.js v6 right away.
2019-04-17 07:55:18 +02:00
28c0f2eeae Fix a typo in usage example (#806) 2019-04-11 16:37:42 +02:00
a21281fc48 Improve typings (#813)
The ApiResponse now accepts a generics that defaults to any, same for every API method that might need a body.
2019-04-10 11:40:25 +02:00
2919f93b73 Custom http agent support (#810) 2019-04-10 11:13:22 +02:00
0d65274de3 Updated issues template 2019-04-09 16:48:31 +02:00
5af9ec1040 Support for publish_address as hostname/ip:port (#804) 2019-04-08 17:13:44 +02:00
5794ad54e4 Updated README.md 2019-04-01 09:49:57 +02:00
aea1ecfe15 Handle bulk errors in examples 2019-04-01 09:08:32 +02:00
52cd07eca3 Generated reference 2019-03-29 18:10:09 +01:00
373957c55c Docs: Fix ingest doc links (#801)
The ingest docs in Elasticsearch doing point to the actual ingest APIs.
This makes up generate links to the real APIs instead, fixing some
broken links in the 5.x docs in the process.
2019-03-29 18:07:35 +01:00
02e24ea981 Generated reference 2019-03-29 15:46:01 +01:00
0073756d3a Docs: Handle more funny cases from ES api spec (#800)
Handles a few "special" doc urls from ES's api spec files. These are
only a problem in 6.x but we'd like to keep the generateDocs script the
same across all branches for easier backporting.
2019-03-29 15:44:47 +01:00
c92b156473 Docs: Fix the API reference (#799) 2019-03-29 08:50:08 +01:00
e98edffd02 Fix docs (#796)
Follow up of https://github.com/elastic/docs/pull/701.
2019-03-28 17:34:45 +01:00
22d65e54ac Updated CONTRIBUTING.md (#794)
As titled, also renamed the script files for a better DX.
2019-03-28 10:10:26 +01:00
fb73b4b08d Master should use the latest version of ES (#780)
The `master` branch should work with the latest snapshot of Elasticsearch.

- Use `8.0.0-SNAPSHOT`
- Code generation
- Updated scripts and CI conf
2019-03-28 09:05:00 +01:00
f260549a4f Added CONTRIBUTING.md and CODE_OF_CONDUCT.md 2019-03-27 16:46:25 +01:00
5bc57b03bf Improved integration test runner 2019-03-27 14:59:55 +01:00
ad6f56c3f1 Doc updates (#791)
Updates for better displaying the documentation in the website.
2019-03-27 07:44:19 +01:00
3808 changed files with 171820 additions and 55747 deletions

16
.buildkite/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
ARG NODE_VERSION=${NODE_VERSION:-18}
FROM node:$NODE_VERSION
# Install required tools
RUN apt-get clean -y && \
apt-get -qy update && \
apt-get -y install zip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /usr/src/app
COPY package.json .
RUN npm install
COPY . .

View File

@ -0,0 +1,30 @@
ARG NODE_JS_VERSION=${NODE_JS_VERSION:-18}
FROM node:${NODE_JS_VERSION}
ARG BUILDER_UID=1000
ARG BUILDER_GID=1000
ENV BUILDER_USER elastic
ENV BUILDER_GROUP elastic
# install zip util
RUN apt-get clean -y && \
apt-get update -y && \
apt-get install -y zip
# Set user permissions and directory
RUN (id -g ${BUILDER_GID} || groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP}) \
&& (id -u ${BUILDER_UID} || useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GID} -m elastic) \
&& mkdir -p /usr/src/elasticsearch-js \
&& chown -R ${BUILDER_UID}:${BUILDER_GID} /usr/src/
WORKDIR /usr/src/elasticsearch-js
# run remainder of commands as non-root user
USER ${BUILDER_UID}:${BUILDER_GID}
# install dependencies
COPY package.json .
RUN npm install
# copy project files
COPY . .

20
.buildkite/certs/ca.crt Executable file
View File

@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDSjCCAjKgAwIBAgIVAJQLm8V2LcaCTHUcoIfO+KL63nG3MA0GCSqGSIb3DQEB
CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu
ZXJhdGVkIENBMB4XDTIwMDIyNjA1NTA1N1oXDTIzMDIyNTA1NTA1N1owNDEyMDAG
A1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5lcmF0ZWQgQ0Ew
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDYyajkPvGtUOE5M1OowQfB
kWVrWjo1+LIxzgCeRHp0YztLtdVJ0sk2xoSrt2uZpxcPepdyOseLTjFJex1D2yCR
AEniIqcFif4G72nDih2LlbhpUe/+/MTryj8ZTkFTzI+eMmbQi5FFMaH+kwufmdt/
5/w8YazO18SxxJUlzMqzfNUrhM8vvvVdxgboU7PWhk28wZHCMHQovomHmzclhRpF
N0FMktA98vHHeRjH19P7rNhifSd7hZzoH3H148HVAKoPgqnZ6vW2O2YfAWOP6ulq
cyszr57p8fS9B2wSdlWW7nVHU1JuKcYD67CxbBS23BeGFgCj4tiNrmxO8S5Yf85v
AgMBAAGjUzBRMB0GA1UdDgQWBBSWAlip9eoPmnG4p4OFZeOUBlAbNDAfBgNVHSME
GDAWgBSWAlip9eoPmnG4p4OFZeOUBlAbNDAPBgNVHRMBAf8EBTADAQH/MA0GCSqG
SIb3DQEBCwUAA4IBAQA19qqrMTWl7YyId+LR/QIHDrP4jfxmrEELrAL58q5Epc1k
XxZLzOBSXoBfBrPdv+3XklWqXrZjKWfdkux0Xmjnl4qul+srrZDLJVZG3I7IrITh
AmQUmL9MuPiMnAcxoGZp1xpijtW8Qmd2qnambbljWfkuVaa4hcVRfrAX6TciIQ21
bS5aeLGrPqR14h30YzDp0RMmTujEa1o6ExN0+RSTkE9m89Q6WdM69az8JW7YkWqm
I+UCG3TcLd3TXmN1zNQkq4y2ObDK4Sxy/2p6yFPI1Fds5w/zLfBOvvPQY61vEqs8
SCCcQIe7f6NDpIRIBlty1C9IaEHj7edyHjF6rtYb
-----END CERTIFICATE-----

27
.buildkite/certs/ca.key Normal file
View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpgIBAAKCAQEA2Mmo5D7xrVDhOTNTqMEHwZFla1o6NfiyMc4AnkR6dGM7S7XV
SdLJNsaEq7drmacXD3qXcjrHi04xSXsdQ9sgkQBJ4iKnBYn+Bu9pw4odi5W4aVHv
/vzE68o/GU5BU8yPnjJm0IuRRTGh/pMLn5nbf+f8PGGsztfEscSVJczKs3zVK4TP
L771XcYG6FOz1oZNvMGRwjB0KL6Jh5s3JYUaRTdBTJLQPfLxx3kYx9fT+6zYYn0n
e4Wc6B9x9ePB1QCqD4Kp2er1tjtmHwFjj+rpanMrM6+e6fH0vQdsEnZVlu51R1NS
binGA+uwsWwUttwXhhYAo+LYja5sTvEuWH/ObwIDAQABAoIBAQC8QDGnMnmPdWJ+
13FYY3cmwel+FXXjFDk5QpgK15A2rUz6a8XxO1d7d1wR+U84uH4v9Na6XQyWjaoD
EyPQnuJiyAtgkZLUHoY244PGR5NsePEQlBSCKmGeF5w/j1LvP/2e9EmP4wKdQYJY
nLxFNcgEBCFnFbKIU5n8fKa/klybCrwlBokenyBro02tqH4LL7h1YMRRrl97fv1V
e/y/0WcMN+KnMglfz6haimBRV2yamCCHHmBImC+wzOgT/quqlxPfI+a3ScHxuA65
3QyCavaqlPh+T3lXnN/Na4UWqFtzMmwgJX2x1zM5qiln46/JoDiXtagvV43L3rNs
LhPRFeIRAoGBAPhEB7nNpEDNjIRUL6WpebWS9brKAVY7gYn7YQrKGhhCyftyaiBZ
zYgxPaJdqYXf+DmkWlANGoYiwEs40QwkR/FZrvO4+Xh3n3dgtl59ZmieuoQvDsG+
RYIj+TfBaqhewhZNMMl7dxz7DeyQhyRCdsvl3VqJM0RuOsIrzrhCIEItAoGBAN+K
lgWI7swDpOEaLmu+IWMkGImh1LswXoZqIgi/ywZ7htZjPzidOIeUsMi+lrYsKojG
uU3sBxASsf9kYXDnuUuUbGT5M/N2ipXERt7klUAA/f5sg1IKlTrabaN/HGs/uNtf
Efa8v/h2VyTurdPCJ17TNpbOMDwX1qGM62tyt2CLAoGBAIHCnP8iWq18QeuQTO8b
a3/Z9hHRL22w4H4MI6aOB6GSlxuTq6CJD4IVqo9IwSg17fnCy2l3z9s4IqWuZqUf
+XJOW8ELd2jdrT2qEOfGR1Z7UCVyqxXcq1vgDYx0zZh/HpalddB5dcJx/c8do2Ty
UEE2PcHqYB9uNcvzNbLc7RtpAoGBALbuU0yePUTI6qGnajuTcQEPpeDjhRHWSFRZ
ABcG1N8uMS66Mx9iUcNp462zgeP8iqY5caUZtMHreqxT+gWKK7F0+as7386pwElF
QPXgO18QMMqHBIQb0vlBjJ1SRPBjSiSDTVEML1DljvTTOX7kEJHh6HdKrmBO5b54
cqMQUo53AoGBAPVWRPUXCqlBz914xKna0ZUh2aesRBg5BvOoq9ey9c52EIU5PXL5
0Isk8sWSsvhl3tjDPBH5WuL5piKgnCTqkVbEHmWu9s1T57Mw6NuxlPMLBWvyv4c6
tB9brOxv0ui3qGMuBsBoDKbkNnwXyOXLyFg7O+H4l016A3mLQzJM+NGV
-----END RSA PRIVATE KEY-----

21
.buildkite/certs/testnode.crt Executable file
View File

@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDYjCCAkqgAwIBAgIVAIClHav09e9XGWJrnshywAjUHTnXMA0GCSqGSIb3DQEB
CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu
ZXJhdGVkIENBMB4XDTIzMDMyODE3MDIzOVoXDTI2MDMyNzE3MDIzOVowEzERMA8G
A1UEAxMIaW5zdGFuY2UwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV
+t5/g6u2r3awCtzqp17KG0hRxzkVoJoF8DYzVh+Rv9ymxQW0C/U8dQihAjkZHaIA
n49lSyNLkwWtmqQgPcimV4d6XuTYx2ahDixXYtjmoOSwH5dRtovKPCNKDPkUj9Vq
NwMW0uB1VxniMKI4DnYFqBgHL9kQKhQqvas6Gx0X6ptGRCLYCtVxeFcau6nnkZJt
urb+HNV5waOh0uTmsqnnslK3NjCQ/f030vPKxM5fOqOU5ajUHpZFJ6ZFmS32074H
l+mZoRT/GtbnVtIg+CJXsWThF3/L4iBImv+rkY9MKX5fyMLJgmIJG68S90IQGR8c
Z2lZYzC0J7zjMsYlODbDAgMBAAGjgYswgYgwHQYDVR0OBBYEFIDIcECn3AVHc3jk
MpQ4r7Kc3WCsMB8GA1UdIwQYMBaAFJYCWKn16g+acbing4Vl45QGUBs0MDsGA1Ud
EQQ0MDKCCWxvY2FsaG9zdIIIaW5zdGFuY2WHBH8AAAGHEAAAAAAAAAAAAAAAAAAA
AAGCA2VzMTAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQBtX3RQ5ATpfORM
lrnhaUPGOWkjnb3p3BrdAWUaWoh136QhaXqxKiALQQhTtTerkXOcuquy9MmAyYvS
9fDdGvLCAO8pPCXjnzonCHerCLGdS7f/eqvSFWCdy7LPHzTAFYfVWVvbZed+83TL
bDY63AMwIexj34vJEStMapuFwWx05fstE8qZWIbYCL87sF5H/MRhzlz3ScAhQ1N7
tODH7zvLzSxFGGEzCIKZ0iPFKbd3Y0wE6SptDSKhOqlnC8kkNeI2GjWsqVfHKsoF
pDFmri7IfOucuvalXJ6xiHPr9RDbuxEXs0u8mteT5nFQo7EaEGdHpg1pNGbfBOzP
lmj/dRS9
-----END CERTIFICATE-----

27
.buildkite/certs/testnode.key Executable file
View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAlfref4Ortq92sArc6qdeyhtIUcc5FaCaBfA2M1Yfkb/cpsUF
tAv1PHUIoQI5GR2iAJ+PZUsjS5MFrZqkID3IpleHel7k2MdmoQ4sV2LY5qDksB+X
UbaLyjwjSgz5FI/VajcDFtLgdVcZ4jCiOA52BagYBy/ZECoUKr2rOhsdF+qbRkQi
2ArVcXhXGrup55GSbbq2/hzVecGjodLk5rKp57JStzYwkP39N9LzysTOXzqjlOWo
1B6WRSemRZkt9tO+B5fpmaEU/xrW51bSIPgiV7Fk4Rd/y+IgSJr/q5GPTCl+X8jC
yYJiCRuvEvdCEBkfHGdpWWMwtCe84zLGJTg2wwIDAQABAoIBAAEP7HYNNnDWdYMD
+WAtYM12X/W5s/wUP94juaBI4u4iZH2EZodlixEdZUCTXgq43WsDUhxX05s7cE+p
H5DuSCHtoo2WHvGKAposwRDm2f3YVWQ2Xyb2ahNt69LYHHWrO+XQ60YYTa3r8Gn3
7dFR3I016/jyn5DeEVaglvS1dfj2UG4ybR4KkMfcKd94X0rKvz3wzAhHIh+hwMtv
sVk7V4vSnKf2mJXwIVECTolnEJEkCjWjjymgUJYKT8yN7JnAsHRcvMa6kWwIGrLp
oQCEaJwYM6ynCRS989pLt3vA2iu5VkYhiHXJ9Ds/5b5yzhzmj+ymzKbFKrrUUrmn
+2Jp1K0CgYEAw8BchALsD/+JuoXjinA14MH7PZjIsXyhtPk+c4pk42iMNyg1J8XF
Y/ITepLYsl2bZqQI1jOJdDqsTwIsva9r749lsmkYI3VOxhi7+qBK0sThR66C87lX
iU2QpnZ9NloC6ort4a3MEvZ/gRQcXdBrNlNoza2p7PHAVDTnsdSrNKUCgYEAxCQV
uo85oZyfnMufn/gcI9IeYOgiB0tO3a8cAFX2wQW1y935t6Z13ApUQc4EnCOH7ZBc
td5kT+xGdRWnfPZ38FM1dd5MBdGE69s3q8pJDUExSgNLqaF6/5bD32qui66L3ugu
eMjxrzqJsc2uQTPCs18SGsyRmf54DpY8HglOmUcCgYAGRDgx+a347SNJl1OrcOAo
q80RMbzrAaRjmL8JD9se9I/YjC73cPtasbsx51WMkDaTWJj30nqJ//7YIKeyAtWf
u6Vzyq19JRo6eTw7T7pVePwFQW7rwnks6hDBY3WqscL6IyxuVxP7X2zBgxVNY4ir
Gox2WSLhdPPFPlRUewxoCQKBgAJvqE1u5fpZ5ame5dao0ECppXLyrymEB/C88g4X
Az+WgJGNqkJbsO8QuccvdeMylcefmWcw4fIULzPZFwF4VjkH74wNPMh9t7buPBzI
IGwnuSMAM3ph5RMzni8yNgTKIDaej6U0abwRcBBjS5zHtc1giusGS3CsNnWH7Cs7
VlyVAoGBAK+prq9t9x3tC3NfCZH8/Wfs/X0T1qm11RiL5+tOhmbguWAqSSBy8OjX
Yh8AOXrFuMGldcaTXxMeiKvI2cyybnls1MFsPoeV/fSMJbex7whdeJeTi66NOSKr
oftUHvkHS0Vv/LicMEOufFGslb4T9aPJ7oyhoSlz9CfAutDWk/q/
-----END RSA PRIVATE KEY-----

View File

@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDVjCCAj6gAwIBAgIULh42yRefYlRRl1hvt055LrUH0HwwDQYJKoZIhvcNAQEL
BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l
cmF0ZWQgQ0EwHhcNMjAwMjI4MDMzNzIwWhcNMjMwMjI3MDMzNzIwWjATMREwDwYD
VQQDEwhpbnN0YW5jZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIUP
t267NN21z+3ukajej8eojSXwP6zHxy7CUAp+sQ7bTq2XCKxkYX3CW9ThcS4cV9mL
ayYdWEYnbEDGYPQDo7Wk3Ih5OEXTMZb/yNEx5D4S2lGMOS5bCDdYx6GvwCMG4jNx
aMktosaxpprAJiHh2oLgQk0hQc/a9JfMo6kJKtuhjxsxjxLwcOHhuaUD7NS0Pjop
CJkSYcrL+nnQPQjKe4uLhAbSyiX914h4QX0CJ0e4z1ccdDX2PFWTrwaIf//vQhCR
wP2YKdfjR0JB4oDAlu85GsIs2cFLPysM5ufuNZO4fCr8uOwloKI8zZ2HhlIfBEcY
Gcy4g9N/9epmxMXZlGcCAwEAAaOBgDB+MB0GA1UdDgQWBBRefYm8DHHDdkTPHhS1
HEUwTb2uiDAfBgNVHSMEGDAWgBSWAlip9eoPmnG4p4OFZeOUBlAbNDAxBgNVHREE
KjAogglsb2NhbGhvc3SHBH8AAAGHEAAAAAAAAAAAAAAAAAAAAAGCA2VzMTAJBgNV
HRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQC+pauqM2wJjQaHyHu+kIm59P4b/5Oj
IH1cYCQfMB7Y2UMLxp0ew+f7o7zzE2DA52YYFDWy6J5DVWtSBPyeFGgX+RH+aA+9
Iv4cc9QpAs6aFjncorHrzNOrWLgCHIeRAxTR0CAkeP2dUZfDBuMpRyP6rAsYzyLH
Rb3/BfYJSI5vxgt5Ke49Y/ljDKFJTyDmAVrHQ4JWrseYE1UZ2eDkBXeiRlYE/QtB
YsrUSqdL6zvFZyUcilxDUUabNcA+GgeGZ2lAEA90F8vwi62QwRXo3Iv1Hz+6xc43
nFofDK9D8/qkrUD9iuhpx1974QwPhwWyjn9RZRpbZA4ngRL+szdRXR4N
-----END CERTIFICATE-----

View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAhQ+3brs03bXP7e6RqN6Px6iNJfA/rMfHLsJQCn6xDttOrZcI
rGRhfcJb1OFxLhxX2YtrJh1YRidsQMZg9AOjtaTciHk4RdMxlv/I0THkPhLaUYw5
LlsIN1jHoa/AIwbiM3FoyS2ixrGmmsAmIeHaguBCTSFBz9r0l8yjqQkq26GPGzGP
EvBw4eG5pQPs1LQ+OikImRJhysv6edA9CMp7i4uEBtLKJf3XiHhBfQInR7jPVxx0
NfY8VZOvBoh//+9CEJHA/Zgp1+NHQkHigMCW7zkawizZwUs/Kwzm5+41k7h8Kvy4
7CWgojzNnYeGUh8ERxgZzLiD03/16mbExdmUZwIDAQABAoIBAEwhjulLMVc9JEfV
PP/qv0cUOBYh3LzF3T/yq4slq7Z9YgnOJYdFM8aZgqNNjc09KEJvE5JOLeiNu9Ff
768Nugg+2HM5MCo7SN9FYCfZLOcbMFCCM2FDcnMAV9A512vzD08xryuT8dNPZ6yZ
DfhK2hQRrb2lrpr3gwSrcGRRu3THqvq7X1RIjpLV3teDMeP8rQPAlpj8fmP+kdVV
5y1ihiDIo87McihG9FMavJtBDXQkUEuVw6eIeir8L/zHHD/ZwhYjNHZGWbrB88sz
CkJkfWh/FlA63tCVdJzkmnERALLTVy9mR0Sq6sUlnFhFNO2BRdWgYLrcp9McfTJC
e8+WsSECgYEAuwQ3nAaFL0jqYu1AREyKT/f3WUenf2UsX7dwwV2/yFtQvkzW7ji4
uZLnfUnZBojtHf35dRo+hDgtvhZhgZNAuPPsbOl/EIMTcbChEqV/3CSTFlhLFM1d
hfM9PoM+Bt/pyUNabjD1sWM0X7WeUhzcddshY3S4daBsNsLuOzweRRcCgYEAtiSS
4qiiGafYsY7gOHuAlOhs/00+1uWIFEHKgoHM9vzCxDN3LCmBdynHk8ZE2TAdhw+l
7xpu6LUxKQDfGmVZa9Epg0kQmVq9c54oQP57pJ3tR+68++insEkfnaZH8jblfq2s
sSkFrY3pdS19edq60nuft64kswKRUUkamCXTXTECgYBdoSfiMpV9bekC7DsPtq5M
iR3KEgi2zEViCmomNTRuL+GF1NyKWdWJ+xVwcYd5MRZdvKimyyPfeGzWTUg14i42
KtEEWgZmkukqMz8BIeCYq6sENeIpIQQgqv3PjU+Bi5r1S4Y7wsFPNRakkD4aaB6r
1rCppWcwZMeoxwEUoO2aswKBgBdDIIdWJi3EpAY5SyWrkEZ0UMdiZC4p7nE33ddB
IJ5CtdU9BXFcc652ZYjX/58FaCABvZ2F8LhDu92SwOusGfmNIxIjWL1dO2jywA1c
8wmZKd7P/M7nbdMz45fMzs9+d1zwbWfK53C8+R4AC1BuwQF0zHc3BHTgVRLelUjt
O8thAoGAdO2gHIqEsZzTgbvLbsh52eVbumjfNGnrnEv1fjb+o+/wAol8dymcmzbL
bZCRzoyA0qwU9kdPFgX46H6so6o1tUM2GQtVFoT6kDnPv7EkLQK0C4cDh6OOHxDU
NPvr/9fHhQd9EDWDvS1JnVMAdKDO6ELp3SoKGGmCXR2QplnqWAk=
-----END RSA PRIVATE KEY-----

67
.buildkite/functions/cleanup.sh Executable file
View File

@ -0,0 +1,67 @@
#!/usr/bin/env bash
#
# Shared cleanup routines between different steps
#
# Please source .buildkite/functions/imports.sh as a whole not just this file
#
# Version 1.0.0
# - Initial version after refactor
function cleanup_volume {
if [[ "$(docker volume ls -q -f name=$1)" ]]; then
echo -e "\033[34;1mINFO:\033[0m Removing volume $1\033[0m"
(docker volume rm "$1") || true
fi
}
function container_running {
if [[ "$(docker ps -q -f name=$1)" ]]; then
return 0;
else return 1;
fi
}
function cleanup_node {
if container_running "$1"; then
echo -e "\033[34;1mINFO:\033[0m Removing container $1\033[0m"
(docker container rm --force --volumes "$1") || true
fi
if [[ -n "$1" ]]; then
echo -e "\033[34;1mINFO:\033[0m Removing volume $1-${suffix}-data\033[0m"
cleanup_volume "$1-${suffix}-data"
fi
}
function cleanup_network {
if [[ "$(docker network ls -q -f name=$1)" ]]; then
echo -e "\033[34;1mINFO:\033[0m Removing network $1\033[0m"
(docker network rm "$1") || true
fi
}
function cleanup_trap {
status=$?
set +x
if [[ "$DETACH" != "true" ]]; then
echo -e "\033[34;1mINFO:\033[0m clean the network if not detached (start and exit)\033[0m"
cleanup_all_in_network "$1"
fi
# status is 0 or SIGINT
if [[ "$status" == "0" || "$status" == "130" ]]; then
echo -e "\n\033[32;1mSUCCESS run-tests\033[0m"
exit 0
else
echo -e "\n\033[31;1mFAILURE during run-tests\033[0m"
exit ${status}
fi
};
function cleanup_all_in_network {
if [[ -z "$(docker network ls -q -f name="^$1\$")" ]]; then
echo -e "\033[34;1mINFO:\033[0m $1 is already deleted\033[0m"
return 0
fi
containers=$(docker network inspect -f '{{ range $key, $value := .Containers }}{{ printf "%s\n" .Name}}{{ end }}' $1)
while read -r container; do
cleanup_node "$container"
done <<< "$containers"
cleanup_network $1
echo -e "\033[32;1mSUCCESS:\033[0m Cleaned up and exiting\033[0m"
};

60
.buildkite/functions/imports.sh Executable file
View File

@ -0,0 +1,60 @@
#!/usr/bin/env bash
#
# Sets up all the common variables and imports relevant functions
#
# Version 1.0.1
# - Initial version after refactor
# - Validate STACK_VERSION asap
function require_stack_version() {
if [[ -z $STACK_VERSION ]]; then
echo -e "\033[31;1mERROR:\033[0m Required environment variable [STACK_VERSION] not set\033[0m"
exit 1
fi
}
require_stack_version
if [[ -z $es_node_name ]]; then
# only set these once
set -euo pipefail
export TEST_SUITE=${TEST_SUITE-free}
export RUNSCRIPTS=${RUNSCRIPTS-}
export DETACH=${DETACH-false}
export CLEANUP=${CLEANUP-false}
export es_node_name=instance
export elastic_password=changeme
export elasticsearch_image=elasticsearch
export elasticsearch_scheme="https"
if [[ $TEST_SUITE != "platinum" ]]; then
export elasticsearch_scheme="http"
fi
export elasticsearch_url=${elasticsearch_scheme}://elastic:${elastic_password}@${es_node_name}:9200
export external_elasticsearch_url=${elasticsearch_url/$es_node_name/localhost}
export elasticsearch_container="${elasticsearch_image}:${STACK_VERSION}"
export suffix=rest-test
export moniker=$(echo "$elasticsearch_container" | tr -C "[:alnum:]" '-')
export network_name=${moniker}${suffix}
export ssl_cert="${script_path}/certs/testnode.crt"
export ssl_key="${script_path}/certs/testnode.key"
export ssl_ca="${script_path}/certs/ca.crt"
fi
export script_path=$(dirname $(realpath -s $0))
source $script_path/functions/cleanup.sh
source $script_path/functions/wait-for-container.sh
trap "cleanup_trap ${network_name}" EXIT
if [[ "$CLEANUP" == "true" ]]; then
cleanup_all_in_network $network_name
exit 0
fi
echo -e "\033[34;1mINFO:\033[0m Creating network $network_name if it does not exist already \033[0m"
docker network inspect "$network_name" > /dev/null 2>&1 || docker network create "$network_name"

View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
#
# Exposes a routine scripts can call to wait for a container if that container set up a health command
#
# Please source .buildkite/functions/imports.sh as a whole not just this file
#
# Version 1.0.1
# - Initial version after refactor
# - Make sure wait_for_contiainer is silent
function wait_for_container {
set +x
until ! container_running "$1" || (container_running "$1" && [[ "$(docker inspect -f "{{.State.Health.Status}}" ${1})" != "starting" ]]); do
echo ""
docker inspect -f "{{range .State.Health.Log}}{{.Output}}{{end}}" ${1}
echo -e "\033[34;1mINFO:\033[0m waiting for node $1 to be up\033[0m"
sleep 2;
done;
# Always show logs if the container is running, this is very useful both on CI as well as while developing
if container_running $1; then
docker logs $1
fi
if ! container_running $1 || [[ "$(docker inspect -f "{{.State.Health.Status}}" ${1})" != "healthy" ]]; then
cleanup_all_in_network $2
echo
echo -e "\033[31;1mERROR:\033[0m Failed to start $1 in detached mode beyond health checks\033[0m"
echo -e "\033[31;1mERROR:\033[0m dumped the docker log before shutting the node down\033[0m"
return 1
else
echo
echo -e "\033[32;1mSUCCESS:\033[0m Detached and healthy: ${1} on docker network: ${network_name}\033[0m"
return 0
fi
}

140
.buildkite/make.mjs Normal file
View File

@ -0,0 +1,140 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/* global $ argv */
'use strict'
import 'zx/globals'
import { readFile, writeFile } from 'fs/promises'
import assert from 'assert'
import { join } from 'desm'
import semver from 'semver'
// xz/globals loads minimist-parsed args as a global `argv`, but it
// interprets args like '8.10' as numbers and shortens them to '8.1'.
// so we have to import and configure minimist ourselves.
import minimist from 'minimist'
const argv = minimist(process.argv.slice(2), { string: ['_', 'task'] })
assert(typeof argv.task === 'string', 'Missing task parameter')
switch (argv.task) {
case 'release':
release(argv._).catch(onError)
break
case 'bump':
bump(argv._).catch(onError)
break
case 'codegen':
codegen(argv._).catch(onError)
break
default:
console.log(`Unknown task: ${argv.task}`)
process.exit(1)
}
async function release (args) {
assert(args.length === 2, 'Release task expects two parameters')
let [version, outputFolder] = args
if (process.env.WORKFLOW === 'snapshot' && !version.endsWith('SNAPSHOT')) {
version = `${version}-SNAPSHOT`
}
await bump([version])
const packageJson = JSON.parse(await readFile(
join(import.meta.url, '..', 'package.json'),
'utf8'
))
await $`npm run build`
await $`npm pack`
await $`zip elasticsearch-js-${version}.zip elastic-elasticsearch-${packageJson.version}.tgz`
await $`rm elastic-elasticsearch-${packageJson.version}.tgz`
await $`mv ${join(import.meta.url, '..', `elasticsearch-js-${version}.zip`)} ${join(import.meta.url, '..', outputFolder, `elasticsearch-js-${version}.zip`)}`
}
async function bump (args) {
assert(args.length === 1, 'Bump task expects one parameter')
let [version] = args
const packageJson = JSON.parse(await readFile(
join(import.meta.url, '..', 'package.json'),
'utf8'
))
if (version.split('.').length === 2) version = `${version}.0`
const cleanVersion = semver.clean(version.includes('SNAPSHOT') ? version.split('-')[0] : version)
assert(semver.valid(cleanVersion), `${cleanVersion} is not seen as a valid semver version. raw version: ${version}`)
packageJson.version = cleanVersion
packageJson.versionCanary = `${cleanVersion}-canary.0`
await writeFile(
join(import.meta.url, '..', 'package.json'),
JSON.stringify(packageJson, null, 2),
'utf8'
)
const pipeline = await readFile(join(import.meta.url, '..', '.buildkite', 'pipeline.yml'), 'utf8')
await writeFile(
join(import.meta.url, '..', '.buildkite', 'pipeline.yml'),
pipeline.replace(/STACK_VERSION: [0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?/, `STACK_VERSION: ${cleanVersion}`),
'utf8'
)
}
// this command can only be executed locally for now
async function codegen (args) {
assert(args.length === 1, 'Codegen task expects one parameter')
const version = args[0].toString()
const clientGeneratorPath = join(import.meta.url, '..', '..', 'elastic-client-generator-js')
const isGeneratorCloned = await $`[[ -d ${clientGeneratorPath} ]]`.exitCode === 0
assert(isGeneratorCloned, 'You must clone the elastic-client-generator-js first')
await $`npm install --prefix ${clientGeneratorPath}`
// generate elasticsearch client. this command will take a while!
if (version === 'main') {
await $`npm run elasticsearch --prefix ${clientGeneratorPath} -- --version main`
} else {
await $`npm run elasticsearch --prefix ${clientGeneratorPath} -- --version ${version.split('.').slice(0, 2).join('.')}`
}
// clean up fixable linter issues
await $`npm run fix --prefix ${clientGeneratorPath}`
await $`rm -rf ${join(import.meta.url, '..', 'src', 'api')}`
await $`mkdir ${join(import.meta.url, '..', 'src', 'api')}`
await $`cp -R ${join(import.meta.url, '..', '..', 'elastic-client-generator-js', 'output')}/* ${join(import.meta.url, '..', 'src', 'api')}`
await $`mv ${join(import.meta.url, '..', 'src', 'api', 'reference.asciidoc')} ${join(import.meta.url, '..', 'docs', 'reference.asciidoc')}`
await $`npm run build`
// run docs example generation
if (version === 'main') {
await $`node ./scripts/generate-docs-examples.js`
} else {
await $`node ./scripts/generate-docs-examples.js ${version.split('.').slice(0, 2).join('.')}`
}
}
function onError (err) {
console.log(err)
process.exit(1)
}

32
.buildkite/pipeline.yml Normal file
View File

@ -0,0 +1,32 @@
---
steps:
- label: ":elasticsearch: :javascript: ES JavaScript ({{ matrix.nodejs }}) Test Suite: {{ matrix.suite }}"
agents:
provider: "gcp"
env:
NODE_VERSION: "{{ matrix.nodejs }}"
TEST_SUITE: "{{ matrix.suite }}"
STACK_VERSION: 8.16.0
matrix:
setup:
suite:
- "free"
- "platinum"
nodejs:
- "18"
- "20"
- "22"
command: ./.buildkite/run-tests.sh
artifact_paths: "./junit-output/junit-*.xml"
- wait: ~
continue_on_failure: true
- label: ":junit: Test results"
agents:
provider: "gcp"
image: family/core-ubuntu-2204
plugins:
- junit-annotate#v2.4.1:
artifacts: "junit-output/junit-*.xml"
job-uuid-file-pattern: "junit-(.*).xml"
fail-build-on-error: true
failure-format: file

View File

@ -0,0 +1,19 @@
{
"jobs": [
{
"enabled": true,
"pipeline_slug": "elasticsearch-js-integration-tests",
"allowed_repo_permissions": ["admin", "write"],
"build_on_commit": true,
"skip_ci_on_only_changed": [
"\\.md$",
"\\.asciidoc$",
"^docs\\/",
"^scripts\\/",
"^catalog-info\\.yaml$",
"^test\\/unit\\/",
"^\\.github\\/"
]
}
]
}

31
.buildkite/run-client.sh Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
#
# Once called Elasticsearch should be up and running
#
script_path=$(dirname "$(realpath -s "$0")")
set -euo pipefail
repo=$(pwd)
export NODE_VERSION=${NODE_VERSION:-18}
echo "--- :javascript: Building Docker image"
docker build \
--file "$script_path/Dockerfile" \
--tag elastic/elasticsearch-js \
--build-arg NODE_VERSION="$NODE_VERSION" \
.
echo "--- :javascript: Running $TEST_SUITE tests"
mkdir -p "$repo/junit-output"
docker run \
--network="${network_name}" \
--env "TEST_ES_SERVER=${elasticsearch_url}" \
--env "ELASTIC_PASSWORD=${elastic_password}" \
--env "TEST_SUITE=${TEST_SUITE}" \
--env "ELASTIC_USER=elastic" \
--env "BUILDKITE=true" \
--volume "$repo/junit-output:/junit-output" \
--name elasticsearch-js \
--rm \
elastic/elasticsearch-js \
bash -c "npm run test:integration; [ -f ./$TEST_SUITE-report-junit.xml ] && mv ./$TEST_SUITE-report-junit.xml /junit-output/junit-$BUILDKITE_JOB_ID.xml || echo 'No JUnit artifact found'"

155
.buildkite/run-elasticsearch.sh Executable file
View File

@ -0,0 +1,155 @@
#!/usr/bin/env bash
#
# Launch one or more Elasticsearch nodes via the Docker image,
# to form a cluster suitable for running the REST API tests.
#
# Export the STACK_VERSION variable, eg. '8.0.0-SNAPSHOT'.
# Export the TEST_SUITE variable, eg. 'free' or 'platinum' defaults to 'free'.
# Export the NUMBER_OF_NODES variable to start more than 1 node
# Version 1.6.1
# - Initial version of the run-elasticsearch.sh script
# - Deleting the volume should not dependent on the container still running
# - Fixed `ES_JAVA_OPTS` config
# - Moved to STACK_VERSION and TEST_VERSION
# - Refactored into functions and imports
# - Support NUMBER_OF_NODES
# - Added 5 retries on docker pull for fixing transient network errors
# - Added flags to make local CCR configurations work
# - Added action.destructive_requires_name=false as the default will be true in v8
# - Added ingest.geoip.downloader.enabled=false as it causes false positives in testing
# - Moved ELASTIC_PASSWORD and xpack.security.enabled to the base arguments for "Security On by default"
# - Use https only when TEST_SUITE is "platinum", when "free" use http
# - Set xpack.security.enabled=false for "free" and xpack.security.enabled=true for "platinum"
script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail
echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on separate terminals \033[0m"
cleanup_node $es_node_name
master_node_name=${es_node_name}
cluster_name=${moniker}${suffix}
# Set vm.max_map_count kernel setting to 262144
if [ "$(sysctl vm.max_map_count)" != 'vm.max_map_count = 262144' ]; then
echo "vm.max_map_count may be too low. resetting."
sudo sysctl -w vm.max_map_count=262144
fi
declare -a volumes
environment=($(cat <<-END
--env ELASTIC_PASSWORD=$elastic_password
--env node.name=$es_node_name
--env cluster.name=$cluster_name
--env cluster.initial_master_nodes=$master_node_name
--env discovery.seed_hosts=$master_node_name
--env cluster.routing.allocation.disk.threshold_enabled=false
--env bootstrap.memory_lock=true
--env node.attr.testattr=test
--env path.repo=/tmp
--env repositories.url.allowed_urls=http://snapshot.test*
--env action.destructive_requires_name=false
--env ingest.geoip.downloader.enabled=false
--env cluster.deprecation_indexing.enabled=false
END
))
if [[ "$TEST_SUITE" == "platinum" ]]; then
environment+=($(cat <<-END
--env xpack.security.enabled=true
--env xpack.license.self_generated.type=trial
--env xpack.security.http.ssl.enabled=true
--env xpack.security.http.ssl.verification_mode=certificate
--env xpack.security.http.ssl.key=certs/testnode.key
--env xpack.security.http.ssl.certificate=certs/testnode.crt
--env xpack.security.http.ssl.certificate_authorities=certs/ca.crt
--env xpack.security.transport.ssl.enabled=true
--env xpack.security.transport.ssl.verification_mode=certificate
--env xpack.security.transport.ssl.key=certs/testnode.key
--env xpack.security.transport.ssl.certificate=certs/testnode.crt
--env xpack.security.transport.ssl.certificate_authorities=certs/ca.crt
END
))
volumes+=($(cat <<-END
--volume $ssl_cert:/usr/share/elasticsearch/config/certs/testnode.crt
--volume $ssl_key:/usr/share/elasticsearch/config/certs/testnode.key
--volume $ssl_ca:/usr/share/elasticsearch/config/certs/ca.crt
END
))
else
environment+=($(cat <<-END
--env node.roles=data,data_cold,data_content,data_frozen,data_hot,data_warm,ingest,master,ml,remote_cluster_client,transform
--env xpack.security.enabled=false
--env xpack.security.http.ssl.enabled=false
END
))
fi
cert_validation_flags=""
if [[ "$TEST_SUITE" == "platinum" ]]; then
cert_validation_flags="--insecure --cacert /usr/share/elasticsearch/config/certs/ca.crt --resolve ${es_node_name}:443:127.0.0.1"
fi
echo "--- :elasticsearch: Environment setup"
echo "TEST_SUITE: $TEST_SUITE"
echo "Elasticsearch URL: $elasticsearch_url"
echo "Elasticsearch External URL: $external_elasticsearch_url"
echo "--- :elasticsearch: Running container"
# Pull the container, retry on failures up to 5 times with
# short delays between each attempt. Fixes most transient network errors.
docker_pull_attempts=0
until [ "$docker_pull_attempts" -ge 5 ]
do
docker pull docker.elastic.co/elasticsearch/"$elasticsearch_container" && break
docker_pull_attempts=$((docker_pull_attempts+1))
echo "Failed to pull image, retrying in 10 seconds (retry $docker_pull_attempts/5)..."
sleep 10
done
NUMBER_OF_NODES=${NUMBER_OF_NODES-1}
http_port=9200
for (( i=0; i<$NUMBER_OF_NODES; i++, http_port++ )); do
node_name=${es_node_name}$i
node_url=${external_elasticsearch_url/9200/${http_port}}$i
if [[ "$i" == "0" ]]; then node_name=$es_node_name; fi
environment+=($(cat <<-END
--env node.name=$node_name
END
))
echo "$i: $http_port $node_url "
volume_name=${node_name}-${suffix}-data
volumes+=($(cat <<-END
--volume $volume_name:/usr/share/elasticsearch/data${i}
END
))
# make sure we detach for all but the last node if DETACH=false (default) so all nodes are started
local_detach="true"
if [[ "$i" == "$((NUMBER_OF_NODES-1))" ]]; then local_detach=$DETACH; fi
echo -e "\033[34;1mINFO:\033[0m Starting container $node_name \033[0m"
set -x
docker run \
--name "$node_name" \
--network "$network_name" \
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g -da:org.elasticsearch.xpack.ccr.index.engine.FollowingEngineAssertions" \
"${environment[@]}" \
"${volumes[@]}" \
--publish "$http_port":9200 \
--ulimit nofile=65536:65536 \
--ulimit memlock=-1:-1 \
--detach="$local_detach" \
--health-cmd="curl $cert_validation_flags --fail $elasticsearch_url/_cluster/health || exit 1" \
--health-interval=2s \
--health-retries=20 \
--health-timeout=2s \
--rm \
docker.elastic.co/elasticsearch/"$elasticsearch_container";
set +x
if wait_for_container "$es_node_name" "$network_name"; then
echo -e "\033[32;1mSUCCESS:\033[0m Running on: $node_url\033[0m"
fi
done

16
.buildkite/run-tests.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# Script to run Elasticsearch container and Elasticsearch client integration tests on Buildkite
#
# Version 0.1
#
script_path=$(dirname "$(realpath -s "$0")")
source "$script_path/functions/imports.sh"
set -euo pipefail
echo "--- :elasticsearch: Starting Elasticsearch"
DETACH=true bash "$script_path/run-elasticsearch.sh"
echo "+++ :javascript: Run Client"
bash "$script_path/run-client.sh"

View File

@ -1,11 +0,0 @@
ARG NODE_JS_VERSION=10
FROM node:${NODE_JS_VERSION}
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
COPY package*.json ./
RUN npm install
COPY . .

View File

@ -1,20 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIDSTCCAjGgAwIBAgIUIwN+0zglsexRKwE1RGHvlCcmrdwwDQYJKoZIhvcNAQEL
BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l
cmF0ZWQgQ0EwHhcNMTkwMjEzMDcyMjQwWhcNMjIwMjEyMDcyMjQwWjA0MTIwMAYD
VQQDEylFbGFzdGljIENlcnRpZmljYXRlIFRvb2wgQXV0b2dlbmVyYXRlZCBDQTCC
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANILs0JO0e7x29zeVx21qalK
XKdX+AMlGJPH75wWO/Jq6YHtxt1wYIg762krOBXfG6JsFSOIwIv5VrzGGRGjSPt9
OXQyXrDDiQvsBT3rpzLNdDs7KMl2tZswwv7w9ujgud0cYnS1MOpn81rfPc73DvMg
xuhplofDx6fn3++PjVRU2FNiIVWyEoaxRjCeGPMBubKZYaYbQA6vYM4Z+ByG727B
AyAER3t7xmvYti/EoO2hv2HQk5zgcj/Oq3AJKhnt8LH8fnfm3TnYNM1htvXqhN05
vsvhvm2PHfnA5qLlSr/3W0aI/U/PqfsFDCgyRV097sMIaKkmavb0Ue7aQ7lgtp0C
AwEAAaNTMFEwHQYDVR0OBBYEFDRKlCMowWR1rwxE0d1lTEQe5O71MB8GA1UdIwQY
MBaAFDRKlCMowWR1rwxE0d1lTEQe5O71MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI
hvcNAQELBQADggEBAKbCJ95EBpeuvF70KEt6QU70k/SH1NRvM9YzKryV0D975Jvu
HOSm9HgSTULeAUFZIa4oYyf3QUfVoI+2T/aQrfXA3gfrJWsHURkyNmiHOFAbYHqi
xA6i249G2GTEjc1+le/M2N2CcDKAmurW6vSGK4upXQbPd6KmnhHREX74zkWjnOa+
+tibbSSOCT4Tmja2DbBxAPuivU9IB1g/hIUmbYQqKffQrBJA0658tz6w63a/Q7xN
pCvvbSgiMZ6qcVIcJkBT2IooYie+ax45pQECHthgIUcQAzfmIfqlU0Qfl8rDgAmn
0c1o6HQjKGU2aVGgSRuaaiHaSZjbPIZVS51sOoI=
-----END CERTIFICATE-----

View File

@ -1,19 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIDIjCCAgqgAwIBAgIUI4QU6jA1dYSCbdIA6oAb2TBEluowDQYJKoZIhvcNAQEL
BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l
cmF0ZWQgQ0EwHhcNMTkwMjEzMDcyMzEzWhcNMjIwMjEyMDcyMzEzWjATMREwDwYD
VQQDEwhpbnN0YW5jZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJeT
yOy6EAScZxrULKjHePciiz38grivCrhFFV+dThaRCcl3DhDzb9Eny5q5iEw3WvLQ
Rqmf01jncNIhaocTt66VqveXaMubbE8O0LcG6e4kpFO+JtnVF8JTARTc+ux/1uD6
hO1VG/HItM7WQrQxh4hfB2u1AX2YQtoqEtXXEC+UHWfl4QzuzXjBnKCkO/L9/6Tf
yNFQWXxKnIiTs8Xm9sEhhSCBJPlLTQu+MX4vR2Uwj5XZmflDUr+ZTenl9qYxL6b3
SWhh/qEl4GAj1+tS7ZZOxE0237mUh3IIFYSWSaMm8K2m/BYHkLNWL5B1dMic0lsv
osSoYrQuCef4HQMCitsCAwEAAaNNMEswHQYDVR0OBBYEFFMg4l1GLW8lYbwASY+r
YeWYRzIiMB8GA1UdIwQYMBaAFDRKlCMowWR1rwxE0d1lTEQe5O71MAkGA1UdEwQC
MAAwDQYJKoZIhvcNAQELBQADggEBAEQrgh1xALpumQTzsjxFRGque/vlKTgRs5Kh
xtgapr6wjIbdq7dagee+4yNOKzS5lGVXCgwrJlHESv9qY0uumT/33vK2uduJ7NAd
fR2ZzyBnhMX+mkYhmGrGYCTUMUIwOIQYa4Evis4W+LHmCIDG03l7gLHfdIBe9VMO
pDZum8f6ng0MM49s8/rXODNYKw8kFyUhnfChqMi/2yggb1uUIfKlJJIchkgYjE13
zuC+fjo029Pq1jeMIdxugLf/7I/8NiW1Yj9aCXevUXG1qzHFEuKAinBXYOZO/vWS
LaEqOhwrzNynwgGpYAr7Rfgv4AflltYIIav4PZT03P7fbyAAf8s=
-----END CERTIFICATE-----

View File

@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAl5PI7LoQBJxnGtQsqMd49yKLPfyCuK8KuEUVX51OFpEJyXcO
EPNv0SfLmrmITDda8tBGqZ/TWOdw0iFqhxO3rpWq95doy5tsTw7Qtwbp7iSkU74m
2dUXwlMBFNz67H/W4PqE7VUb8ci0ztZCtDGHiF8Ha7UBfZhC2ioS1dcQL5QdZ+Xh
DO7NeMGcoKQ78v3/pN/I0VBZfEqciJOzxeb2wSGFIIEk+UtNC74xfi9HZTCPldmZ
+UNSv5lN6eX2pjEvpvdJaGH+oSXgYCPX61Ltlk7ETTbfuZSHcggVhJZJoybwrab8
FgeQs1YvkHV0yJzSWy+ixKhitC4J5/gdAwKK2wIDAQABAoIBAQCRFTJna/xy/WUu
59FLR4qAOj8++JgCwACpue4oU7/vl6nffSYokWoAr2+RzG4qTX2vFi3cpA8+dGCn
sLZvTi8tWzKGxBTZdg2oakzaMzLr74SeZ052iCGyrZJGbvF6Ny7srr1XEXSq6+os
ZCb6pMHOhO7saBdiKMAsY8MdjTl/33AduuE6ztqv+L92xTr2g4QlbT1KvWlEgppU
k4Gy7zdETkPBTSH/17ZwyGJoJICIAhbL4IpmOM4dPIg8nFkVPPpy6p0z4uGjtgnK
nreZ2EKMzCafBaHn7A77gpi0OrQdl6pe0fsGqv/323YjCJPbwwl5TsoNq44DzwiX
3M7XiVJxAoGBAOCne56vdN4uZmCgLVGT2JSUNVPOu4bfjrxWH6cslzrPT2Zhp3lO
M4axZ3gmcervV252YEZXntXDHHCSfrECllRN1WFD63XmyQ/CkhuvZkkeRHfzL1TE
EdqHOTqs4sRETZ7+RITFC81DZQkWWOKeyXMjyPBqd7RnThQHijB1c8Y5AoGBAKy6
CVKBx+zz5crVD0tz4UhOmz1wRNN0CL0l+FXRuFSgbzMIvwpfiqe25crgeLHe2M2/
TogdWbjZ2nUZQTzoRsSkQ6cKHpj+G/gWurp/UcHHXFVwgLSPF7c3KHDtiYq7Vqw0
bvmhM03LI6+ZIPRV7hLBr7WP7UmpAiREMF7tTnmzAoGBAIkx3w3WywFQxtblmyeB
qbd7F2IaE23XoxyjX+tBEQ4qQqwcoSE0v8TXHIBEwjceeX+NLVhn9ClJYVniLRq+
oL3VVqVyzB4RleJZCc98e3PV1yyFx/b1Uo3pHOsXX9lKeTjKwV9v0rhFGzPEgP3M
yOvXA8TG0FnM6OLUg/D6GX0JAoGAMuHS4TVOGeV3ahr9mHKYiN5vKNgrzka+VEod
L9rJ/FQOrfADpyCiDen5I5ygsXU+VM3oanyK88NpcVlxOGoMft0M+OYoQVWKE7lO
ZKYhBX6fGqQ7pfUJPXXIOgwfmni5fZ0sm+j63g3bg10OsiumKGxaQJgXhL1+3gQg
Y7ZwibUCgYEAlZoFFvkMLjpOSaHk1z5ZZnt19X0QUIultBwkumSqMPm+Ks7+uDrx
thGUCoz4ecr/ci4bIUY7mB+zfAbqnBOMxreJqCRbAIuRypo1IlWkTp8DywoDOfMW
NfzjVmzJ7EJu44nGmVAi1jw4Pbseivvi1ujMCoPgaE8I1uSh144bwN8=
-----END RSA PRIVATE KEY-----

View File

@ -1,94 +0,0 @@
version: '3.2'
services:
client-oss:
image: docker.elastic.co/clients/elasticsearch-js:${NODE_JS_VERSION:-10}
build:
context: ..
dockerfile: .ci/Dockerfile
args:
NODE_JS_VERSION: ${NODE_JS_VERSION:-10}
CODECOV_TOKEN: ${CODECOV_TOKEN}
environment:
- "TEST_ES_SERVER=http://elasticsearch-oss:9200"
volumes:
- ..:/usr/src/app
# This will mount the node_modules directory
# to the host machine using the buildtime directory.
- /usr/src/app/node_modules
- esvol:/tmp
networks:
- esnet-oss
depends_on:
- elasticsearch-oss
elasticsearch-oss:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
volumes:
- esvol:/tmp
networks:
- esnet-oss
environment:
- path.repo=/tmp
- "repositories.url.allowed_urls=http://snapshot.*"
- node.attr.testattr=test
- bootstrap.memory_lock=false
- "discovery.type=single-node"
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
client-platinum:
image: docker.elastic.co/clients/elasticsearch-js:${NODE_JS_VERSION:-10}
build:
context: ..
dockerfile: .ci/Dockerfile
args:
NODE_JS_VERSION: ${NODE_JS_VERSION:-10}
environment:
- "TEST_ES_SERVER=https://elastic:changeme@elasticsearch-platinum:9200"
volumes:
- ..:/usr/src/app
# This will mount the node_modules directory
# to the host machine using the buildtime directory.
- /usr/src/app/node_modules
- esvol:/tmp
networks:
- esnet-platinum
depends_on:
- elasticsearch-platinum
# there is not need to run again also the unit test
command: ["npm", "run", "test:integration"]
elasticsearch-platinum:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-7.0.0-beta1}
ports:
- "9200:9200"
networks:
- esnet-platinum
environment:
- "node.attr.testattr=test"
- "path.repo=/tmp"
- "repositories.url.allowed_urls=http://snapshot.*"
- "discovery.type=single-node"
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- "ELASTIC_PASSWORD=changeme"
- "xpack.security.enabled=true"
- "xpack.license.self_generated.type=trial"
- "xpack.security.http.ssl.enabled=true"
- "xpack.security.http.ssl.verification_mode=certificate"
- "xpack.security.http.ssl.key=certs/testnode.key"
- "xpack.security.http.ssl.certificate=certs/testnode.crt"
- "xpack.security.http.ssl.certificate_authorities=certs/ca.crt"
- "xpack.security.transport.ssl.enabled=true"
- "xpack.security.transport.ssl.key=certs/testnode.key"
- "xpack.security.transport.ssl.certificate=certs/testnode.crt"
- "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt"
volumes:
- "./certs/testnode.crt:/usr/share/elasticsearch/config/certs/testnode.crt"
- "./certs/testnode.key:/usr/share/elasticsearch/config/certs/testnode.key"
- "./certs/ca.crt:/usr/share/elasticsearch/config/certs/ca.crt"
networks:
# we need two networks otherwise the two ES instances will join each other
esnet-oss:
esnet-platinum:
volumes:
esvol:

View File

@ -1,67 +0,0 @@
---
##### GLOBAL METADATA
- meta:
cluster: clients-ci
##### JOB DEFAULTS
- job:
project-type: matrix
logrotate:
daysToKeep: 30
numToKeep: 100
properties:
- github:
url: https://github.com/elastic/elasticsearch-js/
- inject:
properties-content: HOME=$JENKINS_HOME
concurrent: true
node: flyweight
scm:
- git:
name: origin
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
reference-repo: /var/lib/jenkins/.git-references/elasticsearch-js.git
branches:
- ${branch_specifier}
url: https://github.com/elastic/elasticsearch-js.git
wipe-workspace: 'True'
triggers:
- github
vault:
# vault read auth/approle/role/clients-ci/role-id
role_id: ddbd0d44-0e51-105b-177a-c8fdfd445126
axes:
- axis:
type: slave
name: label
values:
- linux
- axis:
type: yaml
filename: .ci/test-matrix.yml
name: ELASTICSEARCH_VERSION
- axis:
type: yaml
filename: .ci/test-matrix.yml
name: NODE_JS_VERSION
yaml-strategy:
exclude-key: exclude
filename: .ci/test-matrix.yml
wrappers:
- ansicolor
- timeout:
type: absolute
timeout: 120
fail: true
- timestamps
- workspace-cleanup
builders:
- shell: |-
#!/usr/local/bin/runbld
.ci/run-tests
publishers:
- email:
recipients: infra-root+build@elastic.co

View File

@ -1,14 +0,0 @@
---
- job:
name: elastic+elasticsearch-js+5.x
display-name: 'elastic / elasticsearch-js # 5.x'
description: Testing the elasticsearch-js 5.x branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/5.x
description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
&lt;commitId&gt;, etc.)
triggers:
- github
- timed: '@weekly'

View File

@ -1,14 +0,0 @@
---
- job:
name: elastic+elasticsearch-js+6.x
display-name: 'elastic / elasticsearch-js # 6.x'
description: Testing the elasticsearch-js 6.x branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/6.x
description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
&lt;commitId&gt;, etc.)
triggers:
- github
- timed: '@weekly'

View File

@ -1,14 +0,0 @@
---
- job:
name: elastic+elasticsearch-js+7.x
display-name: 'elastic / elasticsearch-js # 7.x'
description: Testing the elasticsearch-js 7.x branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/7.x
description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
&lt;commitId&gt;, etc.)
triggers:
- github
- timed: '@weekly'

View File

@ -1,14 +0,0 @@
---
- job:
name: elastic+elasticsearch-js+master
display-name: 'elastic / elasticsearch-js # master'
description: Testing the elasticsearch-js master branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/master
description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
&lt;commitId&gt;, etc.)
triggers:
- github
- timed: '@daily'

View File

@ -1,19 +0,0 @@
---
- job:
name: elastic+elasticsearch-js+pull-request
display-name: 'elastic / elasticsearch-js # pull-request'
description: Testing of elasticsearch-js pull requests.
scm:
- git:
branches:
- ${ghprbActualCommit}
refspec: +refs/pull/*:refs/remotes/origin/pr/*
triggers:
- github-pull-request:
org-list:
- elastic
allow-whitelist-orgs-as-admins: true
github-hooks: true
status-context: clients-ci
cancel-builds-on-update: true
publishers: []

View File

@ -1,110 +0,0 @@
#!/usr/bin/env bash
#
# Runs the client tests via Docker with the expectation that the required
# environment variables have already been exported before running this script.
#
# The required environment variables include:
#
# - $ELASTICSEARCH_VERSION
# - $NODE_JS_VERSION
#
set -eo pipefail
set +x
export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id="$VAULT_ROLE_ID" secret_id="$VAULT_SECRET_ID")
export CODECOV_TOKEN=$(vault read -field=token secret/clients-ci/elasticsearch-js/codecov)
unset VAULT_ROLE_ID VAULT_SECRET_ID VAULT_TOKEN
set -x
function cleanup {
docker container rm --force --volumes elasticsearch-oss > /dev/null 2>&1 || true
docker container rm --force --volumes elasticsearch-platinum > /dev/null 2>&1 || true
docker container rm --force --volumes elasticsearch-js-oss > /dev/null 2>&1 || true
docker container rm --force --volumes elasticsearch-js-platinum > /dev/null 2>&1 || true
docker network rm esnet-oss > /dev/null
docker network rm esnet-platinum > /dev/null
}
trap cleanup EXIT
# create network and volume
docker network create esnet-oss
docker network create esnet-platinum
# create client image
docker build \
--file .ci/Dockerfile \
--tag elastic/elasticsearch-js \
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
.
# run elasticsearch oss
docker run \
--rm \
--env "node.attr.testattr=test" \
--env "path.repo=/tmp" \
--env "repositories.url.allowed_urls=http://snapshot.*" \
--env "discovery.type=single-node" \
--network=esnet-oss \
--name=elasticsearch-oss \
--detach \
docker.elastic.co/elasticsearch/elasticsearch-oss:${ELASTICSEARCH_VERSION}
# run elasticsearch platinum
repo=$(pwd)
testnodecrt="/.ci/certs/testnode.crt"
testnodekey="/.ci/certs/testnode.key"
cacrt="/.ci/certs/ca.crt"
docker run \
--rm \
--env "node.attr.testattr=test" \
--env "path.repo=/tmp" \
--env "repositories.url.allowed_urls=http://snapshot.*" \
--env "discovery.type=single-node" \
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
--env "ELASTIC_PASSWORD=changeme" \
--env "xpack.security.enabled=true" \
--env "xpack.license.self_generated.type=trial" \
--env "xpack.security.http.ssl.enabled=true" \
--env "xpack.security.http.ssl.verification_mode=certificate" \
--env "xpack.security.http.ssl.key=certs/testnode.key" \
--env "xpack.security.http.ssl.certificate=certs/testnode.crt" \
--env "xpack.security.http.ssl.certificate_authorities=certs/ca.crt" \
--env "xpack.security.transport.ssl.enabled=true" \
--env "xpack.security.transport.ssl.key=certs/testnode.key" \
--env "xpack.security.transport.ssl.certificate=certs/testnode.crt" \
--env "xpack.security.transport.ssl.certificate_authorities=certs/ca.crt" \
--volume "$repo$testnodecrt:/usr/share/elasticsearch/config/certs/testnode.crt" \
--volume "$repo$testnodekey:/usr/share/elasticsearch/config/certs/testnode.key" \
--volume "$repo$cacrt:/usr/share/elasticsearch/config/certs/ca.crt" \
--network=esnet-platinum \
--name=elasticsearch-platinum \
--detach \
docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION}
# run the client unit and oss integration test
docker run \
--network=esnet-oss \
--env "TEST_ES_SERVER=http://elasticsearch-oss:9200" \
--env "CODECOV_TOKEN" \
--volume $repo:/usr/src/app \
--volume /usr/src/app/node_modules \
--name elasticsearch-js-oss \
--rm \
elastic/elasticsearch-js \
npm run ci
# run the client platinium integration test
docker run \
--network=esnet-platinum \
--env "TEST_ES_SERVER=https://elastic:changeme@elasticsearch-platinum:9200" \
--volume $repo:/usr/src/app \
--volume /usr/src/app/node_modules \
--name elasticsearch-js-platinum \
--rm \
elastic/elasticsearch-js \
npm run test:integration

View File

@ -1,11 +0,0 @@
---
ELASTICSEARCH_VERSION:
- 7.0.0-beta1
NODE_JS_VERSION:
- 11
- 10
- 8
- 6
exclude: ~

View File

@ -1,14 +0,0 @@
comment: off
coverage:
precision: 2
round: down
range: "90...100"
status:
project: yes
patch: yes
changes: no
ignore:
- "api"

View File

@ -3,3 +3,5 @@ npm-debug.log
test/benchmarks
elasticsearch
.git
lib
junit-output

View File

@ -3,7 +3,7 @@
#### You have already researched for similar issues?
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.
#### Are you sure this is an issue with @elastic/elasticsearch or are you just looking for some help?
#### Are you sure this is an issue with `@elastic/elasticsearch` or are you just looking for some help?
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).

View File

@ -1,41 +0,0 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
---
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.
**Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed,
locked, and assigned the `not reproducible` label.**
## 🐛 Bug Report
A clear and concise description of what the bug is.
## To Reproduce
Steps to reproduce the behavior:
Paste your code here:
```js
```
## Expected behavior
A clear and concise description of what you expected to happen.
Paste the results here:
```js
```
## Your Environment
- *node version*: 6,8,10
- *@elastic/elasticsearch version*: >=7.0.0
- *os*: Mac, Windows, Linux
- *any other relevant information*

66
.github/ISSUE_TEMPLATE/bug.yaml vendored Normal file
View File

@ -0,0 +1,66 @@
---
name: 🐛 Bug report
description: Create a report to help us improve
labels: ["Category: Bug"]
body:
- type: markdown
attributes:
value: |
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.
**Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed,
locked, and assigned the `Category: Not an issue` label.**
- type: textarea
id: bug-report
attributes:
label: 🐛 Bug report
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: To reproduce
description: Steps to reproduce the behavior
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: input
id: node-js-version
attributes:
label: Node.js version
placeholder: 18.x, 20.x, etc.
validations:
required: true
- type: input
id: client-version
attributes:
label: "@elastic/elasticsearch version"
placeholder: 7.17.0, 8.14.1, etc.
validations:
required: true
- type: input
id: os
attributes:
label: Operating system
placeholder: Ubuntu 22.04, macOS, etc.
validations:
required: true
- type: input
id: env-info
attributes:
label: Any other relevant environment information

View File

@ -1,22 +0,0 @@
---
name: 🚀 Feature Proposal
about: Submit a proposal for a new feature
---
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.
**Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed,
locked, and assigned the `invalid` label.**
## 🚀 Feature Proposal
A clear and concise description of what the feature is.
## Motivation
Please outline the motivation for the proposal.
## Example
Please provide an example for how this feature would be used.

33
.github/ISSUE_TEMPLATE/feature.yaml vendored Normal file
View File

@ -0,0 +1,33 @@
---
name: 🚀 Feature Proposal
description: Submit a proposal for a new feature
labels: ["Category: Feature"]
body:
- type: markdown
attributes:
value: |
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.
**Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed,
locked, and assigned the `Category: Not an issue` label.**
- type: textarea
id: feature-proposal
attributes:
label: 🚀 Feature Proposal
description: A clear and concise description of what the feature is.
validations:
required: true
- type: textarea
id: motivation
attributes:
label: Motivation
description: Please outline the motivation for the proposal.
- type: textarea
id: example
attributes:
label: Example
description: Please provide an example for how this feature would be used.

View File

@ -1,10 +0,0 @@
---
name: 💬 Questions / Help
about: If you have questions, please check our Gitter or Help repo
---
## 💬 Questions and Help
### Please note that this issue tracker is not a help forum and this issue may be closed.
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.

21
.github/ISSUE_TEMPLATE/question.yaml vendored Normal file
View File

@ -0,0 +1,21 @@
---
name: 💬 Questions / Help
description: If you have questions, please check our community forum or support
labels: ["Category: Question"]
body:
- type: markdown
attributes:
value: |
### Please note that this issue tracker is not a help forum and this issue may be closed.
Please check our [community forum](https://discuss.elastic.co/) or [contact Elastic support](https://www.elastic.co/support) if your issue is not specifically related to the documented functionality of this client library.
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.
- type: textarea
id: question
attributes:
label: Question
description: Your question or comment
validations:
required: true

View File

@ -1,47 +0,0 @@
---
name: 💥 Regression Report
about: Report unexpected behavior that worked in previous versions
---
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.
**Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed,
locked, and assigned the `invalid` label.**
## 💥 Regression Report
A clear and concise description of what the regression is.
## Last working version
Worked up to version:
Stopped working in version:
## To Reproduce
Steps to reproduce the behavior:
Paste your code here:
```js
```
## Expected behavior
A clear and concise description of what you expected to happen.
Paste the results here:
```js
```
## Your Environment
- *node version*: 6,8,10
- *@elastic/elasticsearch version*: >=7.0.0
- *os*: Mac, Windows, Linux
- *any other relevant information*

92
.github/ISSUE_TEMPLATE/regression.yaml vendored Normal file
View File

@ -0,0 +1,92 @@
---
name: 💥 Regression Report
description: Report unexpected behavior that worked in previous versions
labels: ["Category: Bug"]
body:
- type: markdown
attributes:
value: |
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.
**Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed,
locked, and assigned the `Category: Not an issue` label.**
- type: textarea
id: report
attributes:
label: Regression report
description: A clear and concise description of what the regression is.
validations:
required: true
- type: input
id: last-working-version
attributes:
label: Last working version
description: Version of `@elastic/elasticsearch` where this last worked.
validations:
required: true
- type: textarea
id: to-reproduce
attributes:
label: To reproduce
description: |
Paste your code here that shows how to reproduce the behavior.
In some cases, it might be challenging to reproduce the bug in a few lines of code.
You can fork the following repository, which contains all the configuration needed to spin up a three nodes Elasticsearch cluster with security enabled.
[This repository](https://github.com/delvedor/es-reproduce-issue) also contains a preconfigured client instance that you can use to reproduce the issue.
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: input
id: node-version
attributes:
label: Node.js version
description: What version of Node.js you are using (`node --version`).
validations:
required: true
- type: input
id: typescript-version
attributes:
label: TypeScript version
description: TypeScript version you are using, if applicable.
- type: input
id: elasticsearch-client-version
attributes:
label: Elasticsearch client version
description: What version of `@elastic/elasticsearch` and `@elastic/transport` you are using (`npm ls -a | grep '@elastic'`).
validations:
required: true
- type: input
id: elasticsearch-version
attributes:
label: Elasticsearch server version
description: What version of Elasticsearch you are using.
validations:
required: true
- type: input
id: operating-system
attributes:
label: Operating system
description: What operating system you are running.
placeholder: e.g. Linux, MacOS, Windows
- type: textarea
id: env-info
attributes:
label: Any other relevant environment information.

View File

@ -1,6 +0,0 @@
---
name: 👮 Security Issue
about: Responsible Disclosure
---
If you want to report a security issue, please take a look at [elastic/security](https://www.elastic.co/community/security).

8
.github/ISSUE_TEMPLATE/security.yaml vendored Normal file
View File

@ -0,0 +1,8 @@
---
name: 👮 Security Issue
description: Responsible disclosure
body:
- type: markdown
attributes:
value: |
If you want to report a security issue, please take a look at [elastic/security](https://www.elastic.co/community/security).

214
.github/make.sh vendored Executable file
View File

@ -0,0 +1,214 @@
#!/usr/bin/env bash
# ------------------------------------------------------- #
#
# Build entry script for elasticsearch-js
#
# Must be called: ./.github/make.sh <target> <params>
#
# Version: 1.1.0
#
# Targets:
# ---------------------------
# assemble <VERSION> : build client artifacts with version
# bump <VERSION> : bump client internals to version
# bumpmatrix <VERSION> : bump stack version in test matrix to version
# codegen <VERSION> : generate endpoints
# docsgen <VERSION> : generate documentation
# examplegen : generate the doc examples
# clean : clean workspace
#
# ------------------------------------------------------- #
# ------------------------------------------------------- #
# Bootstrap
# ------------------------------------------------------- #
script_path=$(dirname "$(realpath -s "$0")")
repo=$(realpath "$script_path/../")
# shellcheck disable=SC1090
CMD=$1
TASK=$1
TASK_ARGS=()
VERSION=$2
STACK_VERSION=$VERSION
set -euo pipefail
product="elastic/elasticsearch-js"
output_folder=".buildkite/output"
codegen_folder=".buildkite/output"
OUTPUT_DIR="$repo/${output_folder}"
NODE_JS_VERSION=22
WORKFLOW=${WORKFLOW-staging}
mkdir -p "$OUTPUT_DIR"
echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m"
case $CMD in
clean)
echo -e "\033[36;1mTARGET: clean workspace $output_folder\033[0m"
rm -rf "$output_folder"
echo -e "\033[32;1mdone.\033[0m"
exit 0
;;
assemble)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: assemble artifact $VERSION\033[0m"
TASK=release
TASK_ARGS=("$VERSION" "$output_folder")
;;
codegen)
if [ -v "$VERSION" ] || [[ -z "$VERSION" ]]; then
# fall back to branch name or `main` if no VERSION is set
branch_name=$(git rev-parse --abbrev-ref HEAD)
if [[ "$branch_name" =~ ^[0-9]+\.[0-9]+ ]]; then
echo -e "\033[36;1mTARGET: codegen -> No VERSION argument found, using branch name: \`$branch_name\`\033[0m"
VERSION="$branch_name"
else
echo -e "\033[36;1mTARGET: codegen -> No VERSION argument found, using \`main\`\033[0m"
VERSION="main"
fi
fi
if [ "$VERSION" = 'main' ]; then
echo -e "\033[36;1mTARGET: codegen API $VERSION\033[0m"
else
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
fi
TASK=codegen
TASK_ARGS=("$VERSION")
;;
docsgen)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: docsgen -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: generate docs for $VERSION\033[0m"
TASK=codegen
TASK_ARGS=("$VERSION" "$codegen_folder")
;;
examplesgen)
echo -e "\033[36;1mTARGET: generate examples\033[0m"
TASK=codegen
TASK_ARGS=("$VERSION" "$codegen_folder")
;;
bump)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: bump -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: bump to version $VERSION\033[0m"
TASK=bump
TASK_ARGS=("$VERSION")
;;
bumpmatrix)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: bumpmatrix -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: bump stack in test matrix to version $VERSION\033[0m"
TASK=bumpmatrix
TASK_ARGS=("$VERSION")
;;
*)
echo -e "\n'$CMD' is not supported right now\n"
echo -e "\nUsage:"
echo -e "\t $0 release \$VERSION\n"
echo -e "\t $0 bump \$VERSION"
echo -e "\t $0 codegen \$VERSION"
exit 1
;;
esac
# ------------------------------------------------------- #
# Build Container
# ------------------------------------------------------- #
echo -e "\033[34;1mINFO: building $product container\033[0m"
docker build \
--file .buildkite/Dockerfile-make \
--tag "$product" \
--build-arg NODE_JS_VERSION="$NODE_JS_VERSION" \
--build-arg "BUILDER_UID=$(id -u)" \
--build-arg "BUILDER_GID=$(id -g)" \
.
# ------------------------------------------------------- #
# Run the Container
# ------------------------------------------------------- #
echo -e "\033[34;1mINFO: running $product container\033[0m"
if [[ -z "${BUILDKITE+x}" ]] && [[ -z "${CI+x}" ]] && [[ -z "${GITHUB_ACTIONS+x}" ]]; then
echo -e "\033[34;1mINFO: Running in local mode"
docker run \
-u "$(id -u):$(id -g)" \
--volume "$repo:/usr/src/elasticsearch-js" \
--volume /usr/src/elasticsearch-js/node_modules \
--volume "$(realpath $repo/../elastic-client-generator-js):/usr/src/elastic-client-generator-js" \
--env "WORKFLOW=$WORKFLOW" \
--name make-elasticsearch-js \
--rm \
$product \
/bin/bash -c "mkdir -p /usr/src/elastic-client-generator-js/output && \
node .buildkite/make.mjs --task $TASK ${TASK_ARGS[*]}"
else
echo -e "\033[34;1mINFO: Running in CI mode"
docker run \
--volume "$repo:/usr/src/elasticsearch-js" \
--volume /usr/src/elasticsearch-js/node_modules \
-u "$(id -u):$(id -g)" \
--env "WORKFLOW=$WORKFLOW" \
--name make-elasticsearch-js \
--rm \
$product \
/bin/bash -c "cd /usr/src && \
git clone https://$CLIENTS_GITHUB_TOKEN@github.com/elastic/elastic-client-generator-js.git && \
mkdir -p /usr/src/elastic-client-generator-js/output && \
cd /usr/src/elasticsearch-js && \
node .buildkite/make.mjs --task $TASK ${TASK_ARGS[*]}"
fi
# ------------------------------------------------------- #
# Post Command tasks & checks
# ------------------------------------------------------- #
if [[ "$CMD" == "assemble" ]]; then
if compgen -G ".buildkite/output/*" >/dev/null; then
echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m"
else
echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m"
exit 1
fi
fi
if [[ "$CMD" == "bump" ]]; then
if [ -n "$(git status --porcelain)" ]; then
echo -e "\033[32;1mTARGET: successfully bumped client v$VERSION\033[0m"
else
echo -e "\033[31;1mTARGET: failed bumped client v$VERSION\033[0m"
exit 1
fi
fi
if [[ "$CMD" == "codegen" ]]; then
if [ -n "$(git status --porcelain)" ]; then
echo -e "\033[32;1mTARGET: successfully generated client v$VERSION\033[0m"
else
echo -e "\033[31;1mTARGET: failed generating client v$VERSION\033[0m"
exit 1
fi
fi
if [[ "$CMD" == "docsgen" ]]; then
echo "TODO"
fi
if [[ "$CMD" == "examplesgen" ]]; then
echo "TODO"
fi

2
.github/stale.yml vendored
View File

@ -9,6 +9,8 @@ exemptLabels:
- "discussion"
- "feature request"
- "bug"
- "todo"
- "good first issue"
# Label to use when marking an issue as stale
staleLabel: stale

27
.github/workflows/backport.yml vendored Normal file
View File

@ -0,0 +1,27 @@
---
name: Backport
on:
pull_request_target:
types:
- closed
- labeled
jobs:
backport:
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

130
.github/workflows/nodejs.yml vendored Normal file
View File

@ -0,0 +1,130 @@
---
name: Node CI
on:
pull_request: {}
jobs:
paths-filter:
name: Detect files changed
runs-on: ubuntu-latest
outputs:
src-only: "${{ steps.changes.outputs.src-only }}"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dorny/paths-filter/@v3.0.2
id: changes
with:
filters: |
src-only:
- '!(**/*.{md,asciidoc,txt}|*.{md,asciidoc,txt}|{docs,.buildkite,scripts}/**/*|catalog-info.yaml)'
- '.github/workflows/**'
test:
name: Test
runs-on: ${{ matrix.os }}
needs: paths-filter
# only run if code relevant to unit tests was changed
if: needs.paths-filter.outputs.src-only == 'true'
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x, 23.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Lint
run: |
npm run lint
- name: Unit test
run: |
npm run test:unit
- name: ECMAScript module test
run: |
npm run test:esm
license:
name: License check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install
run: |
npm install
- name: License checker
run: |
npm run license-checker
test-bun:
name: Test Bun
runs-on: ${{ matrix.os }}
needs: paths-filter
# only run if code relevant to unit tests was changed
if: needs.paths-filter.outputs.src-only == 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Bun
uses: oven-sh/setup-bun@v2
- name: Install
run: |
bun install
- name: Lint
run: |
bun run lint
- name: Unit test
run: |
bun run test:unit-bun
- name: ECMAScript module test
run: |
bun run test:esm
auto-approve:
name: Auto-approve
needs: [test, license]
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.actor == 'elasticmachine'
steps:
- uses: hmarr/auto-approve-action@v4

38
.github/workflows/npm-publish.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Publish Package to npm
on:
workflow_dispatch:
inputs:
branch:
description: "Git branch to build and publish"
required: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
- run: npm install -g npm
- run: npm install
- run: npm test
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: |
version=$(jq -r .version package.json)
gh release create \
-n "[Changelog](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/$BRANCH_NAME/changelog-client.html)" \
--target "$BRANCH_NAME" \
-t "v$version" \
"v$version"
env:
BRANCH_NAME: ${{ github.event.inputs.branch }}
GH_TOKEN: ${{ github.token }}

43
.github/workflows/serverless-patch.sh vendored Executable file
View File

@ -0,0 +1,43 @@
#!/usr/bin/env bash
set -exuo pipefail
merge_commit_sha=$(jq -r '.pull_request.merge_commit_sha' "$GITHUB_EVENT_PATH")
pull_request_id=$(jq -r '.pull_request.number' "$GITHUB_EVENT_PATH")
pr_shortcode="elastic/elasticsearch-js#$pull_request_id"
# generate patch file
cd "$GITHUB_WORKSPACE/stack"
git format-patch -1 --stdout "$merge_commit_sha" > /tmp/patch.diff
# set committer info
git config --global user.email "elasticmachine@users.noreply.github.com"
git config --global user.name "Elastic Machine"
# apply patch file
cd "$GITHUB_WORKSPACE/serverless"
git am -C1 --reject /tmp/patch.diff || git am --quit
# generate PR body comment
comment="Patch applied from $pr_shortcode"
# enumerate rejected patches in PR comment
has_rejects='false'
for f in ./**/*.rej; do
has_rejects='true'
comment="$comment
## Rejected patch \`$f\` must be resolved:
\`\`\`diff
$(cat "$f")
\`\`\`
"
done
# delete .rej files
rm -fv ./**/*.rej
# send data to output parameters
echo "$comment" > /tmp/pr_body
echo "PR_DRAFT=$has_rejects" >> "$GITHUB_OUTPUT"

53
.github/workflows/serverless-patch.yml vendored Normal file
View File

@ -0,0 +1,53 @@
---
name: Apply PR changes to serverless
on:
pull_request_target:
types:
- closed
- labeled
jobs:
apply-patch:
name: Apply patch
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
(
github.event.action == 'closed'
&& contains(github.event.pull_request.labels.*.name, 'apply-to-serverless')
)
||
(
github.event.action == 'labeled'
&& github.event.label.name == 'apply-to-serverless'
)
)
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
repository: elastic/elasticsearch-js
ref: main
path: stack
fetch-depth: 0
- uses: actions/checkout@v4
with:
persist-credentials: false
repository: elastic/elasticsearch-serverless-js
ref: main
path: serverless
- name: Apply patch from stack to serverless
id: apply-patch
run: $GITHUB_WORKSPACE/stack/.github/workflows/serverless-patch.sh
- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_TOKEN }}
path: serverless
title: "Apply patch from elastic/elasticsearch-js#${{ github.event.pull_request.number }}"
commit-message: "Apply patch from elastic/elasticsearch-js#${{ github.event.pull_request.number }}"
body-path: /tmp/pr_body
draft: "${{ steps.apply-patch.outputs.PR_DRAFT }}"
add-paths: ":!*.rej"

21
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,21 @@
---
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-issue-label: stale
stale-pr-label: stale
days-before-stale: 90
days-before-close: 14
exempt-issue-labels: 'good first issue'
close-issue-label: closed-stale
close-pr-label: closed-stale
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove the `stale` label, or leave a comment, or this will be closed in 14 days.'
stale-pr-message: 'This pull request is stale because it has been open 90 days with no activity. Remove the `stale` label, or leave a comment, or this will be closed in 14 days.'

20
.gitignore vendored
View File

@ -45,13 +45,25 @@ jspm_packages
# vim swap files
*.swp
#Jetbrains editor folder
.idea
package-lock.json
# elasticsearch repo or binary files
elasticsearch*
# Generated typings, we don't commit them
# because we should copy them in the main .d.ts file
api/generated.d.ts
test/benchmarks/macro/fixtures/*
*-junit.xml
.cache
test/bundlers/**/bundle.js
test/bundlers/parcel-test/.parcel-cache
lib
junit-output
bun.lockb
test-results
processinfo

View File

@ -64,6 +64,12 @@ test
scripts
# ci configuration
.ci
.travis.yml
.buildkite
certs
.github
CODE_OF_CONDUCT.md
CONTRIBUTING.md
src
bun.lockb

View File

@ -1,31 +0,0 @@
dist: trusty
sudo: required
language: node_js
node_js:
- "10"
- "8"
- "6"
env:
global:
- ELASTICSEARCH_VERSION=7.0.0-beta1
- QUIET=true
before_install:
- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
- tar -xzf elasticsearch-${ELASTICSEARCH_VERSION}-linux-x86_64.tar.gz
- ./elasticsearch-${ELASTICSEARCH_VERSION}/bin/elasticsearch -Enode.attr.testattr=test -Epath.repo=/tmp -Erepositories.url.allowed_urls='http://snapshot.*' &> /dev/null &
install:
- npm install
script:
- npm run ci
notifications:
email:
on_success: never
on_failure: always

3
CHANGELOG.md Normal file
View File

@ -0,0 +1,3 @@
303 See Other
Location: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/changelog-client.html

3
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,3 @@
303 See Other
Location: https://www.elastic.co/community/codeofconduct

114
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,114 @@
# Contributing to the Elasticsearch Node.js client
The Elasticsearch Node.js client is open source and we love to receive contributions from our community — you!
There are many ways to contribute,
from writing tutorials or blog posts,
improving the documentation,
submitting bug reports and feature requests or writing code.
## Repository structure
The `main` branch is considered unstable, and it's compatible with Elasticsearch main. Unless you are patching an issue, new features should always be sent to the `main` branch, in case of a bugfix, it depends if the bug affects all the release lines.<br/>
There is a branch for every supported release line, such as `7.x` or `6.x`. We release bugfixes as soon as possible, while minor and major releases are published at the same time of the Elastic Stack.
Usually for every release line there will be a *published* version and a *next* version. Eg: the `7.x` branch contains the version published on npm, and bugfixes should be sent there, while `7.2` *(assuming that 7.1.x is released)* contains the next version, and new features should be sent there.
## Code contributions
If you have a bugfix or new feature that you would like to contribute,
please find or open an issue about it first.
Talk about what you would like to do.
It may be that somebody is already working on it,
or that there are particular issues that you should know about before implementing the change.
Note that we strictly follow the [Elastic EOL schedule](https://www.elastic.co/support/eol).
### Submitting your changes
Generally, we require that you test any code you are adding or modifying.
Once your changes are ready to submit for review:
1. Test your changes
Run the test suite to make sure that nothing is broken.
Usually running `npm test` is enough; our CI will take care of running the integration tests. If you want to run the integration tests yourself, see [the *Testing* section](#testing) below.
2. Submit a pull request
Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests).
In the pull request,
choose a title which sums up the changes that you have made,
and in the body provide more details about what your changes do.
Also mention the number of the issue where discussion has taken place,
eg "Closes #123".
3. Sign the Contributor License Agreement
Please make sure you have signed our [Contributor License Agreement](https://www.elastic.co/contributor-agreement/).
We are not asking you to assign copyright to us,
but to give us the right to distribute your code without restriction.
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.
4. Be patient
We might not be able to review your code as fast as we would like to,
but we'll do our best to dedicate it the attention it deserves.
Your effort is much appreciated!
### Code generation
The entire content of the `src/api/` directory is automatically generated from [the Elasticsearch specification](https://github.com/elastic/elasticsearch-specification), as is the `docs/reference.asciidoc` file.
This code generation is done using a separate repository that is not currently available to the public.
If you find discrepancies between this client's API code and what you see when actually interacting with an Elasticsearch API, you can open a pull request here to fix it.
For API fixes, it's likely a change will need to be made to the specification as well, to ensure your fix is not undone by the code generation process.
We will do our best to make sure this is addressed when reviewing and merging your changes.
PRs to improve the specification are also welcome!
It is implemented in TypeScript, so JavaScript devs should be able to understand it fairly easily.
Spec fixes are particularly helpful, as they will be reflected in ALL official Elasticsearch clients, not just this one.
### Testing
There are a few different test scripts.
Usually during development you only need to run `npm test`, but if you want you can run just a part of the suite:
| Script | Description |
|---|---|
| `npm run test:unit` | Runs the content of the `test/unit` folder. |
| `npm run test:coverage-100` | Runs unit tests enforcing 100% coverage. |
| `npm run test:coverage-report` | Runs unit tests and generates an `lcov` coverage report. |
| `npm run test:coverage-ui` | Runs unit tests and generates an HTML coverage report. |
| `npm run test:integration` | Runs the integration test runner.<br/>**Note: requires a living instance of Elasticsearch.** |
| `npm run lint` | Run the [linter](https://github.com/standard/ts-standard). |
| `npm run lint:fix` | Fixes linter errors. |
| `npm run license-checker` | Checks that all dependencies have acceptable open source licenses. |
| `npm test` | Runs `lint` and `test:unit`. |
#### Integration test
The integration tests are generated on the fly by the runner you will find inside `test/integration`.
Once you execute it, it will fetch the [YAML REST test files](https://github.com/elastic/elasticsearch/tree/main/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test) from our artifacts API.
These are used to generate the integration tests.
Usually this step is executed by CI since it takes some time, but you can easily run this yourself!
Just follow this steps:
1. Boot a fresh Elasticsearch instance, which can be done in a Docker container by running `STACK_VERSION=8.10.0 DETACH=true .buildkite/run-elasticsearch.sh`, where `STACK_VERSION` and `DETACH` environment variables can be adjusted to your needs. A `TEST_SUITE` env var can also be set to `free` or `platinum`, and defaults to `free`.
1. Run `npm run test:integration` to run the whole suite, or `npm run test:integration -- --bail` to stop after the first failure.
1. Grab a coffee, it will take some time. ;)
This suite is very large, and not all tests will pass.
This is fine.
This suite is mostly used to identify notable changes in success/fail rate over time as we make changes to the client.
### Releasing
If you have access to make releases, the process is as follows:
1. Update the version in `package.json` according to the scale of the change. (major, minor or patch)
1. Commit changes with message `Bumped vx.y.z` where `x.y.z` is the version in `package.json`
1. Create a release via the GitHub UI.
1. Wait for CI to finish running the test.
1. Publish to npm with `npm publish` *(see [publish](https://docs.npmjs.com/cli/publish) and [dist-tag](https://docs.npmjs.com/cli/dist-tag) docs)*

View File

@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2020 Elastic and contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

2
NOTICE.txt Normal file
View File

@ -0,0 +1,2 @@
Elasticsearch JavaScript Client
Copyright 2022 Elasticsearch B.V.

274
README.md
View File

@ -1,153 +1,173 @@
<img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png">
# @elastic/elasticsearch
# Elasticsearch Node.js client
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://clients-ci.elastic.co/job/elastic+elasticsearch-js+master/badge/icon)](https://clients-ci.elastic.co/job/elastic+elasticsearch-js+master/) [![codecov](https://codecov.io/gh/elastic/elasticsearch-js/branch/master/graph/badge.svg)](https://codecov.io/gh/elastic/elasticsearch-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/elasticsearch.svg?style=flat)](https://www.npmjs.com/package/@elastic/elasticsearch)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://badge.buildkite.com/15e4246eb268ea78f6e10aa90bce38c1abb0a4489e79f5a0ac.svg)](https://buildkite.com/elastic/elasticsearch-javascript-client-integration-tests/builds?branch=main) [![Node CI](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [![codecov](https://codecov.io/gh/elastic/elasticsearch-js/branch/master/graph/badge.svg)](https://codecov.io/gh/elastic/elasticsearch-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/elasticsearch.svg?style=flat)](https://www.npmjs.com/package/@elastic/elasticsearch)
---
**Note:** In the past months we have worked on the new Elasticsearch Node.js client, we will announce it soon!
If you want you can already try it by following the instructions below, while if you're going to use the legacy one or report an issue, please check out [elastic/elasticsearch-js-legacy](https://github.com/elastic/elasticsearch-js-legacy).
---
**[Download the latest version of Elasticsearch](https://www.elastic.co/downloads/elasticsearch)**
or
**[sign-up](https://cloud.elastic.co/registration?elektra=en-ess-sign-up-page)**
**for a free trial of Elastic Cloud**.
The official Node.js client for Elasticsearch.
## Features
- One-to-one mapping with REST API.
- Generalized, pluggable architecture.
- Configurable, automatic discovery of cluster nodes.
- Persistent, Keep-Alive connections.
- Load balancing (with pluggable selection strategy) across all available nodes.
- TypeScript support out of the box.
## Installation
## Install
```
npm install @elastic/elasticsearch
```
Refer to the [Installation section](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_installation)
of the getting started documentation.
## Connecting
Refer to the [Connecting section](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_connecting)
of the getting started documentation.
## Compatibility
The Elasticsearch client is compatible with currently maintained JS versions.
Language clients are forward compatible; meaning that clients support
communicating with greater or equal minor versions of Elasticsearch without
breaking. It does not mean that the client automatically supports new features
of newer Elasticsearch versions; it is only possible after a release of a new
client version. For example, a 8.12 client version won't automatically support
the new features of the 8.13 version of Elasticsearch, the 8.13 client version
is required for that. Elasticsearch language clients are only backwards
compatible with default distributions and without guarantees made.
| Elasticsearch Version | Elasticsearch-JS Branch | Supported |
| --------------------- | ------------------------ | --------- |
| main | main | |
| 8.x | 8.x | 8.x |
| 7.x | 7.x | 7.17 |
## Usage
* [Creating an index](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_creating_an_index)
* [Indexing a document](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_indexing_documents)
* [Getting documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_getting_documents)
* [Searching documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_searching_documents)
* [Updating documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_updating_documents)
* [Deleting documents](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_deleting_documents)
* [Deleting an index](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html#_deleting_an_index)
### Node.js support
NOTE: The minimum supported version of Node.js is `v18`.
The client versioning follows the Elastic Stack versioning, this means that
major, minor, and patch releases are done following a precise schedule that
often does not coincide with the [Node.js release](https://nodejs.org/en/about/releases/) times.
To avoid support insecure and unsupported versions of Node.js, the
client **will drop the support of EOL versions of Node.js between minor releases**.
Typically, as soon as a Node.js version goes into EOL, the client will continue
to support that version for at least another minor release. If you are using the client
with a version of Node.js that will be unsupported soon, you will see a warning
in your logs (the client will start logging the warning with two minors in advance).
Unless you are **always** using a supported version of Node.js,
we recommend defining the client dependency in your
`package.json` with the `~` instead of `^`. In this way, you will lock the
dependency on the minor release and not the major. (for example, `~7.10.0` instead
of `^7.10.0`).
| Node.js Version | Node.js EOL date | End of support |
| --------------- |------------------| ---------------------- |
| `8.x` | `December 2019` | `7.11` (early 2021) |
| `10.x` | `April 2021` | `7.12` (mid 2021) |
| `12.x` | `April 2022` | `8.2` (early 2022) |
| `14.x` | `April 2023` | `8.8` (early 2023) |
| `16.x` | `September 2023` | `8.11` (late 2023) |
### Compatibility
---
Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch.
Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
**Warning:** currently on npm you will only find a beta release that works with Elasticsearch 7, we will add the support for Elasticsearch 5, 6, and 7 once we release the final version of this library.
| Elasticsearch Version | Client Version |
| --------------------- |----------------|
| `8.x` | `8.x` |
| `7.x` | `7.x` |
| `6.x` | `6.x` |
| `5.x` | `5.x` |
---
The library is compatible with all Elasticsearch versions since 5.x, but you should use the same major version of the Elasticsearch instance that you are using.
To install a specific major of the client, run the following command:
```
# Elasticsearch 7.x
@elastic/elasticsearch@7
# Elasticsearch 6.x
@elastic/elasticsearch@6
# Elasticsearch 5.x
@elastic/elasticsearch@5
npm install @elastic/elasticsearch@<major>
```
## Usage
You can find the full documentation in the [docs](https://github.com/elastic/elasticsearch-js/tree/master/docs) folder.
#### Browser
> [!WARNING]
> There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues.
We recommend that you write a lightweight proxy that uses this client instead, you can see a proxy example [here](./docs/examples/proxy).
## Documentation
* [Introduction](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html)
* [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#client-usage)
* [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)
* [Authentication](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#authentication)
* [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.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)
* [Testing](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-testing.html)
* [Examples](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/examples.html)
## Install multiple versions
If you are using multiple versions of Elasticsearch, you need to use multiple versions of the client. In the past, install multiple versions of the same package was not possible, but with `npm v6.9`, you can do that via aliasing.
The command you must run to install different version of the client is:
```sh
npm install <alias>@npm:@elastic/elasticsearch@<version>
```
So for example if you need to install `7.x` and `6.x`, you will run:
```sh
npm install es6@npm:@elastic/elasticsearch@6
npm install es7@npm:@elastic/elasticsearch@7
```
And your `package.json` will look like the following:
```json
"dependencies": {
"es6": "npm:@elastic/elasticsearch@^6.7.0",
"es7": "npm:@elastic/elasticsearch@^7.0.0"
}
```
You will require the packages from your code by using the alias you have defined.
```js
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
const { Client: Client6 } = require('es6')
const { Client: Client7 } = require('es7')
// promise API
const result = await client.search({
index: 'my-index',
body: { foo: 'bar' }
const client6 = new Client6({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const client7 = new Client7({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
// callback API
client.search({
index: 'my-index',
body: { foo: 'bar' }
}, (err, result) => {
if (err) console.log(err)
})
```
The returned value of **every** API call is formed as follows:
```ts
{
body: object | boolean
statusCode: number
headers: object
warnings: [string]
meta: object
}
```
### Client options
The client is designed to be easily configured as you see fit for your needs, following you can see all the possible options that you can use to configure it.
```ts
{
// the Elasticsearch endpoint to use
node: string | string[];
// alias of above
nodes: string | string[];
// custom connection class
Connection: typeof Connection;
// custom connection pool class
ConnectionPool: typeof ConnectionPool;
// custom transport class
Transport: typeof Transport;
// custom serializer class
Serializer: typeof Serializer;
// max number of retries for each request
maxRetries: number;
// max request timeout for each request
requestTimeout: number;
// max ping timeout for each request
pingTimeout: number;
// perform a sniff operation every `n` milliseconds
sniffInterval: number;
// perform a sniff once the client is started
sniffOnStart: boolean;
// custom sniff endpoint, defaults `_nodes/_all/http`
sniffEndpoint: string;
// perform a sniff on connection fault
sniffOnConnectionFault: boolean;
// configurethe node resurrection strategy, default `ping`
resurrectStrategy: 'ping' | 'optimistic' | 'none';
// adds `accept-encoding` header to every request
suggestCompression: boolean;
// enable gzip request body compression
compression: 'gzip';
// ssl configuraton
ssl: http.SecureContextOptions;
// http agent options
agent: http.AgentOptions;
// filters which node not to use for a request
nodeFilter: nodeFilterFn;
// custom selection strategy, defaults `round-robin`
nodeSelector: nodeSelectorFn | string;
}
client6.info().then(console.log, console.log)
client7.info().then(console.log, console.log)
```
### Request specific options
If needed you can pass request specific options in a second object:
```js
// promise API
const result = await client.search({
index: 'my-index',
body: { foo: 'bar' }
}, {
ignore: [404],
maxRetries: 3
})
```
The supported *request specific options* are:
```ts
{
ignore: [number], // default `null`
requestTimeout: number, // client default
maxRetries: number, // default `5`
asStream: boolean, // default `false`
compression: string, // default `false`
headers: object, // default `null`
querystring: object // default `null`
}
Finally, if you want to install the client for the next version of Elasticsearch
*(the one that lives in Elasticsearchs main branch)*, you can use the following
command:
```sh
npm install esmain@github:elastic/elasticsearch-js
```
## License
This software is licensed under the [Apache 2 license](./LICENSE).
This software is licensed under the [Apache License 2.0](./LICENSE).

View File

@ -1,162 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildBulk (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
*
* @param {string} index - Default index for items which don't provide one
* @param {string} type - Default document type for items which don't provide one
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
* @param {enum} refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
* @param {string} routing - Specific routing value
* @param {time} timeout - Explicit operation timeout
* @param {string} type - Default document type for items which don't provide one
* @param {list} _source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
* @param {list} _source_excludes - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
* @param {list} _source_includes - Default list of fields to extract and return from the _source field, can be overridden on each sub-request
* @param {string} pipeline - The pipeline id to preprocess incoming documents with
* @param {object} body - The operation definition and data (action-data pairs), separated by newlines
*/
const acceptedQuerystring = [
'wait_for_active_shards',
'refresh',
'routing',
'timeout',
'type',
'_source',
'_source_excludes',
'_source_includes',
'pipeline',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
waitForActiveShards: 'wait_for_active_shards',
_sourceExcludes: '_source_excludes',
_sourceIncludes: '_source_includes',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function bulk (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['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: index')
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 = null
var { method, body, index, type } = params
var querystring = semicopy(params, ['method', 'body', 'index', 'type'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((index) != null && (type) != null) {
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'
} else if ((index) != null) {
path = '/' + encodeURIComponent(index) + '/' + '_bulk'
} else {
path = '/' + '_bulk'
}
// build request object
const request = {
method,
path,
bulkBody: body,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildBulk

View File

@ -1,146 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatAliases (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.aliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html) request
*
* @param {list} name - A comma-separated list of alias names to return
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catAliases (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, name } = params
var querystring = semicopy(params, ['method', 'body', 'name'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((name) != null) {
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
} else {
path = '/' + '_cat' + '/' + 'aliases'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatAliases

View File

@ -1,148 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatAllocation (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request
*
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {enum} bytes - The unit in which to display byte values
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'bytes',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catAllocation (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, nodeId, node_id } = params
var querystring = semicopy(params, ['method', 'body', 'nodeId', 'node_id'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((node_id || nodeId) != null) {
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
} else {
path = '/' + '_cat' + '/' + 'allocation'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatAllocation

View File

@ -1,146 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatCount (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request
*
* @param {list} index - A comma-separated list of index names to limit the returned information
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catCount (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((index) != null) {
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_cat' + '/' + 'count'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatCount

View File

@ -1,150 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatFielddata (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.fielddata](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request
*
* @param {list} fields - A comma-separated list of fields to return the fielddata size
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {enum} bytes - The unit in which to display byte values
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
* @param {list} fields - A comma-separated list of fields to return in the output
*/
const acceptedQuerystring = [
'format',
'bytes',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'fields',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catFielddata (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, fields } = params
var querystring = semicopy(params, ['method', 'body', 'fields'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((fields) != null) {
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
} else {
path = '/' + '_cat' + '/' + 'fielddata'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatFielddata

View File

@ -1,143 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatHealth (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} ts - Set to false to disable timestamping
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'ts',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catHealth (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat' + '/' + 'health'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatHealth

View File

@ -1,130 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatHelp (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.help](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request
*
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
*/
const acceptedQuerystring = [
'help',
's',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catHelp (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatHelp

View File

@ -1,152 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatIndices (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.indices](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html) request
*
* @param {list} index - A comma-separated list of index names to limit the returned information
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {enum} bytes - The unit in which to display byte values
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {enum} health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status
* @param {boolean} help - Return help information
* @param {boolean} pri - Set to true to return stats only for primary shards
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'bytes',
'local',
'master_timeout',
'h',
'health',
'help',
'pri',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catIndices (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((index) != null) {
path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_cat' + '/' + 'indices'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatIndices

View File

@ -1,141 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatMaster (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.master](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catMaster (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat' + '/' + 'master'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatMaster

View File

@ -1,141 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatNodeattrs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.nodeattrs](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catNodeattrs (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat' + '/' + 'nodeattrs'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatNodeattrs

View File

@ -1,144 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatNodes (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.nodes](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} full_id - Return the full node ID instead of the shortened version (default: false)
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'full_id',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
fullId: 'full_id',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catNodes (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat' + '/' + 'nodes'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatNodes

View File

@ -1,141 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatPendingTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catPendingTasks (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat' + '/' + 'pending_tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatPendingTasks

View File

@ -1,141 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatPlugins (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.plugins](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catPlugins (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat' + '/' + 'plugins'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatPlugins

View File

@ -1,146 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatRecovery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html) request
*
* @param {list} index - A comma-separated list of index names to limit the returned information
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {enum} bytes - The unit in which to display byte values
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'bytes',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catRecovery (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((index) != null) {
path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_cat' + '/' + 'recovery'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatRecovery

View File

@ -1,141 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatRepositories (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.repositories](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catRepositories (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat' + '/' + 'repositories'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatRepositories

View File

@ -1,143 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatSegments (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html) request
*
* @param {list} index - A comma-separated list of index names to limit the returned information
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {enum} bytes - The unit in which to display byte values
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'bytes',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catSegments (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((index) != null) {
path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_cat' + '/' + 'segments'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatSegments

View File

@ -1,148 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatShards (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.shards](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html) request
*
* @param {list} index - A comma-separated list of index names to limit the returned information
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {enum} bytes - The unit in which to display byte values
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'bytes',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catShards (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((index) != null) {
path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_cat' + '/' + 'shards'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatShards

View File

@ -1,147 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatSnapshots (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html) request
*
* @param {list} repository - Name of repository from which to fetch the snapshot information
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} ignore_unavailable - Set to true to ignore unavailable snapshots
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'ignore_unavailable',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
ignoreUnavailable: 'ignore_unavailable',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catSnapshots (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, repository } = params
var querystring = semicopy(params, ['method', 'body', 'repository'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((repository) != null) {
path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
} else {
path = '/' + '_cat' + '/' + 'snapshots'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatSnapshots

View File

@ -1,146 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
*
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {list} node_id - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
* @param {list} actions - A comma-separated list of actions that should be returned. Leave empty to return all.
* @param {boolean} detailed - Return detailed task information (default: false)
* @param {number} parent_task - Return tasks with specified parent task id. Set to -1 to return all.
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'node_id',
'actions',
'detailed',
'parent_task',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
nodeId: 'node_id',
parentTask: 'parent_task',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catTasks (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cat' + '/' + 'tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatTasks

View File

@ -1,146 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatTemplates (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.templates](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html) request
*
* @param {string} name - A pattern that returned template names must match
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catTemplates (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, name } = params
var querystring = semicopy(params, ['method', 'body', 'name'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((name) != null) {
path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
} else {
path = '/' + '_cat' + '/' + 'templates'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatTemplates

View File

@ -1,148 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCatThreadPool (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.thread_pool](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html) request
*
* @param {list} thread_pool_patterns - A comma-separated list of regular-expressions to filter the thread pools in the output
* @param {string} format - a short version of the Accept header, e.g. json, yaml
* @param {enum} size - The multiplier in which to display values
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {list} h - Comma-separated list of column names to display
* @param {boolean} help - Return help information
* @param {list} s - Comma-separated list of column names or column aliases to sort by
* @param {boolean} v - Verbose mode. Display column headers
*/
const acceptedQuerystring = [
'format',
'size',
'local',
'master_timeout',
'h',
'help',
's',
'v',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function catThreadPool (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, threadPoolPatterns, thread_pool_patterns } = params
var querystring = semicopy(params, ['method', 'body', 'threadPoolPatterns', 'thread_pool_patterns'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((thread_pool_patterns || threadPoolPatterns) != null) {
path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
} else {
path = '/' + '_cat' + '/' + 'thread_pool'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCatThreadPool

View File

@ -1,122 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrDeleteAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.delete_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html) request
*
* @param {string} name - The name of the auto follow pattern.
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrDeleteAutoFollowPattern (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['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
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 = null
var { method, body, name } = params
var querystring = semicopy(params, ['method', 'body', 'name'])
if (method == null) {
method = 'DELETE'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrDeleteAutoFollowPattern

View File

@ -1,128 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrFollow (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html) request
*
* @param {string} index - The name of the follower index
* @param {string} wait_for_active_shards - Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
* @param {object} body - The name of the leader index and other optional ccr related parameters
*/
const acceptedQuerystring = [
'wait_for_active_shards'
]
const snakeCase = {
waitForActiveShards: 'wait_for_active_shards'
}
return function ccrFollow (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['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'PUT'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrFollow

View File

@ -1,116 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrFollowInfo (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.follow_info](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html) request
*
* @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrFollowInfo (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// 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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrFollowInfo

View File

@ -1,116 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrFollowStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.follow_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html) request
*
* @param {list} index - A comma-separated list of index patterns; use `_all` to perform the operation on all indices
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrFollowStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// 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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrFollowStats

View File

@ -1,120 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrGetAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.get_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html) request
*
* @param {string} name - The name of the auto follow pattern.
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrGetAutoFollowPattern (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// 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 = null
var { method, body, name } = params
var querystring = semicopy(params, ['method', 'body', 'name'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((name) != null) {
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
} else {
path = '/' + '_ccr' + '/' + 'auto_follow'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrGetAutoFollowPattern

View File

@ -1,122 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrPauseFollow (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.pause_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html) request
*
* @param {string} index - The name of the follower index that should pause following its leader index.
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrPauseFollow (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['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrPauseFollow

View File

@ -1,127 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrPutAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.put_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html) request
*
* @param {string} name - The name of the auto follow pattern.
* @param {object} body - The specification of the auto follow pattern
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrPutAutoFollowPattern (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['name'] == null) {
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
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 = null
var { method, body, name } = params
var querystring = semicopy(params, ['method', 'body', 'name'])
if (method == null) {
method = 'PUT'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrPutAutoFollowPattern

View File

@ -1,123 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrResumeFollow (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.resume_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html) request
*
* @param {string} index - The name of the follow index to resume following.
* @param {object} body - The name of the leader index and other optional ccr related parameters
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrResumeFollow (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['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrResumeFollow

View File

@ -1,115 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html) request
*
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrStats (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// 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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_ccr' + '/' + 'stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrStats

View File

@ -1,122 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildCcrUnfollow (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.unfollow](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
*
* @param {string} index - The name of the follower index that should be turned into a regular index.
*/
const acceptedQuerystring = [
]
const snakeCase = {
}
return function ccrUnfollow (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['index'] == null) {
const err = new ConfigurationError('Missing required parameter: index')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildCcrUnfollow

View File

@ -1,126 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClearScroll (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [clear_scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request
*
* @param {list} scroll_id - A comma-separated list of scroll IDs to clear
* @param {object} body - A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
*/
const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clearScroll (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// 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 = null
var { method, body, scrollId, scroll_id } = params
var querystring = semicopy(params, ['method', 'body', 'scrollId', 'scroll_id'])
if (method == null) {
method = 'DELETE'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((scroll_id || scrollId) != null) {
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
} else {
path = '/' + '_search' + '/' + 'scroll'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClearScroll

View File

@ -1,127 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterAllocationExplain (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.allocation_explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html) request
*
* @param {boolean} include_yes_decisions - Return 'YES' decisions in explanation (default: false)
* @param {boolean} include_disk_info - Return information about disk usage and shard sizes (default: false)
* @param {object} body - The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
*/
const acceptedQuerystring = [
'include_yes_decisions',
'include_disk_info',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
includeYesDecisions: 'include_yes_decisions',
includeDiskInfo: 'include_disk_info',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clusterAllocationExplain (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// 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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = body == null ? 'GET' : 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClusterAllocationExplain

View File

@ -1,137 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterGetSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.get_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request
*
* @param {boolean} flat_settings - Return settings in flat format (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {time} timeout - Explicit operation timeout
* @param {boolean} include_defaults - Whether to return all default clusters setting.
*/
const acceptedQuerystring = [
'flat_settings',
'master_timeout',
'timeout',
'include_defaults',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
flatSettings: 'flat_settings',
masterTimeout: 'master_timeout',
includeDefaults: 'include_defaults',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clusterGetSettings (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cluster' + '/' + 'settings'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClusterGetSettings

View File

@ -1,158 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterHealth (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request
*
* @param {list} index - Limit the information returned to a specific index
* @param {enum} level - Specify the level of detail for returned information
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {time} timeout - Explicit operation timeout
* @param {string} wait_for_active_shards - Wait until the specified number of shards is active
* @param {string} wait_for_nodes - Wait until the specified number of nodes is available
* @param {enum} wait_for_events - Wait until all currently queued events with the given priority are processed
* @param {boolean} wait_for_no_relocating_shards - Whether to wait until there are no relocating shards in the cluster
* @param {boolean} wait_for_no_initializing_shards - Whether to wait until there are no initializing shards in the cluster
* @param {enum} wait_for_status - Wait until cluster is in a specific state
*/
const acceptedQuerystring = [
'level',
'local',
'master_timeout',
'timeout',
'wait_for_active_shards',
'wait_for_nodes',
'wait_for_events',
'wait_for_no_relocating_shards',
'wait_for_no_initializing_shards',
'wait_for_status',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
waitForActiveShards: 'wait_for_active_shards',
waitForNodes: 'wait_for_nodes',
waitForEvents: 'wait_for_events',
waitForNoRelocatingShards: 'wait_for_no_relocating_shards',
waitForNoInitializingShards: 'wait_for_no_initializing_shards',
waitForStatus: 'wait_for_status',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clusterHealth (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body, index } = params
var querystring = semicopy(params, ['method', 'body', 'index'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((index) != null) {
path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
} else {
path = '/' + '_cluster' + '/' + 'health'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClusterHealth

View File

@ -1,131 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterPendingTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html) request
*
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Specify timeout for connection to master
*/
const acceptedQuerystring = [
'local',
'master_timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clusterPendingTasks (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cluster' + '/' + 'pending_tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClusterPendingTasks

View File

@ -1,135 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterPutSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.put_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request
*
* @param {boolean} flat_settings - Return settings in flat format (default: false)
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {time} timeout - Explicit operation timeout
* @param {object} body - The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart).
*/
const acceptedQuerystring = [
'flat_settings',
'master_timeout',
'timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
flatSettings: 'flat_settings',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clusterPutSettings (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['body'] == null) {
const err = new ConfigurationError('Missing required parameter: body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'PUT'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cluster' + '/' + 'settings'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClusterPutSettings

View File

@ -1,126 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterRemoteInfo (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.remote_info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html) request
*
*/
const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clusterRemoteInfo (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_remote' + '/' + 'info'
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClusterRemoteInfo

View File

@ -1,136 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterReroute (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.reroute](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html) request
*
* @param {boolean} dry_run - Simulate the operation only and return the resulting state
* @param {boolean} explain - Return an explanation of why the commands can or cannot be executed
* @param {boolean} retry_failed - Retries allocation of shards that are blocked due to too many subsequent allocation failures
* @param {list} metric - Limit the information returned to the specified metrics. Defaults to all but metadata
* @param {time} master_timeout - Explicit operation timeout for connection to master node
* @param {time} timeout - Explicit operation timeout
* @param {object} body - The definition of `commands` to perform (`move`, `cancel`, `allocate`)
*/
const acceptedQuerystring = [
'dry_run',
'explain',
'retry_failed',
'metric',
'master_timeout',
'timeout',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
dryRun: 'dry_run',
retryFailed: 'retry_failed',
masterTimeout: 'master_timeout',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clusterReroute (params, options, callback) {
options = options || {}
if (typeof options === 'function') {
callback = options
options = {}
}
if (typeof params === 'function' || params == null) {
callback = params
params = {}
options = {}
}
// 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 = null
var { method, body } = params
var querystring = semicopy(params, ['method', 'body'])
if (method == null) {
method = 'POST'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
path = '/' + '_cluster' + '/' + 'reroute'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClusterReroute

View File

@ -1,163 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
'use strict'
/* eslint camelcase: 0 */
/* eslint no-unused-vars: 0 */
function buildClusterState (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.state](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request
*
* @param {list} index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
* @param {list} metric - Limit the information returned to the specified metrics
* @param {boolean} local - Return local information, do not retrieve the state from master node (default: false)
* @param {time} master_timeout - Specify timeout for connection to master
* @param {boolean} flat_settings - Return settings in flat format (default: false)
* @param {number} wait_for_metadata_version - Wait for the metadata version to be equal or greater than the specified metadata version
* @param {time} wait_for_timeout - The maximum time to wait for wait_for_metadata_version before timing out
* @param {boolean} ignore_unavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed)
* @param {boolean} allow_no_indices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
* @param {enum} expand_wildcards - Whether to expand wildcard expression to concrete indices that are open, closed or both.
*/
const acceptedQuerystring = [
'local',
'master_timeout',
'flat_settings',
'wait_for_metadata_version',
'wait_for_timeout',
'ignore_unavailable',
'allow_no_indices',
'expand_wildcards',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
]
const snakeCase = {
masterTimeout: 'master_timeout',
flatSettings: 'flat_settings',
waitForMetadataVersion: 'wait_for_metadata_version',
waitForTimeout: 'wait_for_timeout',
ignoreUnavailable: 'ignore_unavailable',
allowNoIndices: 'allow_no_indices',
expandWildcards: 'expand_wildcards',
errorTrace: 'error_trace',
filterPath: 'filter_path'
}
return function clusterState (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.body != null) {
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// check required url components
if (params['index'] != null && (params['metric'] == null)) {
const err = new ConfigurationError('Missing required parameter of the url: metric')
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 = null
var { method, body, index, metric } = params
var querystring = semicopy(params, ['method', 'body', 'index', 'metric'])
if (method == null) {
method = 'GET'
}
var ignore = options.ignore || null
if (typeof ignore === 'number') {
ignore = [ignore]
}
var path = ''
if ((metric) != null && (index) != null) {
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
} else if ((metric) != null) {
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric)
} else {
path = '/' + '_cluster' + '/' + 'state'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
const requestOptions = {
ignore,
requestTimeout: options.requestTimeout || null,
maxRetries: options.maxRetries || null,
asStream: options.asStream || false,
headers: options.headers || null,
querystring: options.querystring || null,
compression: options.compression || false,
warnings
}
return makeRequest(request, requestOptions, callback)
function semicopy (obj, exclude) {
var target = {}
var keys = Object.keys(obj)
for (var i = 0, len = keys.length; i < len; i++) {
var key = keys[i]
if (exclude.indexOf(key) === -1) {
target[snakeCase[key] || key] = obj[key]
if (acceptedQuerystring.indexOf(snakeCase[key] || key) === -1) {
warnings = warnings || []
warnings.push('Client - Unknown parameter: "' + key + '", sending it as query parameter')
}
}
}
return target
}
}
}
module.exports = buildClusterState

Some files were not shown because too many files have changed in this diff Show More