Commit Graph

234 Commits

Author SHA1 Message Date
9d719ce874 Bug #2694 (#2731)
Co-authored-by: Siddhu545 <Siddharthkhengare@gmail.com>
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2025-04-15 12:44:00 -05:00
e8dc747c61 Merge serverless functionality from @elastic/elasticsearch-serverless (#2695)
* Expose a serverMode option to enable serverless-friendly defaults

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

* Docs cleanup

* Add another note to docs about connecting to serverless
2025-04-03 14:41:58 -05:00
461f9b7f66 SPDX license format (#2667)
* Switch to SPDX license format for all non-codegen files

* Add test to ensure all committed JS files have SPDX header
2025-03-21 12:31:38 -05:00
172180cb21 Report correct transport connection type in telemetry (#2599)
Fixes #2324
2025-02-03 12:52:26 -06:00
0ad42ff1a2 Drop default 30-second timeout (#2573) 2025-01-30 10:37:53 -06:00
6447fc10bf Drop support for body param in helpers and tests (#2521)
* Update tests and bulk helper to stop using body param

* Update compatible-with content-type header for 9.0
2024-12-05 13:03:19 -06:00
36cfacc409 Fix ECMAScript import (#2475) 2024-11-18 12:14:58 -06:00
2455dac4e5 Add _id to the result of helpers.search (#2432) 2024-11-06 12:20:10 -06:00
11939fd22c Add streaming support to Arrow helper (#2407) 2024-11-04 15:47:53 -06:00
20ac2a637e Skip flaky test (#2416) 2024-10-28 11:46:10 -05:00
86b4d4e2f9 Upgrade tap to latest (#2400) 2024-10-24 11:33:46 -05:00
c3247d0c66 Basic helper for ES|QL's Apache Arrow output format (#2391) 2024-10-22 15:00:18 -05:00
82acfc33a9 Respect disablePrototypePoisoningProtection option (#2380) 2024-10-16 14:19:44 -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
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
896216860f ES|QL: Object API helper (#2238)
* ESQL toRecord helper

* ESQL helper tests

* Add ESQL object API helper to client meta header

* Add docstring for toRecords

* Include column metadata in toRecords helper

* Add docs for ESQL toRecords helper

* Verify columns in helper return object
2024-05-06 12:30:47 -05:00
4aa00e03e1 onSuccess function for bulk helper (#2199)
* Bulk helper onSuccess callback

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

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

* Add onSuccess tests for each datasource type

* Cleanup, additional comments

* Add documentation for onSuccess callback

* Update changelog

* Drop link to 8.14 release notes.

Page not yet published, breaking docs build.
2024-04-02 14:38:09 -05:00
d430aecdbd Move make.sh to .buildkite (#2165) 2024-03-21 12:07:24 -05:00
05e3139f80 Ensure new connections inherit client's set defaults (#2159)
* Add test confirming the issue

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

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

for https://github.com/elastic/elasticsearch-js/issues/1791
2024-03-20 16:32:15 -05:00
1607a0d3f7 Fix hang in bulk helper semaphore when server responses are slower than flushInterval (#2027)
* Set version to 8.10.1

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

* Copy and empty bulkBody when flushBytes is reached

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

* comment typo fixes

---------

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
2024-02-06 09:58:21 +04:00
4aaf49b6ea Integration test improvements (#2109)
* Improvements to integrations

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

* Bump all the things to 8.12.0

* Split Dockerfile copy into two layers

* Fix test cron names
2023-12-14 16:35:37 -06:00
426919709f Throw an explicit error when asStream is used with bulk helper (#2078) 2023-11-16 10:14:20 -06:00
6b4cdee53c Allow document to be overwritten in onDocument iteratee of bulk helper (#1732)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
2023-07-20 14:33:46 -05:00
a2b5e66a46 Add test to verify bulk helper index drift fix (#1912) 2023-06-12 16:03:11 -05:00
5c4c29f51c More integration test fixes (#1889) 2023-05-30 13:11:28 -05:00
bdb44d6d9a Use correct user-agent header by default (#1865) 2023-05-05 10:48:41 -05:00
4011f0153f Fix integration test runner for 8.8 (#1859) 2023-05-02 09:57:03 -05:00
c82005855f Integration test cleanup (#1841
* Fix bad sysctl command in README

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

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

* Drop several skipped integration tests

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

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

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

* Skip a few more free suite tests

* Default to https when running platinum tests

* Add make targets for local integration testing

* Linter cleanup

* Skip some platinum integration tests

* Improvements to integration test README

* Another free test to skip for now

* Continue on non-bail test failure

* Output cleanup
2023-04-10 14:24:14 -05:00
911af982b2 Fix integration test (#1689) 2022-05-06 15:15:19 +02:00
0fbdf10a68 Fix integration test (#1581) 2022-01-12 08:14:19 +01:00
85d1968ce5 Updated transport dependency 2021-12-16 17:56:01 +01:00
4ad5daeaf4 Aggregations should be a generic in responses (#1596) 2021-12-16 17:49:05 +01:00
dbfc8fc4d1 Propagate bulk helper document generic (#1606) 2021-12-16 16:45:48 +01:00
853fe27505 Support params.body as string. (#1585) 2021-10-25 19:06:44 +02:00
a5a0a1c589 Do a shallow clone copy of the body when the body key is defined (#1584) 2021-10-25 16:56:33 +02:00
529742ac1f Updated test 2021-10-25 09:38:16 +02:00
4cf1fc6cd4 Updated test 2021-10-21 09:53:24 +02:00
4492532727 Update unknown parameter handling. (#1568) 2021-10-18 16:01:55 +02:00
1a227459f0 Elasticsearch v8 (#1558) 2021-09-30 09:45:04 +02:00
3feda5d9f6 Show socket local/remote address in case of ECONNRESET (#1555)
* Show socket local/remote address in case of ECONNRESET

* Fallback if socket or properties are not defined
2021-09-22 10:05:58 +02:00
212c3c4ffe Add support for maxResponseSize and maxCompressedResponseSize (#1551) 2021-09-16 08:19:57 +02:00
b67d42cb5f Add test for mocking library (#1545) 2021-08-30 15:36:14 +02:00
ee50a8e770 Always emit request aborted event (#1534) 2021-08-24 11:53:14 +02:00
a7658b2a66 Always display request params and options in request event (#1531) 2021-08-24 11:25:48 +02:00
a9b62049cd Fix parcel build (#1535) 2021-08-23 15:29:57 +02:00
a0dcace7cd Fix isHttpConnection check (#1526) 2021-08-20 12:40:25 +02:00
f161946984 Add warning.name to product check security exception (#1515) 2021-08-20 10:39:38 +02:00
4ae38ca7f0 Update integration test scripts (#1525)
* Updated scripts

* Update runner
2021-08-18 17:47:23 +02:00
516f52e303 Show the body as string if the response error can't be read as ES error (#1509)
* Show the body as string if the response error can't be read as ES error

* Updated test
2021-08-11 09:40:33 +02:00