@opensearch-project/opensearch
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -21,7 +21,12 @@ { | ||
], | ||
/*temporarily turn off no-unused-vars, open an issue to track https://github.com/opensearch-project/opensearch-js/issues/241*/ | ||
"no-unused-vars": "off", | ||
/*temporarily turn off no-dupe-else-if, open an issue to track https://github.com/opensearch-project/opensearch-js/issues/240*/ | ||
"no-dupe-else-if": "off" | ||
"no-dupe-else-if": "off", | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"varsIgnorePattern": "^_.*", | ||
"argsIgnorePattern": "^_.*" | ||
} | ||
] | ||
} | ||
} | ||
} |
@@ -1,41 +0,16 @@ | ||
- [Overview](#overview) | ||
- [Current Admins](#current-admins) | ||
- [Admin Responsibilities](#admin-responsibilities) | ||
- [Prioritize Security](#prioritize-security) | ||
- [Enforce Code of Conduct](#enforce-code-of-conduct) | ||
- [Adopt Organizational Best Practices](#adopt-organizational-best-practices) | ||
# OpenSearch JavaScript Client Admins | ||
## Overview | ||
This document explains who the admins are (see below), what they do in this repo, and how they should be doing it. If you're interested in becoming a maintainer, see [MAINTAINERS](MAINTAINERS.md). If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md). | ||
## Current Admins | ||
| Admin | GitHub ID | Affiliation | | ||
| --------------------- | ------------------------------------------------- | ----------- | | ||
| Anan Zhuang | [ananzh](https://github.com/ananzh) | Amazon | | ||
| Bishoy Boktor | [boktorbb-amzn](https://github.com/boktorbb-amzn) | Amazon | | ||
| Charlotte | [CEHENKLE](https://github.com/CEHENKLE) | Amazon | | ||
| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon | | ||
| Kawika (Rocky) Avilla | [kavilla](https://github.com/kavilla) | Amazon | | ||
| Mihir Soni | [mihirsoni](https://github.com/mihirsoni) | Amazon | | ||
| Sean Neumann | [seanneumann](https://github.com/seanneumann) | Amazon | | ||
| Tommy Markley | [tmarkley](https://github.com/tmarkley) | Amazon | | ||
| Admin | GitHub ID | Affiliation | | ||
|-----------------------|-----------------------------------------------|-------------| | ||
| Anan Zhuang | [ananzh](https://github.com/ananzh) | Amazon | | ||
| Bishoy Boktor | [boktorbb](https://github.com/boktorbb) | Amazon | | ||
| Charlotte | [CEHENKLE](https://github.com/CEHENKLE) | Amazon | | ||
| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon | | ||
| Kawika (Rocky) Avilla | [kavilla](https://github.com/kavilla) | Amazon | | ||
| Mihir Soni | [mihirsoni](https://github.com/mihirsoni) | Amazon | | ||
| Sean Neumann | [seanneumann](https://github.com/seanneumann) | Amazon | | ||
## Admin Responsibilities | ||
As an admin you own stewartship of the repository and its settings. Admins have [admin-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization). Use those privileges to serve the community and protect the repository as follows. | ||
### Prioritize Security | ||
Security is your number one priority. Manage security keys and safeguard access to the repository. | ||
Note that this repository is monitored and supported 24/7 by Amazon Security, see [Reporting a Vulnerability](SECURITY.md) for details. | ||
### Enforce Code of Conduct | ||
Act on [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) violations by revoking access, and blocking malicious actors. | ||
### Adopt Organizational Best Practices | ||
Adopt organizational best practices, work in the open, and collaborate with other admins by opening issues before making process changes. Prefer consistency, and avoid diverging from practices in the opensearch-project organization. | ||
[This document](https://github.com/opensearch-project/.github/blob/main/ADMINS.md) | ||
explains what an admin's responsibilities are. |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
@@ -20,6 +20,9 @@ - [Compatibility with OpenSearch](#compatibility-with-opensearch) | ||
| 1.3.1 | 1.1.0 | | ||
| 1.3.2 | 1.1.0 | | ||
| 1.3.3 | 1.1.0 | | ||
| 2.0.0 | 2.0.0 | | ||
| 2.0.1 | 2.0.0 | | ||
## Upgrading | ||
Major versions of OpenSearch introduce breaking changes that require careful upgrades of the client. While `opensearch-js` 2.0.0 works against OpenSearch 1.3.1, certain deprecated features removed in OpenSearch 2.0 have also been removed from the client. Please refer to the [OpenSearch documentation](https://opensearch.org/docs/latest/clients/index/) for more information. | ||
Major versions of OpenSearch introduce breaking changes that require careful upgrades of the client. While `opensearch-js` 2.0.0 works against the latest OpenSearch 1.x, certain deprecated features removed in OpenSearch 2.0 have also been removed from the client. Please refer to the [OpenSearch documentation](https://opensearch.org/docs/latest/clients/index/) for more information. |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -290,3 +289,3 @@ | ||
if (callback == null) { | ||
return new Promise((resolve, reject) => { | ||
return new Promise((resolve) => { | ||
this.close(resolve); | ||
@@ -293,0 +292,0 @@ }); |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -222,3 +221,3 @@ | ||
port: url.port !== '' ? url.port : undefined, | ||
headers: this.headers, | ||
headers: Object.assign({}, this.headers), | ||
agent: this.agent, | ||
@@ -254,3 +253,4 @@ }; | ||
// access them with `instance.agent` and `instance.ssl`. | ||
[inspect.custom](depth, options) { | ||
[inspect.custom]() { | ||
// eslint-disable-next-line no-unused-vars | ||
const { authorization, ...headers } = this.headers; | ||
@@ -271,2 +271,3 @@ | ||
toJSON() { | ||
// eslint-disable-next-line no-unused-vars | ||
const { authorization, ...headers } = this.headers; | ||
@@ -273,0 +274,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -86,3 +85,3 @@ | ||
interface IndexAction { | ||
interface IndexActionOperation { | ||
index: { | ||
@@ -94,3 +93,3 @@ _index: string; | ||
interface CreateAction { | ||
interface CreateActionOperation { | ||
create: { | ||
@@ -116,2 +115,4 @@ _index: string; | ||
type CreateAction = CreateActionOperation | [CreateActionOperation, unknown]; | ||
type IndexAction = IndexActionOperation | [IndexActionOperation, unknown]; | ||
type UpdateAction = [UpdateActionOperation, Record<string, any>]; | ||
@@ -118,0 +119,0 @@ type Action = IndexAction | CreateAction | UpdateAction | DeleteAction; |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -101,3 +100,2 @@ | ||
appendFilterPath('_scroll_id', params, false); | ||
const { method, body, index, ...querystring } = params; | ||
@@ -137,5 +135,4 @@ let response = null; | ||
{ | ||
scroll: querystring.scroll, | ||
rest_total_hits_as_int: | ||
querystring.rest_total_hits_as_int || querystring.restTotalHitsAsInt, | ||
scroll: params.scroll, | ||
rest_total_hits_as_int: params.rest_total_hits_as_int || params.restTotalHitsAsInt, | ||
body: { scroll_id }, | ||
@@ -205,3 +202,3 @@ }, | ||
objectMode: true, | ||
read(size) {}, | ||
read() {}, | ||
}); | ||
@@ -339,3 +336,3 @@ | ||
function finish() { | ||
return new Promise((resolve, reject) => { | ||
return new Promise((resolve) => { | ||
if (running === 0) { | ||
@@ -354,3 +351,3 @@ resolve(); | ||
} else { | ||
return new Promise((resolve, reject) => { | ||
return new Promise((resolve) => { | ||
resolveSemaphore = resolve; | ||
@@ -541,17 +538,16 @@ }); | ||
timeoutRef.refresh(); | ||
const action = onDocument(chunk); | ||
const operation = Array.isArray(action) | ||
? Object.keys(action[0])[0] | ||
: Object.keys(action)[0]; | ||
const result = onDocument(chunk); | ||
const [action, payload] = Array.isArray(result) ? result : [result, chunk]; | ||
const operation = Object.keys(action)[0]; | ||
if (operation === 'index' || operation === 'create') { | ||
actionBody = serializer.serialize(action); | ||
payloadBody = typeof chunk === 'string' ? chunk : serializer.serialize(chunk); | ||
payloadBody = typeof payload === 'string' ? payload : serializer.serialize(payload); | ||
chunkBytes += Buffer.byteLength(actionBody) + Buffer.byteLength(payloadBody); | ||
bulkBody.push(actionBody, payloadBody); | ||
} else if (operation === 'update') { | ||
actionBody = serializer.serialize(action[0]); | ||
actionBody = serializer.serialize(action); | ||
payloadBody = | ||
typeof chunk === 'string' | ||
? `{"doc":${chunk}}` | ||
: serializer.serialize({ doc: chunk, ...action[1] }); | ||
: serializer.serialize({ doc: chunk, ...payload }); | ||
chunkBytes += Buffer.byteLength(actionBody) + Buffer.byteLength(payloadBody); | ||
@@ -659,3 +655,3 @@ bulkBody.push(actionBody, payloadBody); | ||
} else { | ||
return new Promise((resolve, reject) => { | ||
return new Promise((resolve) => { | ||
resolveSemaphore = resolve; | ||
@@ -662,0 +658,0 @@ }); |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -12,0 +11,0 @@ |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -33,6 +32,6 @@ | ||
import { Readable as ReadableStream } from 'stream'; | ||
import { ConnectionPool, CloudConnectionPool } from './pool'; | ||
import Connection from './Connection'; | ||
import * as errors from './errors'; | ||
import { CloudConnectionPool, ConnectionPool } from './pool'; | ||
import Serializer from './Serializer'; | ||
import * as errors from './errors'; | ||
@@ -64,2 +63,7 @@ export type ApiError = | ||
export interface MemoryCircuitBreakerOptions { | ||
enabled: boolean; | ||
maxPercentage: number; | ||
} | ||
interface TransportOptions { | ||
@@ -83,2 +87,3 @@ emit: (event: string | symbol, ...args: any[]) => boolean; | ||
opaqueIdPrefix?: string; | ||
memoryCircuitBreaker?: MemoryCircuitBreakerOptions; | ||
} | ||
@@ -179,2 +184,3 @@ | ||
opaqueIdPrefix: string | null; | ||
memoryCircuitBreaker: MemoryCircuitBreakerOptions | undefined; | ||
sniffEndpoint: string; | ||
@@ -181,0 +187,0 @@ _sniffEnabled: boolean; |
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
@@ -8,4 +9,2 @@ * | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
@@ -186,6 +185,10 @@ | ||
then(onFulfilled, onRejected) { | ||
return p.then(onFulfilled, onRejected); | ||
if (p != null) { | ||
return p.then(onFulfilled, onRejected); | ||
} | ||
}, | ||
catch(onRejected) { | ||
return p.catch(onRejected); | ||
if (p != null) { | ||
return p.catch(onRejected); | ||
} | ||
}, | ||
@@ -199,3 +202,5 @@ abort() { | ||
finally(onFinally) { | ||
return p.finally(onFinally); | ||
if (p != null) { | ||
return p.finally(onFinally); | ||
} | ||
}, | ||
@@ -682,3 +687,3 @@ }; | ||
let nextReqId = 0; | ||
return function genReqId(params, options) { | ||
return function genReqId() { | ||
return (nextReqId = (nextReqId + 1) & maxInt); | ||
@@ -685,0 +690,0 @@ }; |
@@ -1,78 +0,18 @@ | ||
- [Overview](#overview) | ||
- [Current Maintainers](#current-maintainers) | ||
- [Maintainer Responsibilities](#maintainer-responsibilities) | ||
- [Uphold Code of Conduct](#uphold-code-of-conduct) | ||
- [Prioritize Security](#prioritize-security) | ||
- [Review Pull Requests](#review-pull-requests) | ||
- [Triage Open Issues](#triage-open-issues) | ||
- [Backports](#backports) | ||
- [Be Responsive](#be-responsive) | ||
- [Maintain Overall Health of the Repo](#maintain-overall-health-of-the-repo) | ||
- [Use Semver](#use-semver) | ||
- [Release Frequently](#release-frequently) | ||
- [Promote Other Maintainers](#promote-other-maintainers) | ||
# OpenSearch JavaScript Client Maintainers | ||
## Overview | ||
This document explains who the maintainers are (see below), what they do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md). | ||
## Current Maintainers | ||
| Maintainer | GitHub ID | Affiliation | | ||
| --------------------- | ------------------------------------------------- | ----------- | | ||
| Anan Zhuang | [ananzh](https://github.com/ananzh) | Amazon | | ||
| Bishoy Boktor | [boktorbb-amzn](https://github.com/boktorbb-amzn) | Amazon | | ||
| Kawika (Rocky) Avilla | [kavilla](https://github.com/kavilla) | Amazon | | ||
| Mihir Soni | [mihirsoni](https://github.com/mihirsoni) | Amazon | | ||
| Sean Neumann | [seanneumann](https://github.com/seanneumann) | Amazon | | ||
| Tommy Markley | [tmarkley](https://github.com/tmarkley) | Amazon | | ||
| Maintainer | GitHub ID | Affiliation | | ||
|-----------------------|-----------------------------------------------|-------------| | ||
| Anan Zhuang | [ananzh](https://github.com/ananzh) | Amazon | | ||
| Bishoy Boktor | [boktorbb](https://github.com/boktorbb) | Amazon | | ||
| Kawika (Rocky) Avilla | [kavilla](https://github.com/kavilla) | Amazon | | ||
| Mihir Soni | [mihirsoni](https://github.com/mihirsoni) | Amazon | | ||
| Sean Neumann | [seanneumann](https://github.com/seanneumann) | Amazon | | ||
| Daniel Doubrovkine | [dblock](https://github.com/dblock) | Amazon | | ||
| Vacha Shah | [VachaShah](https://github.com/VachaShah) | Amazon | | ||
| Theo Truong | [nhtruong](https://github.com/nhtruong) | Amazon | | ||
## Maintainer Responsibilities | ||
Maintainers are active and visible members of the community, and have [maintain-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization). Use those privileges to serve the community and evolve code as follows. | ||
### Uphold Code of Conduct | ||
Model the behavior set forward by the [Code of Conduct](CODE_OF_CONDUCT.md) and raise any violations to other maintainers and admins. | ||
### Prioritize Security | ||
Security is your number one priority. Maintainer's Github keys must be password protected securely and any reported security vulnerabilities are addressed before features or bugs. | ||
Note that this repository is monitored and supported 24/7 by Amazon Security, see [Reporting a Vulnerability](SECURITY.md) for details. | ||
### Review Pull Requests | ||
Review pull requests regularly, comment, suggest, reject, merge and close. Accept only high quality pull-requests. Provide code reviews and guidance on incomming pull requests. Don't let PRs be stale and do your best to be helpful to contributors. | ||
### Triage Open Issues | ||
Manage labels, review issues regularly, and triage by labelling them. | ||
All repositories in this organization have a standard set of labels, including `bug`, `documentation`, `duplicate`, `enhancement`, `good first issue`, `help wanted`, `blocker`, `invalid`, `question`, `wontfix`, and `untriaged`, along with release labels, such as `v1.0.0`, `v1.1.0` and `v2.0.0`, and `backport`. | ||
Use labels to target an issue or a PR for a given release, add `help wanted` to good issues for new community members, and `blocker` for issues that scare you or need immediate attention. Request for more information from a submitter if an issue is not clear. Create new labels as needed by the project. | ||
### Backports | ||
The Github workflow in [backport.yml](.github/workflows/backport.yml) creates backport PRs automatically when the original PR with an appropriate label `backport <backport-branch-name>` is merged to main. To backport a PR to `1.x`, add a label `backport 1.x` to the PR, once this PR is merged to main, the workflow will create a backport PR to the `1.x` branch. | ||
### Be Responsive | ||
Respond to enhancement requests, and forum posts. Allocate time to reviewing and commenting on issues and conversations as they come in. | ||
### Maintain Overall Health of the Repo | ||
Keep the `main` branch at production quality at all times. Backport features as needed. Cut release branches and tags to enable future patches. | ||
### Use Semver | ||
Use and enforce [semantic versioning](https://semver.org/) and do not let breaking changes be made outside of major releases. | ||
### Release Frequently | ||
Make frequent project releases to the community. | ||
### Promote Other Maintainers | ||
Assist, add, and remove [MAINTAINERS](MAINTAINERS.md). Exercise good judgement, and propose high quality contributors to become co-maintainers. | ||
[This document](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md) | ||
explains what maintainers do in this repo, and how they should be doing it. | ||
If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md). |
@@ -9,8 +9,20 @@ { | ||
"require": "./index.js", | ||
"types": "./index.d.ts", | ||
"import": "./index.mjs" | ||
}, | ||
"./aws": "./lib/aws/index.js", | ||
"./": "./" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
".": [ | ||
"index.d.ts" | ||
], | ||
"aws": [ | ||
"./lib/aws/index.d.ts" | ||
] | ||
} | ||
}, | ||
"homepage": "https://www.opensearch.org/", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"versionCanary": "7.10.0-canary.6", | ||
@@ -27,4 +39,4 @@ "keywords": [ | ||
"scripts": { | ||
"test": "npm run lint && tap test/{unit,acceptance}/{*,**/*}.test.js && npm run test:types", | ||
"test:unit": "tap test/unit/{*,**/*}.test.js", | ||
"test": "npm run lint && tap test/{unit,acceptance}/{*,**/*,**/**/*}.test.js && npm run test:types", | ||
"test:unit": "tap test/unit/{*,**/*,**/**/*}.test.js", | ||
"test:acceptance": "tap test/acceptance/*.test.js", | ||
@@ -35,5 +47,5 @@ "test:integration": "node test/integration/index.js", | ||
"test:types": "tsd", | ||
"test:coverage-90": "tap test/{unit,acceptance}/{*,**/*}.test.js --coverage --branches=90 --functions=90 --lines=90 --statements=90 --nyc-arg=\"--exclude=api\"", | ||
"test:coverage-report": "tap test/{unit,acceptance}/{*,**/*}.test.js --coverage --branches=90 --functions=90 --lines=90 --statements=90 --nyc-arg=\"--exclude=api\" && nyc report --reporter=text-lcov > coverage.lcov", | ||
"test:coverage-ui": "tap test/{unit,acceptance}/{*,**/*}.test.js --coverage --coverage-report=html --nyc-arg=\"--exclude=api\"", | ||
"test:coverage-90": "tap test/{unit,acceptance}/{*,**/*,**/**/*}.test.js --coverage --branches=90 --functions=90 --lines=90 --statements=90 --nyc-arg=\"--exclude=api\"", | ||
"test:coverage-report": "tap test/{unit,acceptance}/{*,**/*,**/**/*}.test.js --coverage --branches=90 --functions=90 --lines=90 --statements=90 --nyc-arg=\"--exclude=api\" && nyc report --reporter=text-lcov > coverage.lcov", | ||
"test:coverage-ui": "tap test/{unit,acceptance}/{*,**/*,**/**/*}.test.js --coverage --coverage-report=html --nyc-arg=\"--exclude=api\"", | ||
"lint": "eslint .", | ||
@@ -50,2 +62,3 @@ "lint:fix": "eslint . --fix", | ||
"devDependencies": { | ||
"@aws-sdk/types": "^3.160.0", | ||
"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1", | ||
@@ -67,3 +80,3 @@ "@types/node": "^15.3.1", | ||
"minimist": "^1.2.5", | ||
"node-fetch": "^2.6.1", | ||
"node-fetch": "^3.2.10", | ||
"ora": "^5.4.0", | ||
@@ -79,4 +92,4 @@ "prettier": "^2.6.2", | ||
"stoppable": "^1.1.0", | ||
"tap": "^15.0.9", | ||
"tsd": "^0.15.1", | ||
"tap": "^16.3.0", | ||
"tsd": "^0.24.1", | ||
"workq": "^3.0.0", | ||
@@ -86,2 +99,3 @@ "xmlbuilder2": "^2.4.1" | ||
"dependencies": { | ||
"aws4": "^1.11.0", | ||
"debug": "^4.3.1", | ||
@@ -92,2 +106,5 @@ "hpagent": "^0.1.1", | ||
}, | ||
"resolutions": { | ||
"**/strip-ansi": "^6.0.1" | ||
}, | ||
"license": "Apache-2.0", | ||
@@ -115,2 +132,2 @@ "repository": { | ||
} | ||
} | ||
} |
109
README.md
@@ -15,3 +15,3 @@ [![Nodejs](https://github.com/opensearch-project/opensearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/opensearch-project/opensearch-js/actions/workflows/nodejs.yml) | ||
- [Setup](#setup) | ||
- [Sample code](#sample-code) | ||
- [Sample code](#sample-code) | ||
- [Project Resources](#project-resources) | ||
@@ -48,110 +48,7 @@ - [Code of Conduct](#code-of-conduct) | ||
### Sample code | ||
## Sample code | ||
```javascript | ||
'use strict'; | ||
Please see the [USER_GUIDE](USER_GUIDE.md) for code snippets. | ||
var host = 'localhost'; | ||
var protocol = 'https'; | ||
var port = 9200; | ||
var auth = 'admin:admin'; // For testing only. Don't store credentials in code. | ||
var ca_certs_path = '/full/path/to/root-ca.pem'; | ||
// Optional client certificates if you don't want to use HTTP basic authentication. | ||
// var client_cert_path = '/full/path/to/client.pem' | ||
// var client_key_path = '/full/path/to/client-key.pem' | ||
// Create a client with SSL/TLS enabled. | ||
var { Client } = require('@opensearch-project/opensearch'); | ||
var fs = require('fs'); | ||
var client = new Client({ | ||
node: protocol + '://' + auth + '@' + host + ':' + port, | ||
ssl: { | ||
ca: fs.readFileSync(ca_certs_path), | ||
// You can turn off certificate verification (rejectUnauthorized: false) if you're using self-signed certificates with a hostname mismatch. | ||
// cert: fs.readFileSync(client_cert_path), | ||
// key: fs.readFileSync(client_key_path) | ||
}, | ||
}); | ||
async function search() { | ||
// Create an index with non-default settings. | ||
var index_name = 'books'; | ||
var settings = { | ||
settings: { | ||
index: { | ||
number_of_shards: 4, | ||
number_of_replicas: 3, | ||
}, | ||
}, | ||
}; | ||
var response = await client.indices.create({ | ||
index: index_name, | ||
body: settings, | ||
}); | ||
console.log('Creating index:'); | ||
console.log(response.body); | ||
// Add a document to the index. | ||
var document = { | ||
title: 'The Outsider', | ||
author: 'Stephen King', | ||
year: '2018', | ||
genre: 'Crime fiction', | ||
}; | ||
var id = '1'; | ||
var response = await client.index({ | ||
id: id, | ||
index: index_name, | ||
body: document, | ||
refresh: true, | ||
}); | ||
console.log('Adding document:'); | ||
console.log(response.body); | ||
// Search for the document. | ||
var query = { | ||
query: { | ||
match: { | ||
title: { | ||
query: 'The Outsider', | ||
}, | ||
}, | ||
}, | ||
}; | ||
var response = await client.search({ | ||
index: index_name, | ||
body: query, | ||
}); | ||
console.log('Search results:'); | ||
console.log(response.body.hits); | ||
// Delete the document. | ||
var response = await client.delete({ | ||
index: index_name, | ||
id: id, | ||
}); | ||
console.log('Deleting document:'); | ||
console.log(response.body); | ||
// Delete the index. | ||
var response = await client.indices.delete({ | ||
index: index_name, | ||
}); | ||
console.log('Deleting index:'); | ||
console.log(response.body); | ||
} | ||
search().catch(console.log); | ||
``` | ||
## Project Resources | ||
@@ -158,0 +55,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1090876
97
29725
5
32
77
3
+ Addedaws4@^1.11.0
+ Addedaws4@1.13.2(transitive)