Compare commits

..

920 Commits

Author SHA1 Message Date
5138dd925d Update api-reference.md 2025-05-19 20:49:04 -06:00
0a14ecca4e Auto-generated API code (#2833) 2025-05-19 19:50:38 +00:00
965e51b630 Update dependency @types/node to v22.15.19 (#2828)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-05-19 19:43:27 +00:00
62c8c576b9 Update dependency semver to v7.7.2 (#2837)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-05-19 19:33:34 +00:00
d2581804eb Mention typesWithBody in breaking changes (#2839) 2025-05-19 19:32:23 +00:00
67a52dbc37 Update dependency apache-arrow to v20 (#2838)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-05-19 19:30:42 +00:00
96463f1f44 add products to docset.yml (#2836) 2025-05-19 19:01:04 +00:00
4d4ffca1ba Update dependency zx to v8 (#2829)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-05-19 18:23:30 +00:00
a6e23fd3a8 Drop support for Node 18 (#2827) 2025-05-08 11:41:44 -05:00
a86319b14d Remove dangling references to typesWithBodyKey (#2821)
This was removed for 9.0.
2025-05-05 12:39:53 -05:00
b030084f24 Export helper types (#2822) 2025-05-05 11:54:58 -05:00
591bf56cba Auto-generated API code (#2819) 2025-05-05 11:20:41 -05:00
b38bed5bfa Update dependency @types/node to v22.15.3 (#2815)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-05-05 16:19:21 +00:00
489e5c5809 Update oven-sh/setup-bun digest to 735343b (#2814)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-05-05 10:58:07 -05:00
3bc89758bf Stop running scheduled integration tests (#2812)
We're running them on PRs again now, so this is now more noisy than
useful.
2025-05-01 10:13:22 -05:00
8ba13d31d8 Update dependency rimraf to v6 (#2802)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-29 10:32:37 -05:00
3da4572d1b Update dependency proxy to v2 (#2801)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-28 16:22:21 +00:00
56225051df Auto-generated API code (#2805) 2025-04-28 10:12:24 -05:00
d6cb0dd5b7 Update dependency @types/node to v22.15.2 (#2799)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-28 09:48:24 -05:00
ae7853798c Bump to 9.0.1 (#2797) 2025-04-25 12:41:31 -05:00
f400e68ad1 Release notes for 9.0.1 (#2764) 2025-04-25 10:42:27 -05:00
41a2159f63 Update docs to clarify 9.x compatibility (#2789) 2025-04-24 14:20:38 -05:00
710b937bff Use async reader for parsing Apache Arrow responses (#2788) 2025-04-24 14:11:33 -05:00
926b468c6d [docs] Fix various syntax and rendering errors (#2776) 2025-04-24 11:51:45 -05:00
be0b96b5f5 Update Arrow helper tests to test iteration over results (#2786) 2025-04-22 11:48:53 -05:00
821e77e7ad Support Apache Arrow 19 (#2782) 2025-04-22 10:11:17 -05:00
27774c9d3c Migrate integration tests to built JS files (#2750) 2025-04-21 14:53:52 -05:00
9657180af6 Auto-generated API code (#2773) 2025-04-21 12:48:20 -05:00
bfb4196439 Automerge Renovate Docker updates (#2777) 2025-04-21 12:37:56 -05:00
40860afe0e Update actions/setup-node digest to 49933ea (#2771)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-21 12:28:28 -05:00
c7d9b00fe3 CODEOWNERS for supply chain attack prevention (#2768) 2025-04-18 10:23:47 -05:00
25933c003b Improve docs about observability event emitter (#2765) 2025-04-17 15:09:48 -05:00
98b38028aa Add test to verify default node filter function (#2756) 2025-04-16 13:28:32 -05:00
c3f987caaf fix image paths for docs-assembler (#2753)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-04-16 12:17:36 -05:00
d726942ad1 Ensure npm publish succeeds when publishing non-latest versions (#2754) 2025-04-16 11:02:28 -05:00
1650e3d264 Reinstate running integration tests on PRs (#2752) 2025-04-16 09:50:25 -05:00
46b08caa4f Bump version to 9.0.0 (#2749) 2025-04-15 14:41:04 -05:00
2a93c062e4 Update changelog to include fix for #2694 (#2745) 2025-04-15 13:41:24 -05:00
9d719ce874 Bug #2694 (#2731)
Co-authored-by: Siddhu545 <Siddharthkhengare@gmail.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-04-15 12:44:00 -05:00
d9d54b1bb8 Auto-generated API code (#2740) 2025-04-14 17:52:54 +00:00
931a80cacb Update ESQL helper types (#2738) 2025-04-14 12:44:39 -05:00
1ab089022e Update dependency @types/ms to v2 (#2733)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-14 12:14:26 -05:00
b9a2df5407 Update dependency @types/node to v22.14.1 (#2732)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-14 11:15:59 -05:00
8b4fcc8ce1 Merge branch 'main' of https://github.com/marciw/elasticsearch-js (#2729) 2025-04-11 16:30:35 +02:00
3fc214d2a2 Restore troubleshooting content (#2727) 2025-04-10 09:57:35 -05:00
868dd02ffd Auto-generated API code (#2721) 2025-04-09 12:14:16 -05:00
d29e079a1e Make example generation quiet by default (#2722) 2025-04-08 11:38:14 -05:00
5d8f357805 Update release notes and related files (#2717) 2025-04-08 10:50:39 -05:00
42b5781967 Auto-generated API code (#2714) 2025-04-07 14:41:26 -05:00
8174ba5207 Changelog for 9.0.0 (#2712)
* Changelog for 9.0.0

* Update title for release notes page

* Grammar tweak

* Adjustment to formatting
2025-04-07 13:53:24 -05:00
fd0c9992b3 Update dependency typescript to v5.8.3 (#2705)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-07 11:14:06 -05:00
11a1297792 Update dependency @elastic/request-converter to v9.0.1 (#2704)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-07 11:13:25 -05:00
dea4db1736 Bump to 9.0.0-alpha.5 (#2701) 2025-04-04 13:18:12 -05:00
d5bd34fc23 Auto-generated API code (#2700) 2025-04-04 13:02:57 -05:00
b2a490718d Update helpers to use new multisearch types (#2697)
* Update helpers to use correct multisearch types

The spec combined definitions for search and multisearch bodies in
https://github.com/elastic/elasticsearch-specification/pull/2960.

* Stop copying project files to Dockerfile

Slightly faster run times for codegen, hopefully.
2025-04-04 12:32:12 -05:00
e8dc747c61 Merge serverless functionality from @elastic/elasticsearch-serverless (#2695)
* Expose a serverMode option to enable serverless-friendly defaults

* Update basic config docs to note how the serverMode flag works

* Docs cleanup

* Add another note to docs about connecting to serverless
2025-04-03 14:41:58 -05:00
c5f9625463 replace mis-converted table (#2685) 2025-04-01 10:36:18 -05:00
a9a5aca736 Update dependency @elastic/request-converter to v9 (#2687)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-03-31 16:11:46 +00:00
64ef5359e7 Update dependency @types/node to v22.13.14 (#2686)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-31 11:07:04 -05:00
1abb4e3c9f add missing mapped pages (#2684) 2025-03-27 14:01:57 -05:00
d9e9906c4e Update dependency @types/node to v22.13.13 (#2677)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-03-26 15:08:41 +00:00
1519963dd9 Update actions/setup-node digest to cdca736 (#2676)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-26 10:04:59 -05:00
867ceda5a3 Auto-generated API code (#2645) 2025-03-24 17:55:18 +00:00
88270bf354 Updates navigation titles and descriptions for release notes (#2665) 2025-03-21 12:49:56 -05:00
0f09faefbd Update dependency tap to v21.1.0 (#2659)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-21 12:47:43 -05:00
b775456296 Update dependency typescript to v5.8.2 (#2660)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-21 12:44:48 -05:00
9de4dc5009 [docs] Miscellaneous docs clean up (#2663)
* remove unused substitutions

* move images
2025-03-21 12:42:42 -05:00
461f9b7f66 SPDX license format (#2667)
* Switch to SPDX license format for all non-codegen files

* Add test to ensure all committed JS files have SPDX header
2025-03-21 12:31:38 -05:00
afc83338b0 Assume codegen renders markdown, not asciidoc (#2664)
* Assume codegen renders markdown, not asciidoc

* Drop accidental local dev tweak
2025-03-21 11:16:10 -05:00
85396ddc67 Update dependency semver to v7.7.1 (#2654)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-18 11:54:15 -05:00
16b51c2315 Update dependency @types/node to v22.13.10 (#2653)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-18 10:47:34 -05:00
3ed94d71e0 fix external links (#2649) 2025-03-07 15:11:18 -06:00
e2eb6ef586 Update dependency @types/node to v22.13.9 (#2641)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-07 14:59:54 -06:00
6836a3f1c7 Update dependency @elastic/request-converter to v8.18.0 (#2642)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-03-07 20:39:26 +00:00
0eaeb78c96 Fix npm-publish workflow (#2650)
Reverting an accidental revert
2025-03-07 10:30:34 -06:00
c713e599d1 Put version back to correct value (#2648) 2025-03-06 10:43:53 -06:00
8ca68a4178 [docs] Clean up cross-repo links (#2640)
* clean up cross-repo links

* add docs-content to cross_links
2025-03-03 15:28:38 -06:00
3e5e568c07 [docs] Migrate docs from AsciiDoc to Markdown (#2635)
* delete asciidoc files

* add migrated files

* Apply suggestions from review

Co-authored-by: Josh Mock <josh@joshmock.com>

* Apply suggestions from review

Co-authored-by: Josh Mock <josh@joshmock.com>

* add the new ci checks (#2634)

---------

Co-authored-by: Marci W <333176+marciw@users.noreply.github.com>
Co-authored-by: Josh Mock <josh@joshmock.com>
2025-02-27 12:51:14 -05:00
ac231c859e Improve npm publish version parsing (#2638) 2025-02-26 13:04:18 -06:00
a22c4622d9 Bump to 9.0.0-alpha.4 (#2637) 2025-02-26 12:37:46 -06:00
6f9e1062f3 Auto-generated API code (#2636) 2025-02-26 12:31:25 -06:00
7449adbd1f add the new ci checks (#2634) 2025-02-26 12:09:05 -05:00
d5a0f1171f Add recent releases to changelog (#2633) 2025-02-24 13:37:34 -06:00
d86eb82e82 Update dependency chai to v5.2.0 (#2624)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-02-24 10:57:17 -06:00
a411cc7c7d Auto-generated API code (#2627) 2025-02-24 10:54:40 -06:00
c99abab058 Update dependency @types/node to v22.13.5 (#2623)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-24 10:52:07 -06:00
c5b2915b5a Auto-generated API code (#2618) 2025-02-18 10:40:56 -06:00
20fb610d82 Update dependency tap to v21.0.2 (#2617)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-18 10:37:41 -06:00
c8504fe616 Update dependency @types/node to v22.13.4 (#2616)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-18 10:36:55 -06:00
4795a8c0d5 Slack alerts for integration test suite (#2615)
* Notify Slack on integration test failure

* Run integration tests on most recent minors

* Whoops, wrong alpha
2025-02-11 11:19:47 -06:00
9139662bcc Auto-generated API code (#2610)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-02-11 10:09:49 -06:00
9e4572f4e1 Another attempt to get Renovate to stop trying to upgrade a Docker image (#2614)
The Docker image version is dictated by an upstream env var so the
change it keeps trying to make will have no effect anyway.
2025-02-10 13:13:02 -06:00
a25bc97297 Update dependency @types/node to v22.13.1 (#2607)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-10 12:52:56 -06:00
172180cb21 Report correct transport connection type in telemetry (#2599)
Fixes #2324
2025-02-03 12:52:26 -06:00
947e09e62a Drop serverless side-port automation (#2600) 2025-02-03 12:51:53 -06:00
86169003b4 Auto-generated API code (#2595) 2025-02-03 12:48:17 -06:00
11ff146ae8 Update actions/setup-node digest to 1d0ff46 (#2594)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-03 12:11:08 -06:00
d2c63b4c5f bump 9.0.0 alpha.3 (#2591) 2025-01-30 11:45:47 -06:00
0ad42ff1a2 Drop default 30-second timeout (#2573) 2025-01-30 10:37:53 -06:00
6dbf91a9c3 github-action: Add AsciiDoc freeze warning (#2589)
* github-action: Add AsciiDoc freeze warning

* github-action: Add AsciiDoc freeze warning
2025-01-29 16:51:52 -08:00
39b2700add github-action: Add AsciiDoc freeze warning (#2588) 2025-01-28 15:55:26 -06:00
869174f953 Bump version to 9.0.0-alpha.2 (#2574) 2025-01-28 12:28:42 -06:00
5eb3554083 Auto-generated API code (#2577)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-01-28 12:26:27 -06:00
26ce906b5b Update actions/stale digest to 5bef64f (#2586)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-28 11:32:20 -06:00
5f9561d566 Update dependency @types/node to v22.10.7 (#2576)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-21 12:39:09 -06:00
3676c8229a Fix Renovate rules for Dockerfile (#2572) 2025-01-13 10:15:27 -06:00
2bcbd36d75 Update dependency typescript to v5.7.3 (#2565)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-13 10:09:10 -06:00
63104b5e5e Auto-generated code for main (#2566) 2025-01-13 09:44:45 -06:00
2b2a9947c7 Update dependency @types/node to v22.10.5 (#2547)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-08 13:21:31 -06:00
b95aa986b7 Auto-generated code for main (#2551) 2025-01-07 11:48:46 -06:00
0ee486bc9c Drop @types/tap for built-in types (#2561) 2025-01-07 11:06:18 -06:00
f835fa3b12 Update @sinonjs/fake-timers digest to 48f089f (#2527)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-06 12:50:24 -06:00
e688f36396 Update dependency @elastic/request-converter to v8.17.0 (#2555)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-06 12:39:44 -06:00
b8c3ac446e Update peter-evans/create-pull-request digest to 67ccf78 (#2556)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-06 12:34:18 -06:00
3a288cf86b Update buildkite plugin junit-annotate to v2.6.0 (#2554)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-06 12:31:13 -06:00
100be27ad1 Update changelog for 8.17.0 (#2545) 2024-12-12 11:48:57 -06:00
c490dd0821 Update changelog for 8.16.3 (#2541) 2024-12-12 09:35:45 -06:00
e992c329c3 Parse branch name during code gen including 'x' (#2534) 2024-12-10 10:32:18 -06:00
bfdae66333 Auto-generated code for main (#2530) 2024-12-10 10:03:40 -06:00
ed3cace127 Checkout correct branch of generator (#2531) 2024-12-10 09:58:14 -06:00
f33aa8cccd Publish 9.0 tags as prereleases (#2524) 2024-12-05 14:30:28 -06:00
7cb973a206 Update changelog for 9.0.0 body param removal (#2523) 2024-12-05 14:12:59 -06:00
a4315a905e Auto-generated code for main (#2522) 2024-12-05 13:28:38 -06:00
6447fc10bf Drop support for body param in helpers and tests (#2521)
* Update tests and bulk helper to stop using body param

* Update compatible-with content-type header for 9.0
2024-12-05 13:03:19 -06:00
e9c2f8b0af Bump version to 9.0.0-alpha.1 (#2516)
* Bump version to 9.0.0-alpha.1

* Update npm publish workflow for 9.0.0 alpha
2024-12-05 10:40:34 -06:00
15b9ee2f06 Codegen for 8.x clients should use the 8.x generator branch (#2515) 2024-12-05 10:37:46 -06:00
e30e964131 Update stale rules to keep tracking issues open (#2514) 2024-12-03 11:18:16 -06:00
0f187f47c4 Disable Dockerfile Node.js upgrades by Renovate (#2509) 2024-12-02 12:17:45 -06:00
101f34bd5e Update dependency into-stream to v8 (#2507)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-12-02 12:15:23 -06:00
ec0c561e36 Auto-generated code for main (#2504)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-12-02 12:12:27 -06:00
c1e90b12f0 Update dependency @elastic/request-converter to v8.16.2 (#2505)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-12-02 18:12:01 +00:00
5cb670256e Update dependency typescript to v5.7.2 (#2506)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-12-02 18:07:44 +00:00
86f488f68f Update dependency @types/node to v22.10.1 (#2499)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-12-02 12:03:41 -06:00
6009fab7fe Update changelog to include 8.16.2 and 8.15.3 (#2490) 2024-11-21 10:40:58 -06:00
26ae260058 Ignore tap artifacts (#2487) 2024-11-21 10:14:17 -06:00
fbbbece711 Add docstrings for Client class and related properties (#2484) 2024-11-20 14:43:36 -06:00
a30c3dca2d Add changelog for 8.16.1 (#2479) 2024-11-18 13:32:52 -06:00
36cfacc409 Fix ECMAScript import (#2475) 2024-11-18 12:14:58 -06:00
6dc83cd33e Auto-generated code for main (#2473)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-18 11:29:36 -06:00
7c7ce29127 Update dependency @elastic/request-converter to v8.16.1 (#2469)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-18 11:13:38 -06:00
2b890af355 Update integration test automation branches (#2463) 2024-11-14 09:37:36 -06:00
421f953b00 Upgrade ts-standard (#2460) 2024-11-13 10:42:33 -06:00
c5e4107181 Update peter-evans/create-pull-request action to v7 (#2456)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-12 13:44:49 -06:00
5880c84c13 Update dependency typescript to v5 (#2455)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-12 17:34:24 +00:00
290639d168 Update dependency chai to v5 (#2453)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-12 11:27:52 -06:00
0b90613694 Address feedback and add clarity (#2449) 2024-11-12 10:51:18 -06:00
1ad057abcc Update dependency @types/split2 to v4 (#2438)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-11 11:51:35 -06:00
44d890ec57 Update dependency @types/node to v22 (#2437)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-11 17:16:54 +00:00
2b2a2f03e6 Auto-generated code for main (#2439) 2024-11-11 11:05:18 -06:00
7bcd75bdb0 Add changelog for 8.15.2 (#2444) 2024-11-11 09:47:00 -06:00
2455dac4e5 Add _id to the result of helpers.search (#2432) 2024-11-06 12:20:10 -06:00
edb5563bf8 Update dependency @types/node to v18.19.64 (#2421)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-04 22:21:49 +00:00
11939fd22c Add streaming support to Arrow helper (#2407) 2024-11-04 15:47:53 -06:00
e0c613f898 Auto-generated code for main (#2425) 2024-11-04 10:06:34 -06:00
20f2c740cd Update buildkite plugin junit-annotate to v2.5.0 (#2422)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-04 10:01:14 -06:00
97bdca22d8 Update actions/stale action to v9 (#2423)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-04 10:00:38 -06:00
a7123f807d Auto-generated code for main (#2384) 2024-10-28 15:12:59 -05:00
20ac2a637e Skip flaky test (#2416) 2024-10-28 11:46:10 -05:00
e287c1edd9 Don't use hash-based Docker image version (#2414) 2024-10-28 11:19:02 -05:00
90d43f4f28 Pin dependencies (#2408)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-10-28 11:03:46 -05:00
572927b4f1 Don't generate coverage during standard unit test run (#2404) 2024-10-24 11:55:11 -05:00
86b4d4e2f9 Upgrade tap to latest (#2400) 2024-10-24 11:33:46 -05:00
8e79bf847a Enable Renovate (#2398) 2024-10-23 11:38:08 -05:00
cef328c93d Prep 8.16.0 (#2396) 2024-10-23 08:48:04 -05:00
c3247d0c66 Basic helper for ES|QL's Apache Arrow output format (#2391) 2024-10-22 15:00:18 -05:00
e9fdcb0647 Add doc about timeout best practices (#2381) 2024-10-18 11:13:41 -05:00
82acfc33a9 Respect disablePrototypePoisoningProtection option (#2380) 2024-10-16 14:19:44 -05:00
661caf8422 Update changelog for 8.15.1 (#2379) 2024-10-15 11:36:54 -05:00
3430734fe0 Auto-generated code for main (#2371)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-14 12:14:09 -05:00
810e009202 Update Github actions to reflect security best practices (#2375)
* Update Github actions to reflect security best practices

* Upgrade @types/node
2024-10-14 11:27:22 -05:00
c274b1b32f Upgraded @types/node package to v18 (#2374) 2024-10-14 11:13:55 -05:00
428a7b023d Auto-generated code for main (#2368) 2024-09-30 13:37:11 -05:00
aad41df231 Upgrade transport to 8.8.1 (#2366) 2024-09-26 13:29:27 -05:00
34704b2e5c Auto-generated code for main (#2362) 2024-09-23 14:54:43 -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
3772 changed files with 176532 additions and 81121 deletions

14
.buildkite/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
ARG NODE_VERSION=${NODE_VERSION:-20}
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

View File

@ -0,0 +1,27 @@
ARG NODE_JS_VERSION=${NODE_JS_VERSION:-20}
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

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

@ -2,7 +2,7 @@
#
# Shared cleanup routines between different steps
#
# Please source .ci/functions/imports.sh as a whole not just this file
# Please source .buildkite/functions/imports.sh as a whole not just this file
#
# Version 1.0.0
# - Initial version after refactor

View File

View File

@ -2,7 +2,7 @@
#
# Exposes a routine scripts can call to wait for a container if that container set up a health command
#
# Please source .ci/functions/imports.sh as a whole not just this file
# Please source .buildkite/functions/imports.sh as a whole not just this file
#
# Version 1.0.1
# - Initial version after refactor

126
.buildkite/make.mjs Normal file
View File

@ -0,0 +1,126 @@
/*
* Copyright Elasticsearch B.V. and contributors
* SPDX-License-Identifier: Apache-2.0
*/
/* 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.md')} ${join(import.meta.url, '..', 'docs', 'reference', 'api-reference.md')}`
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 @@
---
agents:
provider: "gcp"
image: family/core-ubuntu-2204
memory: "8G"
cpu: "2"
steps:
- label: ":elasticsearch: :javascript: ES JavaScript ({{ matrix.nodejs }})"
env:
NODE_VERSION: "{{ matrix.nodejs }}"
TEST_SUITE: "platinum"
STACK_VERSION: 9.0.0
GITHUB_TOKEN_PATH: "secret/ci/elastic-elasticsearch-js/github-token"
TEST_ES_STACK: "1"
matrix:
setup:
nodejs:
- "20"
- "22"
- "23"
command: ./.buildkite/run-tests.sh
artifact_paths: "./junit-output/junit-*.xml"
- wait: ~
continue_on_failure: true
- label: ":junit: Test results"
plugins:
- junit-annotate#v2.6.0:
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\\/"
]
}
]
}

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

@ -0,0 +1,38 @@
#!/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:-20}
echo "--- :javascript: Building Docker image"
docker build \
--file "$script_path/Dockerfile" \
--tag elastic/elasticsearch-js \
--build-arg NODE_VERSION="$NODE_VERSION" \
.
GITHUB_TOKEN=$(vault read -field=token "$GITHUB_TOKEN_PATH")
export GITHUB_TOKEN
echo "--- :javascript: Running tests"
mkdir -p "$repo/junit-output"
docker run \
--network="${network_name}" \
--env TEST_ES_STACK \
--env STACK_VERSION \
--env GITHUB_TOKEN \
--env "TEST_ES_SERVER=${elasticsearch_url}" \
--env "ELASTIC_PASSWORD=${elastic_password}" \
--env "ELASTIC_USER=elastic" \
--env "BUILDKITE=true" \
--volume "/usr/src/app/node_modules" \
--volume "$repo:/usr/src/app" \
--volume "$repo/junit-output:/junit-output" \
--name elasticsearch-js \
--rm \
elastic/elasticsearch-js \
bash -c "npm run test:integration; [ -f ./report-junit.xml ] && mv ./report-junit.xml /junit-output/junit-$BUILDKITE_JOB_ID.xml || echo 'No JUnit artifact found'"

View File

@ -7,7 +7,7 @@
# 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.0
# 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
@ -20,21 +20,27 @@
# - 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 seperate terminals \033[0m"
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 xpack.security.enabled=true
--env node.name=$es_node_name
--env cluster.name=$cluster_name
--env cluster.initial_master_nodes=$master_node_name
@ -51,6 +57,7 @@ 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
@ -72,6 +79,8 @@ 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
))
@ -82,6 +91,13 @@ 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
@ -136,6 +152,4 @@ END
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,15 +0,0 @@
ARG NODE_JS_VERSION=16
FROM node:${NODE_JS_VERSION}
# Create app directory
WORKDIR /usr/src/app
RUN apt-get clean -y
RUN apt-get update -y
RUN apt-get install -y zip
# Install app dependencies
COPY package*.json ./
RUN npm install
COPY . .

View File

@ -1,19 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIDIzCCAgugAwIBAgIVAMTO6uVx9dLox2t0lY4IcBKZXb5WMA0GCSqGSIb3DQEB
CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu
ZXJhdGVkIENBMB4XDTIwMDIyNjA1NTA1OVoXDTIzMDIyNTA1NTA1OVowEzERMA8G
A1UEAxMIaW5zdGFuY2UwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDK
YLTOikVENiN/qYupOsoXd7VYYnryyfCC/dK4FC2aozkbqjFzBdvPGAasoc4yEiH5
CGeXMgJuOjk1maqetmdIsw00j4oHJviYsnGXzxxS5swhD7spcW4Uk4V4tAUzrbfT
vW/2WW/yYCLe5phVb2chz0jL+WYb4bBmdfs/t6RtP9RqsplYAmVp3gZ6lt2YNtvE
k9gz0TVk3DuO1TquIClfRYUjuywS6xDSvxJ8Jl91EfDWM8QU+9F+YAtiv74xl2U3
P0wwMqNvMxf9/3ak3lTQGsgO4L6cwbKpVLMMzxSVunZz/sgl19xy3qHHz1Qr2MjJ
/2c2J7vahUL4NPRkjJClAgMBAAGjTTBLMB0GA1UdDgQWBBS2Wn8E2VZv4oenY+pR
O8G3zfQXhzAfBgNVHSMEGDAWgBSWAlip9eoPmnG4p4OFZeOUBlAbNDAJBgNVHRME
AjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAvwPvCiJJ6v9jYcyvYY8I3gP0oCwrylpRL
n91UlgRSHUmuAObyOoVN5518gSV/bTU2SDrstcLkLFxHvnfpoGJoxsQEHuGxwDRI
nhYNd62EKLerehNM/F9ILKmvTh8f6QPCzjUuExTXv+63l2Sr6dBS7FHsGs6UKUYO
llM/y9wMZ1LCuZuBg9RhtgpFXRSgDM9Z7Begu0d/BPX9od/qAeZg9Arz4rwUiCN4
IJOMEBEPi5q1tgeS0Fb1Grpqd0Uz5tZKtEHNKzLG+zSMmkneL62Nk2HsmEFZKwzg
u2pU42UaUE596G6o78s1aLn9ICcElPHTjiuZNSiyuu9IzvFDjGQw
-----END CERTIFICATE-----

View File

@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAymC0zopFRDYjf6mLqTrKF3e1WGJ68snwgv3SuBQtmqM5G6ox
cwXbzxgGrKHOMhIh+QhnlzICbjo5NZmqnrZnSLMNNI+KByb4mLJxl88cUubMIQ+7
KXFuFJOFeLQFM623071v9llv8mAi3uaYVW9nIc9Iy/lmG+GwZnX7P7ekbT/UarKZ
WAJlad4GepbdmDbbxJPYM9E1ZNw7jtU6riApX0WFI7ssEusQ0r8SfCZfdRHw1jPE
FPvRfmALYr++MZdlNz9MMDKjbzMX/f92pN5U0BrIDuC+nMGyqVSzDM8Ulbp2c/7I
Jdfcct6hx89UK9jIyf9nNie72oVC+DT0ZIyQpQIDAQABAoIBADAh7f7NjgnaInlD
ds8KB3SraPsbeQhzlPtiqRJU4j/MIFH/GYG03AGWQkget67a9y+GmzSvlTpoKKEh
6h2TXl9BDpv4o6ht0WRn1HJ5tM/Wyqf2WNpTew3zxCPgFPikkXsPrChYPzLTQJfp
GkP/mfTFmxfAOlPZSp4j41zVLYs53eDkAegFPVfKSr1XNNJ3QODLPcIBfxBYsiC9
oU+jRW8xYuj31cEl5k5UqrChJ1rm3mt6cguqXKbISuoSvi13gXI6DccqhuLAU+Kr
ib2XYrRP+pWocZo/pM9WUVoNGtFxfY88sAQtvG6gDKo2AURtFyq84Ow0h9mdixV/
gRIDPcECgYEA5nEqE3OKuG9WuUFGXvjtn4C0F6JjflYWh7AbX51S4F6LKrW6/XHL
Rg4BtF+XReT7OQ6llsV8kZeUxsUckkgDLzSaA8lysNDV5KkhAWHfRqH//QKFbqZi
JL9t3x63Qt81US8s2hQk3khPYTRM8ZB3xHiXvZYSGC/0x/DxfEO3QJECgYEA4NK5
sxtrat8sFz6SK9nWEKimPjDVzxJ0hxdX4tRq/JdOO5RncawVqt6TNP9gTuxfBvhW
MhJYEsQj8iUoL1dxo9d1eP8HEANNV0iX5OBvJNmgBp+2OyRSyr+PA55+wAxYuAE7
QKaitOjW57fpArNRt2hQyiSzTuqUFRWTWJHCWNUCgYAEurPTXF6vdFGCUc2g61jt
GhYYGhQSpq+lrz6Qksj9o9MVWE9zHh++21C7o+6V16I0RJGva3QoBMVf4vG4KtQt
5tV2WG8LI+4P2Ey+G4UajP6U8bVNVQrUmD0oBBhcvfn5JY+1Fg6/pRpD82/U0VMz
7AmpMWhDqNBMPiymkTk0kQKBgCuWb05cSI0ly4SOKwS5bRk5uVFhYnKNH255hh6C
FGP4acB/WzbcqC7CjEPAJ0nl5d6SExQOHmk1AcsWjR3wlCWxxiK5PwNJwJrlhh1n
reS1FKN0H36D4lFQpkeLWQOe4Sx7gKNeKzlr0w6Fx3Uwku0+Gju2tdTdAey8jB6l
08opAoGAEe1AuR/OFp2xw6V8TH9UHkkpGxy+OrXI6PX6tgk29PgB+uiMu4RwbjVz
1di1KKq2XecAilVbnyqY+edADxYGbSnci9x5wQRIebfMi3VXKtV8NQBv2as6qwtW
JDcQUWotOHjpdvmfJWWkcBhbAKrgX8ukww00ZI/lC3/rmkGnBBg=
-----END RSA PRIVATE KEY-----

View File

@ -1,7 +0,0 @@
ARG NODE_JS_VERSION=10
FROM node:${NODE_JS_VERSION}-alpine
RUN apk --no-cache add git
# Create app directory
WORKDIR /usr/src/app

View File

@ -1,74 +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: STACK_VERSION
- axis:
type: yaml
filename: .ci/test-matrix.yml
name: NODE_JS_VERSION
- axis:
type: yaml
filename: .ci/test-matrix.yml
name: TEST_SUITE
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
# - junit:
# results: "*-junit.xml"
# allow-empty-results: true

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.3
display-name: 'elastic / elasticsearch-js # 7.3'
description: Testing the elasticsearch-js 7.3 branch.
parameters:
- string:
name: branch_specifier
default: refs/heads/7.3
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,107 +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.
*/
/* 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'
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 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')
const [version] = args
const packageJson = JSON.parse(await readFile(
join(import.meta.url, '..', 'package.json'),
'utf8'
))
const cleanVersion = semver.clean(version.includes('SNAPSHOT') ? version.split('-')[0] : version)
assert(semver.valid(cleanVersion))
packageJson.version = cleanVersion
packageJson.versionCanary = `${cleanVersion}-canary.0`
await writeFile(
join(import.meta.url, '..', 'package.json'),
JSON.stringify(packageJson, null, 2),
'utf8'
)
const testMatrix = await readFile(join(import.meta.url, 'test-matrix.yml'), 'utf8')
await writeFile(
join(import.meta.url, 'test-matrix.yml'),
testMatrix.replace(/STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"/, `STACK_VERSION:\n - "${cleanVersion}-SNAPSHOT"`), // eslint-disable-line
'utf8'
)
}
// this command can only be executed locally for now
async function codegen (args) {
assert(args.length === 1, 'Bump task expects one parameter')
const [version] = args
await $`node scripts/generate --version ${version}`
}
function onError (err) {
console.log(err)
process.exit(1)
}

View File

@ -1,178 +0,0 @@
#!/usr/bin/env bash
# ------------------------------------------------------- #
#
# Skeleton for common build entry script for all elastic
# clients. Needs to be adapted to individual client usage.
#
# Must be called: ./.ci/make.sh <target> <params>
#
# Version: 1.1.0
#
# Targets:
# ---------------------------
# assemble <VERSION> : build client artefacts with version
# bump <VERSION> : bump client internals 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
NODE_JS_VERSION=16
WORKFLOW=${WORKFLOW-staging}
set -euo pipefail
product="elastic/elasticsearch-js"
output_folder=".ci/output"
OUTPUT_DIR="$repo/${output_folder}"
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
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"
# ------------------------------------------------------- #
# Parse Command
# ------------------------------------------------------- #
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 artefact $VERSION\033[0m"
TASK=release
TASK_ARGS=("$VERSION" "$output_folder")
;;
codegen)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: codegen -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
TASK=codegen
# VERSION is BRANCH here for now
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
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION" "$codegen_folder")
;;
examplesgen)
echo -e "\033[36;1mTARGET: generate examples\033[0m"
TASK=codegen
# VERSION is BRANCH here for now
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
# VERSION is BRANCH here for now
TASK_ARGS=("$VERSION")
;;
*)
echo -e "\nUsage:\n\t $CMD is not supported right now\n"
exit 1
esac
# ------------------------------------------------------- #
# Build Container
# ------------------------------------------------------- #
echo -e "\033[34;1mINFO: building $product container\033[0m"
docker build \
--file .ci/Dockerfile \
--tag ${product} \
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
--build-arg USER_ID="$(id -u)" \
--build-arg GROUP_ID="$(id -g)" \
.
# ------------------------------------------------------- #
# Run the Container
# ------------------------------------------------------- #
echo -e "\033[34;1mINFO: running $product container\033[0m"
docker run \
--volume $repo:/usr/src/app \
--volume /usr/src/app/node_modules \
--env "WORKFLOW=${WORKFLOW}" \
--name make-elasticsearch-js \
--rm \
$product \
node .ci/make.mjs --task $TASK ${TASK_ARGS[*]}
# ------------------------------------------------------- #
# Post Command tasks & checks
# ------------------------------------------------------- #
if [[ "$CMD" == "assemble" ]]; then
if compgen -G ".ci/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

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
source /usr/local/bin/bash_standard_lib.sh
DOCKER_IMAGES="node:14-alpine
node:12-alpine
node:10-alpine
node:8-alpine
"
for di in ${DOCKER_IMAGES}
do
(retry 2 docker pull "${di}") || echo "Error pulling ${di} Docker image, we continue"
done

View File

@ -1,43 +0,0 @@
#!/usr/bin/env bash
# parameters are available to this script
# STACK_VERSION -- version e.g Major.Minor.Patch(-Prelease)
# TEST_SUITE -- which test suite to run: free or platinum
# ELASTICSEARCH_URL -- The url at which elasticsearch is reachable, a default is composed based on STACK_VERSION and TEST_SUITE
# NODE_JS_VERSION -- node js version (defined in test-matrix.yml, a default is hardcoded here)
script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail
NODE_JS_VERSION=${NODE_JS_VERSION-12}
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
elasticsearch_container=${elasticsearch_container-}
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
echo -e "\033[34;1mINFO:\033[0m TEST_SUITE ${TEST_SUITE}\033[0m"
echo -e "\033[34;1mINFO:\033[0m URL ${ELASTICSEARCH_URL}\033[0m"
echo -e "\033[34;1mINFO:\033[0m CONTAINER ${elasticsearch_container}\033[0m"
echo -e "\033[34;1mINFO:\033[0m NODE_JS_VERSION ${NODE_JS_VERSION}\033[0m"
echo -e "\033[1m>>>>> Build docker container >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
docker build \
--file .ci/Dockerfile \
--tag elastic/elasticsearch-js \
--build-arg NODE_JS_VERSION=${NODE_JS_VERSION} \
.
echo -e "\033[1m>>>>> NPM run test:integration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
repo=$(realpath $(dirname $(realpath -s $0))/../)
docker run \
--network=${network_name} \
--env "TEST_ES_SERVER=${ELASTICSEARCH_URL}" \
--env "TEST_SUITE=${TEST_SUITE}" \
--volume $repo:/usr/src/app \
--volume /usr/src/app/node_modules \
--name elasticsearch-js \
--rm \
elastic/elasticsearch-js \
npm run test:integration

View File

@ -1,23 +0,0 @@
#!/usr/bin/env bash
#
# Version 1.1
# - Moved to .ci folder and seperated out `run-repository.sh`
# - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products
script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail
echo -e "\033[1m>>>>> Start [$STACK_VERSION container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
DETACH=true bash .ci/run-elasticsearch.sh
if [[ -n "$RUNSCRIPTS" ]]; then
for RUNSCRIPT in ${RUNSCRIPTS//,/ } ; do
echo -e "\033[1m>>>>> Running run-$RUNSCRIPT.sh >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
CONTAINER_NAME=${RUNSCRIPT} \
DETACH=true \
bash .ci/run-${RUNSCRIPT}.sh
done
fi
echo -e "\033[1m>>>>> Repository specific tests >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
bash .ci/run-repository.sh

View File

@ -1,14 +0,0 @@
---
STACK_VERSION:
- "7.17.12-SNAPSHOT"
NODE_JS_VERSION:
- 16
- 14
- 12
TEST_SUITE:
- free
- platinum
exclude: ~

View File

@ -3,3 +3,9 @@ npm-debug.log
test/benchmarks
elasticsearch
.git
lib
junit-output
.tap
rest-api-spec
yaml-rest-tests
generated-tests

3
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,3 @@
package.json @joshmock
renovate.json @joshmock
catalog-info.yaml @joshmock

View File

@ -1,49 +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
```
<!--
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.
The repository also contains a preconfigured client instance that you can use to reproduce the issue.
https://github.com/delvedor/es-reproduce-issue
--->
## 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: 20.x, 22.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,55 +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
```
<!--
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.
The repository also contains a preconfigured client instance that you can use to reproduce the issue.
https://github.com/delvedor/es-reproduce-issue
--->
## 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).

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

@ -0,0 +1,222 @@
#!/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]+|x) ]]; 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"
# determine branch to clone
GENERATOR_BRANCH="main"
if [[ "$VERSION" == 8.* ]]; then
GENERATOR_BRANCH="8.x"
fi
echo -e "\033[34;1mINFO: Generator branch: $GENERATOR_BRANCH"
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 --branch $GENERATOR_BRANCH 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

25
.github/stale.yml vendored
View File

@ -1,25 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 15
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- "discussion"
- "feature request"
- "bug"
- "todo"
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: |
We understand that this might be important for you, but this issue has been automatically marked as stale because it has not had recent activity either from our end or yours.
It will be closed if no further activity occurs, please write a comment if you would like to keep this going.
Note: in the past months we have built a new client, that has just landed in master. If you want to open an issue or a pr for the legacy client, you should do that in https://github.com/elastic/elasticsearch-js-legacy
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@ -1,16 +1,27 @@
---
name: Backport
on:
pull_request:
pull_request_target:
types:
- closed
- labeled
jobs:
backport:
runs-on: ubuntu-latest
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:
- name: Backport
uses: tibdex/backport@v1
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

19
.github/workflows/docs-build.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: docs-build
on:
push:
branches:
- main
pull_request_target: ~
merge_group: ~
jobs:
docs-preview:
uses: elastic/docs-builder/.github/workflows/preview-build.yml@main
with:
path-pattern: docs/**
permissions:
deployments: write
id-token: write
contents: read
pull-requests: read

14
.github/workflows/docs-cleanup.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: docs-cleanup
on:
pull_request_target:
types:
- closed
jobs:
docs-preview:
uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main
permissions:
contents: none
id-token: write
deployments: write

View File

@ -1,199 +1,123 @@
---
name: Node CI
on: [push, pull_request]
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- uses: dorny/paths-filter/@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # 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: [12.x, 14.x, 16.x]
node-version: [20.x, 22.x, 23.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Install
run: |
npm install
- name: Lint
run: |
npm run lint
- name: Lint
run: |
npm run lint
- name: Unit test
run: |
npm run test:unit
- name: Unit test
run: |
npm run test:unit
- name: Acceptance test
run: |
npm run test:acceptance
- name: Type Definitions
run: |
npm run test:types
helpers-integration-test:
name: Helpers integration test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.16-SNAPSHOT
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Integration test
run: |
npm run test:integration:helpers
bundler-support:
name: Bundler support
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.16-SNAPSHOT
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install
run: |
npm install
npm install --prefix test/bundlers/parcel-test
npm install --prefix test/bundlers/rollup-test
npm install --prefix test/bundlers/webpack-test
- name: Build
run: |
npm run build --prefix test/bundlers/parcel-test
npm run build --prefix test/bundlers/rollup-test
npm run build --prefix test/bundlers/webpack-test
- name: Run bundle
run: |
npm start --prefix test/bundlers/parcel-test
npm start --prefix test/bundlers/rollup-test
npm start --prefix test/bundlers/webpack-test
mock-support:
name: Mock support
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install
run: |
npm install
npm install --prefix test/mock
- name: Run test
run: |
npm test --prefix test/mock
code-coverage:
name: Code coverage
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Code coverage report
run: |
npm run test:coverage-report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.lcov
fail_ci_if_error: true
- name: Code coverage 100%
run: |
npm run test:coverage-100
- name: ECMAScript module test
run: |
npm run test:esm
license:
name: License check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22.x
- name: Install
run: |
npm install
- name: License checker
run: |
npm run license-checker
- name: SPDX header check
run: npm run license-header
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:
node-version: [14.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Use Bun
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2
- name: Install
run: |
npm install
- name: Install
run: |
bun install
- name: License checker
run: |
npm run license-checker
- name: Lint
run: |
bun run lint
- name: Unit test
run: |
bun run test:unit-bun
- name: ECMAScript module test
run: |
bun run test:esm

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

@ -0,0 +1,71 @@
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
- run: npm install -g npm
- run: npm install
- run: npm test
- name: npm publish
run: |
version=$(jq -r .version package.json)
tag_meta=$(echo "$version" | cut -s -d '-' -f2)
# if no meta info on the version (e.g. a '-alpha.1' prefix), publish as a stable release
if [[ -z "$tag_meta" ]]; then
# get latest version on npm
latest=$(npm view @elastic/elasticsearch --json | jq -r '.["dist-tags"].latest')
# if $version is higher than the most recently published version, publish as-is
if [[ $(yes | npx semver "$version" "$latest" | tail -n1) == "$version" ]]; then
npm publish --provenance --access public
else
# otherwise, publish with "previous" tag
npm publish --provenance --access public --tag "previous"
fi
else
# publish as a non-stable release using the meta name (e.g. 'alpha') as the tag
tag=$(echo "$tag_meta" | cut -d '.' -f1)
npm publish --provenance --access public --tag "$tag"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish version on GitHub
run: |
version=$(jq -r .version package.json)
tag_meta=$(echo "$version" | cut -s -d '-' -f2)
if [[ -z "$tag_meta" ]]; then
gh release create \
-n "[Changelog](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/$BRANCH_NAME/changelog-client.html)"
--target "$BRANCH_NAME" \
--title "v$version" \
"v$version"
else
tag_main=$(echo "$version" | cut -d '-' -f1)
gh release create \
-n "This is a $tag_main pre-release. Changes may not be stable." \
--latest=false \
--prerelease \
--target "$BRANCH_NAME" \
--title "v$version" \
"v$version"
fi
env:
BRANCH_NAME: ${{ github.event.inputs.branch }}
GH_TOKEN: ${{ github.token }}

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@5bef64f19d7facfb25b37b414482c7164d639639 # v9
with:
stale-issue-label: stale
stale-pr-label: stale
days-before-stale: 90
days-before-close: 14
exempt-issue-labels: "good first issue,tracking"
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."

11
.gitignore vendored
View File

@ -61,3 +61,14 @@ test/benchmarks/macro/fixtures/*
test/bundlers/**/bundle.js
test/bundlers/parcel-test/.parcel-cache
lib
junit-output
bun.lockb
test-results
processinfo
.tap
rest-api-spec
yaml-rest-tests
generated-tests
schema

View File

@ -64,13 +64,16 @@ test
scripts
# ci configuration
.ci
.travis.yml
.buildkite
certs
.github
CODE_OF_CONDUCT.md
CONTRIBUTING.md
# CANARY-PACKAGE
api/kibana.d.ts
# /CANARY-PACKAGE
src
bun.lockb
.tap
rest-api-spec
yaml-rest-tests
generated-tests

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

View File

@ -8,7 +8,7 @@ improving the documentation,
submitting bug reports and feature requests or writing code.
## Repository structure
The `master` branch is considered unstable, and it's compatible with Elasticsearch master. Unless you are patching an issue, new features should always be sent to the `master` branch, in case of a bugfix, it depends if the bug affects all the release lines.<br/>
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.
@ -31,7 +31,7 @@ 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 run `npm test` is enough, our CI will take care of running the integration test. If you want to run the integration test yourself, see the *Testing* section below.
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
@ -58,46 +58,50 @@ Once your changes are ready to submit for review:
### Code generation
The contents of the API folder and the `docs/reference.asciidoc` file are generated by a script.<br/>
To run the script, use the following command:
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.
```sh
node scripts/generate --version <version name>
```
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.
For example:
```sh
node scripts/generate --version 7.15.0
```
To run the script for an unreleased snapshot version, append `-SNAPSHOT` to the version name. For example:
```sh
node scripts/generate --version 8.0.0-SNAPSHOT
```
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 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, following you will find all the testing scripts and what they do.
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:behavior` | Runs the content of the `test/behavior` folder. |
| `npm run test:types` | Runs the content of the `test/types` folder. |
| `npm run test:unit -- --cov --coverage-report=html` | Runs the content of the `test/unit` folder and calculates the code coverage. |
| `npm run test:integration` | Runs the integration test runner.<br/>*Note: it requires a living instance of Elasticsearch.* |
| `npm run lint` | Run the [linter](https://standardjs.com/). |
| `npm run lint:fix` | Fixes the lint errors. |
| `npm test` | Runs lint, unit, behavior, and types test. |
| `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 test are generated on the fly by the runner you will find inside `test/integration`, once you execute it, it will clone the Elasticsearch repository and checkout the correct version to grab the [OSS yaml files](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/test) and the [Elastic licensed yaml files](https://github.com/elastic/elasticsearch/tree/master/x-pack/plugin/src/test/resources/rest-api-spec/test) that will be used for generating the test.
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 an Elasticsearch instance, you can do that by running `./scripts/es-docker.sh` or `./scripts/es-docker-platinum.sh`, the first one will work only with the OSS APIs, while the second will work also with the Elastic licensed APIs;
1. If you are running the OSS test, you should use `npm run test:integration`, otherwise use `TEST_ES_SERVER=https://elastic:changeme@localhost:9200 npm run test:integration`. You can also pass a `-b` parameter if you want the test to bail out at the first failure: `npm run test:integration -- -b`;
1. Grab a coffee, it will take some time ;)
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

2
NOTICE.txt Normal file
View File

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

239
README.md
View File

@ -2,35 +2,60 @@
# 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/buildStatus/icon?job=elastic%2Belasticsearch-js%2Bmaster)](https://clients-ci.elastic.co/view/Javascript/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)
**[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.
---
## Installation
**Note:** In the past months we have worked on the new Elasticsearch Node.js client and you can use it by following the instructions below. If you're going to use the legacy one or report an issue, however, please check out [elastic/elasticsearch-js-legacy](https://github.com/elastic/elasticsearch-js-legacy).
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
## Features
- One-to-one mapping with REST API.
- Generalized, pluggable architecture.
- Configurable, automatic discovery of cluster nodes.
- Persistent, Keep-Alive connections.
- Load balancing across all available nodes.
- Child client support.
- TypeScript support out of the box.
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.
## Install
```
npm install @elastic/elasticsearch
```
## 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 |
| --------------------- | ----------------------- |
| main | main |
| 9.x | 9.x |
| 8.x | 8.x |
| 7.x | 7.x |
## 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 `v12`.
NOTE: The minimum supported version of Node.js is `v20`.
The client versioning follows the Elastc Stack versioning, this means that
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.
@ -41,192 +66,94 @@ to support that version for at least another minor release. If you are using the
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,
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) |
### 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.
| Elasticsearch Version | Client Version |
| --------------------- |----------------|
| `master` | `master` |
| `7.x` | `7.x` |
| `6.x` | `6.x` |
| `5.x` | `5.x` |
To install a specific major of the client, run the following command:
```
npm install @elastic/elasticsearch@<major>
```
| 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) |
| `18.x` | `April 2025` | `9.1` (mid 2025) |
#### 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).
> [!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)
- [Changelog](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/changelog-client.html)
- [Usage](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-usage.html)
- [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)
- [Breaking changes coming from the old client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/breaking-changes.html)
- [Authentication](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/auth-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-client.html)
- [Extend the client](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/extend-client.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)
## Quick start
First of all, require the client and initialize it:
```js
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
```
You can use both the callback-style API and the promise-style API, both behave the same way.
```js
// promise API
const result = await client.search({
index: 'my-index',
body: {
query: {
match: { hello: 'world' }
}
}
})
// callback API
client.search({
index: 'my-index',
body: {
query: {
match: { hello: 'world' }
}
}
}, (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
}
```
Let's see a complete example!
```js
'use strict'
const { Client } = require('@elastic/elasticsearch')
const client = new Client({ node: 'http://localhost:9200' })
async function run () {
// Let's start by indexing some data
await client.index({
index: 'game-of-thrones',
// type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6
body: {
character: 'Ned Stark',
quote: 'Winter is coming.'
}
})
await client.index({
index: 'game-of-thrones',
// type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6
body: {
character: 'Daenerys Targaryen',
quote: 'I am the blood of the dragon.'
}
})
await client.index({
index: 'game-of-thrones',
// type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6
body: {
character: 'Tyrion Lannister',
quote: 'A mind needs books like a sword needs a whetstone.'
}
})
// here we are forcing an index refresh, otherwise we will not
// get any result in the consequent search
await client.indices.refresh({ index: 'game-of-thrones' })
// Let's search!
const { body } = await client.search({
index: 'game-of-thrones',
// type: '_doc', // uncomment this line if you are using Elasticsearch ≤ 6
body: {
query: {
match: { quote: 'winter' }
}
}
})
console.log(body.hits.hits)
}
run().catch(console.log)
```
## 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
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: Client6 } = require('es6')
const { Client: Client7 } = require('es7')
const client6 = new Client6({ node: 'http://localhost:9200' })
const client7 = new Client7({ node: 'http://localhost:9201' })
const client6 = new Client6({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
const client7 = new Client7({
cloud: { id: '<cloud-id>' },
auth: { apiKey: 'base64EncodedKey' }
})
client6.info(console.log)
client7.info(console.log)
client6.info().then(console.log, console.log)
client7.info().then(console.log, console.log)
```
Finally, if you want to install the client for the next version of Elasticsearch *(the one that lives in Elasticsearchs master branch)*, you can use the following command:
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 esmaster@github:elastic/elasticsearch-js
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,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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion_timeout', 'keep_alive', 'typed_keys', 'keep_on_completion', 'batched_reduce_size', 'request_cache', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'explain', 'stored_fields', 'docvalue_fields', 'from', 'ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'search_type', 'size', 'sort', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'terminate_after', 'stats', 'suggest_field', 'suggest_mode', 'suggest_size', 'suggest_text', 'timeout', 'track_scores', 'track_total_hits', 'allow_partial_search_results', 'version', 'seq_no_primary_term', 'max_concurrent_shard_requests']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', typedKeys: 'typed_keys', keepOnCompletion: 'keep_on_completion', batchedReduceSize: 'batched_reduce_size', requestCache: 'request_cache', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', docvalueFields: 'docvalue_fields', ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', terminateAfter: 'terminate_after', suggestField: 'suggest_field', suggestMode: 'suggest_mode', suggestSize: 'suggest_size', suggestText: 'suggest_text', trackScores: 'track_scores', trackTotalHits: 'track_total_hits', allowPartialSearchResults: 'allow_partial_search_results', seqNoPrimaryTerm: 'seq_no_primary_term', maxConcurrentShardRequests: 'max_concurrent_shard_requests' }
function AsyncSearchApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
AsyncSearchApi.prototype.delete = function asyncSearchDeleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.get = function asyncSearchGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.status = function asyncSearchStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + 'status' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.submit = function asyncSearchSubmitApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_async_search'
} else {
if (method == null) method = 'POST'
path = '/' + '_async_search'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = AsyncSearchApi

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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function AutoscalingApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
AutoscalingApi.prototype.deleteAutoscalingPolicy = function autoscalingDeleteAutoscalingPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
AutoscalingApi.prototype.getAutoscalingCapacity = function autoscalingGetAutoscalingCapacityApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'capacity'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AutoscalingApi.prototype.getAutoscalingPolicy = function autoscalingGetAutoscalingPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AutoscalingApi.prototype.putAutoscalingPolicy = function autoscalingPutAutoscalingPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_autoscaling' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(AutoscalingApi.prototype, {
delete_autoscaling_policy: { get () { return this.deleteAutoscalingPolicy } },
get_autoscaling_capacity: { get () { return this.getAutoscalingCapacity } },
get_autoscaling_policy: { get () { return this.getAutoscalingPolicy } },
put_autoscaling_policy: { get () { return this.putAutoscalingPolicy } }
})
module.exports = AutoscalingApi

View File

@ -1,70 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'type', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' }
function bulkApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_bulk'
} else if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_bulk'
} else {
if (method == null) method = 'POST'
path = '/' + '_bulk'
}
// build request object
const request = {
method,
path,
bulkBody: body,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = bulkApi

View File

@ -1,648 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['format', 'local', 'h', 'help', 's', 'v', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'bytes', 'master_timeout', 'fields', 'time', 'ts', 'health', 'pri', 'include_unloaded_segments', 'allow_no_match', 'allow_no_datafeeds', 'allow_no_jobs', 'from', 'size', 'full_id', 'include_bootstrap', 'active_only', 'detailed', 'index', 'ignore_unavailable', 'nodes', 'actions', 'parent_task_id']
const snakeCase = { expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', includeUnloadedSegments: 'include_unloaded_segments', allowNoMatch: 'allow_no_match', allowNoDatafeeds: 'allow_no_datafeeds', allowNoJobs: 'allow_no_jobs', fullId: 'full_id', includeBootstrap: 'include_bootstrap', activeOnly: 'active_only', ignoreUnavailable: 'ignore_unavailable', parentTaskId: 'parent_task_id' }
function CatApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
CatApi.prototype.aliases = function catAliasesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'aliases' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'aliases'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.allocation = function catAllocationApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'allocation' + '/' + encodeURIComponent(node_id || nodeId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'allocation'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.count = function catCountApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'count' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'count'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.fielddata = function catFielddataApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, fields, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((fields) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'fielddata' + '/' + encodeURIComponent(fields)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'fielddata'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.health = function catHealthApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'health'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.help = function catHelpApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.indices = function catIndicesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'indices' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'indices'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.master = function catMasterApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'master'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.mlDataFrameAnalytics = function catMlDataFrameAnalyticsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics' + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'data_frame' + '/' + 'analytics'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.mlDatafeeds = function catMlDatafeedsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, datafeedId, datafeed_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((datafeed_id || datafeedId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds' + '/' + encodeURIComponent(datafeed_id || datafeedId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'datafeeds'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.mlJobs = function catMlJobsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, jobId, job_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((job_id || jobId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors' + '/' + encodeURIComponent(job_id || jobId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'anomaly_detectors'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.mlTrainedModels = function catMlTrainedModelsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, modelId, model_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((model_id || modelId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models' + '/' + encodeURIComponent(model_id || modelId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'ml' + '/' + 'trained_models'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.nodeattrs = function catNodeattrsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodeattrs'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.nodes = function catNodesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'nodes'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.pendingTasks = function catPendingTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'pending_tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.plugins = function catPluginsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'plugins'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.recovery = function catRecoveryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'recovery' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'recovery'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.repositories = function catRepositoriesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'repositories'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.segments = function catSegmentsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'segments' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'segments'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.shards = function catShardsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'shards' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'shards'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.snapshots = function catSnapshotsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, repository, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((repository) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'snapshots' + '/' + encodeURIComponent(repository)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'snapshots'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.tasks = function catTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.templates = function catTemplatesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'templates' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'templates'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.threadPool = function catThreadPoolApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, threadPoolPatterns, thread_pool_patterns, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((thread_pool_patterns || threadPoolPatterns) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'thread_pool' + '/' + encodeURIComponent(thread_pool_patterns || threadPoolPatterns)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'thread_pool'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CatApi.prototype.transforms = function catTransformsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, transformId, transform_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((transform_id || transformId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms' + '/' + encodeURIComponent(transform_id || transformId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cat' + '/' + 'transforms'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(CatApi.prototype, {
ml_data_frame_analytics: { get () { return this.mlDataFrameAnalytics } },
ml_datafeeds: { get () { return this.mlDatafeeds } },
ml_jobs: { get () { return this.mlJobs } },
ml_trained_models: { get () { return this.mlTrainedModels } },
pending_tasks: { get () { return this.pendingTasks } },
thread_pool: { get () { return this.threadPool } }
})
module.exports = CatApi

View File

@ -1,403 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_active_shards']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards' }
function CcrApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
CcrApi.prototype.deleteAutoFollowPattern = function ccrDeleteAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.follow = function ccrFollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.followInfo = function ccrFollowInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'info'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.followStats = function ccrFollowStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.forgetFollower = function ccrForgetFollowerApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'forget_follower'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.getAutoFollowPattern = function ccrGetAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'auto_follow'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.pauseAutoFollowPattern = function ccrPauseAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'pause'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.pauseFollow = function ccrPauseFollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'pause_follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.putAutoFollowPattern = function ccrPutAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.resumeAutoFollowPattern = function ccrResumeAutoFollowPatternApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ccr' + '/' + 'auto_follow' + '/' + encodeURIComponent(name) + '/' + 'resume'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.resumeFollow = function ccrResumeFollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'resume_follow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.stats = function ccrStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ccr' + '/' + 'stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
CcrApi.prototype.unfollow = function ccrUnfollowApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ccr' + '/' + 'unfollow'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(CcrApi.prototype, {
delete_auto_follow_pattern: { get () { return this.deleteAutoFollowPattern } },
follow_info: { get () { return this.followInfo } },
follow_stats: { get () { return this.followStats } },
forget_follower: { get () { return this.forgetFollower } },
get_auto_follow_pattern: { get () { return this.getAutoFollowPattern } },
pause_auto_follow_pattern: { get () { return this.pauseAutoFollowPattern } },
pause_follow: { get () { return this.pauseFollow } },
put_auto_follow_pattern: { get () { return this.putAutoFollowPattern } },
resume_auto_follow_pattern: { get () { return this.resumeAutoFollowPattern } },
resume_follow: { get () { return this.resumeFollow } }
})
module.exports = CcrApi

View File

@ -1,55 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function clearScrollApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, scrollId, scroll_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((scroll_id || scrollId) != null) {
if (method == null) method = 'DELETE'
path = '/' + '_search' + '/' + 'scroll' + '/' + encodeURIComponent(scroll_id || scrollId)
} else {
if (method == null) method = 'DELETE'
path = '/' + '_search' + '/' + 'scroll'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = clearScrollApi

View File

@ -1,50 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function closePointInTimeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_pit'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = closePointInTimeApi

View File

@ -1,420 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['include_yes_decisions', 'include_disk_info', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'timeout', 'master_timeout', 'wait_for_removal', 'local', 'flat_settings', 'include_defaults', 'expand_wildcards', 'level', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_events', 'wait_for_no_relocating_shards', 'wait_for_no_initializing_shards', 'wait_for_status', 'node_ids', 'node_names', 'create', 'dry_run', 'explain', 'retry_failed', 'metric', 'wait_for_metadata_version', 'wait_for_timeout', 'ignore_unavailable', 'allow_no_indices']
const snakeCase = { includeYesDecisions: 'include_yes_decisions', includeDiskInfo: 'include_disk_info', errorTrace: 'error_trace', filterPath: 'filter_path', masterTimeout: 'master_timeout', waitForRemoval: 'wait_for_removal', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', expandWildcards: 'expand_wildcards', 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', nodeIds: 'node_ids', nodeNames: 'node_names', dryRun: 'dry_run', retryFailed: 'retry_failed', waitForMetadataVersion: 'wait_for_metadata_version', waitForTimeout: 'wait_for_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices' }
function ClusterApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_cluster' + '/' + 'allocation' + '/' + 'explain'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVotingConfigExclusionsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'HEAD'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_component_template'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.getSettings = function clusterGetSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'settings'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.health = function clusterHealthApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'health' + '/' + encodeURIComponent(index)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'health'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'pending_tasks'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConfigExclusionsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'voting_config_exclusions'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_component_template' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.putSettings = function clusterPutSettingsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_cluster' + '/' + 'settings'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_remote' + '/' + 'info'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.reroute = function clusterRerouteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_cluster' + '/' + 'reroute'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.state = function clusterStateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params.index != null && (params.metric == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: metric')
return handleError(err, callback)
}
let { method, body, metric, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((metric) != null && (index) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric) + '/' + encodeURIComponent(index)
} else if ((metric) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state' + '/' + encodeURIComponent(metric)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'state'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
ClusterApi.prototype.stats = function clusterStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, nodeId, node_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((node_id || nodeId) != null) {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'stats' + '/' + 'nodes' + '/' + encodeURIComponent(node_id || nodeId)
} else {
if (method == null) method = 'GET'
path = '/' + '_cluster' + '/' + 'stats'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(ClusterApi.prototype, {
allocation_explain: { get () { return this.allocationExplain } },
delete_component_template: { get () { return this.deleteComponentTemplate } },
delete_voting_config_exclusions: { get () { return this.deleteVotingConfigExclusions } },
exists_component_template: { get () { return this.existsComponentTemplate } },
get_component_template: { get () { return this.getComponentTemplate } },
get_settings: { get () { return this.getSettings } },
pending_tasks: { get () { return this.pendingTasks } },
post_voting_config_exclusions: { get () { return this.postVotingConfigExclusions } },
put_component_template: { get () { return this.putComponentTemplate } },
put_settings: { get () { return this.putSettings } },
remote_info: { get () { return this.remoteInfo } }
})
module.exports = ClusterApi

View File

@ -1,64 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['ignore_unavailable', 'ignore_throttled', 'allow_no_indices', 'expand_wildcards', 'min_score', 'preference', 'routing', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'terminate_after', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', ignoreThrottled: 'ignore_throttled', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', minScore: 'min_score', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', terminateAfter: 'terminate_after', errorTrace: 'error_trace', filterPath: 'filter_path' }
function countApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required url components
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_count'
} else if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_count'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_count'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = countApi

View File

@ -1,69 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'version', 'version_type', 'pipeline', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function createApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_create'
} else {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_create' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = createApi

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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['accept_data_loss', 'timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { acceptDataLoss: 'accept_data_loss', masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
function DanglingIndicesApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
DanglingIndicesApi.prototype.deleteDanglingIndex = function danglingIndicesDeleteDanglingIndexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index_uuid == null && params.indexUuid == null) {
const err = new this[kConfigurationError]('Missing required parameter: index_uuid or indexUuid')
return handleError(err, callback)
}
let { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImportDanglingIndexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index_uuid == null && params.indexUuid == null) {
const err = new this[kConfigurationError]('Missing required parameter: index_uuid or indexUuid')
return handleError(err, callback)
}
let { method, body, indexUuid, index_uuid, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_dangling' + '/' + encodeURIComponent(index_uuid || indexUuid)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
DanglingIndicesApi.prototype.listDanglingIndices = function danglingIndicesListDanglingIndicesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_dangling'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(DanglingIndicesApi.prototype, {
delete_dangling_index: { get () { return this.deleteDanglingIndex } },
import_dangling_index: { get () { return this.importDanglingIndex } },
list_dangling_indices: { get () { return this.listDanglingIndices } }
})
module.exports = DanglingIndicesApi

View File

@ -1,65 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', 'refresh', 'routing', 'timeout', 'if_seq_no', 'if_primary_term', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function deleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'DELETE'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = deleteApi

View File

@ -1,71 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyzer', 'analyze_wildcard', 'default_operator', 'df', 'from', 'ignore_unavailable', 'allow_no_indices', 'conflicts', 'expand_wildcards', 'lenient', 'preference', 'q', 'routing', 'scroll', 'search_type', 'search_timeout', 'size', 'max_docs', 'sort', 'terminate_after', 'stats', 'version', 'request_cache', 'refresh', 'timeout', 'wait_for_active_shards', 'scroll_size', 'wait_for_completion', 'requests_per_second', 'slices', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', searchType: 'search_type', searchTimeout: 'search_timeout', maxDocs: 'max_docs', terminateAfter: 'terminate_after', requestCache: 'request_cache', waitForActiveShards: 'wait_for_active_shards', scrollSize: 'scroll_size', waitForCompletion: 'wait_for_completion', requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
function deleteByQueryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_delete_by_query'
} else {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_delete_by_query'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = deleteByQueryApi

View File

@ -1,60 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['requests_per_second', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { requestsPerSecond: 'requests_per_second', errorTrace: 'error_trace', filterPath: 'filter_path' }
function deleteByQueryRethrottleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.task_id == null && params.taskId == null) {
const err = new this[kConfigurationError]('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params.requests_per_second == null && params.requestsPerSecond == null) {
const err = new this[kConfigurationError]('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
let { method, body, taskId, task_id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_delete_by_query' + '/' + encodeURIComponent(task_id || taskId) + '/' + '_rethrottle'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = deleteByQueryRethrottleApi

View File

@ -1,56 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['timeout', 'master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
function deleteScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = deleteScriptApi

View File

@ -1,173 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletion: 'wait_for_completion' }
function EnrichApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
EnrichApi.prototype.deletePolicy = function enrichDeletePolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
EnrichApi.prototype.executePolicy = function enrichExecutePolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name) + '/' + '_execute'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
EnrichApi.prototype.getPolicy = function enrichGetPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((name) != null) {
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
} else {
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + 'policy'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
EnrichApi.prototype.putPolicy = function enrichPutPolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.name == null) {
const err = new this[kConfigurationError]('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, name, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_enrich' + '/' + 'policy' + '/' + encodeURIComponent(name)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
EnrichApi.prototype.stats = function enrichStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_enrich' + '/' + '_stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(EnrichApi.prototype, {
delete_policy: { get () { return this.deletePolicy } },
execute_policy: { get () { return this.executePolicy } },
get_policy: { get () { return this.getPolicy } },
put_policy: { get () { return this.putPolicy } }
})
module.exports = EnrichApi

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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_completion_timeout', 'keep_alive', 'keep_on_completion']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', waitForCompletionTimeout: 'wait_for_completion_timeout', keepAlive: 'keep_alive', keepOnCompletion: 'keep_on_completion' }
function EqlApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
EqlApi.prototype.delete = function eqlDeleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
EqlApi.prototype.get = function eqlGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
EqlApi.prototype.getStatus = function eqlGetStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_eql' + '/' + 'search' + '/' + 'status' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
EqlApi.prototype.search = function eqlSearchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_eql' + '/' + 'search'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(EqlApi.prototype, {
get_status: { get () { return this.getStatus } }
})
module.exports = EqlApi

View File

@ -1,65 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function existsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = existsApi

View File

@ -1,74 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function existsSourceApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params.id != null && (params.type == null || params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: type, index')
return handleError(err, callback)
} else if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
if (method == null) method = 'HEAD'
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = existsSourceApi

View File

@ -1,65 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['analyze_wildcard', 'analyzer', 'default_operator', 'df', 'stored_fields', 'lenient', 'preference', 'q', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' }
function explainApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_explain'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_explain' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = explainApi

View File

@ -1,81 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
function FeaturesApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
FeaturesApi.prototype.getFeatures = function featuresGetFeaturesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_features'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
FeaturesApi.prototype.resetFeatures = function featuresResetFeaturesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_features' + '/' + '_reset'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(FeaturesApi.prototype, {
get_features: { get () { return this.getFeatures } },
reset_features: { get () { return this.resetFeatures } }
})
module.exports = FeaturesApi

View File

@ -1,55 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['fields', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'include_unmapped', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', includeUnmapped: 'include_unmapped', errorTrace: 'error_trace', filterPath: 'filter_path' }
function fieldCapsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_field_caps'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_field_caps'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = fieldCapsApi

View File

@ -1,124 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_advance', 'wait_for_index', 'checkpoints', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'wait_for_checkpoints', 'wait_for_checkpoints_timeout', 'allow_partial_search_results']
const snakeCase = { waitForAdvance: 'wait_for_advance', waitForIndex: 'wait_for_index', errorTrace: 'error_trace', filterPath: 'filter_path', waitForCheckpoints: 'wait_for_checkpoints', waitForCheckpointsTimeout: 'wait_for_checkpoints_timeout', allowPartialSearchResults: 'allow_partial_search_results' }
function FleetApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
FleetApi.prototype.globalCheckpoints = function fleetGlobalCheckpointsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + 'global_checkpoints'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
FleetApi.prototype.msearch = function fleetMsearchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_msearch'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_fleet' + '/' + '_fleet_msearch'
}
// build request object
const request = {
method,
path,
bulkBody: body,
querystring
}
return this.transport.request(request, options, callback)
}
FleetApi.prototype.search = function fleetSearchApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_fleet' + '/' + '_fleet_search'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(FleetApi.prototype, {
global_checkpoints: { get () { return this.globalCheckpoints } }
})
module.exports = FleetApi

View File

@ -1,65 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function getApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = getApi

View File

@ -1,56 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['master_timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path' }
function getScriptApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_scripts' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = getScriptApi

View File

@ -1,50 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function getScriptContextApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_script_context'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = getScriptContextApi

View File

@ -1,50 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function getScriptLanguagesApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_script_language'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = getScriptLanguagesApi

View File

@ -1,65 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'version', 'version_type', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', versionType: 'version_type', errorTrace: 'error_trace', filterPath: 'filter_path' }
function getSourceApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/' + '_source'
} else {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_source' + '/' + encodeURIComponent(id)
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = getSourceApi

View File

@ -1,72 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['routing', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function GraphApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
GraphApi.prototype.explore = function graphExploreApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_graph' + '/' + 'explore'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_graph' + '/' + 'explore'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = GraphApi

View File

@ -1,317 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'only_managed', 'only_errors', 'dry_run']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', onlyManaged: 'only_managed', onlyErrors: 'only_errors', dryRun: 'dry_run' }
function IlmApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
IlmApi.prototype.deleteLifecycle = function ilmDeleteLifecycleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.policy == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy')
return handleError(err, callback)
}
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.explainLifecycle = function ilmExplainLifecycleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'explain'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.getLifecycle = function ilmGetLifecycleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((policy) != null) {
if (method == null) method = 'GET'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
} else {
if (method == null) method = 'GET'
path = '/' + '_ilm' + '/' + 'policy'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.getStatus = function ilmGetStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ilm' + '/' + 'status'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.migrateToDataTiers = function ilmMigrateToDataTiersApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'migrate_to_data_tiers'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.moveToStep = function ilmMoveToStepApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'move' + '/' + encodeURIComponent(index)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.putLifecycle = function ilmPutLifecycleApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.policy == null) {
const err = new this[kConfigurationError]('Missing required parameter: policy')
return handleError(err, callback)
}
let { method, body, policy, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_ilm' + '/' + 'policy' + '/' + encodeURIComponent(policy)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.removePolicy = function ilmRemovePolicyApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'remove'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.retry = function ilmRetryApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_ilm' + '/' + 'retry'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.start = function ilmStartApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'start'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IlmApi.prototype.stop = function ilmStopApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_ilm' + '/' + 'stop'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(IlmApi.prototype, {
delete_lifecycle: { get () { return this.deleteLifecycle } },
explain_lifecycle: { get () { return this.explainLifecycle } },
get_lifecycle: { get () { return this.getLifecycle } },
get_status: { get () { return this.getStatus } },
migrate_to_data_tiers: { get () { return this.migrateToDataTiers } },
move_to_step: { get () { return this.moveToStep } },
put_lifecycle: { get () { return this.putLifecycle } },
remove_policy: { get () { return this.removePolicy } }
})
module.exports = IlmApi

View File

@ -1,71 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['wait_for_active_shards', 'op_type', 'refresh', 'routing', 'timeout', 'version', 'version_type', 'if_seq_no', 'if_primary_term', 'pipeline', 'require_alias', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { waitForActiveShards: 'wait_for_active_shards', opType: 'op_type', versionType: 'version_type', ifSeqNo: 'if_seq_no', ifPrimaryTerm: 'if_primary_term', requireAlias: 'require_alias', errorTrace: 'error_trace', filterPath: 'filter_path' }
function indexApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + encodeURIComponent(id)
} else if ((index) != null && (id) != null) {
if (method == null) method = 'PUT'
path = '/' + encodeURIComponent(index) + '/' + '_doc' + '/' + encodeURIComponent(id)
} else if ((index) != null && (type) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type)
} else {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_doc'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = indexApi

File diff suppressed because it is too large Load Diff

View File

@ -1,50 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function infoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = infoApi

View File

@ -1,200 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['master_timeout', 'timeout', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'summary', 'if_version', 'verbose']
const snakeCase = { masterTimeout: 'master_timeout', errorTrace: 'error_trace', filterPath: 'filter_path', ifVersion: 'if_version' }
function IngestApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ingest' + '/' + 'geoip' + '/' + 'stats'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
IngestApi.prototype.getPipeline = function ingestGetPipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((id) != null) {
if (method == null) method = 'GET'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
} else {
if (method == null) method = 'GET'
path = '/' + '_ingest' + '/' + 'pipeline'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
IngestApi.prototype.processorGrok = function ingestProcessorGrokApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_ingest' + '/' + 'processor' + '/' + 'grok'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
IngestApi.prototype.putPipeline = function ingestPutPipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
IngestApi.prototype.simulate = function ingestSimulateApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((id) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + encodeURIComponent(id) + '/' + '_simulate'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_ingest' + '/' + 'pipeline' + '/' + '_simulate'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(IngestApi.prototype, {
delete_pipeline: { get () { return this.deletePipeline } },
geo_ip_stats: { get () { return this.geoIpStats } },
get_pipeline: { get () { return this.getPipeline } },
processor_grok: { get () { return this.processorGrok } },
put_pipeline: { get () { return this.putPipeline } }
})
module.exports = IngestApi

View File

@ -1,188 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path', 'local', 'accept_enterprise', 'acknowledge', 'type']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path', acceptEnterprise: 'accept_enterprise' }
function LicenseApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
LicenseApi.prototype.delete = function licenseDeleteApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_license'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
LicenseApi.prototype.get = function licenseGetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_license'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
LicenseApi.prototype.getBasicStatus = function licenseGetBasicStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_license' + '/' + 'basic_status'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
LicenseApi.prototype.getTrialStatus = function licenseGetTrialStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_license' + '/' + 'trial_status'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
LicenseApi.prototype.post = function licensePostApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_license'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
LicenseApi.prototype.postStartBasic = function licensePostStartBasicApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_license' + '/' + 'start_basic'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
LicenseApi.prototype.postStartTrial = function licensePostStartTrialApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_license' + '/' + 'start_trial'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(LicenseApi.prototype, {
get_basic_status: { get () { return this.getBasicStatus } },
get_trial_status: { get () { return this.getTrialStatus } },
post_start_basic: { get () { return this.postStartBasic } },
post_start_trial: { get () { return this.postStartTrial } }
})
module.exports = LicenseApi

View File

@ -1,125 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function LogstashApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
LogstashApi.prototype.deletePipeline = function logstashDeletePipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'DELETE'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
LogstashApi.prototype.getPipeline = function logstashGetPipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
LogstashApi.prototype.putPipeline = function logstashPutPipelineApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.id == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'PUT'
path = '/' + '_logstash' + '/' + 'pipeline' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(LogstashApi.prototype, {
delete_pipeline: { get () { return this.deletePipeline } },
get_pipeline: { get () { return this.getPipeline } },
put_pipeline: { get () { return this.putPipeline } }
})
module.exports = LogstashApi

View File

@ -1,70 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['stored_fields', 'preference', 'realtime', 'refresh', 'routing', '_source', '_source_excludes', '_source_exclude', '_source_includes', '_source_include', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { storedFields: 'stored_fields', _sourceExcludes: '_source_excludes', _sourceExclude: '_source_exclude', _sourceIncludes: '_source_includes', _sourceInclude: '_source_include', errorTrace: 'error_trace', filterPath: 'filter_path' }
function mgetApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params.type != null && (params.index == null)) {
const err = new this[kConfigurationError]('Missing required parameter of the url: index')
return handleError(err, callback)
}
let { method, body, index, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null && (type) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mget'
} else if ((index) != null) {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_mget'
} else {
if (method == null) method = body == null ? 'GET' : 'POST'
path = '/' + '_mget'
}
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = mgetApi

View File

@ -1,107 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }
function MigrationApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
MigrationApi.prototype.deprecations = function migrationDeprecationsApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_migration' + '/' + 'deprecations'
} else {
if (method == null) method = 'GET'
path = '/' + '_migration' + '/' + 'deprecations'
}
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
MigrationApi.prototype.getFeatureUpgradeStatus = function migrationGetFeatureUpgradeStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'GET'
path = '/' + '_migration' + '/' + 'system_features'
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
MigrationApi.prototype.postFeatureUpgrade = function migrationPostFeatureUpgradeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
let { method, body, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if (method == null) method = 'POST'
path = '/' + '_migration' + '/' + 'system_features'
// build request object
const request = {
method,
path,
body: body || '',
querystring
}
return this.transport.request(request, options, callback)
}
Object.defineProperties(MigrationApi.prototype, {
get_feature_upgrade_status: { get () { return this.getFeatureUpgradeStatus } },
post_feature_upgrade: { get () { return this.postFeatureUpgrade } }
})
module.exports = MigrationApi

File diff suppressed because it is too large Load Diff

View File

@ -1,66 +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 */
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
const acceptedQuerystring = ['system_id', 'system_api_version', 'interval', 'pretty', 'human', 'error_trace', 'source', 'filter_path']
const snakeCase = { systemId: 'system_id', systemApiVersion: 'system_api_version', errorTrace: 'error_trace', filterPath: 'filter_path' }
function MonitoringApi (transport, ConfigurationError) {
this.transport = transport
this[kConfigurationError] = ConfigurationError
}
MonitoringApi.prototype.bulk = function monitoringBulkApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params.body == null) {
const err = new this[kConfigurationError]('Missing required parameter: body')
return handleError(err, callback)
}
let { method, body, type, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
let path = ''
if ((type) != null) {
if (method == null) method = 'POST'
path = '/' + '_monitoring' + '/' + encodeURIComponent(type) + '/' + 'bulk'
} else {
if (method == null) method = 'POST'
path = '/' + '_monitoring' + '/' + 'bulk'
}
// build request object
const request = {
method,
path,
bulkBody: body,
querystring
}
return this.transport.request(request, options, callback)
}
module.exports = MonitoringApi

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