Compare commits

...

135 Commits

Author SHA1 Message Date
8166b3b0b4 Auto-generated API code (#2878) 2025-06-23 13:23:48 -04:00
05b7ee6f5b Auto-generated API code (#2867) 2025-06-09 10:29:04 -05:00
d1ba1423c8 Auto-generated API code (#2857) 2025-06-02 17:10:39 +00:00
eaa6c1e2b3 Auto-generated API code (#2851) 2025-05-27 15:14:43 +00:00
a5e8f74f8c Auto-generated API code (#2830) 2025-05-19 19:35:47 +00:00
c0f28a6f03 Export helper types (#2822) (#2823)
(cherry picked from commit b030084f24)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-05-05 13:05:54 -05:00
119e979c2b Auto-generated API code (#2818) 2025-05-05 11:19:55 -05:00
da2cb5fd27 Update dependency rimraf to v6 (#2802) (#2811)
(cherry picked from commit 8ba13d31d8)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-29 10:42:10 -05:00
6aaf80500e Update dependency proxy to v2 (#2801) (#2810)
(cherry picked from commit 3da4572d1b)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-29 10:31:35 -05:00
e46109675a Auto-generated API code (#2804) 2025-04-28 10:11:23 -05:00
e041b3ac5c Update dependency @types/node to v22.15.2 (#2799) (#2809)
(cherry picked from commit d6cb0dd5b7)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-28 10:02:09 -05:00
803f7f00c9 Bump to 8.18.2 (#2795) 2025-04-25 10:45:27 -05:00
72b0401f8e 8.18.2 changelog (#2793) 2025-04-25 10:42:05 -05:00
3c2f0723d5 Use async reader for parsing Apache Arrow responses (#2788) (#2791) 2025-04-24 14:25:10 -05:00
955113e51f Support Apache Arrow 19 (#2782) (#2784) 2025-04-22 10:20:29 -05:00
72444ed155 Migrate integration tests to built JS files (#2750) (#2779) 2025-04-22 09:16:05 -05:00
2694b5d16c Release notes fo 8.18.1 (#2763) 2025-04-21 13:51:50 -05:00
c0d22ab963 Auto-generated API code (#2774) 2025-04-21 12:49:12 -05:00
c61b8598a4 CODEOWNERS for supply chain attack prevention (#2768) (#2769)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-04-18 10:26:05 -05:00
fac687d4af Improve deserialization docs (#2766) 2025-04-17 15:10:08 -05:00
eeb0d94046 Put node roles support back (#2759) 2025-04-17 10:45:18 -05:00
94a7274647 Bump to 8.18.1 (#2760) 2025-04-16 13:40:57 -05:00
db41d2895c Bump transport to latest 8.x version (#2757) 2025-04-16 13:28:47 -05:00
f155f68702 Add changelog for 8.18 (#2746) 2025-04-15 14:20:01 -05:00
770fac4b9d Bug #2694 (#2731) (#2743)
Co-authored-by: Siddhu545 <Siddharthkhengare@gmail.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
Co-authored-by: Siddharth Khengare <67581382+Siddhu545@users.noreply.github.com>
2025-04-15 13:26:17 -05:00
2241ae667e Update dependency @types/ms to v2 (#2733) (#2737)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-14 12:16:34 -05:00
6751482e21 Auto-generated API code (#2734) 2025-04-14 12:15:05 -05:00
1bb105a469 Update dependency @types/node to v22.14.1 (#2732) (#2736)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-14 11:36:35 -05:00
257ec2214e Auto-generated API code (#2719) 2025-04-08 11:41:47 -05:00
5f49e49823 Make example generation quiet by default (#2722) (#2723)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-04-08 11:39:09 -05:00
986b756c6b Auto-generated API code (#2706) 2025-04-07 14:42:49 -05:00
429fdab80b Update dependency typescript to v5.8.3 (#2705) (#2710)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit fd0c9992b3)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-07 11:20:09 -05:00
6042bcd20c [DOCS]Removes link pointing to EIS reference docs. (#2708) 2025-04-07 11:02:34 -05:00
3d59389b9d Bump to 8.18.0 (#2702) 2025-04-04 13:59:32 -05:00
31d9398be4 Auto-generated API code (#2689) 2025-03-31 11:12:20 -05:00
bd7ba9b962 Update dependency @types/node to v22.13.14 (#2686) (#2692)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 64ef5359e7)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-31 11:10:39 -05:00
06cb5b4926 Update dependency @types/node to v22.13.13 (#2677) (#2682)
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>
(cherry picked from commit d9e9906c4e)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-26 10:45:52 -05:00
2d75e0a16c Auto-generated API code (#2678) 2025-03-24 12:19:59 -05:00
e502d2f17a Drop broken support for roles (#2674) 2025-03-21 14:24:45 -05:00
a061576809 Update dependency tap to v21.1.0 (#2659) (#2670)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 0f09faefbd)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-21 12:51:29 -05:00
0ed7cd016a Update dependency semver to v7.7.1 (#2654) (#2662)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 85396ddc67)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-21 12:48:13 -05:00
843ad31ec5 Update dependency typescript to v5.8.2 (#2660) (#2669)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit b775456296)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-21 12:45:58 -05:00
31e1247df5 Update dependency @types/node to v22.13.10 (#2653) (#2661)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 16b51c2315)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-21 12:43:25 -05:00
ccd69195dd Auto-generated API code (#2646) 2025-03-20 01:00:58 +00:00
38cc36656c Update dependency @types/node to v22.13.9 (#2641) (#2652)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit e2eb6ef586)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-07 15:16:01 -06:00
23b4434d07 Update dependency @elastic/request-converter to v8.18.0 (#2642) (#2651)f
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>
(cherry picked from commit 6836a3f1c7)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-07 14:57:46 -06:00
6fcb168445 Update dependency chai to v5.2.0 (#2624) (#2630)
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>
(cherry picked from commit d86eb82e82)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-24 13:47:32 -06:00
54e2088acd Auto-generated API code (#2628) 2025-02-24 10:56:26 -06:00
c480a24b31 Update dependency @types/node to v22.13.5 (#2623) (#2629)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit c99abab058)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-24 10:53:51 -06:00
4d4f18db5f Auto-generated API code (#2620) 2025-02-18 10:40:04 -06:00
ee3936b193 Update dependency tap to v21.0.2 (#2617) (#2622)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 20fb610d82)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-18 10:38:49 -06:00
b19fed4fef Update dependency @types/node to v22.13.4 (#2616) (#2621)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit c8504fe616)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-18 10:38:19 -06:00
b62e2427fb Auto-generated API code (#2611) 2025-02-10 13:19:42 -06:00
976282f95b Update dependency @types/node to v22.13.1 (#2607) (#2613)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit a25bc97297)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-02-10 13:00:40 -06:00
355e108319 Report correct transport connection type in telemetry (#2599) (#2601)
Fixes #2324

(cherry picked from commit 172180cb21)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-02-03 13:10:48 -06:00
37e20ee85d Auto-generated API code (#2598) 2025-02-03 12:54:23 -06:00
93e2b8b695 Auto-generated API code (#2581) 2025-01-28 11:52:55 -06:00
9c092a0b30 Update dependency @types/node to v22.10.7 (#2576) (#2582)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 5f9561d566)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-21 13:11:24 -06:00
d161c0a428 [Backport 8.x] Update dependency typescript to v5.7.3 (#2571)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 2bcbd36d75)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-13 10:19:45 -06:00
8c7d4c42e6 Auto-generated code for 8.x (#2568) 2025-01-13 10:06:57 -06:00
fbc4fa0685 [Backport 8.x] Update dependency @types/node to v22.10.5 (#2563)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 2b2a9947c7)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-08 13:25:53 -06:00
cb6084b7c3 Auto-generated code for 8.x (#2548) 2025-01-07 12:52:35 -06:00
35ce1bfef1 [Backport 8.x] Drop @types/tap for built-in types (#2562)
(cherry picked from commit 0ee486bc9c)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-01-07 11:07:00 -06:00
151aef2707 [Backport 8.x] Update @sinonjs/fake-timers digest to 48f089f (#2560)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit f835fa3b12)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-06 12:51:31 -06:00
8579a85fde [Backport 8.x] Update dependency @elastic/request-converter to v8.17.0 (#2558)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit e688f36396)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-01-06 12:40:52 -06:00
be0400789a Prep 8.17.0 (#2543) 2024-12-12 10:50:16 -06:00
e2905c5708 Prep 8.16.3 for release (#2540) 2024-12-12 09:35:28 -06:00
f02c66cdcc Auto-generated code for 8.x (#2529) 2024-12-11 10:12:08 -06:00
8d868df86a [Backport 8.x] Parse branch name during code gen including 'x' (#2535)
(cherry picked from commit e992c329c3)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-12-10 11:13:03 -06:00
5ebd549ad1 [Backport 8.x] Checkout correct branch of generator (#2533)
(cherry picked from commit ed3cace127)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-12-10 10:19:55 -06:00
7f364b75b7 [Backport 8.x] Codegen for 8.x clients should use the 8.x generator branch (#2519)
(cherry picked from commit 15b9ee2f06)

Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-12-05 10:39:22 -06:00
fe0ddb31a1 [Backport 8.x] Update dependency into-stream to v8 (#2513)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 101f34bd5e)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-12-02 12:18:18 -06:00
955eb121fb [Backport 8.x] Update dependency @types/node to v22.10.1 (#2510)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit 86f488f68f)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-12-02 12:13:54 -06:00
da1a798310 [Backport 8.x] Update dependency @elastic/request-converter to v8.16.2 (#2512)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
(cherry picked from commit c1e90b12f0)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-12-02 12:13:07 -06:00
82c9e5df37 [Backport 8.x] Update dependency typescript to v5.7.2 (#2511)
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>
(cherry picked from commit 5cb670256e)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-12-02 12:09:36 -06:00
4e1273ef33 Auto-generated code for 8.x (#2500) 2024-12-02 12:06:57 -06:00
dbd0ec2457 [Backport 8.x] Update changelog to include 8.16.2 and 8.15.3 (#2495)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-21 10:42:34 -06:00
fc7109aa66 [Backport 8.x] Ignore tap artifacts (#2491)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-21 10:21:56 -06:00
758b745254 Add docstrings for Client class and related properties (#2484) (#2485)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-21 10:20:37 -06:00
3f3e9bac1e [Backport 8.x] Add changelog for 8.16.1 (#2480)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-18 13:33:47 -06:00
b3b9d40293 [Backport 8.x] Fix ECMAScript import (#2476)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-18 12:34:14 -06:00
14cdd64f7d Update dependency @elastic/request-converter to v8.16.1 (#2469) (#2474)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-18 11:23:45 -06:00
5d41135190 Auto-generated code for 8.x (#2471) 2024-11-18 11:21:08 -06:00
e4c4f1acb7 [Backport 8.x] Update integration test automation branches (#2465)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-18 11:19:20 -06:00
ad3caf9e94 [Backport 8.x] Upgrade ts-standard (#2461)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-13 10:45:23 -06:00
fcb421a54e [Backport 8.x] Update dependency typescript to v5 (#2458)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-12 13:38:46 -06:00
71e6e7007a [Backport 8.x] Update dependency chai to v5 (#2457)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-12 11:29:02 -06:00
dabe34dae8 [Backport 8.x] Address feedback and add clarity (#2451)
Co-authored-by: Marci W <333176+marciw@users.noreply.github.com>
2024-11-12 11:07:14 -06:00
346663f704 [Backport 8.x] Update dependency @types/split2 to v4 (#2448)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-11 11:52:38 -06:00
32345dac41 [Backport 8.x] Update dependency @types/node to v22 (#2447)
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 11:52:06 -06:00
6efbed6be1 Auto-generated code for 8.x (#2441) 2024-11-11 10:41:35 -06:00
8be306b82d [Backport 8.x] Add changelog for 8.15.2 (#2445)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-11 09:49:50 -06:00
979475b542 Update dependency @types/node to v18.19.64 (#2421) (#2431)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-11-06 13:10:34 -06:00
a829634f83 [Backport 8.x] Add _id to the result of helpers.search (#2434)
(cherry picked from commit 2455dac4e5)

Co-authored-by: Rami <72725910+ramikg@users.noreply.github.com>
2024-11-06 12:27:50 -06:00
dd9b38b051 [Backport 8.x] Add streaming support to Arrow helper (#2429)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-11-04 15:48:30 -06:00
0e98719d60 Auto-generated code for 8.x (#2426) 2024-11-04 09:58:15 -06:00
7da9976777 Auto-generated code for 8.x (#2412)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-28 15:12:33 -05:00
4ca358cad6 [Backport 8.x] Skip flaky test (#2418)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-28 11:57:48 -05:00
cf2eda1ab3 [Backport 8.x] Don't use hash-based Docker image version (#2415)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-28 11:27:40 -05:00
5d747eec0c [Backport 8.x] Pin dependencies (#2413)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-10-28 11:26:29 -05:00
f38cbde243 [Backport 8.x] Don't generate coverage during standard unit test run (#2405)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-24 12:07:39 -05:00
61c18a6ba5 [Backport 8.x] Upgrade tap to latest (#2402)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-24 11:38:47 -05:00
432cd36879 [Backport 8.x] Basic helper for ES|QL's Apache Arrow output format (#2394)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-23 08:46:40 -05:00
e7de86a1f2 [Backport 8.x] Upgrade transport to 8.8.1 (#2390)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-21 11:57:53 -05:00
f23f77cc41 Manually backport #2375 to 8.x (#2389) 2024-10-21 11:40:05 -05:00
09b5c84d24 [Backport 8.x] Respect disablePrototypePoisoningProtection option (#2388)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-21 11:34:12 -05:00
604d4aefa7 [Backport 8.x] Update changelog for 8.15.1 (#2387)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-21 11:05:24 -05:00
e279b3ebfa [Backport 8.x] Add doc about timeout best practices (#2386)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2024-10-21 11:04:55 -05:00
fceebae8ae Auto-generated code for 8.x (#2372) 2024-10-14 11:18:55 -05:00
e45ed28c05 Auto-generated code for 8.x (#2369) 2024-09-30 13:41:23 -05:00
58b457eedc Changes to make auto-merge action work (#2360)
Hopefully.
2024-09-03 13:06:50 -05:00
132d6d6062 Auto-generated code for main (#2357) 2024-09-03 09:36:33 -05:00
9e08aaebe2 Add experimental Bun test runner (#2353)
* Add experimental Bun test runner

* Add TypeScript export for Bun

* Clean up tests to prevent TypeScript build warnings

* Use Node.js 22 to run codegen

* Squash a couple TypeScript errors during tests

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

* Ignore Bun lockfile

* Drop unused index.ts

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

* Make code more ESM-friendly

* Add missing mjs file

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

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

* Migrate bug issue template to a form

* Migrate question issue template to a form

* Add support link

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

* Fix bad request-converter version

* Switch back to pull_request

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

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

* Update docs/observability.asciidoc

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

* Fix docs typo

* Fix bad link references in asciidoc changelog

* Drop link to 8.15 changelog

For now. Link just doesn't work yet.

---------

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
2024-07-01 15:47:50 -05:00
f34bb6aa28 Upgrade transport to 8.7.0 (#2300) 2024-07-01 13:29:55 -05:00
1f9db892ea Drop deprecated use of npm install --production=false (#2298) 2024-07-01 12:36:52 -05:00
3692 changed files with 99151 additions and 13511 deletions

View File

@ -3,14 +3,14 @@ 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/*
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 --production=false
RUN npm install
COPY . .

View File

@ -24,7 +24,7 @@ USER ${BUILDER_UID}:${BUILDER_GID}
# install dependencies
COPY package.json .
RUN npm install --production=false
RUN npm install
# copy project files
COPY . .

View File

@ -125,6 +125,13 @@ async function codegen (args) {
await $`cp -R ${join(import.meta.url, '..', '..', 'elastic-client-generator-js', 'output')}/* ${join(import.meta.url, '..', 'src', 'api')}`
await $`mv ${join(import.meta.url, '..', 'src', 'api', 'reference.asciidoc')} ${join(import.meta.url, '..', 'docs', 'reference.asciidoc')}`
await $`npm run build`
// run docs example generation
if (version === 'main') {
await $`node ./scripts/generate-docs-examples.js`
} else {
await $`node ./scripts/generate-docs-examples.js ${version.split('.').slice(0, 2).join('.')}`
}
}
function onError (err) {

View File

@ -1,17 +1,20 @@
---
agents:
provider: "gcp"
image: family/core-ubuntu-2204
memory: "8G"
cpu: "2"
steps:
- label: ":elasticsearch: :javascript: ES JavaScript ({{ matrix.nodejs }}) Test Suite: {{ matrix.suite }}"
agents:
provider: "gcp"
- label: ":elasticsearch: :javascript: ES JavaScript ({{ matrix.nodejs }})"
env:
NODE_VERSION: "{{ matrix.nodejs }}"
TEST_SUITE: "{{ matrix.suite }}"
STACK_VERSION: 8.15.0
TEST_SUITE: "platinum"
STACK_VERSION: 9.0.0
GITHUB_TOKEN_PATH: "secret/ci/elastic-elasticsearch-js/github-token"
TEST_ES_STACK: "1"
matrix:
setup:
suite:
- "free"
- "platinum"
nodejs:
- "18"
- "20"
@ -21,9 +24,6 @@ steps:
- wait: ~
continue_on_failure: true
- label: ":junit: Test results"
agents:
provider: "gcp"
image: family/core-ubuntu-2204
plugins:
- junit-annotate#v2.4.1:
artifacts: "junit-output/junit-*.xml"

View File

@ -10,22 +10,29 @@ export NODE_VERSION=${NODE_VERSION:-18}
echo "--- :javascript: Building Docker image"
docker build \
--file "$script_path/Dockerfile" \
--tag elastic/elasticsearch-js \
--build-arg NODE_VERSION="$NODE_VERSION" \
.
--file "$script_path/Dockerfile" \
--tag elastic/elasticsearch-js \
--build-arg NODE_VERSION="$NODE_VERSION" \
.
echo "--- :javascript: Running $TEST_SUITE tests"
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_SERVER=${elasticsearch_url}" \
--env "ELASTIC_PASSWORD=${elastic_password}" \
--env "TEST_SUITE=${TEST_SUITE}" \
--env "ELASTIC_USER=elastic" \
--env "BUILDKITE=true" \
--volume "$repo/junit-output:/junit-output" \
--name elasticsearch-js \
--rm \
elastic/elasticsearch-js \
bash -c "npm run test:integration; [ -f ./$TEST_SUITE-report-junit.xml ] && mv ./$TEST_SUITE-report-junit.xml /junit-output/junit-$BUILDKITE_JOB_ID.xml || echo 'No JUnit artifact found'"
--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

@ -5,3 +5,7 @@ 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,50 +0,0 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
labels: ["Category: Bug"]
---
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.**
## 🐛 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: 18.x, 20.x, etc.
validations:
required: true
- type: input
id: client-version
attributes:
label: "@elastic/elasticsearch version"
placeholder: 7.17.0, 8.14.1, etc.
validations:
required: true
- type: input
id: os
attributes:
label: Operating system
placeholder: Ubuntu 22.04, macOS, etc.
validations:
required: true
- type: input
id: env-info
attributes:
label: Any other relevant environment information

View File

@ -1,23 +0,0 @@
---
name: 🚀 Feature Proposal
about: Submit a proposal for a new feature
labels: ["Category: 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 `Category: Not an issue` 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,11 +0,0 @@
---
name: 💬 Questions / Help
about: If you have questions, please check our Gitter or Help repo
labels: ["Category: Question"]
---
## 💬 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,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).

196
.github/make.sh vendored
View File

@ -37,7 +37,7 @@ product="elastic/elasticsearch-js"
output_folder=".buildkite/output"
codegen_folder=".buildkite/output"
OUTPUT_DIR="$repo/${output_folder}"
NODE_JS_VERSION=18
NODE_JS_VERSION=22
WORKFLOW=${WORKFLOW-staging}
mkdir -p "$OUTPUT_DIR"
@ -46,84 +46,84 @@ echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m"
case $CMD in
clean)
echo -e "\033[36;1mTARGET: clean workspace $output_folder\033[0m"
rm -rf "$output_folder"
echo -e "\033[32;1mdone.\033[0m"
exit 0
;;
assemble)
if [ -v $VERSION ]; then
echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
exit 1
fi
echo -e "\033[36;1mTARGET: assemble artifact $VERSION\033[0m"
TASK=release
TASK_ARGS=("$VERSION" "$output_folder")
;;
codegen)
if [ -v "$VERSION" ] || [[ -z "$VERSION" ]]; then
# fall back to branch name or `main` if no VERSION is set
branch_name=$(git rev-parse --abbrev-ref HEAD)
if [[ "$branch_name" =~ ^[0-9]+\.[0-9]+ ]]; then
echo -e "\033[36;1mTARGET: codegen -> No VERSION argument found, using branch name: \`$branch_name\`\033[0m"
VERSION="$branch_name"
else
echo -e "\033[36;1mTARGET: codegen -> No VERSION argument found, using \`main\`\033[0m"
VERSION="main"
fi
fi
if [ "$VERSION" = 'main' ]; then
echo -e "\033[36;1mTARGET: codegen API $VERSION\033[0m"
else
echo -e "\033[36;1mTARGET: codegen API v$VERSION\033[0m"
fi
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
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
# ------------------------------------------------------- #
@ -150,7 +150,7 @@ if [[ -z "${BUILDKITE+x}" ]] && [[ -z "${CI+x}" ]] && [[ -z "${GITHUB_ACTIONS+x}
-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" \
--volume "$(realpath "$repo/../elastic-client-generator-js"):/usr/src/elastic-client-generator-js" \
--env "WORKFLOW=$WORKFLOW" \
--name make-elasticsearch-js \
--rm \
@ -159,6 +159,14 @@ if [[ -z "${BUILDKITE+x}" ]] && [[ -z "${CI+x}" ]] && [[ -z "${GITHUB_ACTIONS+x}
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 \
@ -168,7 +176,7 @@ else
--rm \
$product \
/bin/bash -c "cd /usr/src && \
git clone https://$CLIENTS_GITHUB_TOKEN@github.com/elastic/elastic-client-generator-js.git && \
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[*]}"
@ -179,36 +187,36 @@ fi
# ------------------------------------------------------- #
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
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"
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"
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"
echo "TODO"
fi
if [[ "$CMD" == "examplesgen" ]]; then
echo "TODO"
echo "TODO"
fi

View File

@ -11,8 +11,10 @@ jobs:
outputs:
src-only: "${{ steps.changes.outputs.src-only }}"
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter/@v2.11.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- uses: dorny/paths-filter/@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
@ -30,14 +32,16 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x, 23.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: ${{ matrix.node-version }}
@ -53,15 +57,21 @@ jobs:
run: |
npm run test:unit
- name: ECMAScript module test
run: |
npm run test:esm
license:
name: License check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 22.x
@ -72,3 +82,39 @@ jobs:
- name: License checker
run: |
npm run license-checker
test-bun:
name: Test Bun
runs-on: ${{ matrix.os }}
needs: paths-filter
# only run if code relevant to unit tests was changed
if: needs.paths-filter.outputs.src-only == 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Use Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
- name: Install
run: |
bun install
- name: Lint
run: |
bun run lint
- name: Unit test
run: |
bun run test:unit-bun
- name: ECMAScript module test
run: |
bun run test:esm

View File

@ -9,15 +9,16 @@ jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: "20.x"
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
- run: npm install -g npm
- run: npm install

View File

@ -26,26 +26,28 @@ jobs:
)
)
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
repository: elastic/elasticsearch-js
ref: main
path: stack
fetch-depth: 0
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
repository: elastic/elasticsearch-serverless-js
ref: main
path: serverless
- name: Apply patch from stack to serverless
id: apply-patch
run: $GITHUB_WORKSPACE/stack/.github/workflows/serverless-patch.sh
- uses: peter-evans/create-pull-request@v6
- uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6
with:
token: ${{ secrets.GH_TOKEN }}
path: serverless
title: 'Apply patch from elastic/elasticsearch-js#${{ github.event.pull_request.number }}'
commit-message: 'Apply patch from elastic/elasticsearch-js#${{ github.event.pull_request.number }}'
title: "Apply patch from elastic/elasticsearch-js#${{ github.event.pull_request.number }}"
commit-message: "Apply patch from elastic/elasticsearch-js#${{ github.event.pull_request.number }}"
body-path: /tmp/pr_body
draft: '${{ steps.apply-patch.outputs.PR_DRAFT }}'
add-paths: ':!*.rej'
draft: "${{ steps.apply-patch.outputs.PR_DRAFT }}"
add-paths: ":!*.rej"

View File

@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8
with:
stale-issue-label: stale
stale-pr-label: stale

8
.gitignore vendored
View File

@ -64,3 +64,11 @@ 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

@ -72,3 +72,8 @@ CODE_OF_CONDUCT.md
CONTRIBUTING.md
src
bun.lockb
.tap
rest-api-spec
yaml-rest-tests
generated-tests

View File

@ -42,6 +42,9 @@ spec:
main:
branch: "main"
cronline: "@daily"
8_14:
branch: "8.14"
8_x:
branch: "8.x"
cronline: "@daily"
8_14:
branch: "8.16"
cronline: "@daily"

View File

@ -167,16 +167,19 @@ const client = new Client({
----
|`nodeFilter`
a|`function` - Filters which node not to use for a request. +
a|`function` - Takes a `Connection` and returns `true` if it can be sent a request, otherwise `false`. +
_Default:_
[source,js]
----
function defaultNodeFilter (node) {
// avoid master only nodes
if (node.roles.master === true &&
node.roles.data === false &&
node.roles.ingest === false) {
return false
function defaultNodeFilter (conn) {
if (conn.roles != null) {
if (
// avoid master-only nodes
conn.roles.master &&
!conn.roles.data &&
!conn.roles.ingest &&
!conn.roles.ml
) return false
}
return true
}
@ -252,8 +255,8 @@ const client = new Client({
----
|`disablePrototypePoisoningProtection`
|`boolean`, `'proto'`, `'constructor'` - By the default the client will protect you against prototype poisoning attacks. Read https://web.archive.org/web/20200319091159/https://hueniverse.com/square-brackets-are-the-enemy-ff5b9fd8a3e8?gi=184a27ee2a08[this article] to learn more. If needed you can disable prototype poisoning protection entirely or one of the two checks. Read the `secure-json-parse` https://github.com/fastify/secure-json-parse[documentation] to learn more. +
_Default:_ `false`
|`boolean`, `'proto'`, `'constructor'` - The client can protect you against prototype poisoning attacks. Read https://web.archive.org/web/20200319091159/https://hueniverse.com/square-brackets-are-the-enemy-ff5b9fd8a3e8?gi=184a27ee2a08[this article] to learn more about this security concern. If needed, you can enable prototype poisoning protection entirely (`false`) or one of the two checks (`'proto'` or `'constructor'`). For performance reasons, it is disabled by default. Read the `secure-json-parse` https://github.com/fastify/secure-json-parse[documentation] to learn more. +
_Default:_ `true`
|`caFingerprint`
|`string` - If configured, verify that the fingerprint of the CA certificate that has signed the certificate of the server matches the supplied fingerprint. Only accepts SHA256 digest fingerprints. +

View File

@ -1,6 +1,191 @@
[[changelog-client]]
== Release notes
[discrete]
=== 8.18.2
[discrete]
==== Fixes
[discrete]
===== Ensure Apache Arrow ES|QL helper uses async iterator
The `esql.toArrowReader()` helper function was trying to return `RecordBatchStreamReader`, a synchronous iterator, despite the fact that the `apache-arrow` package was, in most cases, automatically coercing it to `AsyncRecordBatchStreamReader`, its asynchronous counterpart. It now is always returned as an async iterator.
[discrete]
=== 8.18.1
[discrete]
==== Fixes
[discrete]
===== Fix broken node roles and node filter
The docs note a `nodeFilter` option on the client that will, by default, filter the nodes based on any `roles` values that are set at instantition. At some point, this functionality was partially disabled. This brings the feature back, ensuring that it matches what the documentation has said it does all along.
[discrete]
=== 8.18.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v8.18`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.18/release-notes-8.18.0.html[here].
[discrete]
==== Fixes
[discrete]
===== Improved Cloud ID parsing
When using a Cloud ID as the `cloud` parameter to instantiate the client, that ID was assumed to be in the correct format. New assertions have been added to verify that format and throw a `ConfigurationError` if it is invalid. See https://github.com/elastic/elasticsearch-js/issues/2694[#2694].
[discrete]
=== 8.17.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v8.17`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/release-notes-8.17.0.html[here].
[discrete]
=== 8.16.3
[discrete]
==== Fixes
[discrete]
===== Improved support for Elasticsearch `v8.16`
Updated TypeScript types based on fixes and improvements to the Elasticsearch specification.
[discrete]
=== 8.16.2
[discrete]
==== Fixes
[discrete]
===== Improved support for Elasticsearch `v8.16`
Updated TypeScript types based on fixes and improvements to the Elasticsearch specification.
[discrete]
===== Drop testing artifacts from npm package
Tap, the unit testing tool used by this project, was recently upgraded and started writing to a `.tap` directory. Since tests are run prior to an `npm publish` in CI, this directory was being included in the published package and bloating its size.
[discrete]
=== 8.16.1
[discrete]
==== Fixes
[discrete]
===== Fix ECMAScript imports
Fixed package configuration to correctly support native ECMAScript `import` syntax.
[discrete]
=== 8.16.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v8.16`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/release-notes-8.16.0.html[here].
[discrete]
===== Support Apache Arrow in ES|QL helper
The ES|QL helper can now return results as an Apache Arrow `Table` or `RecordBatchReader`, which enables high-performance calculations on ES|QL results, even if the response data is larger than the system's available memory. See <<esql-helper>> for more information.
[discrete]
==== Fixes
[discrete]
===== Pass prototype poisoning options to serializer correctly
The client's `disablePrototypePoisoningProtection` option was set to `true` by default, but when it was set to any other value it was ignored, making it impossible to enable prototype poisoning protection without providing a custom serializer implementation.
[discrete]
=== 8.15.3
[discrete]
==== Fixes
[discrete]
===== Improved support for Elasticsearch `v8.15`
Updated TypeScript types based on fixes and improvements to the Elasticsearch specification.
[discrete]
===== Drop testing artifacts from npm package
Tap, the unit testing tool, was recently upgraded and started writing to a `.tap` directory. Since tests are run prior to an `npm publish` in CI, this directory was being included in the published package and bloating its size.
[discrete]
=== 8.15.2
[discrete]
==== Fixes
[discrete]
===== Improved support for Elasticsearch `v8.15`
Updated TypeScript types based on fixes and improvements to the Elasticsearch specification.
[discrete]
=== 8.15.1
[discrete]
==== Fixes
[discrete]
===== Improved support for Elasticsearch `v8.15`
Updated TypeScript types based on fixes and improvements to the Elasticsearch specification.
[discrete]
=== 8.15.0
[discrete]
==== Features
[discrete]
===== Support for Elasticsearch `v8.15.0`
You can find all the API changes
https://www.elastic.co/guide/en/elasticsearch/reference/8.15/release-notes-8.15.0.html[here].
[discrete]
===== OpenTelemetry zero-code instrumentation support
For those that use an observability service that supports OpenTelemetry spans, the client will now automatically generate traces for each Elasticsearch request it makes.
See {jsclient}/observability.html#_opentelemetry[the docs]
for more information.
[discrete]
=== 8.14.1
[discrete]
==== Features
[discrete]
===== Improved support for Elasticsearch `8.14`
Updated types based on fixes and changes to the Elasticsearch specification.
[discrete]
=== 8.14.0
@ -198,7 +383,7 @@ https://www.elastic.co/guide/en/elasticsearch/reference/8.9/release-notes-8.9.0.
[discrete]
===== Allow document to be overwritten in `onDocument` iteratee of bulk helper https://github.com/elastic/elasticsearch-js/pull/1732[#1732]
In the https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html#bulk-helper[bulk helper], documents could not be modified before being sent to Elasticsearch. It is now possible to https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-helpers.html#_modifying_a_document_before_operation[modify a document] before sending it.
In the {jsclient}/client-helpers.html#bulk-helper[bulk helper], documents could not be modified before being sent to Elasticsearch. It is now possible to {jsclient}/client-helpers.html#_modifying_a_document_before_operation[modify a document] before sending it.
[discrete]
==== Fixes

View File

@ -2,10 +2,11 @@
== Configuration
The client is designed to be easily configured for your needs. In the following
The client is designed to be easily configured for your needs. In the following
section, you can see the possible options that you can use to configure it.
* <<basic-config>>
* <<advanced-config>>
* <<timeout-best-practices>>
* <<child>>
* <<client-testing>>

View File

@ -1,7 +1,7 @@
[[client-connecting]]
== Connecting
== Connecting
This page contains the information you need to connect and use the Client with
This page contains the information you need to connect and use the Client with
{es}.
**On this page**
@ -19,7 +19,7 @@ This page contains the information you need to connect and use the Client with
[discrete]
=== Authentication
This document contains code snippets to show you how to connect to various {es}
This document contains code snippets to show you how to connect to various {es}
providers.
@ -27,18 +27,18 @@ providers.
[[auth-ec]]
==== Elastic Cloud
If you are using https://www.elastic.co/cloud[Elastic Cloud], the client offers
an easy way to connect to it via the `cloud` option. You must pass the Cloud ID
that you can find in the cloud console, then your username and password inside
If you are using https://www.elastic.co/cloud[Elastic Cloud], the client offers
an easy way to connect to it via the `cloud` option. You must pass the Cloud ID
that you can find in the cloud console, then your username and password inside
the `auth` option.
NOTE: When connecting to Elastic Cloud, the client will automatically enable
both request and response compression by default, since it yields significant
throughput improvements. Moreover, the client will also set the tls option
`secureProtocol` to `TLSv1_2_method` unless specified otherwise. You can still
NOTE: When connecting to Elastic Cloud, the client will automatically enable
both request and response compression by default, since it yields significant
throughput improvements. Moreover, the client will also set the tls option
`secureProtocol` to `TLSv1_2_method` unless specified otherwise. You can still
override this option by configuring them.
IMPORTANT: Do not enable sniffing when using Elastic Cloud, since the nodes are
IMPORTANT: Do not enable sniffing when using Elastic Cloud, since the nodes are
behind a load balancer, Elastic Cloud will take care of everything for you.
Take a look https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how[here]
to know more.
@ -61,18 +61,18 @@ const client = new Client({
[[connect-self-managed-new]]
=== Connecting to a self-managed cluster
By default {es} will start with security features like authentication and TLS
enabled. To connect to the {es} cluster you'll need to configure the Node.js {es}
client to use HTTPS with the generated CA certificate in order to make requests
By default {es} will start with security features like authentication and TLS
enabled. To connect to the {es} cluster you'll need to configure the Node.js {es}
client to use HTTPS with the generated CA certificate in order to make requests
successfully.
If you're just getting started with {es} we recommend reading the documentation
on https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html[configuring]
and
https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html[starting {es}]
If you're just getting started with {es} we recommend reading the documentation
on https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html[configuring]
and
https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html[starting {es}]
to ensure your cluster is running as expected.
When you start {es} for the first time you'll see a distinct block like the one
When you start {es} for the first time you'll see a distinct block like the one
below in the output from {es} (you may have to scroll up if it's been a while):
[source,sh]
@ -90,24 +90,24 @@ below in the output from {es} (you may have to scroll up if it's been a while):
----
Depending on the circumstances there are two options for verifying the HTTPS
connection, either verifying with the CA certificate itself or via the HTTP CA
Depending on the circumstances there are two options for verifying the HTTPS
connection, either verifying with the CA certificate itself or via the HTTP CA
certificate fingerprint.
[discrete]
[[auth-tls]]
==== TLS configuration
The generated root CA certificate can be found in the `certs` directory in your
{es} config location (`$ES_CONF_PATH/certs/http_ca.crt`). If you're running {es}
in Docker there is
The generated root CA certificate can be found in the `certs` directory in your
{es} config location (`$ES_CONF_PATH/certs/http_ca.crt`). If you're running {es}
in Docker there is
https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html[additional documentation for retrieving the CA certificate].
Without any additional configuration you can specify `https://` node urls, and
the certificates used to sign these requests will be verified. To turn off
certificate verification, you must specify an `tls` object in the top level
config and set `rejectUnauthorized: false`. The default `tls` values are the
same that Node.js's https://nodejs.org/api/tls.html#tls_tls_connect_options_callback[`tls.connect()`]
Without any additional configuration you can specify `https://` node urls, and
the certificates used to sign these requests will be verified. To turn off
certificate verification, you must specify an `tls` object in the top level
config and set `rejectUnauthorized: false`. The default `tls` values are the
same that Node.js's https://nodejs.org/api/tls.html#tls_tls_connect_options_callback[`tls.connect()`]
uses.
[source,js]
@ -152,7 +152,7 @@ const client = new Client({
})
----
The certificate fingerprint can be calculated using `openssl x509` with the
The certificate fingerprint can be calculated using `openssl x509` with the
certificate file:
[source,sh]
@ -160,8 +160,8 @@ certificate file:
openssl x509 -fingerprint -sha256 -noout -in /path/to/http_ca.crt
----
If you don't have access to the generated CA file from {es} you can use the
following script to output the root CA fingerprint of the {es} instance with
If you don't have access to the generated CA file from {es} you can use the
following script to output the root CA fingerprint of the {es} instance with
`openssl s_client`:
[source,sh]
@ -186,8 +186,8 @@ SHA256 Fingerprint=A5:2D:D9:35:11:E8:C6:04:5E:21:F1:66:54:B7:7C:9E:E0:F3:4A:EA:2
WARNING: Running {es} without security enabled is not recommended.
If your cluster is configured with
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html[security explicitly disabled]
If your cluster is configured with
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html[security explicitly disabled]
then you can connect via HTTP:
[source,js]
@ -208,14 +208,14 @@ Following you can find all the supported authentication strategies.
[[auth-apikey]]
==== ApiKey authentication
You can use the
{ref-7x}/security-api-create-api-key.html[ApiKey]
authentication by passing the `apiKey` parameter via the `auth` option. The
`apiKey` parameter can be either a base64 encoded string or an object with the
values that you can obtain from the
You can use the
{ref-7x}/security-api-create-api-key.html[ApiKey]
authentication by passing the `apiKey` parameter via the `auth` option. The
`apiKey` parameter can be either a base64 encoded string or an object with the
values that you can obtain from the
{ref-7x}/security-api-create-api-key.html[create api key endpoint].
NOTE: If you provide both basic authentication credentials and the ApiKey
NOTE: If you provide both basic authentication credentials and the ApiKey
configuration, the ApiKey takes precedence.
[source,js]
@ -268,10 +268,10 @@ const client = new Client({
[[auth-basic]]
==== Basic authentication
You can provide your credentials by passing the `username` and `password`
You can provide your credentials by passing the `username` and `password`
parameters via the `auth` option.
NOTE: If you provide both basic authentication credentials and the Api Key
NOTE: If you provide both basic authentication credentials and the Api Key
configuration, the Api Key will take precedence.
[source,js]
@ -342,14 +342,14 @@ const result = await client.search({
}, { meta: true })
----
In this case, the result will be:
In this case, the result will be:
[source,ts]
----
{
body: object | boolean
statusCode: number
headers: object
warnings: [string],
warnings: string[],
meta: object
}
----
@ -361,7 +361,7 @@ NOTE: The body is a boolean value when you use `HEAD` APIs.
If needed, you can abort a running request by using the `AbortController` standard.
CAUTION: If you abort a request, the request will fail with a
CAUTION: If you abort a request, the request will fail with a
`RequestAbortedError`.
@ -410,19 +410,23 @@ The supported request specific options are:
[cols=2*]
|===
|`ignore`
|`[number]` - HTTP status codes which should not be considered errors for this request. +
|`number[]` - HTTP status codes which should not be considered errors for this request. +
_Default:_ `null`
|`requestTimeout`
|`number` - Max request timeout for the request in milliseconds, it overrides the client default. +
|`number | string` - Max request timeout for the request in milliseconds, it overrides the client default. +
_Default:_ `30000`
|`retryOnTimeout`
|`boolean` - Retry requests that have timed out.
_Default:_ `false`
|`maxRetries`
|`number` - Max number of retries for the request, it overrides the client default. +
_Default:_ `3`
|`compression`
|`string, boolean` - Enables body compression for the request. +
|`string | boolean` - Enables body compression for the request. +
_Options:_ `false`, `'gzip'` +
_Default:_ `false`
@ -446,6 +450,10 @@ _Default:_ `null`
|`any` - Custom object per request. _(you can use it to pass data to the clients events)_ +
_Default:_ `null`
|`opaqueId`
|`string` - Set the `X-Opaque-Id` HTTP header. See {ref}/api-conventions.html#x-opaque-id
_Default:_ `null`
|`maxResponseSize`
|`number` - When configured, it verifies that the uncompressed response size is lower than the configured number, if it's higher it will abort the request. It cannot be higher than buffer.constants.MAX_STRING_LENTGH +
_Default:_ `null`
@ -458,6 +466,17 @@ _Default:_ `null`
|`AbortSignal` - The AbortSignal instance to allow request abortion. +
_Default:_ `null`
|`meta`
|`boolean` - Rather than returning the body, return an object containing `body`, `statusCode`, `headers` and `meta` keys +
_Default_: `false`
|`redaction`
|`object` - Options for redacting potentially sensitive data from error metadata. See <<redaction>>.
|`retryBackoff`
|`(min: number, max: number, attempt: number) => number;` - A function that calculates how long to sleep, in seconds, before the next request retry +
_Default:_ A built-in function that uses exponential backoff with jitter.
|===
[discrete]
@ -537,8 +556,8 @@ Resources used to assess these recommendations:
~Added~ ~in~ ~`v7.10.0`~
If you need to pass through an http(s) proxy for connecting to {es}, the client
out of the box offers a handy configuration for helping you with it. Under the
If you need to pass through an http(s) proxy for connecting to {es}, the client
out of the box offers a handy configuration for helping you with it. Under the
hood, it uses the https://github.com/delvedor/hpagent[`hpagent`] module.
IMPORTANT: In versions 8.0+ of the client, the default `Connection` type is set to `UndiciConnection`, which does not support proxy configurations.
@ -715,5 +734,5 @@ This pre-flight product check allows the client to establish the version of Elas
that it is communicating with. The product check requires one additional HTTP request to
be sent to the server as part of the request pipeline before the main API call is sent.
In most cases, this will succeed during the very first API call that the client sends.
Once the product check completes, no further product check HTTP requests are sent for
Once the product check completes, no further product check HTTP requests are sent for
subsequent API calls.

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.clearCachedRealms({
realms: "default_file,ldap1",
});
console.log(response);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.forcemerge({
index: ".ds-my-data-stream-2099.03.07-000001",
max_num_segments: 1,
});
console.log(response);
----

View File

@ -4,20 +4,16 @@
[source, js]
----
const response = await client.search({
index: 'bank',
body: {
query: {
match_all: {}
query: {
pinned: {
ids: ["1", "4", "100"],
organic: {
match: {
description: "iphone",
},
},
},
sort: [
{
account_number: 'asc'
}
],
from: 10,
size: 10
}
})
console.log(response)
},
});
console.log(response);
----

View File

@ -0,0 +1,20 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "my-index-000001",
settings: {
analysis: {
analyzer: {
my_analyzer: {
tokenizer: "whitespace",
filter: ["stemmer"],
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,40 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.watcher.putWatch({
id: "cluster_health_watch",
trigger: {
schedule: {
interval: "10s",
},
},
input: {
http: {
request: {
host: "localhost",
port: 9200,
path: "/_cluster/health",
},
},
},
condition: {
compare: {
"ctx.payload.status": {
eq: "red",
},
},
},
actions: {
send_email: {
email: {
to: "username@example.org",
subject: "Cluster Status Warning",
body: "Cluster status is RED",
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,8 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.migration.postFeatureUpgrade();
console.log(response);
----

View File

@ -4,18 +4,13 @@
[source, js]
----
const response = await client.search({
index: 'bank',
body: {
query: {
match_all: {}
index: "my-index",
query: {
match: {
"http.clientip": "40.135.0.0",
},
sort: [
{
account_number: 'asc'
}
]
}
})
console.log(response)
},
fields: ["http.clientip"],
});
console.log(response);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.getDataStream({
name: "my-data-stream",
filter_path: "data_streams.indices.index_name",
});
console.log(response);
----

View File

@ -0,0 +1,8 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.shardStores();
console.log(response);
----

View File

@ -0,0 +1,15 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.renderSearchTemplate({
source: '{ "query": {{#toJson}}my_query{{/toJson}} }',
params: {
my_query: {
match_all: {},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,12 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.analyze({
tokenizer: "standard",
filter: ["asciifolding"],
text: "açaí à la carte",
});
console.log(response);
----

View File

@ -0,0 +1,67 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "italian_example",
settings: {
analysis: {
filter: {
italian_elision: {
type: "elision",
articles: [
"c",
"l",
"all",
"dall",
"dell",
"nell",
"sull",
"coll",
"pell",
"gl",
"agl",
"dagl",
"degl",
"negl",
"sugl",
"un",
"m",
"t",
"s",
"v",
"d",
],
articles_case: true,
},
italian_stop: {
type: "stop",
stopwords: "_italian_",
},
italian_keywords: {
type: "keyword_marker",
keywords: ["esempio"],
},
italian_stemmer: {
type: "stemmer",
language: "light_italian",
},
},
analyzer: {
rebuilt_italian: {
tokenizer: "standard",
filter: [
"italian_elision",
"lowercase",
"italian_stop",
"italian_keywords",
"italian_stemmer",
],
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,19 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.inference.put({
task_type: "text_embedding",
inference_id: "my-e5-model",
inference_config: {
service: "elasticsearch",
service_settings: {
num_allocations: 1,
num_threads: 1,
model_id: ".multilingual-e5-small",
},
},
});
console.log(response);
----

View File

@ -0,0 +1,13 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.putIndexTemplate({
name: "my-data-stream-template",
index_patterns: ["my-data-stream*"],
data_stream: {},
priority: 500,
});
console.log(response);
----

View File

@ -0,0 +1,46 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
index: "retrievers_example",
retriever: {
rrf: {
retrievers: [
{
standard: {
query: {
range: {
year: {
gt: 2023,
},
},
},
},
},
{
standard: {
query: {
term: {
topic: "elastic",
},
},
},
},
],
rank_window_size: 10,
rank_constant: 1,
},
},
_source: false,
aggs: {
topics: {
terms: {
field: "topic",
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,24 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
index: "sales",
size: 0,
filter_path: "aggregations",
query: {
term: {
type: "t-shirt",
},
},
aggs: {
avg_price: {
avg: {
field: "price",
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,18 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.inference.put({
task_type: "rerank",
inference_id: "my-rerank-model",
inference_config: {
service: "cohere",
service_settings: {
model_id: "rerank-english-v3.0",
api_key: "{{COHERE_API_KEY}}",
},
},
});
console.log(response);
----

View File

@ -4,17 +4,14 @@
[source, js]
----
const response = await client.indices.updateAliases({
body: {
actions: [
{
add: {
index: 'test1',
alias: 'alias1'
}
}
]
}
})
console.log(response)
actions: [
{
add: {
index: "logs-*",
alias: "logs",
},
},
],
});
console.log(response);
----

View File

@ -0,0 +1,26 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "asciifold_example",
settings: {
analysis: {
analyzer: {
standard_asciifolding: {
tokenizer: "standard",
filter: ["my_ascii_folding"],
},
},
filter: {
my_ascii_folding: {
type: "asciifolding",
preserve_original: true,
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,36 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "idx",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
kwd: {
type: "keyword",
ignore_above: 3,
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "idx",
id: 1,
document: {
kwd: ["foo", "foo", "bang", "bar", "baz"],
},
});
console.log(response1);
----

View File

@ -0,0 +1,37 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.cluster.putComponentTemplate({
name: "component_template1",
template: {
mappings: {
properties: {
"@timestamp": {
type: "date",
},
},
},
},
});
console.log(response);
const response1 = await client.cluster.putComponentTemplate({
name: "runtime_component_template",
template: {
mappings: {
runtime: {
day_of_week: {
type: "keyword",
script: {
source:
"emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH))",
},
},
},
},
},
});
console.log(response1);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.transform.startTransform({
transform_id: "ecommerce_transform",
});
console.log(response);
----

View File

@ -0,0 +1,12 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.tasks.list({
human: "true",
detailed: "true",
actions: "indices:data/write/bulk",
});
console.log(response);
----

View File

@ -4,18 +4,14 @@
[source, js]
----
const response = await client.search({
body: {
query: {
index: "my-index-000001",
aggs: {
"my-agg-name": {
terms: {
user: [
'kimchy',
'elasticsearch'
],
boost: 1
}
}
}
})
console.log(response)
field: "my-field",
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.watcher.executeWatch({
id: "my_watch",
});
console.log(response);
----

View File

@ -0,0 +1,39 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "basque_example",
settings: {
analysis: {
filter: {
basque_stop: {
type: "stop",
stopwords: "_basque_",
},
basque_keywords: {
type: "keyword_marker",
keywords: ["Adibidez"],
},
basque_stemmer: {
type: "stemmer",
language: "basque",
},
},
analyzer: {
rebuilt_basque: {
tokenizer: "standard",
filter: [
"lowercase",
"basque_stop",
"basque_keywords",
"basque_stemmer",
],
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ccr.followStats({
index: "<index>",
});
console.log(response);
----

View File

@ -0,0 +1,20 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
query: {
has_child: {
type: "child",
query: {
match_all: {},
},
max_children: 10,
min_children: 2,
score_mode: "min",
},
},
});
console.log(response);
----

View File

@ -0,0 +1,19 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.putMapping({
index: "my-index-000001",
properties: {
name: {
properties: {
last: {
type: "text",
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,28 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "sales",
mappings: {
properties: {
tags: {
type: "keyword",
},
comments: {
type: "nested",
properties: {
username: {
type: "keyword",
},
comment: {
type: "text",
},
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ml.flushJob({
job_id: "low_request_rate",
calc_interim: true,
});
console.log(response);
----

View File

@ -0,0 +1,23 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
aggs: {
JapaneseCars: {
terms: {
field: "make",
include: ["mazda", "honda"],
},
},
ActiveCarManufacturers: {
terms: {
field: "make",
exclude: ["rover", "jensen"],
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.invalidateToken({
username: "myuser",
});
console.log(response);
----

View File

@ -0,0 +1,28 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.analyze({
tokenizer: "keyword",
char_filter: [
{
type: "mapping",
mappings: [
"٠ => 0",
"١ => 1",
"٢ => 2",
"٣ => 3",
"٤ => 4",
"٥ => 5",
"٦ => 6",
"٧ => 7",
"٨ => 8",
"٩ => 9",
],
},
],
text: "My license plate is ٢٥٠١٥",
});
console.log(response);
----

View File

@ -1,43 +0,0 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
body: {
aggs: {
countries: {
terms: {
field: 'artist.country',
order: [
{
'rock>playback_stats.avg': 'desc'
},
{
_count: 'desc'
}
]
},
aggs: {
rock: {
filter: {
term: {
genre: 'rock'
}
},
aggs: {
playback_stats: {
stats: {
field: 'play_count'
}
}
}
}
}
}
}
}
})
console.log(response)
----

View File

@ -0,0 +1,21 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "my-index-000001",
mappings: {
properties: {
full_name: {
type: "text",
index_prefixes: {
min_chars: 1,
max_chars: 10,
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,16 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
index: "my-index-000001",
routing: "user1,user2",
query: {
match: {
title: "document",
},
},
});
console.log(response);
----

View File

@ -4,9 +4,7 @@
[source, js]
----
const response = await client.search({
index: '*',
q: 'user:kimchy'
})
console.log(response)
index: "my-data-stream",
});
console.log(response);
----

View File

@ -0,0 +1,24 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ingest.putPipeline({
id: "pipelineB",
description: "outer pipeline",
processors: [
{
pipeline: {
name: "pipelineA",
},
},
{
set: {
field: "outer_pipeline_set",
value: "outer",
},
},
],
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.getTemplate({
name: "template_1",
});
console.log(response);
----

View File

@ -0,0 +1,38 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "my-index-000001",
mappings: {
properties: {
my_wildcard: {
type: "wildcard",
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "my-index-000001",
id: 1,
document: {
my_wildcard: "This string can be quite lengthy",
},
});
console.log(response1);
const response2 = await client.search({
index: "my-index-000001",
query: {
wildcard: {
my_wildcard: {
value: "*quite*lengthy",
},
},
},
});
console.log(response2);
----

View File

@ -4,10 +4,9 @@
[source, js]
----
const response = await client.get({
index: 'twitter',
id: '2',
routing: 'user1'
})
console.log(response)
index: "my-index-000001",
id: 0,
_source: "*.id",
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.refresh({
index: "my-index-000001,my-index-000002",
});
console.log(response);
----

View File

@ -1,22 +0,0 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
body: {
aggs: {
genres: {
terms: {
script: {
source: "doc['genre'].value",
lang: 'painless'
}
}
}
}
}
})
console.log(response)
----

View File

@ -0,0 +1,26 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.index({
index: "example",
document: {
location: {
type: "Polygon",
orientation: "LEFT",
coordinates: [
[
[-177, 10],
[176, 15],
[172, 0],
[176, -15],
[-177, -10],
[-177, 10],
],
],
},
},
});
console.log(response);
----

View File

@ -0,0 +1,36 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.index({
index: "my-index-000001",
id: 5,
refresh: "true",
document: {
query: {
bool: {
should: [
{
match: {
message: {
query: "Japanese art",
_name: "query1",
},
},
},
{
match: {
message: {
query: "Holand culture",
_name: "query2",
},
},
},
],
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,38 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
index: "example-index",
retriever: {
rrf: {
retrievers: [
{
standard: {
query: {
term: {
text: "blue shoes sale",
},
},
},
},
{
standard: {
query: {
sparse_vector: {
field: "ml.tokens",
inference_id: "my_elser_model",
query: "What blue shoes are on sale?",
},
},
},
},
],
rank_window_size: 50,
rank_constant: 20,
},
},
});
console.log(response);
----

View File

@ -0,0 +1,29 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "my-index-000001",
settings: {
analysis: {
analyzer: {
my_custom_analyzer: {
type: "custom",
tokenizer: "standard",
char_filter: ["html_strip"],
filter: ["lowercase", "asciifolding"],
},
},
},
},
});
console.log(response);
const response1 = await client.indices.analyze({
index: "my-index-000001",
analyzer: "my_custom_analyzer",
text: "Is this déjà vu</b>?",
});
console.log(response1);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.analyze({
analyzer: "whitespace",
text: "The quick brown fox.",
});
console.log(response);
----

View File

@ -0,0 +1,8 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.security.getServiceAccounts();
console.log(response);
----

View File

@ -0,0 +1,14 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.snapshot.restore({
repository: "my_repository",
snapshot: "my_snapshot_2099.05.06",
indices: "my-index,logs-my_app-default",
rename_pattern: "(.+)",
rename_replacement: "restored-$1",
});
console.log(response);
----

View File

@ -0,0 +1,11 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.sql.query({
format: "txt",
query: "SELECT * FROM library ORDER BY page_count DESC LIMIT 5",
});
console.log(response);
----

View File

@ -0,0 +1,12 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.connector.updateApiKeyId({
connector_id: "my-connector",
api_key_id: "my-api-key-id",
api_key_secret_id: "my-connector-secret-id",
});
console.log(response);
----

View File

@ -0,0 +1,12 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.eql.search({
index: "my-data-stream",
query: '\n process where process.name == "regsvr32.exe"\n ',
size: 50,
});
console.log(response);
----

View File

@ -0,0 +1,52 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
index: "my-index",
retriever: {
rrf: {
retrievers: [
{
standard: {
query: {
multi_match: {
query: "How is the weather in Jamaica?",
fields: ["title", "description"],
},
},
},
},
{
standard: {
query: {
text_expansion: {
"ml.inference.title_expanded.predicted_value": {
model_id: ".elser_model_2",
model_text: "How is the weather in Jamaica?",
},
},
},
},
},
{
standard: {
query: {
text_expansion: {
"ml.inference.description_expanded.predicted_value": {
model_id: ".elser_model_2",
model_text: "How is the weather in Jamaica?",
},
},
},
},
},
],
window_size: 10,
rank_constant: 20,
},
},
});
console.log(response);
----

View File

@ -0,0 +1,27 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.transport.request({
method: "PUT",
path: "/_internal/desired_nodes/&lt;history_id&gt;/&lt;version&gt;",
body: {
nodes: [
{
settings: {
"node.name": "instance-000187",
"node.external_id": "instance-000187",
"node.roles": ["data_hot", "master"],
"node.attr.data": "hot",
"node.attr.logical_availability_zone": "zone-0",
},
processors: 8,
memory: "58gb",
storage: "2tb",
},
],
},
});
console.log(response);
----

View File

@ -4,20 +4,14 @@
[source, js]
----
const response = await client.search({
body: {
query: {
multi_match: {
query: 'Will Smith',
type: 'cross_fields',
fields: [
'first_name',
'last_name'
],
operator: 'and'
}
}
}
})
console.log(response)
query: {
multi_match: {
query: "Will Smith",
type: "cross_fields",
fields: ["first_name", "last_name"],
operator: "and",
},
},
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.transform.resetTransform({
transform_id: "ecommerce_transform",
});
console.log(response);
----

View File

@ -1,17 +0,0 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.create({
index: 'twitter',
id: '1',
body: {
user: 'kimchy',
post_date: '2009-11-15T14:12:12',
message: 'trying out Elasticsearch'
}
})
console.log(response)
----

View File

@ -0,0 +1,31 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ingest.putPipeline({
id: "set_os",
description: "sets the value of host.os.name from the field os",
processors: [
{
set: {
field: "host.os.name",
value: "{{{os}}}",
},
},
],
});
console.log(response);
const response1 = await client.ingest.simulate({
id: "set_os",
docs: [
{
_source: {
os: "Ubuntu",
},
},
],
});
console.log(response1);
----

View File

@ -0,0 +1,27 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ingest.putPipeline({
id: "my-pipeline-id",
description: "My optional pipeline description",
processors: [
{
set: {
description: "My optional processor description",
field: "my-keyword-field",
value: "foo",
},
},
],
_meta: {
reason: "set my-keyword-field to foo",
serialization: {
class: "MyPipeline",
id: 10,
},
},
});
console.log(response);
----

View File

@ -0,0 +1,20 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.inference.put({
task_type: "text_embedding",
inference_id: "google_vertex_ai_embeddings",
inference_config: {
service: "googlevertexai",
service_settings: {
service_account_json: "<service_account_json>",
model_id: "<model_id>",
location: "<location>",
project_id: "<project_id>",
},
},
});
console.log(response);
----

View File

@ -4,9 +4,8 @@
[source, js]
----
const response = await client.cluster.health({
wait_for_status: 'yellow',
timeout: '50s'
})
console.log(response)
wait_for_status: "yellow",
timeout: "50s",
});
console.log(response);
----

View File

@ -1,30 +0,0 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.search({
body: {
query: {
term: {
user: 'kimchy'
}
},
sort: {
_script: {
type: 'number',
script: {
lang: 'painless',
source: "doc['field_name'].value * params.factor",
params: {
factor: 1.1
}
},
order: 'asc'
}
}
}
})
console.log(response)
----

View File

@ -0,0 +1,37 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ml.evaluateDataFrame({
index: "house_price_predictions",
query: {
bool: {
filter: [
{
term: {
"ml.is_training": false,
},
},
],
},
},
evaluation: {
regression: {
actual_field: "price",
predicted_field: "ml.price_prediction",
metrics: {
r_squared: {},
mse: {},
msle: {
offset: 10,
},
huber: {
delta: 1.5,
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,12 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.sql.query({
format: "yaml",
query: "SELECT * FROM library ORDER BY page_count DESC",
fetch_size: 5,
});
console.log(response);
----

View File

@ -0,0 +1,54 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ilm.putLifecycle({
name: "logs",
policy: {
phases: {
hot: {
actions: {
rollover: {
max_primary_shard_size: "50gb",
},
},
},
warm: {
min_age: "30d",
actions: {
shrink: {
number_of_shards: 1,
},
forcemerge: {
max_num_segments: 1,
},
},
},
cold: {
min_age: "60d",
actions: {
searchable_snapshot: {
snapshot_repository: "found-snapshots",
},
},
},
frozen: {
min_age: "90d",
actions: {
searchable_snapshot: {
snapshot_repository: "found-snapshots",
},
},
},
delete: {
min_age: "735d",
actions: {
delete: {},
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,23 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ilm.putLifecycle({
name: "my_policy",
policy: {
phases: {
warm: {
actions: {
allocate: {
include: {
box_type: "hot,warm",
},
},
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,10 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.cat.repositories({
v: "true",
});
console.log(response);
----

View File

@ -0,0 +1,19 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.ilm.putLifecycle({
name: "my_policy",
policy: {
phases: {
delete: {
actions: {
delete: {},
},
},
},
},
});
console.log(response);
----

View File

@ -0,0 +1,24 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.index({
index: "example",
document: {
location: {
type: "polygon",
coordinates: [
[
[1000, -1001],
[1001, -1001],
[1001, -1000],
[1000, -1000],
[1000, -1001],
],
],
},
},
});
console.log(response);
----

View File

@ -0,0 +1,20 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.analyze({
tokenizer: "whitespace",
filter: [
{
type: "keyword_marker",
keywords: ["jumping"],
},
"stemmer",
],
text: "fox running and jumping",
explain: true,
attributes: "keyword",
});
console.log(response);
----

View File

@ -0,0 +1,78 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
[source, js]
----
const response = await client.indices.create({
index: "clientips",
mappings: {
properties: {
client_ip: {
type: "keyword",
},
env: {
type: "keyword",
},
},
},
});
console.log(response);
const response1 = await client.bulk({
index: "clientips",
operations: [
{
index: {},
},
{
client_ip: "172.21.0.5",
env: "Development",
},
{
index: {},
},
{
client_ip: "172.21.2.113",
env: "QA",
},
{
index: {},
},
{
client_ip: "172.21.2.162",
env: "QA",
},
{
index: {},
},
{
client_ip: "172.21.3.15",
env: "Production",
},
{
index: {},
},
{
client_ip: "172.21.3.16",
env: "Production",
},
],
});
console.log(response1);
const response2 = await client.enrich.putPolicy({
name: "clientip_policy",
match: {
indices: "clientips",
match_field: "client_ip",
enrich_fields: ["env"],
},
});
console.log(response2);
const response3 = await client.enrich.executePolicy({
name: "clientip_policy",
wait_for_completion: "false",
});
console.log(response3);
----

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