From 423c59979457009e6e497393ccbdd590b570bf87 Mon Sep 17 00:00:00 2001 From: Miki Date: Wed, 12 Jul 2023 12:19:31 -0700 Subject: [PATCH] Manual master cherrypick into 2.x (#550) * Adding new OpenSearch versions and updating compatibility matrix (#257) Signed-off-by: Vacha Shah --- .ci/license/check-license-headers.sh | 56 + .ci/license/license-mc.txt | 9 + .ci/license/license-sc.txt | 6 + .ci/opendistro/Dockerfile.opendistro | 7 - .ci/opendistro/docker-compose.yml | 16 - .ci/opensearch/Dockerfile.opensearch | 6 + .ci/opensearch/docker-compose.yml | 12 + .eslintrc.json | 18 +- .github/dependabot.yml | 10 + .github/workflows/add-untriaged.yml | 19 + .github/workflows/changelog_verifier.yml | 18 + .github/workflows/dependabot_pr.yml | 44 + .github/workflows/gh_pages.yml | 33 + .github/workflows/license-header.yml | 14 + .github/workflows/links.yml | 24 + .github/workflows/release-drafter.yml | 2 +- .gitignore | 6 + ADMINS.md | 51 +- CHANGELOG.md | 168 ++ COMPATIBILITY.md | 5 +- CONTRIBUTING.md | 26 +- DEVELOPER_GUIDE.md | 60 +- MAINTAINERS.md | 91 +- Makefile | 14 +- README.md | 111 +- RELEASING.md | 6 +- api/api/bulk.js | 26 +- api/api/cat.js | 322 ++- api/api/clear_scroll.js | 17 +- api/api/cluster.js | 240 +- api/api/count.js | 31 +- api/api/create.js | 29 +- api/api/create_pit.js | 88 + api/api/dangling_indices.js | 48 +- api/api/delete.js | 26 +- api/api/delete_all_pits.js | 53 + api/api/delete_by_query.js | 51 +- api/api/delete_by_query_rethrottle.js | 17 +- api/api/delete_pit.js | 61 + api/api/delete_script.js | 17 +- api/api/exists.js | 28 +- api/api/exists_source.js | 28 +- api/api/explain.js | 30 +- api/api/features.js | 27 +- api/api/field_caps.js | 22 +- api/api/get.js | 28 +- api/api/get_all_pits.js | 53 + api/api/get_script.js | 19 +- api/api/get_script_context.js | 14 +- api/api/get_script_languages.js | 14 +- api/api/get_source.js | 28 +- api/api/index.js | 32 +- api/api/indices.js | 818 +++++- api/api/info.js | 14 +- api/api/ingest.js | 92 +- api/api/mget.js | 27 +- api/api/msearch.js | 25 +- api/api/msearch_template.js | 22 +- api/api/mtermvectors.js | 3 +- api/api/nodes.js | 94 +- api/api/ping.js | 14 +- api/api/put_script.js | 20 +- api/api/rank_eval.js | 22 +- api/api/reindex.js | 25 +- api/api/reindex_rethrottle.js | 17 +- api/api/render_search_template.js | 17 +- api/api/scripts_painless_execute.js | 16 +- api/api/scroll.js | 20 +- api/api/search.js | 63 +- api/api/search_shards.js | 22 +- api/api/search_template.js | 30 +- api/api/shutdown.js | 6 +- api/api/snapshot.js | 213 +- api/api/tasks.js | 59 +- api/api/terms_enum.js | 4 +- api/api/termvectors.js | 29 +- api/api/update.js | 31 +- api/api/update_by_query.js | 53 +- api/api/update_by_query_rethrottle.js | 17 +- api/index.js | 31 +- api/new.d.ts | 67 +- api/opensearch_dashboards.d.ts | 7 +- api/requestParams.d.ts | 19 +- api/types.d.ts | 62 +- api/utils.js | 3 +- guides/advanced_index_actions.md | 91 + guides/bulk.md | 166 ++ guides/document_lifecycle.md | 162 ++ guides/index_lifecycle.md | 152 ++ guides/index_template.md | 228 ++ guides/search.md | 217 ++ index.d.ts | 725 ++++- index.js | 5 +- index.mjs | 3 +- lib/Connection.d.ts | 3 +- lib/Connection.js | 11 +- lib/Helpers.d.ts | 9 +- lib/Helpers.js | 30 +- lib/Serializer.d.ts | 3 +- lib/Serializer.js | 250 +- lib/Transport.d.ts | 14 +- lib/Transport.js | 41 +- lib/aws/AwsSigv4Signer.js | 176 ++ lib/aws/errors.js | 24 + lib/aws/index.d.ts | 40 + lib/aws/index.js | 19 + lib/errors.d.ts | 7 +- lib/errors.js | 3 +- lib/pool/BaseConnectionPool.js | 3 +- lib/pool/CloudConnectionPool.js | 3 +- lib/pool/ConnectionPool.js | 9 +- lib/pool/index.d.ts | 10 +- lib/pool/index.js | 3 +- package.json | 58 +- scripts/download-artifacts.js | 3 +- scripts/generate.js | 3 +- scripts/release-canary.js | 32 +- scripts/utils/clone-opensearch.js | 3 +- scripts/utils/generateApis.js | 7 +- scripts/utils/generateDocs.js | 3 +- scripts/utils/generateMain.js | 3 +- scripts/utils/generateRequestTypes.js | 6 +- scripts/utils/index.js | 3 +- test/acceptance/events-order.test.js | 97 +- test/acceptance/observability.test.js | 7 +- test/acceptance/proxy.test.js | 3 +- test/acceptance/resurrect.test.js | 17 +- test/acceptance/sniff.test.js | 11 +- test/benchmarks/macro/complex.bench.js | 3 +- test/benchmarks/macro/simple.bench.js | 3 +- test/benchmarks/micro/basic.bench.js | 5 +- test/benchmarks/suite.js | 5 +- test/bundlers/parcel-test/index.js | 5 +- test/bundlers/rollup-test/index.js | 5 +- test/bundlers/rollup-test/rollup.config.js | 3 +- test/bundlers/webpack-test/index.js | 5 +- test/bundlers/webpack-test/webpack.config.js | 3 +- test/fixtures/longnumerals-dataset.ndjson | 3 + test/integration/helper.js | 3 +- .../integration/helpers-secure/search.test.js | 8 +- test/integration/helpers/bulk.test.js | 15 +- test/integration/helpers/msearch.test.js | 10 +- test/integration/helpers/scroll.test.js | 8 +- test/integration/helpers/search.test.js | 8 +- test/integration/index.js | 18 +- test/integration/reporter.js | 3 +- .../serializer/longnumerals.test.js | 90 + test/integration/test-runner.js | 3 +- test/types/api-response-body.test-d.ts | 3 +- test/types/api-response.test-d.ts | 3 +- test/types/awssigv4signer.test-d.ts | 33 + test/types/client-options.test-d.ts | 3 +- test/types/client.test-d.ts | 9 +- test/types/connection-pool.test-d.ts | 4 +- test/types/connection.test-d.ts | 7 +- test/types/errors.test-d.ts | 3 +- test/types/helpers.test-d.ts | 3 +- test/types/new-types.test-d.ts | 3 +- test/types/serializer.test-d.ts | 3 +- test/types/transport.test-d.ts | 3 +- test/unit/api-async.js | 3 +- test/unit/api.test.js | 11 +- test/unit/base-connection-pool.test.js | 3 +- test/unit/child.test.js | 31 +- test/unit/client.test.js | 119 +- test/unit/cloud-connection-pool.test.js | 3 +- test/unit/connection-pool.test.js | 3 +- test/unit/connection.test.js | 96 +- test/unit/errors.test.js | 11 +- test/unit/esm/index.mjs | 3 +- test/unit/esm/index.test.js | 3 +- test/unit/events.test.js | 17 +- test/unit/helpers/bulk.test.js | 212 +- test/unit/helpers/msearch.test.js | 51 +- test/unit/helpers/scroll.test.js | 11 +- test/unit/helpers/search.test.js | 3 +- test/unit/lib/aws/awssigv4signer.test.js | 474 ++++ test/unit/selectors.test.js | 3 +- test/unit/serializer.test.js | 29 +- test/unit/transport.test.js | 77 +- test/utils/MockConnection.js | 3 +- test/utils/buildCluster.js | 3 +- test/utils/buildProxy.js | 15 +- test/utils/buildServer.js | 5 +- test/utils/index.js | 21 +- yarn.lock | 2340 ++++++----------- 186 files changed, 8090 insertions(+), 2549 deletions(-) create mode 100755 .ci/license/check-license-headers.sh create mode 100644 .ci/license/license-mc.txt create mode 100644 .ci/license/license-sc.txt delete mode 100644 .ci/opendistro/Dockerfile.opendistro delete mode 100644 .ci/opendistro/docker-compose.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/add-untriaged.yml create mode 100644 .github/workflows/changelog_verifier.yml create mode 100644 .github/workflows/dependabot_pr.yml create mode 100644 .github/workflows/gh_pages.yml create mode 100644 .github/workflows/license-header.yml create mode 100644 .github/workflows/links.yml create mode 100644 api/api/create_pit.js create mode 100644 api/api/delete_all_pits.js create mode 100644 api/api/delete_pit.js create mode 100644 api/api/get_all_pits.js create mode 100644 guides/advanced_index_actions.md create mode 100644 guides/bulk.md create mode 100644 guides/document_lifecycle.md create mode 100644 guides/index_lifecycle.md create mode 100644 guides/index_template.md create mode 100644 guides/search.md create mode 100644 lib/aws/AwsSigv4Signer.js create mode 100644 lib/aws/errors.js create mode 100644 lib/aws/index.d.ts create mode 100644 lib/aws/index.js create mode 100644 test/fixtures/longnumerals-dataset.ndjson create mode 100644 test/integration/serializer/longnumerals.test.js create mode 100644 test/types/awssigv4signer.test-d.ts create mode 100644 test/unit/lib/aws/awssigv4signer.test.js diff --git a/.ci/license/check-license-headers.sh b/.ci/license/check-license-headers.sh new file mode 100755 index 000000000..8470661f7 --- /dev/null +++ b/.ci/license/check-license-headers.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# Copyright OpenSearch Contributors +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# Check that source code files in this repo have the appropriate license +# header. + +if [ "$TRACE" != "" ]; then + export PS4='${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' + set -o xtrace +fi +set -o errexit +set -o pipefail + +TOP=$(cd "$(dirname "$0")/.." >/dev/null && pwd) +NLINES_SC=$(wc -l ./.ci/license/license-sc.txt | awk '{print $1}') +NLINES_MC=$(wc -l ./.ci/license/license-mc.txt | awk '{print $1}') + +echo $NLINES_SC +echo $NLINES_MC + +function check_license_header { + local fP + f=$1 + if (diff -a --strip-trailing-cr license/license-mc.txt <(head -$NLINES_MC "$f") >/dev/null) || (diff -a --strip-trailing-cr license/license-sc.txt <(head -$NLINES_SC "$f") >/dev/null); then + return 0 + else + echo "check-license-headers: error: '$f' does not have required license header, see 'diff -u ./.ci/license/license-mc.txt <(head -$NLINES_MC ../$f)'" + return 1 + fi +} + +cd "$TOP" +nErrors=0 + +for f in $(git ls-files --directory ../ | grep '\.ts$' | grep -v '^docs/'); do + if ! check_license_header $f; then + nErrors=$((nErrors+1)) + fi +done + +for f in $(git ls-files --directory ../ | grep '\.js$' | grep -v '^docs/'); do + if ! check_license_header $f; then + nErrors=$((nErrors+1)) + fi +done + +if [[ $nErrors -eq 0 ]]; then + exit 0 +else + exit 1 +fi diff --git a/.ci/license/license-mc.txt b/.ci/license/license-mc.txt new file mode 100644 index 000000000..43d1458f2 --- /dev/null +++ b/.ci/license/license-mc.txt @@ -0,0 +1,9 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ diff --git a/.ci/license/license-sc.txt b/.ci/license/license-sc.txt new file mode 100644 index 000000000..a21dff654 --- /dev/null +++ b/.ci/license/license-sc.txt @@ -0,0 +1,6 @@ +// Copyright OpenSearch Contributors +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. diff --git a/.ci/opendistro/Dockerfile.opendistro b/.ci/opendistro/Dockerfile.opendistro deleted file mode 100644 index 05f319324..000000000 --- a/.ci/opendistro/Dockerfile.opendistro +++ /dev/null @@ -1,7 +0,0 @@ -ARG OPENDISTRO_VERSION -FROM amazon/opendistro-for-elasticsearch:${OPENDISTRO_VERSION} - -ARG es_path=/usr/share/elasticsearch - -ARG SECURE_INTEGRATION -RUN if [ "$SECURE_INTEGRATION" != "true" ] ; then $es_path/bin/elasticsearch-plugin remove opendistro_security; fi diff --git a/.ci/opendistro/docker-compose.yml b/.ci/opendistro/docker-compose.yml deleted file mode 100644 index cb25dbce2..000000000 --- a/.ci/opendistro/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: '3' - -services: - elasticsearch: - build: - context: . - dockerfile: Dockerfile.opendistro - args: - - SECURE_INTEGRATION=${SECURE_INTEGRATION:-false} - - OPENDISTRO_VERSION=${OPENDISTRO_VERSION:-latest} - environment: - - discovery.type=single-node - - bootstrap.memory_lock=true - ports: - - '9200:9200' - user: elasticsearch diff --git a/.ci/opensearch/Dockerfile.opensearch b/.ci/opensearch/Dockerfile.opensearch index 67a1a3b13..e248a6206 100644 --- a/.ci/opensearch/Dockerfile.opensearch +++ b/.ci/opensearch/Dockerfile.opensearch @@ -5,4 +5,10 @@ ARG opensearch_path=/usr/share/opensearch ARG opensearch_yml=$opensearch_path/config/opensearch.yml ARG SECURE_INTEGRATION + +HEALTHCHECK --start-period=20s --interval=5s --retries=2 --timeout=1s \ + CMD if [ "$SECURE_INTEGRATION" != "true" ]; \ + then curl --fail localhost:9200/_cat/health; \ + else curl --fail -k https:/localhost:9200/_cat/health -u admin:admin; fi + RUN if [ "$SECURE_INTEGRATION" != "true" ] ; then $opensearch_path/bin/opensearch-plugin remove opensearch-security; fi diff --git a/.ci/opensearch/docker-compose.yml b/.ci/opensearch/docker-compose.yml index 9f8b2a525..977dbb3b1 100644 --- a/.ci/opensearch/docker-compose.yml +++ b/.ci/opensearch/docker-compose.yml @@ -2,6 +2,7 @@ version: '3' services: opensearch: + restart: always build: context: . dockerfile: Dockerfile.opensearch @@ -11,6 +12,17 @@ services: environment: - discovery.type=single-node - bootstrap.memory_lock=true + - SECURE_INTEGRATION=${SECURE_INTEGRATION:-false} ports: - '9200:9200' user: opensearch + autoheal: + restart: always + image: willfarrell/autoheal + environment: + - AUTOHEAL_CONTAINER_LABEL=all + - AUTOHEAL_START_PERIOD=30 + - AUTOHEAL_INTERVAL=5 + - AUTOHEAL_DEFAULT_STOP_TIMEOUT=30 + volumes: + - /var/run/docker.sock:/var/run/docker.sock diff --git a/.eslintrc.json b/.eslintrc.json index cec6ba762..594440a68 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,7 +7,10 @@ "eslint:recommended", "prettier" ], - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", + "parserOptions": { + "requireConfigFile": false + }, "plugins": [ "prettier" ], @@ -18,9 +21,14 @@ "endOfLine": "auto" } ], - /*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": "^_.*" + } + ] } -} \ No newline at end of file +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..e86a31156 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +updates: + - directory: / + open-pull-requests-limit: 3 + package-ecosystem: npm + schedule: + interval: weekly + labels: + - "dependabot" + - "dependencies" +version: 2 diff --git a/.github/workflows/add-untriaged.yml b/.github/workflows/add-untriaged.yml new file mode 100644 index 000000000..9dcc7020d --- /dev/null +++ b/.github/workflows/add-untriaged.yml @@ -0,0 +1,19 @@ +name: Apply 'untriaged' label during issue lifecycle + +on: + issues: + types: [opened, reopened, transferred] + +jobs: + apply-label: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['untriaged'] + }) diff --git a/.github/workflows/changelog_verifier.yml b/.github/workflows/changelog_verifier.yml new file mode 100644 index 000000000..992a38b62 --- /dev/null +++ b/.github/workflows/changelog_verifier.yml @@ -0,0 +1,18 @@ +name: "Changelog Verifier" +on: + pull_request: + types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled] + +jobs: + # Enforces the update of a changelog file on every pull request + verify-changelog: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.sha }} + + - uses: dangoslen/changelog-enforcer@v3 + with: + skipLabels: "autocut, skip-changelog" diff --git a/.github/workflows/dependabot_pr.yml b/.github/workflows/dependabot_pr.yml new file mode 100644 index 000000000..5abbd37e3 --- /dev/null +++ b/.github/workflows/dependabot_pr.yml @@ -0,0 +1,44 @@ +name: Dependabot PR actions +on: + pull_request: + types: + - opened + - reopened + - synchronize + - labeled + - unlabeled + +jobs: + dependabot: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.5.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + + - name: Check out code + uses: actions/checkout@v3 + with: + token: ${{ steps.github_app_token.outputs.token }} + + - name: Update the changelog + uses: dangoslen/dependabot-changelog-helper@v2 + with: + version: 'Unreleased' + + - name: Commit the changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Update changelog" + branch: ${{ github.head_ref }} + commit_user_name: dependabot[bot] + commit_user_email: support@github.com + commit_options: '--signoff' \ No newline at end of file diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml new file mode 100644 index 000000000..99f89b0cc --- /dev/null +++ b/.github/workflows/gh_pages.yml @@ -0,0 +1,33 @@ +name: Publish Docs to Github Pages +on: + workflow_dispatch: + push: + branches: [main] +jobs: + update-docs: + runs-on: ubuntu-latest + name: Update gh-pages with docs + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + ruby-version: 16.x + - name: Install Tools + run: | + sudo apt install -y jq + npm install -g jsdoc + - name: Generate Docs + run: | + export PACKAGE_VERSION=$(jq .version package.json -r | awk -F. '{print $1"."$2}') + export DOC_FOLDER=docs/$PACKAGE_VERSION + jsdoc api lib -d $DOC_FOLDER -r --readme README.md + cp *.md $DOC_FOLDER + cp *.txt $DOC_FOLDER + cp OpenSearch.svg $DOC_FOLDER + - name: Deploy Docs to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + keep_files: true + enable_jekyll: true diff --git a/.github/workflows/license-header.yml b/.github/workflows/license-header.yml new file mode 100644 index 000000000..54fb53ee3 --- /dev/null +++ b/.github/workflows/license-header.yml @@ -0,0 +1,14 @@ +name: License headers + +on: [push, pull_request] + +jobs: + licenseheader: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Check license headers + run: "./.ci/license/check-license-headers.sh" \ No newline at end of file diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml new file mode 100644 index 000000000..70749934e --- /dev/null +++ b/.github/workflows/links.yml @@ -0,0 +1,24 @@ +name: Link Checker +on: + push: + branches: + - "*" + pull_request: + branches: + - "*" + +jobs: + linkchecker: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: lychee Link Checker + id: lychee + uses: lycheeverse/lychee-action@v1.5.0 + with: + args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "file:///github/workspace/*" --exclude-mail + fail: true + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 05de96757..87503acb6 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -27,4 +27,4 @@ jobs: uses: softprops/action-gh-release@v1 with: draft: true - generate_release_notes: true + generate_release_notes: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 09aaa949d..1f15093f3 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,12 @@ opensearch* !opensearch_dashboards* !opensearchDashboards* +# documentation +docs/ + +# temporary +tmp/ + test/benchmarks/macro/fixtures/* *-junit.xml diff --git a/ADMINS.md b/ADMINS.md index 1e3db5dee..9b5f7c6b7 100644 --- a/ADMINS.md +++ b/ADMINS.md @@ -1,41 +1,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) - -## 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). +# OpenSearch JavaScript Client Admins ## 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 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. +| 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 | + +[This document](https://github.com/opensearch-project/.github/blob/main/ADMINS.md) +explains what an admin's responsibilities are. diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb..d6296760d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,168 @@ +# CHANGELOG + +Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) + +## [Unreleased] +### Added +### Dependencies +### Changed +### Deprecated +### Removed +### Fixed +### Security + +## [2.3.0] + +### Added +- Add serialization and deserialization of numerals larger than `Number.MAX_SAFE_INTEGER` ([#544](https://github.com/opensearch-project/opensearch-js/pull/544)) +### Dependencies +- Bumps `prettier` from 2.8.7 to 2.8.8 +- Bumps `ora` from 6.1.2 to 6.3.1 +- Bumps `@types/node` from 18.15.11 to 20.2.5 +- Bumps `eslint` from 8.38.0 to 8.41.0 +- Bumps `xmlbuilder2` from 3.0.2 to 3.1.1 +- Bumps `simple-git` from 3.17.0 to 3.18.0 +- Bumps `@babel/eslint-parser` from 7.21.3 to 7.21.8 +- Bumps `@aws-sdk/types` from 3.257.0 to 3.341.0 +- Bumps `semver` from 7.3.8 to 7.5.1 +- Bumps `node-fetch` from 3.2.10 to 3.3.1 +### Changed +- Implemented Docker Image caching for `integration-unreleased` workflow ([#387](https://github.com/opensearch-project/opensearch-js/issues/387)) +- Add upgrading NPM to all workflows running older Node.js versions ([#545](https://github.com/opensearch-project/opensearch-js/issues/545)) +- Upgrade and secure the backport workflow ([#547](https://github.com/opensearch-project/opensearch-js/issues/547)) +### Deprecated +### Removed +### Fixed +- Fixed malformed `bundler.yml` ([#497](https://github.com/opensearch-project/opensearch-js/pull/497)) +### Security + +## [2.2.1] + +### Added + +- Add release details to releasing.md ([319](https://github.com/opensearch-project/opensearch-js/pull/319)) +- Added Amazon OpenSearch Serverless in user_guide ([#372](https://github.com/opensearch-project/opensearch-js/issues/372)) +- Add guidelines on installing yarn, dependencies; instructions on running ESLint in developer_guide ([#439](https://github.com/opensearch-project/opensearch-js/issues/435)) +- Added pull_request_template ([440](https://github.com/opensearch-project/opensearch-js/pull/440)) +- Added guide for Search ([#473](https://github.com/opensearch-project/opensearch-js/pull/489)) + +### Dependencies + +- Bumps `aws4` from 1.11.0 to 1.12.0 +- Bumps `minimist` from 1.2.6 to 1.2.8 +- Bumps `tsd` from 0.24.1 to 0.27.0 +- Bumps `dezalgo` from 1.0.3 to 1.0.4 +- Bumps `simple-statistics` from 7.7.0 to 7.8.3 +- Bumps `eslint` from 8.30.0 to 8.38.0 +- Downgrades `@types/node` from 18.11.19 to 17.0.45 +- Bumps `ora` from 5.4.1 to 6.1.2 +- Bumps `@aws-sdk/types` from 3.190.0 to 3.257.0 +- Bumps `secure-json-parse` from 2.4.0 to 2.7.0 +- Bumps `simple-git` from 3.15.1 to 3.17.0 +- Bumps `deepmerge` from 4.2.2 to 4.3.1 +- Bumps `tap` from 16.3.0 to 16.3.4 +- Bumps `rimraf` from 4.1.1 to 5.0.0 +- Bumps `@types/node` from 17.0.45 to 18.15.11 +- Bumps `caniuse-lite` from 1.0.30001249 to 1.0.30001469 +- Bumps `eslint-config-prettier` from 8.6.0 to 8.8.0 +- Bumps `split2` from 4.1.0 to 4.2.0 +- Bumps `prettier` from 2.8.4 to 2.8.7 +- Bumps `jsdoc` from 4.0.0 to 4.0.2 +- Bumps `@babel/eslint-parser` from 7.19.1 to 7.21.3 + +### Changed + +- Remove test artifacts from gh_pages workflow ([#335](https://github.com/opensearch-project/opensearch-js/issues/335)) +- Make fields in `BulkOperation` optional to match OpenSearch Bulk API requirements ([#378](https://github.com/opensearch-project/opensearch-js/pull/378)) +- Remove guidance on using npm and switch completely to yarn in developer_guide ([#439](https://github.com/opensearch-project/opensearch-js/issues/435)) +- Change coverage, compatability, integration, integration with unreleased Open Search, node ci, bundler tests not to run on documentation change ([441](https://github.com/opensearch-project/opensearch-js/pull/441)) +- Change the Windows yarn installation troubleshoot steps ([455](https://github.com/opensearch-project/opensearch-js/issues/455)) +- Make `callback` arg in `BaseConnectionPool`, `CloudConnectionPool` and `ConnectionPool` optional ([#451](https://github.com/opensearch-project/opensearch-js/pull/451)) + +### Deprecated + +- Remove deprecation warnings in bulk.test.js ([#434](https://github.com/opensearch-project/opensearch-js/issues/434)) + +### Removed + +- Remove waitCluster in Integration Tests ([#422](https://github.com/opensearch-project/opensearch-js/issues/422)) + +### Fixed + +- Added missing types for AwsSigv4SignerOptions.service ([#377](https://github.com/opensearch-project/opensearch-js/pull/377)) +- Fixed deprecated folder mapping "./" in the "exports" field module resolution ([#416](https://github.com/opensearch-project/opensearch-js/pull/416)) + +### Security + +- [CVE-2022-25912] Bumps simple-git from 3.4.0 to 3.15.0 ([#341](https://github.com/opensearch-project/opensearch-js/pull/341)) + +## [2.2.0] + +### Added + +- Add release details to releasing.md ([319](https://github.com/opensearch-project/opensearch-js/pull/319)) +- Allow overriding the aws service identifier in AwsSigv4Signer ([333](https://github.com/opensearch-project/opensearch-js/pull/333)) +- Added skip-changelog label ([339](https://github.com/opensearch-project/opensearch-js/pull/339)) +- Added jsdoc for documentation generation ([#335](https://github.com/opensearch-project/opensearch-js/issues/335)) +- Documented Transport#request ([#335](https://github.com/opensearch-project/opensearch-js/issues/335)) +- Documented all API methods ([#335](https://github.com/opensearch-project/opensearch-js/issues/335)) +- Added point in time APIs ([#348](https://github.com/opensearch-project/opensearch-js/pull/348)) +- Added support for Amazon OpenSearch Serverless ([#356](https://github.com/opensearch-project/opensearch-js/issues/356)) +- Added required `array` argument when invoking `SerializationError` ([#419](https://github.com/opensearch-project/opensearch-js/pull/419)) +- Removed unnecessary `data` argument when invoking `OpenSearchClientError` ([#421](https://github.com/opensearch-project/opensearch-js/pull/421)) +- Fixed typos in `ConnectionPool` ([#427](https://github.com/opensearch-project/opensearch-js/pull/427)) +- Added the solution for the possible error during yarn installation on Windows OS ([#435](https://github.com/opensearch-project/opensearch-js/issues/435)) +- Added missing `createConnection` method type definition in `BaseConnectionPool` )([#490](https://github.com/opensearch-project/opensearch-js/pull/490)) + +### Dependencies + +- Bumps `xmlbuilder2` from 2.4.1 to 3.0.2 +- Bumps `minimatch` from 3.0.4 to 3.1.2 +- Bumps `eslint` from 7.32.0 to 8.32.0 +- Replaced `babel-eslint` with `@babel/eslint-parser` +- Bumps `eslint-plugin-prettier` from 4.0.0 to 4.2.1 +- Bumps `json5` from 2.2.0 to 2.2.3 +- Bumps `split2` from 3.2.2 to 4.1.0 +- Bumps `@types/node` from 15.14.7 to 18.11.19 +- Bumps `prettier` from 2.7.1 to 2.8.4 +- Bumps `hpagent` from 0.1.2 to 1.2.0 +- Bumps `eslint-config-prettier` from 8.5.0 to 8.6.0 +- Bumps `rimraf` from 3.0.2 to 4.1.1 + +### Dependencies + +### Changed + +- Remove test artifacts from gh_pages workflow ([#335](https://github.com/opensearch-project/opensearch-js/issues/335)) +- Make `TimeoutError` and `RequestAbortedError` classes' `meta` argument optional ([#478](https://github.com/opensearch-project/opensearch-js/pull/478/)) + +### Deprecated + +### Removed + +### Fixed + +### Security + +- [CVE-2022-25912] Bumps simple-git from 3.4.0 to 3.15.0 ([#341](https://github.com/opensearch-project/opensearch-js/pull/341)) + +## [2.1.0] + +### Added + +- Github workflow for changelog verification ([#306](https://github.com/opensearch-project/opensearch-js/pull/306)) +- Add GitHub and Jenkins release workflow ([#317](https://github.com/opensearch-project/opensearch-js/pull/317)) + +### Dependencies + +- Bumps `tsd` from 0.22.0 to 0.24.1 +- Bumps `semver` from 7.3.7 to 7.3.8 + +### Fixed + +- Fix mutability of connection headers ([#291](https://github.com/opensearch-project/opensearch-js/issues/291)) + +[2.1.0]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.1.0 +[2.2.0]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.2.0 +[2.2.1]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.2.1 +[Unreleased]: https://github.com/opensearch-project/opensearch-js/compare/2.2.1...HEAD diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index 2c54931cc..2308e52c0 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -17,8 +17,11 @@ The below matrix shows the compatibility of the [`opensearch-js`](https://www.np | 1.2.4 | 1.1.0 | | 1.3.0 | 1.1.0 | | 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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7b7072d2..9b6f6370d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,6 +5,8 @@ - [Feature Requests](#feature-requests) - [Contributing Code](#contributing-code) - [Developer Certificate of Origin](#developer-certificate-of-origin) +- [Changelog](#changelog) + - [Adding Changes](#adding-changes) - [Review Process](#review-process) ## Contributing to OpenSearch @@ -13,7 +15,7 @@ OpenSearch is a community project that is built and maintained by people just li ## First Things First -1. **When in doubt, open an issue** - For almost any type of contribution, the first step is opening an issue. Even if you think you already know what the solution is, writing down a description of the problem you're trying to solve will help everyone get context when they review your pull request. If it's truly a trivial change (e.g. spelling error), you can skip this step -- but as the subject says, when it doubt, [open an issue](issues). +1. **When in doubt, open an issue** - For almost any type of contribution, the first step is opening an issue. Even if you think you already know what the solution is, writing down a description of the problem you're trying to solve will help everyone get context when they review your pull request. If it's truly a trivial change (e.g. spelling error), you can skip this step -- but as the subject says, when it doubt, [open an issue](https://github.com/opensearch-project/opensearch-js/issues/new/choose). 2. **Only submit your own work** (or work you have sufficient rights to submit) - Please make sure that any code or documentation you submit is your work or you have the rights to submit. We respect the intellectual property rights of others, and as part of contributing, we'll ask you to sign your contribution with a "Developer Certificate of Origin" (DCO) that states you have the rights to submit this work and you understand we'll use your contribution. There's more information about this topic in the [DCO section](#developer-certificate-of-origin). @@ -25,7 +27,7 @@ Ugh! Bugs! A bug is when software behaves in a way that you didn't expect and the developer didn't intend. To help us understand what's going on, we first want to make sure you're working from the latest version. -Once you've confirmed that the bug still exists in the latest version, you'll want to check to make sure it's not something we already know about on the [open issues GitHub page](issues). +Once you've confirmed that the bug still exists in the latest version, you'll want to check to make sure it's not something we already know about on the [open issues GitHub page](https://github.com/opensearch-project/opensearch-js/issues/new/choose). If you've upgraded to the latest version and you can't find it in our open issues list, then you'll need to tell us how to reproduce it Provide as much information as you can. You may think that the problem lies with your query, when actually it depends on how your data is indexed. The easier it is for us to recreate your problem, the faster it is likely to be fixed. @@ -35,7 +37,7 @@ If you've thought of a way that OpenSearch could be better, we want to hear abou ### Contributing Code -As with other types of contributions, the first step is to [open an issue on GitHub](issues/new/choose). Opening an issue before you make changes makes sure that someone else isn't already working on that particular problem. It also lets us all work together to find the right approach before you spend a bunch of time on a PR. So again, when in doubt, open an issue. +As with other types of contributions, the first step is to [open an issue on GitHub](https://github.com/opensearch-project/opensearch-js/issues/new/choose). Opening an issue before you make changes makes sure that someone else isn't already working on that particular problem. It also lets us all work together to find the right approach before you spend a bunch of time on a PR. So again, when in doubt, open an issue. ## Developer Certificate of Origin @@ -84,9 +86,25 @@ Signed-off-by: Jane Smith You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `– – signoff` to add the `Signed-off-by` line to the end of the commit message. +## Changelog + +OpenSearch-js maintains a version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. + +The changes are curated by version, with the changes to the main branch added chronologically to the `Unreleased` version. Each version has corresponding sections which list out the category of the change - `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`. + + +### Adding Changes + +As a contributor, you must ensure that every pull request has its changes listed out within the corresponding version and appropriate section of the [CHANGELOG](CHANGELOG.md) file. + +Adding in the change is a two step process - +1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR. + +2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there. + ## Review Process -We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction. +We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](https://github.com/opensearch-project/opensearch-js/issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction. During the PR process, expect that there will be some back-and-forth. Please try to respond to comments in a timely fashion, and if you don't wish to continue with the PR, let us know. If a PR takes too many iterations for its complexity or size, we may reject it. Additionally, if you stop responding we may close the PR as abandoned. In either case, if you feel this was done in error, please add a comment on the PR. diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index fb4ad7e2c..da36c276f 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -3,7 +3,10 @@ - [Git Clone OpenSearch Node.js Client Repository](#git-clone-opensearch-nodejs-client-repository) - [Install Prerequisites](#install-prerequisites) - [Node.js](#nodejs) + - [Yarn](#yarn) - [Docker](#docker) + - [Installing Dependencies](#installing-dependencies) + - [Using ESLint](#using-eslint) - [Unit Testing](#unit-testing) - [Integration Testing](#integration-testing) - [Execute integration tests from your terminal](#execute-integration-tests-from-your-terminal) @@ -25,30 +28,77 @@ e.g. `git clone https://github.com/[your username]/opensearch-js.git`. The minimum supported version of Node.js is v10. +#### Yarn + +This project uses yarn as it's package manager. You can use npm to install yarn: + +``` +npm install --global yarn +``` + #### Docker [Docker](https://docs.docker.com/install/) is required for building some OpenSearch artifacts and executing integration tests. +### Installing Dependencies + +To install all the dependencies needed for this project, run + +``` +yarn install +``` +There might be an issue on Windows OS: +``` +yarn. ps1 cannot be loaded because running scripts is disabled on this system +``` +If this occurs, open Windows PowerShell and run: +``` +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser +``` +Agree to the changes. +Now you can run `yarn install` +If the problem persists, you can try to open Windows PowerShell as an administrator and run: +``` +Set-ExecutionPolicy -ExecutionPolicy Unrestricted +``` + +### Using ESLint + +To do a ESLint check on the project, run: + +``` +yarn run lint +``` + +To let ESLint to fix errors in your code automatically, run: + +``` +yarn run lint:fix +``` + +This will instruct ESLint to try to fix as many issues as possible. The fixes are made to the actual files themselves and only the remaining unfixed issues are output. + +Not all problems are fixable using this option, and some of them you will need to fix manually. + ### Unit Testing Go to your terminal and run: ``` cd folder-path -npm run test:unit +yarn run test:unit ``` -To run a specific unit test, you can use the following jest command. `npm test` will not work. +To run a specific unit test, you can use the following jest command. `yarn test` will not work. ``` cd folder-path/to/test jest TestName ``` -If you don't have jest, you can install it via npm or yarn +If you don't have jest, you can install it via yarn ``` -npm i -g jest-cli yarn global add jest-cli ``` @@ -69,7 +119,7 @@ If you have not installed docker-compose, you can install it from this [link](ht 2. Run all integration tests. ``` - npm run test:integration:helpers + yarn run test:integration:helpers ``` 3. Stop and clean containers. ``` diff --git a/MAINTAINERS.md b/MAINTAINERS.md index debb81f15..e28e24874 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -1,78 +1,23 @@ -- [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) - ## 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). +This document contains a list of maintainers in this repo. See [opensearch-project/.github/RESPONSIBILITIES.md](https://github.com/opensearch-project/.github/blob/main/RESPONSIBILITIES.md#maintainer-responsibilities) that explains what the role of maintainer means, what maintainers do in this and other repos, and how they should be doing it. If you're interested in contributing, and becoming a maintainer, 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 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 ` 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. +| Maintainer | GitHub ID | Affiliation | +|-----------------------|-----------------------------------------------|-------------| +| Anan Zhuang | [ananzh](https://github.com/ananzh) | Amazon | +| Kawika (Rocky) Avilla | [kavilla](https://github.com/kavilla) | 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 | +| Harsha Vamsi Kalluri | [harshavamsi](https://github.com/harshavamsi) | Amazon | +| Timur Bolotov | [timursaurus](https://github.com/timursaurus) | | + +## Emeritus + +| Maintainer | GitHub ID | Affiliation | +|---------------|-------------------------------------------|-------------| +| Bishoy Boktor | [boktorbb](https://github.com/boktorbb) | Amazon | +| Mihir Soni | [mihirsoni](https://github.com/mihirsoni) | Amazon | diff --git a/Makefile b/Makefile index 9c5984d9d..8a0f5085a 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,9 @@ -cluster.opendistro.build: - docker-compose --project-directory .ci/opendistro build; - -cluster.opendistro.start: - docker-compose --project-directory .ci/opendistro up -d ; - sleep 20; - -cluster.opendistro.stop: - docker-compose --project-directory .ci/opendistro down ; - cluster.opensearch.build: docker-compose --project-directory .ci/opensearch build; cluster.opensearch.start: docker-compose --project-directory .ci/opensearch up -d ; - sleep 20; + sleep 60; cluster.opensearch.stop: docker-compose --project-directory .ci/opensearch down ; @@ -24,4 +14,4 @@ cluster.clean: ## Remove unused Docker volumes and networks docker network prune --force docker system prune --volumes --force -.PHONY: cluster.opendistro.build cluster.opendistro.start cluster.opendistro.stop cluster.opensearch.build cluster.opensearch.start cluster.opensearch.stop cluster.clean +.PHONY: cluster.opensearch.build cluster.opensearch.start cluster.opensearch.stop cluster.clean diff --git a/README.md b/README.md index 0f90b2cac..3348fad97 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ OpenSearch Node.js client - [Welcome!](#welcome) - [Example use](#example-use) - [Setup](#setup) - - [Sample code](#sample-code) +- [Sample code](#sample-code) - [Project Resources](#project-resources) - [Code of Conduct](#code-of-conduct) - [License](#license) @@ -44,113 +44,10 @@ Then require the client: const { Client } = require('@opensearch-project/opensearch'); ``` -### Sample code +## Sample code + +Please see the [USER_GUIDE](USER_GUIDE.md) for code snippets. -```javascript -'use strict'; - -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 diff --git a/RELEASING.md b/RELEASING.md index 6a2d5b21d..020b556d5 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -15,9 +15,9 @@ This document explains the release strategy for artifacts in this organization. Given the current major release of 1.0, projects in this organization maintain the following active branches. -* **main**: The next _major_ release. This is the branch where all merges take place and code moves fast. -* **1.x**: The next _minor_ release. Once a change is merged into `main`, decide whether to backport it to `1.x`. -* **1.0**: The _current_ release. In between minor releases, only hotfixes (e.g. security) are backported to `1.0`. +- **main**: The next _major_ release. This is the branch where all merges take place and code moves fast. +- **1.x**: The next _minor_ release. Once a change is merged into `main`, decide whether to backport it to `1.x`. +- **1.0**: The _current_ release. In between minor releases, only hotfixes (e.g. security) are backported to `1.0`. Label PRs with the next major version label (e.g. `2.0.0`) and merge changes into `main`. Label PRs that you believe need to be backported as `1.x` and `1.0`. Backport PRs by checking out the versioned branch, cherry-pick changes and open a PR against each target backport branch. diff --git a/api/api/bulk.js b/api/api/bulk.js index c4f6ebdcc..3fb5a1401 100644 --- a/api/api/bulk.js +++ b/api/api/bulk.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -64,6 +63,29 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * The bulk operation lets you add, update, or delete many documents in a single request. + * Compared to individual OpenSearch indexing requests, the bulk operation has significant performance benefits. + * Whenever practical, we recommend batching indexing operations into bulk requests. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk/|OpenSearch - Bulk} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {Object[]} params.body - {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk/#request-body|Request Body} + * @param {string} [params.index] - Specifying the index means you don’t need to include it in the request body. + * @param {string} [params.pipeline] - The pipeline ID for preprocessing documents. + * @param {string} [params.routing] - Routes the request to the specified shard. + * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster. + * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed. + * @param {boolean} [params.require_alias=false] - Specifies whether the target index must be an index alias. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/document-apis/bulk/#response|Bulk Response} + */ function bulkApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/cat.js b/api/api/cat.js index e6df85209..84e2c3d7e 100644 --- a/api/api/cat.js +++ b/api/api/cat.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-CAT */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'format', @@ -70,6 +71,7 @@ const acceptedQuerystring = [ 'nodes', 'actions', 'parent_task_id', + 'pri', ]; const snakeCase = { expandWildcards: 'expand_wildcards', @@ -93,6 +95,22 @@ function CatApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +/** + * The CAT aliases operation lists the mapping of aliases to indices, plus routing and filtering information. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/ OpenSearch - CAT aliases} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.name] - To limit the information to specific aliases, provide the alias names seperated by commas. + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'. Default is 'open'. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/#response CAT aliases Response} + */ CatApi.prototype.aliases = function catAliasesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -119,6 +137,23 @@ CatApi.prototype.aliases = function catAliasesApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT allocation operation lists the allocation of disk space for indices and the number of shards on each node. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-allocation/ OpenSearch - CAT allocation} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.node_id] - To limit the information to specific nodes, provide the node names seperated by commas. + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-allocation/#response CAT allocation Response} + */ CatApi.prototype.allocation = function catAllocationApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -145,6 +180,20 @@ CatApi.prototype.allocation = function catAllocationApi(params, options, callbac return this.transport.request(request, options, callback); }; +/** + * The CAT count operation lists the number of documents in your cluster. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-count/ OpenSearch - CAT count} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.index] - To see the number of documents in specific indices or aliases, provide the index/alias names seperated by commas. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-count/#response CAT count Response} + */ CatApi.prototype.count = function catCountApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -171,6 +220,20 @@ CatApi.prototype.count = function catCountApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT fielddata operation lists the memory size used by each field per node. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/ OpenSearch - CAT fielddata} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.fields] - To limit the information to specific fields, provide the field names seperated by commas. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/#response CAT fielddata Response} + */ CatApi.prototype.fielddata = function catFielddataApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -197,6 +260,22 @@ CatApi.prototype.fielddata = function catFielddataApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * The CAT health operation lists the status of the cluster, how long the cluster has been up, the number of nodes, + * and other useful information that helps you analyze the health of your cluster. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-health/ OpenSearch - CAT health} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'. + * @param {boolean} [params.ts=true] - If true, returns HH:MM:SS and Unix epoch timestamps. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-health/#response CAT health Response} + */ CatApi.prototype.health = function catHealthApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -218,6 +297,18 @@ CatApi.prototype.health = function catHealthApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * See the available operations in the CAT API + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/index OpenSearch - CAT} + * + * @memberOf API-CAT + * + * @param {Object} params - (ignored) + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ CatApi.prototype.help = function catHelpApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -239,6 +330,27 @@ CatApi.prototype.help = function catHelpApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT indices operation lists information related to indices—how much disk space they are using, how many shards they have, their health status, and so on. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-indices/ OpenSearch - CAT indices} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.index] - To limit the information to specific indices, provide the index names seperated by commas. + * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'. + * @param {string} [params.health] - Limit indices based on their health status. Supported values are 'green', 'yellow', and 'red'. + * @param {boolean} [params.include_unloaded_segments=false] - Whether to include information from segments not loaded into memory. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {boolean} [params.pri=false] - Whether to return information only from the primary shards. + * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'. + * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-indices/#response CAT indices Response} + */ CatApi.prototype.indices = function catIndicesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -265,6 +377,18 @@ CatApi.prototype.indices = function catIndicesApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT cluster manager operation lists information that helps identify the elected cluster manager node. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/ OpenSearch - CAT cluster manager} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/#response CAT cluster manager Response} + */ CatApi.prototype.cluster_manager = function catClusterManagerApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -311,6 +435,21 @@ CatApi.prototype.master = function catMasterApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT nodeattrs operation lists the attributes of custom nodes. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-nodeattrs/ OpenSearch - CAT aliases} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-nodeattrs/#response CAT nodeattrs Response} + */ CatApi.prototype.nodeattrs = function catNodeattrsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -332,6 +471,25 @@ CatApi.prototype.nodeattrs = function catNodeattrsApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * The CAT nodes operation lists node-level information, including node roles and load metrics. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-nodes/ OpenSearch - CAT nodes} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'. + * @param {boolean} [params.full_id=false] - If true, return the full node ID. If false, return the shortened node ID. + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'. + * @param {boolean} [params.include_unloaded_segments=false] - Whether to include information from segments not loaded into memory. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-nodes/#response CAT nodes Response} + */ CatApi.prototype.nodes = function catNodesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -353,6 +511,22 @@ CatApi.prototype.nodes = function catNodesApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT pending tasks operation lists the progress of all pending tasks, including task priority and time in queue. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-pending-tasks/ OpenSearch - CAT pending tasks} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-pending-tasks/#response CAT pending tasks Response} + */ CatApi.prototype.pendingTasks = function catPendingTasksApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -374,6 +548,21 @@ CatApi.prototype.pendingTasks = function catPendingTasksApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * The CAT plugins operation lists the names, components, and versions of the installed plugins. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ OpenSearch - CAT plugins} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/#response CAT plugins Response} + */ CatApi.prototype.plugins = function catPluginsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -395,6 +584,23 @@ CatApi.prototype.plugins = function catPluginsApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT recovery operation lists all completed and ongoing index and shard recoveries. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-recovery/ OpenSearch - CAT recovery} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'. + * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'. + * @param {boolean} [params.active_only=false] - Whether to only include ongoing shard recoveries. + * @param {boolean} [params.detailed=false] - Whether to only include ongoing shard recoveries. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-recovery/#response CAT recovery Response} + */ CatApi.prototype.recovery = function catRecoveryApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -421,6 +627,21 @@ CatApi.prototype.recovery = function catRecoveryApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT repositories operation lists all completed and ongoing index and shard recoveries. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/ OpenSearch - CAT repositories} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/#response CAT repositories Response} + */ CatApi.prototype.repositories = function catRepositoriesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -442,6 +663,22 @@ CatApi.prototype.repositories = function catRepositoriesApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * The cat segments operation lists Lucene segment-level information for each index. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ OpenSearch - CAT segments} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.index] - To see only the information about segments of specific indices, provide the index names seperated by commas. + * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-segments/#response CAT segments Response} + */ CatApi.prototype.segments = function catSegmentsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -468,6 +705,24 @@ CatApi.prototype.segments = function catSegmentsApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT shards operation lists the state of all primary and replica shards and how they are distributed. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ OpenSearch - CAT shards} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.index] - To see only the information about shards of specific indices, provide the index names seperated by commas. + * @param {string} [params.bytes] - Specify the units for byte size. For example, '7kb' or '6gb'. + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster_manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-shards/#response CAT shards Response} + */ CatApi.prototype.shards = function catShardsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -494,6 +749,21 @@ CatApi.prototype.shards = function catShardsApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT snapshots operation lists all snapshots for a repository. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ OpenSearch - CAT snapshots} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/#response CAT snapshots Response} + */ CatApi.prototype.snapshots = function catSnapshotsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -520,6 +790,23 @@ CatApi.prototype.snapshots = function catSnapshotsApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * The CAT tasks operation lists the progress of all tasks currently running on your cluster. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ OpenSearch - CAT tasks} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {string} [params.nodes] - A comma-separated list of node IDs or names to limit the returned information. Use '_local' to return information from the node you’re connecting to, specify the node name to get information from specific nodes, or keep the parameter empty to get information from all nodes. + * @param {string} [params.time] - Specify the units for time. For example, '5d' or '7h'. + * @param {boolean} [params.detailed=false] - Returns detailed task information. + * @param {string} [params.parent_task_id] - Returns tasks with a specified parent task ID (node_id:task_number). Keep empty or set to -1 to return all. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/#response CAT tasks Response} + */ CatApi.prototype.tasks = function catTasksApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -541,6 +828,22 @@ CatApi.prototype.tasks = function catTasksApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * The CAT templates operation lists the names, patterns, order numbers, and version numbers of index templates. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ OpenSearch - CAT templates} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {boolean} [params.name] - If you want to limit it to a specific template or pattern, provide the template name or pattern. + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-templates/#response CAT templates Response} + */ CatApi.prototype.templates = function catTemplatesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -567,6 +870,21 @@ CatApi.prototype.templates = function catTemplatesApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * The CAT thread pool operation lists the active, queued, and rejected threads of different thread pools on each node. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cat/cat-thread-pool/ OpenSearch - CAT thread pool} + * + * @memberOf API-CAT + * + * @param {Object} params - Accepts {@link https://opensearch.org/docs/latest/api-reference/cat/index#optional-query-parameters - common CAT parameters} along with the following unique parameters: + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cat/cat-thread-pool/#response CAT thread pool Response} + */ CatApi.prototype.threadPool = function catThreadPoolApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/clear_scroll.js b/api/api/clear_scroll.js index 38295daf1..07128d4d0 100644 --- a/api/api/clear_scroll.js +++ b/api/api/clear_scroll.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,6 +36,20 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; +/** + * Close the search context when you’re done scrolling, because the scroll operation continues to consume computing resources until the timeout. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ OpenSearch - Scroll } + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} [params.scroll_id] The ID of the scroll to be terminated. Use `_all` to close all open scroll contexts. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function clearScrollApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/cluster.js b/api/api/cluster.js index 2679285c7..89379796f 100644 --- a/api/api/cluster.js +++ b/api/api/cluster.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Cluster */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'include_yes_decisions', @@ -101,6 +102,26 @@ function ClusterApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +/** + * The most basic cluster allocation explain request finds an unassigned shard and explains why it can’t be allocated to a node. If you add some options, you can instead get information on a specific shard, including why OpenSearch assigned it to its current node. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-allocation/ OpenSearch - Cluster allocation explain} + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {boolean} [params.include_yes_decisions=false] - OpenSearch makes a series of yes or no decisions when trying to allocate a shard to a node. If this parameter is true, OpenSearch includes the (generally more numerous) “yes” decisions in its response. + * @param {boolean} [params.include_disk_info=false] - Whether to include information about disk usage in the response. + * @param {Object} [params.body] + * @param {string} [params.body.current_node] - If you only want an explanation if the shard happens to be on a particular node, specify that node name here. + * @param {string} [params.body.index] - The name of the shard’s index. + * @param {boolean} [params.body.primary] - Whether to provide an explanation for the primary shard (true) or its first replica (false), which share the same shard ID. + * @param {number} [params.body.shard] - The shard ID that you want an explanation for. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cluster-allocation/#response Cluster allocation explain Response} + */ ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi( params, options, @@ -126,6 +147,19 @@ ClusterApi.prototype.allocationExplain = function clusterAllocationExplainApi( return this.transport.request(request, options, callback); }; +/** + * Delete Component Template(s) + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {string} [params.name] The name of the component template to be deleted. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTemplateApi( params, options, @@ -157,6 +191,19 @@ ClusterApi.prototype.deleteComponentTemplate = function clusterDeleteComponentTe return this.transport.request(request, options, callback); }; +/** + * Clears cluster voting config exclusions. + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {boolean} [params.wait_for_removal] Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVotingConfigExclusionsApi( params, options, @@ -182,6 +229,19 @@ ClusterApi.prototype.deleteVotingConfigExclusions = function clusterDeleteVoting return this.transport.request(request, options, callback); }; +/** + * Information about whether a particular component template exist + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {boolean} [params.name] Name of the template + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTemplateApi( params, options, @@ -213,6 +273,19 @@ ClusterApi.prototype.existsComponentTemplate = function clusterExistsComponentTe return this.transport.request(request, options, callback); }; +/** + * Returns one or more component templates + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {string | string[]} [params.name] Name(s) of the template(s) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplateApi( params, options, @@ -243,6 +316,21 @@ ClusterApi.prototype.getComponentTemplate = function clusterGetComponentTemplate return this.transport.request(request, options, callback); }; +/** + * Get Cluster Settings + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-settings/ OpenSearch - Cluster Settings} + * @memberOf API-Cluster + * + * @param {Object} params + * ç + * @param {boolean} [params.include_defaults] Whether to include default settings as part of the response. This parameter is useful for identifying the names and current values of settings you want to update. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.getSettings = function clusterGetSettingsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -264,6 +352,30 @@ ClusterApi.prototype.getSettings = function clusterGetSettingsApi(params, option return this.transport.request(request, options, callback); }; +/** + * The most basic cluster health request returns a simple status of the health of your cluster. OpenSearch expresses cluster health in three colors: green, yellow, and red. A green status means all primary shards and their replicas are allocated to nodes. A yellow status means all primary shards are allocated to nodes, but some replicas aren’t. A red status means at least one primary shard is not allocated to any node. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-health/ OpenSearch - Cluster Health} + * @memberOf API-Cluster + * + * @param {Object} params + * @param {} [params.index] - To get the status of a specific index, provide the index name. + * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'. + * @param {string} [params.level=cluster] - The level of detail for returned health information. Supported values are 'cluster', 'indices', and 'shards'. + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {string} [params.timeout=30s] - The amount of time to wait for a response from the cluster. + * @param {string} [params.wait_for_active_shards=0] - Wait until the specified number of shards is active before returning a response. 'all' for all shards + * @param {string} [params.wait_for_nodes] - Wait for N number of nodes. Use 12 for exact match, >12 and <12 for range. + * @param {string} [params.wait_for_events] - Wait until all currently queued events with the given priority are processed. Supported values are 'immediate', 'urgent', 'high', 'normal', 'low', and 'languid'. + * @param {boolean} [params.wait_for_no_relocating_shards=false] - Whether to wait until there are no relocating shards in the cluster. + * @param {boolean} [params.wait_for_no_initializing_shards=false] - Whether to wait until there are no initializing shards in the cluster. + * @param {string} [params.wait_for_status] - Wait until the cluster health reaches the specified status or better. Supported values are 'green', 'yellow', and 'red'. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cluster-health/#response Cluster Health Response} + */ ClusterApi.prototype.health = function clusterHealthApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -290,6 +402,19 @@ ClusterApi.prototype.health = function clusterHealthApi(params, options, callbac return this.transport.request(request, options, callback); }; +/** + * Get a list of any cluster-level changes + * @memberOf API-Cluster + * + * @param {Object} params + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -311,6 +436,19 @@ ClusterApi.prototype.pendingTasks = function clusterPendingTasksApi(params, opti return this.transport.request(request, options, callback); }; +/** + * Updates the cluster voting config exclusions by node ids or node names. + * @memberOf API-Cluster + * + * @param {Object} params + * @param {string} [params.node_names] - A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify node_names. + * @param {string} [params.node_ids] - A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify node_ids. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConfigExclusionsApi( params, options, @@ -336,6 +474,22 @@ ClusterApi.prototype.postVotingConfigExclusions = function clusterPostVotingConf return this.transport.request(request, options, callback); }; +/** + * Creates or updates a component template + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {string} params.name - The name of the component template. + * @param {object} params.body - The template definition. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {boolean} [params.create=false] - Whether the index template should only be added if new or can also replace an existing one. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplateApi( params, options, @@ -371,6 +525,22 @@ ClusterApi.prototype.putComponentTemplate = function clusterPutComponentTemplate return this.transport.request(request, options, callback); }; +/** + * Updates the cluster settings. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-settings/ OpenSearch - Cluster Settings} + * @memberOf API-Cluster + * + * @param {Object} params + * @param {boolean} [params.flat_settings] Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {string} [params.timeout=30s] - The amount of time to wait for a response from the cluster. + * @param {object} params.body - The settings to be updated. Can be either 'transient' or 'persistent' (survives cluster restart). + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.putSettings = function clusterPutSettingsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -398,6 +568,17 @@ ClusterApi.prototype.putSettings = function clusterPutSettingsApi(params, option return this.transport.request(request, options, callback); }; +/** + * This operation provides connection information for any remote OpenSearch clusters that you’ve configured for the local cluster, such as the remote cluster alias, connection mode (sniff or proxy), IP addresses for seed nodes, and timeout settings. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/remote-info/ OpenSearch - Remote cluster information} + * @memberOf API-Cluster + * + * @param {Object} params - (Unused) + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/remote-info/#response Remote cluster information } + */ ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -419,6 +600,23 @@ ClusterApi.prototype.remoteInfo = function clusterRemoteInfoApi(params, options, return this.transport.request(request, options, callback); }; +/** + * Allows to manually change the allocation of individual shards in the cluster. + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {object} [params.body] - The definition of 'commands' to perform ('move', 'cancel', 'allocate') + * @param {boolean} [params.dry_run] - Simulate the operation only and return the resulting state + * @param {boolean} [params.explain] - Return an explanation of why the commands can or cannot be executed + * @param {boolean} [params.retry_failed] - Retries allocation of shards that are blocked due to too many subsequent allocation failures + * @param {string | string[]} [params.metric] - Limit the information returned to the specified metrics. Defaults to all but metadata (options: _all, blocks, metadata, nodes, routing_table, cluster_manager_node, version) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.reroute = function clusterRerouteApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -440,6 +638,28 @@ ClusterApi.prototype.reroute = function clusterRerouteApi(params, options, callb return this.transport.request(request, options, callback); }; +/** + * Get comprehensive information about the state of the cluster. + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {string | string[]} [params.metric] - Limit the information returned to the specified metrics. Defaults to all but metadata (options: _all, blocks, metadata, nodes, routing_table, cluster_manager_node, version). + * @param {string | string[]} [params.index] - List of index names; use '_all' or empty string to perform the operation on all indices. + * @param {boolean} [params.local=false] - Whether to return information from the local node only instead of from the cluster manager node. + * @param {string} [params.cluster_manager_timeout=30s] - The amount of time to wait for a connection to the cluster manager node. + * @param {boolean} [params.flat_settings=false] - Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. + * @param {number} [params.wait_for_metadata_version] - Wait for the metadata version to be equal or greater than the specified metadata version. + * @param {string} [params.wait_for_timeout=30s] - The maximum time to wait for wait_for_metadata_version before timing out + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'. Default is 'open'. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ ClusterApi.prototype.state = function clusterStateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -483,6 +703,22 @@ ClusterApi.prototype.state = function clusterStateApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * The CAT aliases operation lists the mapping of aliases to indices, plus routing and filtering information. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/cluster-stats/ OpenSearch - Cluster stats} + * + * @memberOf API-Cluster + * + * @param {Object} params + * @param {string | string[]} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use '_local' to return information from the node you're connecting to, leave empty to get information from all nodes. + * + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/cluster-stats/#response Cluster stats Response} + */ + ClusterApi.prototype.stats = function clusterStatsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/count.js b/api/api/count.js index 1b65db4a3..c436297b4 100644 --- a/api/api/count.js +++ b/api/api/count.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Count */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'ignore_unavailable', @@ -68,6 +69,32 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * The count API gives you quick access to the number of documents that match a query. You can also use it to check the document count of an index, data stream, or cluster. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/count/ OpenSearch - Bulk} + * + * @memberOf API-Count + * + * @param {Object} params + * @param {boolean} [params.allow_no_indices=false] - If false, the request returns an error if any wildcard expression or index alias targets any closed or missing indices. + * @param {string} [params.analyzer] - The analyzer to use in the query string. + * @param {boolean} [params.analyze_wildcard=false] - Specifies whether to analyze wildcard and prefix queries. + * @param {string} [params.default_operator='OR'] - Indicates whether the default operator for a string query should be 'AND' or 'OR'. + * @param {string} [params.df] - The default field in case a field prefix is not provided in the query string. + * @param {string} [params.expand_wildcards=open] - Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are 'all', 'open', 'closed', 'hidden', and 'none'. + * @param {boolean} [params.ignore_unavailable=false] - Specifies whether to include missing or closed indices in the response. + * @param {boolean} [params.lenient=false] - Specifies whether OpenSearch should accept requests if queries have format errors (for example, querying a text field for an integer). + * @param {number} [params.min_score] - Include only documents with a minimum '_score' value in the result. + * @param {string} [params.routing] - Value used to route the operation to a specific shard. + * @param {string} [params.preference] - Specifies which shard or node OpenSearch should perform the count operation on. + * @param {number} [params.terminate_after] - The maximum number of documents OpenSearch should process before terminating the request. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/count/#response Count Response} + */ + function countApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/create.js b/api/api/create.js index 3f5d8443f..32d234466 100644 --- a/api/api/create.js +++ b/api/api/create.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -55,6 +54,32 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Adds a document with a predefined ID to an index. + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/ OpenSearch - Index Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {string} params.id - A unique identifier to attach to the document. + * @param {Object} params.body - The content of the document. + * @param {number} [params.if_seq_no] - Only perform the index operation if the document has the specified sequence number. + * @param {number} [params.if_primary_term] - Only perform the index operation if the document has the specified primary term. + * @param {string} [params.pipeline] - Route the index operation to a certain pipeline. + * @param {string} [params.routing] - value used to assign the index operation to a specific shard. + * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster. + * @param {number} [params.version] - The document’s version number. + * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte') + * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed. + * @param {boolean} [params.require_alias=false] - Specifies whether the target index must be an index alias. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/#response Index Response} + */ function createApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/create_pit.js b/api/api/create_pit.js new file mode 100644 index 000000000..9665fc44b --- /dev/null +++ b/api/api/create_pit.js @@ -0,0 +1,88 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +'use strict'; + +/* eslint camelcase: 0 */ +/* eslint no-unused-vars: 0 */ + +/** @namespace API-PIT */ + +const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); +const acceptedQuerystring = [ + 'allow_partial_pit_creation', + 'keep_alive', + 'preference', + 'routing', + 'pretty', + 'human', + 'error_trace', + 'source', + 'filter_path', +]; +const snakeCase = { + allowPartialPitCreation: 'allow_partial_pit_creation', + keepAlive: 'keep_alive', + errorTrace: 'error_trace', + filterPath: 'filter_path', +}; + +/** + * Creates a point in time. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#create-a-pit|Opensearch - Create a PIT} + * @memberOf API-PIT + * + * @param {Object} params + * @param {string} params.index - The name(s) of the target index(es) for the PIT. May contain a comma-separated list or a wildcard index pattern. + * @param {string} params.keep_alive - The amount of time to keep the PIT + * @param {string} [params.preference=random] - The node or the shard used to perform the search. + * @param {string} [params.routing] - Specifies to route search requests to a specific shard. + * @param {string} [params.expand_wildcards=open] - The type of index that can match the wildcard pattern. Supports comma-separated values. + * @param {string} [params.allow_partial_pit_creation=false] - Specifies whether to create a PIT with partial failures. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#sample-response|Create PIT Response} + */ + +function createPitApi(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + // check required parameters + if (params['index'] == null) { + const err = new this[kConfigurationError]('Missing required parameter: index'); + return handleError(err, callback); + } + + if (params['keep_alive'] == null) { + const err = new this[kConfigurationError]('Missing required parameter: keep_alive'); + return handleError(err, callback); + } + + let { method, body, index, ...querystring } = params; + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring); + + let path = ''; + if (method == null) method = 'POST'; + path = '/' + encodeURIComponent(index) + '/' + '_search' + '/' + 'point_in_time'; + + // build request object + const request = { + method, + path, + body: body || '', + querystring, + }; + + return this.transport.request(request, options, callback); +} + +module.exports = createPitApi; diff --git a/api/api/dangling_indices.js b/api/api/dangling_indices.js index 33c04fcf4..4647a8400 100644 --- a/api/api/dangling_indices.js +++ b/api/api/dangling_indices.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Dangling-Indices */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'accept_data_loss', @@ -58,6 +59,22 @@ function DanglingIndicesApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +/** + * Deletes the specified dangling index + *
See also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ OpenSearch - Dangling Indexes} + * @memberOf API-Dangling-Indices + * + * @param {Object} params + * @param {string} params.index_uuid - The UUID of the dangling index + * @param {boolean} [params.accept_data_loss] - Must be set to true in order to delete the dangling index + * @param {string} [params.timeout=30s] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ DanglingIndicesApi.prototype.deleteDanglingIndex = function danglingIndicesDeleteDanglingIndexApi( params, options, @@ -91,6 +108,22 @@ DanglingIndicesApi.prototype.deleteDanglingIndex = function danglingIndicesDelet return this.transport.request(request, options, callback); }; +/** + * Imports the specified dangling index + *
See also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ OpenSearch - Dangling Indexes} + * @memberOf API-Dangling-Indices + * + * @param {Object} params + * @param {string} params.index_uuid - The UUID of the dangling index + * @param {boolean} [params.accept_data_loss] - Must be set to true in order to delete the dangling index + * @param {string} [params.timeout=30s] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImportDanglingIndexApi( params, options, @@ -124,6 +157,17 @@ DanglingIndicesApi.prototype.importDanglingIndex = function danglingIndicesImpor return this.transport.request(request, options, callback); }; +/** + * Retrieve all dangling indices. + *
See also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ OpenSearch - Dangling Indexes} + * @memberOf API-Dangling-Indices + * + * @param {Object} params - (Unused) + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ DanglingIndicesApi.prototype.listDanglingIndices = function danglingIndicesListDanglingIndicesApi( params, options, diff --git a/api/api/delete.js b/api/api/delete.js index 61f4eef1e..dbdfde11d 100644 --- a/api/api/delete.js +++ b/api/api/delete.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -58,6 +57,29 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Delete a document + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/update-document/ OpenSearch - Update Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {string} params.id - A unique identifier to attach to the document. + * @param {number} [params.if_seq_no] - Only perform the delete operation if the document has the specified sequence number. + * @param {number} [params.if_primary_term] - Only perform the delete operation if the document has the specified primary term. + * @param {string} [params.routing] - Value used to assign the index operation to a specific shard. + * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster. + * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed. + * @param {number} [params.version] - The document’s version number. + * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte') + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/update-document/#response Update Response} + */ function deleteApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/delete_all_pits.js b/api/api/delete_all_pits.js new file mode 100644 index 000000000..dcb582f48 --- /dev/null +++ b/api/api/delete_all_pits.js @@ -0,0 +1,53 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +'use strict'; + +/* eslint camelcase: 0 */ +/* eslint no-unused-vars: 0 */ + +const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); +const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; +const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; + +/** + * Deletes all PITs in the OpenSearch cluster. The Delete All PITs API deletes only local PITs or mixed PITs (PITs created in both local and remote clusters). It does not delete fully remote PITs. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#delete-pits|Opensearch - Delete PITs} + * @memberOf API-PIT + * + * @param {Object} params + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#sample-response-2|Delete all PITs Response} + */ +function deleteAllPitsApi(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { method, body, ...querystring } = params; + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring); + + let path = ''; + if (method == null) method = 'DELETE'; + path = '/' + '_search' + '/' + 'point_in_time' + '/' + '_all'; + + // build request object + const request = { + method, + path, + body: body || '', + querystring, + }; + + return this.transport.request(request, options, callback); +} + +module.exports = deleteAllPitsApi; diff --git a/api/api/delete_by_query.js b/api/api/delete_by_query.js index 55db6b91d..17f46adc5 100644 --- a/api/api/delete_by_query.js +++ b/api/api/delete_by_query.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -99,6 +98,54 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Deletes documents matching the provided query. + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/delete-by-query/ OpenSearch - Delete by query} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names to search; use '_all' or empty string to perform the operation on all indices + * @param {Object} params.body - The search definition using the Query DSL + * @param {string} [params.analyzer] - The analyzer to use for the query string + * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed + * @param {string} [params.default_operator=OR] - The default operator for query string query (options: AND, OR) + * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string + * @param {number} [params.from=0] - Starting offset + * @param {boolean} [params.ignore_unavailable=false] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices=true] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes '_all' string or when no indices have been specified) + * @param {string} [params.conflicts] - What to do when the delete-by-query hits version conflicts? (options: abort, proceed) + * @param {string} [params.expand_wildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.lenient=false] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random) + * @param {string} [params.q] - Query in the Lucene query string syntax + * @param {string} [params.routing] - A comma-separated list of specific routing values + * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch) + * @param {string} [params.search_timeout] - Explicit timeout for each search request. Defaults to no timeout. + * @param {number} [params.size] - Deprecated, please use 'max_docs' instead + * @param {number} [params.max_docs] - Maximum number of documents to process (default: all documents) + * @param {string} [params.sort] - A comma-separated list of : pairs + * @param {string} [params._source] - True or false to return the _source field or not, or a list of fields to return + * @param {string} [params._source_excludes] - A list of fields to exclude from the returned _source field + * @param {string} [params._source_includes] - A list of fields to extract and return from the _source field + * @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {string} [params.stats] - Specific 'tag' of the request for logging and statistical purposes + * @param {boolean} [params.version] - Specify whether to return document version as part of a hit + * @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {boolean} [params.refresh=false] - Should the effected indexes be refreshed? + * @param {string} [params.timeout=1m] - time each individual bulk request should wait for shards that are unavailable. + * @param {string} [params.wait_for_active_shards=1] - Sets the number of shard copies that must be active before proceeding with the delete-by-query operation. 1 means the primary shard only. Set to 'all' for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {number} [params.scroll_size=1000] - Size on the scroll request powering the delete-by-query + * @param {boolean} [params.wait_for_completion] - Should the request should block until the delete-by-query is complete. + * @param {number} [params.requests_per_second=-1] - The throttle for this request in sub-requests per second. -1 means no throttle. + * @param {string} [params.slices=1] - The number of slices this task should be divided into. 1 means the task isn't sliced into subtasks. Can be set to 'auto'. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/delete-by-query/#response Delete by query Response} + */ function deleteByQueryApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/delete_by_query_rethrottle.js b/api/api/delete_by_query_rethrottle.js index a24a2e287..654f8b526 100644 --- a/api/api/delete_by_query_rethrottle.js +++ b/api/api/delete_by_query_rethrottle.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -48,6 +47,20 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Changes the number of requests per second for a particular Delete By Query operation. + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.task_id - The task id to rethrottle + * @param {number} params.requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function deleteByQueryRethrottleApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/delete_pit.js b/api/api/delete_pit.js new file mode 100644 index 000000000..52e3e8ff1 --- /dev/null +++ b/api/api/delete_pit.js @@ -0,0 +1,61 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +'use strict'; + +/* eslint camelcase: 0 */ +/* eslint no-unused-vars: 0 */ + +const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); +const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; +const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; + +/** + * Deletes one or several PITs. PITs are automatically deleted when the keep_alive time period elapses. However, to deallocate resources, you can delete a PIT using the Delete PIT API. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#delete-pits|Opensearch - Delete PITs} + * @memberOf API-PIT + * + * @param {Object} params + * @param {Object} params.body + * @param {string[]} params.body.pit_id - The PIT IDs of the PITs to be deleted. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#sample-response-2|Delete PIT Response} + */ +function deletePitApi(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + // check required parameters + if (params['body'] == null) { + const err = new this[kConfigurationError]('Missing required parameter: body'); + return handleError(err, callback); + } + + let { method, body, ...querystring } = params; + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring); + + let path = ''; + if (method == null) method = 'DELETE'; + path = '/' + '_search' + '/' + 'point_in_time'; + + // build request object + const request = { + method, + path, + body: body || '', + querystring, + }; + + return this.transport.request(request, options, callback); +} + +module.exports = deletePitApi; diff --git a/api/api/delete_script.js b/api/api/delete_script.js index bded0694b..ac0c89314 100644 --- a/api/api/delete_script.js +++ b/api/api/delete_script.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -51,6 +50,20 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Delete a stored script. + * @memberOf API-Script + * + * @param {Object} params + * @param {string} params.id - Stored script or search template name + * @param {string} [params.timeout=30s] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function deleteScriptApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/exists.js b/api/api/exists.js index 2c9ff22b9..224ad591f 100644 --- a/api/api/exists.js +++ b/api/api/exists.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -64,6 +63,31 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Check whether a document exists + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {string} params.id - Document ID. + * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards. + * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. + * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.routing] - A value used to route the operation to a specific shard. + * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index. + * @param {string} [params._source=true] - Whether to include the '_source' field in the response body. + * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response. + * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response. + * @param {number} [params.version] - The document’s version number. + * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte') + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response} + */ function existsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/exists_source.js b/api/api/exists_source.js index c7b918efc..41999e7be 100644 --- a/api/api/exists_source.js +++ b/api/api/exists_source.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,31 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** + * Check whether a document source exists + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {string} params.id - Document ID. + * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards. + * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. + * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.routing] - A value used to route the operation to a specific shard. + * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index. + * @param {string} [params._source=true] - Whether to include the '_source' field in the response body. + * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response. + * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response. + * @param {number} [params.version] - The document’s version number. + * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte') + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response} + */ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'preference', diff --git a/api/api/explain.js b/api/api/explain.js index 9d1daf11e..656b8fb41 100644 --- a/api/api/explain.js +++ b/api/api/explain.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -67,6 +66,33 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Returns information about why a specific matches (or doesn't match) a query. + *
See also: {@link https://opensearch.org/docs/latest/api-reference/explain/ OpenSearch - Explain} + * @memberOf API-Search + * + * @param {Object} params + * @param {string} [params.id] - The document ID + * @param {string} [params.index] - The name of the index + * @param {Object} [params.body] - The query definition using the Query DSL + * @param {string} [params.analyzer] - The analyzer to use for the query string + * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed + * @param {string} [params.default_operator=OR] - The default operator for query string query (options: AND, OR) + * @param {string} [params.df] - The default field for query string query (default: _all) + * @param {string} [params.stored_fields] - A comma-separated list of stored fields to return in the response + * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random) + * @param {string} [params.q] - Query in the Lucene query string syntax + * @param {string} [params.routing] - Specific routing value + * @param {string} [params._source=true] - Whether to include the '_source' field in the response body. + * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response. + * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function explainApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/features.js b/api/api/features.js index 0d36abbaa..155ea1eb3 100644 --- a/api/api/features.js +++ b/api/api/features.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Features */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'cluster_manager_timeout', @@ -55,6 +56,18 @@ function FeaturesApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +/** + * Gets a list of features + * @memberOf API-Features + * + * @param {Object} params + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ FeaturesApi.prototype.getFeatures = function featuresGetFeaturesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -76,6 +89,16 @@ FeaturesApi.prototype.getFeatures = function featuresGetFeaturesApi(params, opti return this.transport.request(request, options, callback); }; +/** + * Resets the internal state of features, usually by deleting system indices + * @memberOf API-Features + * + * @param {Object} params - (Unused) + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ FeaturesApi.prototype.resetFeatures = function featuresResetFeaturesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/field_caps.js b/api/api/field_caps.js index 5bb0d21c3..5c6ff0137 100644 --- a/api/api/field_caps.js +++ b/api/api/field_caps.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -55,6 +54,25 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Returns the information about the capabilities of fields among multiple indices. + *
See also: {@link https://opensearch.org/docs/latest/opensearch/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations OpenSearch - Alias} + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {string} [params.fields] - A comma-separated list of field names + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.include_unmapped] - Indicates whether unmapped fields should be included in the response. + * @param {Object} [params.body] - An index filter specified with the Query DSL + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function fieldCapsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/get.js b/api/api/get.js index 0cd08da37..20ff721f6 100644 --- a/api/api/get.js +++ b/api/api/get.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -64,6 +63,31 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Retrieve a document + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {string} params.id - Document ID. + * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards. + * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. + * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.routing] - A value used to route the operation to a specific shard. + * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index. + * @param {string} [params._source=true] - Whether to include the '_source' field in the response body. + * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response. + * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response. + * @param {number} [params.version] - The document’s version number. + * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte') + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response} + */ function getApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/get_all_pits.js b/api/api/get_all_pits.js new file mode 100644 index 000000000..4819c4c4a --- /dev/null +++ b/api/api/get_all_pits.js @@ -0,0 +1,53 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +'use strict'; + +/* eslint camelcase: 0 */ +/* eslint no-unused-vars: 0 */ + +const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); +const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; +const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; + +/** + * Returns all PITs in the OpenSearch cluster. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#list-all-pits|Opensearch - List all PITs} + * @memberOf API-PIT + * + * @param {Object} params + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/opensearch/point-in-time-api#sample-response-1|List all PITs Response} + */ +function getAllPitsApi(params, options, callback) { + [params, options, callback] = normalizeArguments(params, options, callback); + + let { method, body, ...querystring } = params; + querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring); + + let path = ''; + if (method == null) method = 'GET'; + path = '/' + '_search' + '/' + 'point_in_time' + '/' + '_all'; + + // build request object + const request = { + method, + path, + body: null, + querystring, + }; + + return this.transport.request(request, options, callback); +} + +module.exports = getAllPitsApi; diff --git a/api/api/get_script.js b/api/api/get_script.js index 67fdb7005..454fa3564 100644 --- a/api/api/get_script.js +++ b/api/api/get_script.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Script */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'cluster_manager_timeout', @@ -50,6 +51,20 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Retrieves a stored script. + *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-stored-script/ OpenSearch - Get Stored Script} + * @memberOf API-Script + * + * @param {Object} params + * @param {string} params.id - Stored script or search template name + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function getScriptApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/get_script_context.js b/api/api/get_script_context.js index 871a02c7c..6958aca28 100644 --- a/api/api/get_script_context.js +++ b/api/api/get_script_context.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; +/** + * Retrieves all contexts for stored scripts. + *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-script-contexts/ OpenSearch - Get stored script contexts} + * @memberOf API-Script + * + * @param {Object} params - (Unused) + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function getScriptContextApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/get_script_languages.js b/api/api/get_script_languages.js index c0530a298..923c6dd52 100644 --- a/api/api/get_script_languages.js +++ b/api/api/get_script_languages.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; +/** + * The get script language API operation retrieves all supported script languages and their contexts. + *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-script-language/ OpenSearch - Get script language} + * @memberOf API-Script + * + * @param {Object} params - (Unused) + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function getScriptLanguagesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/get_source.js b/api/api/get_source.js index c49052ca8..2084b1f26 100644 --- a/api/api/get_source.js +++ b/api/api/get_source.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -62,6 +61,31 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Retrieve the source of a document + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {string} params.id - Document ID. + * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards. + * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. + * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.routing] - A value used to route the operation to a specific shard. + * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index. + * @param {string} [params._source=true] - Whether to include the '_source' field in the response body. + * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response. + * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response. + * @param {number} [params.version] - The document’s version number. + * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte') + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response} + */ function getSourceApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/index.js b/api/api/index.js index c10109994..03bcab2b7 100644 --- a/api/api/index.js +++ b/api/api/index.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Document */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'wait_for_active_shards', @@ -63,6 +64,33 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Adds a document to an index. + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/ OpenSearch - Index Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {Object} params.body - The content of the document. + * @param {string} [params.id] - A unique identifier to attach to the document. + * @param {number} [params.if_seq_no] - Only perform the index operation if the document has the specified sequence number. + * @param {number} [params.if_primary_term] - Only perform the index operation if the document has the specified primary term. + * @param {string} [params.pipeline] - Route the index operation to a certain pipeline. + * @param {string} [params.routing] - value used to assign the index operation to a specific shard. + * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster. + * @param {number} [params.version] - The document’s version number. + * @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte') + * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed. + * @param {boolean} [params.require_alias=false] - Specifies whether the target index must be an index alias. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/#response Index Response} + */ + function indexApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/indices.js b/api/api/indices.js index f8c578f13..5e7ec6b25 100644 --- a/api/api/indices.js +++ b/api/api/indices.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -30,6 +29,8 @@ 'use strict'; +/** @namespace API-Index */ + /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ @@ -129,6 +130,25 @@ function IndicesApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +/** + * Adds a block to an index. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma separated list of indices to add a block to + * @param {string} params.block - The block to add (one of read, write, read_only or metadata) + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.addBlock = function indicesAddBlockApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -166,6 +186,21 @@ IndicesApi.prototype.addBlock = function indicesAddBlockApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * Performs the analysis process on a text and return the tokens breakdown of the text. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ OpenSearch - Perform text analysis} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - The name of the index to scope the operation + * @param {Object} [params.body] - Define analyzer/tokenizer parameters and the text on which the analysis should be performed + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.analyze = function indicesAnalyzeApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -192,6 +227,27 @@ IndicesApi.prototype.analyze = function indicesAnalyzeApi(params, options, callb return this.transport.request(request, options, callback); }; +/** + * Clears all or specific caches for one or more indices. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ OpenSearch - Clear index or data stream cache} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index name to limit the operation + * @param {boolean} [params.fielddata] - Clear field data + * @param {string} [params.fields] - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) + * @param {boolean} [params.query] - Clear query caches + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.request] - Clear request cache + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.clearCache = function indicesClearCacheApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -218,6 +274,25 @@ IndicesApi.prototype.clearCache = function indicesClearCacheApi(params, options, return this.transport.request(request, options, callback); }; +/** + * Clones an index + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/clone/ OpenSearch - Clone Index} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - The name of the source index to clone + * @param {string} params.target - The name of the target index to clone into + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the cloned index before the operation returns. + * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.clone = function indicesCloneApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -255,6 +330,26 @@ IndicesApi.prototype.clone = function indicesCloneApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * Closes an index. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ OpenSearch - Close Index} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma separated list of indices to close + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {string} [params.wait_for_active_shards] - Sets the number of active shards to wait for before the operation returns. Set to `index-setting` to wait according to the index setting `index.write.wait_for_active_shards`, or `all` to wait for all shards, or an integer. Defaults to `0`. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.close = function indicesCloseApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -282,6 +377,24 @@ IndicesApi.prototype.close = function indicesCloseApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * Creates an index + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ OpenSearch - Create Index} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {Object} [params.body] - The configuration for the index (`settings` and `mappings`) + * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for before the operation returns. + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.create = function indicesCreateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -309,6 +422,25 @@ IndicesApi.prototype.create = function indicesCreateApi(params, options, callbac return this.transport.request(request, options, callback); }; +/** + * Deletes an index. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ OpenSearch - Delete Index} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes + * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices + * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.delete = function indicesDeleteApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -336,6 +468,23 @@ IndicesApi.prototype.delete = function indicesDeleteApi(params, options, callbac return this.transport.request(request, options, callback); }; +/** + * Deletes an alias. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices + * @param {string} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. + * @param {string} [params.timeout] - Explicit timestamp for the document + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -378,6 +527,22 @@ IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi(params, option return this.transport.request(request, options, callback); }; +/** + * Deletes an index template. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.name - The name of the template + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateApi( params, options, @@ -409,6 +574,21 @@ IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateAp return this.transport.request(request, options, callback); }; +/** + * Deletes an index template (Deprecated. Use IndicesApi#deleteIndexTemplate instead) + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.name - The name of the template + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -436,6 +616,7 @@ IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi(params, return this.transport.request(request, options, callback); }; +// TODO: Remove. Experimental feature added in ES 7.15 IndicesApi.prototype.diskUsage = function indicesDiskUsageApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -463,6 +644,26 @@ IndicesApi.prototype.diskUsage = function indicesDiskUsageApi(params, options, c return this.transport.request(request, options, callback); }; +/** + * Returns information about whether a particular index exists. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/exists/ OpenSearch - Index Exists} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes + * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices + * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all) + * @param {boolean} [params.flat_settings=false] - Return settings in flat format + * @param {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.exists = function indicesExistsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -490,6 +691,25 @@ IndicesApi.prototype.exists = function indicesExistsApi(params, options, callbac return this.transport.request(request, options, callback); }; +/** + * Returns information about whether a particular alias exists. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.name - A comma-separated list of alias names to return + * @param {string} [params.index] - A comma-separated list of index names to filter aliases + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.existsAlias = function indicesExistsAliasApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -522,6 +742,23 @@ IndicesApi.prototype.existsAlias = function indicesExistsAliasApi(params, option return this.transport.request(request, options, callback); }; +/** + * Returns information about whether a particular index template exists. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.name - The name of the template + * @param {boolean} [params.flat_settings=false] - Return settings in flat format + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateApi( params, options, @@ -553,6 +790,22 @@ IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateAp return this.transport.request(request, options, callback); }; +/** + * Returns information about whether a particular index template exists. (Deprecated. Use IndicesApi#existsIndexTemplate instead) + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.name - The comma separated names of the index templates + * @param {boolean} [params.flat_settings=false] - Return settings in flat format + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -580,6 +833,7 @@ IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi(params, return this.transport.request(request, options, callback); }; +// TODO: Remove. Experimental feature added in ES 7.15 IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi( params, options, @@ -611,6 +865,24 @@ IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi( return this.transport.request(request, options, callback); }; +/** + * Performs the flush operation on one or more indices. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string for all indices + * @param {boolean} [params.force] - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) + * @param {boolean} [params.wait_if_ongoing=true] - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. If set to false the flush will be skipped iff if another flush operation is already running. + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.flush = function indicesFlushApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -637,6 +909,25 @@ IndicesApi.prototype.flush = function indicesFlushApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * Performs the force merge operation on one or more indices. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {boolean} [params.flush=true] - Specify whether the index should be flushed after performing the operation + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {number} [params.max_num_segments] - The number of segments the index should be merged into (default: dynamic) + * @param {boolean} [params.only_expunge_deletes] - Specify whether the operation should only expunge deleted documents + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.forcemerge = function indicesForcemergeApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -663,6 +954,27 @@ IndicesApi.prototype.forcemerge = function indicesForcemergeApi(params, options, return this.transport.request(request, options, callback); }; +/** + * Returns information about one or more indices. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ OpenSearch - Get Index} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * @param {boolean} [params.ignore_unavailable=false] - Ignore unavailable indexes + * @param {boolean} [params.allow_no_indices=false] - Ignore if a wildcard expression resolves to no concrete indices + * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all) + * @param {boolean} [params.flat_settings=false] - Return settings in flat format + * @param {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices. + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.get = function indicesGetApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -690,6 +1002,25 @@ IndicesApi.prototype.get = function indicesGetApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * Returns an alias. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.name] - A comma-separated list of alias names to return + * @param {string} [params.index] - A comma-separated list of index names to filter aliases + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.getAlias = function indicesGetAliasApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -722,6 +1053,26 @@ IndicesApi.prototype.getAlias = function indicesGetAliasApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * Returns mapping for one or more fields. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/mappings/ OpenSearch - Mapping} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.fields - A comma-separated list of fields + * @param {string} [params.index] - A comma-separated list of index names + * @param {boolean} [params.include_defaults] - Whether the default mapping values should be returned as well + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi( params, options, @@ -790,6 +1141,23 @@ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi( return this.transport.request(request, options, callback); }; +/** + * Returns an index template. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.name] - The comma separated names of the index templates + * @param {boolean} [params.flat_setting=false] - Return settings in flat format + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi( params, options, @@ -820,6 +1188,25 @@ IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi( return this.transport.request(request, options, callback); }; +/** + * Returns mappings for one or more indices. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/mappings/ OpenSearch - Mapping} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node (Deprecated) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.getMapping = function indicesGetMappingApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -852,6 +1239,28 @@ IndicesApi.prototype.getMapping = function indicesGetMappingApi(params, options, return this.transport.request(request, options, callback); }; +/** + * Returns settings for one or more indices. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ OpenSearch - Get Settings} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {string} [params.name] - The name of the settings that should be included + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.flat_settings=false] - Return settings in flat format + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * @param {boolean} [params.include_defaults] - Whether to return all default setting for each of the indices. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.getSettings = function indicesGetSettingsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -884,6 +1293,22 @@ IndicesApi.prototype.getSettings = function indicesGetSettingsApi(params, option return this.transport.request(request, options, callback); }; +/** + * Returns an index template. (Deprecated. Use IndicesApi#getIndexTemplate instead) + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.name] - The comma separated names of the index templates + * @param {boolean} [params.flat_settings=false] - Return settings in flat format + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.local=false] - Return local information, do not retrieve the state from cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.getTemplate = function indicesGetTemplateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -910,6 +1335,22 @@ IndicesApi.prototype.getTemplate = function indicesGetTemplateApi(params, option return this.transport.request(request, options, callback); }; +/** + * Returns a progress status of current upgrade. (Deprecated. Use API-Document#reindex instead) + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -931,6 +1372,26 @@ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi(params, options, return this.transport.request(request, options, callback); }; +/** + * ROpens an index. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ OpenSearch - Open Index} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma separated list of indices to open + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {string} [params.wait_for_active_shards] - Sets the number of active shards to wait for before the operation returns. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.open = function indicesOpenApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -958,6 +1419,24 @@ IndicesApi.prototype.open = function indicesOpenApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * Creates or updates an alias. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. + * @param {string} params.name - The name of the alias to be created or updated + * @param {string} [params.timeout] - Explicit timestamp for the document + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {Object} [params.body] - The settings for the alias, such as `routing` or `filter` + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.putAlias = function indicesPutAliasApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1000,6 +1479,24 @@ IndicesApi.prototype.putAlias = function indicesPutAliasApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * Creates or updates an index template. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-templates/ OpenSearch - Index Templates} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.name - The name of the template + * @param {Object} params.body - The template definition + * @param {boolean} [params.create] - Whether the index template should only be added if new or can also replace an existing one + * @param {string} [params.cause] - User defined reason for creating/updating the index template + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi( params, options, @@ -1035,6 +1532,27 @@ IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi( return this.transport.request(request, options, callback); }; +/** + * Updates index mappings. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ OpenSearch - Create or Update Mapping} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. + * @param {Object} params.body - The mapping definition + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.write_index_only] - When true, applies mappings only to the write index of an alias or data stream + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.putMapping = function indicesPutMappingApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1085,6 +1603,28 @@ IndicesApi.prototype.putMapping = function indicesPutMappingApi(params, options, return this.transport.request(request, options, callback); }; +/** + * Updates the index settings. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ OpenSearch - Update Settings} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {Object} params.body - The index settings to be updated + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {string} [params.timeout] - Explicit operation timeout + * @param {boolean} [params.preserve_existing=false] - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.flat_settings=false] - Return settings in flat format + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.putSettings = function indicesPutSettingsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1117,6 +1657,23 @@ IndicesApi.prototype.putSettings = function indicesPutSettingsApi(params, option return this.transport.request(request, options, callback); }; +/** + * Creates or updates an index template. (Deprecated. Use IndicesApi#putIndexTemplate instead) + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.name - The name of the template + * @param {Object} params.body - The template definition + * @param {number} [params.order] - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) + * @param {boolean} [params.create] - Whether the index template should only be added if new or can also replace an existing one + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.putTemplate = function indicesPutTemplateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1148,6 +1705,21 @@ IndicesApi.prototype.putTemplate = function indicesPutTemplateApi(params, option return this.transport.request(request, options, callback); }; +/** + * Returns information about ongoing index shard recoveries. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {boolean} [params.detailed] - Whether to display detailed information about shard recovery + * @param {boolean} [params.active_only] - Display only those recoveries that are currently on-going + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.recovery = function indicesRecoveryApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1174,6 +1746,22 @@ IndicesApi.prototype.recovery = function indicesRecoveryApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * Performs the refresh operation in one or more indices. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.refresh = function indicesRefreshApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1200,6 +1788,20 @@ IndicesApi.prototype.refresh = function indicesRefreshApi(params, options, callb return this.transport.request(request, options, callback); }; +/** + * Returns information about any matching indices, aliases, and data streams + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.name] - A comma-separated list of names or wildcard expressions + * @param {string} [params.expand_wildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (options: open, closed, hidden, none, all) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1227,6 +1829,26 @@ IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi(params, opti return this.transport.request(request, options, callback); }; +/** + * Updates an alias to point to a new index when the existing index is considered to be too large or too old. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream OpenSearch - Rollover a data stream} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.alias - The name of the alias to rollover + * @param {string} [params.new_index] - The name of the rollover index + * @param {string} [params.timeout] - Explicit operation timeout + * @param {boolean} [params.dry_run=false] - If set to true the rollover action will only be validated but not actually performed even if a condition matches. + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the newly created rollover index before the operation returns. + * @param {Object} [params.body] - The conditions that needs to be met for executing rollover + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.rollover = function indicesRolloverApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1271,6 +1893,23 @@ IndicesApi.prototype.rollover = function indicesRolloverApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * Provides low-level information about segments in a Lucene index. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.verbose] - Includes detailed memory usage by Lucene. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.segments = function indicesSegmentsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1297,6 +1936,23 @@ IndicesApi.prototype.segments = function indicesSegmentsApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * Provides store information for shard copies of indices. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {string} [params.status] - A comma-separated list of statuses used to filter on shards to get store information for (options: green, yellow, red, all) + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.shardStores = function indicesShardStoresApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1323,6 +1979,26 @@ IndicesApi.prototype.shardStores = function indicesShardStoresApi(params, option return this.transport.request(request, options, callback); }; +/** + * Allow to shrink an existing index into a new index with fewer primary shards. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ OpenSearch - Shrink Index} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - The name of the source index to shrink + * @param {string} params.target - The name of the target index to shrink into + * @param {boolean} [params.copy_settings] - whether or not to copy settings from the source index (defaults to false) + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the shrunken index before the operation returns. + * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.shrink = function indicesShrinkApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1360,6 +2036,23 @@ IndicesApi.prototype.shrink = function indicesShrinkApi(params, options, callbac return this.transport.request(request, options, callback); }; +/** + * Simulate matching the given index name against the index templates in the system + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.name - The name of the index (it must be a concrete index name) + * @param {Object} [params.body] - New index template definition, which will be included in the simulation, as if it already exists in the system + * @param {boolean} [params.create] - Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one + * @param {string} [params.cause] - User defined reason for dry-run creating the new template for simulation purposes + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTemplateApi( params, options, @@ -1391,6 +2084,23 @@ IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTempla return this.transport.request(request, options, callback); }; +/** + * Simulate resolving the given template name or body (Deprecated. Use IndicesApi#simulateIndexTemplate instead) + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.name] - The name of the index template + * @param {boolean} [params.create] - Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one + * @param {string} [params.cause] - User defined reason for dry-run creating the new template for simulation purposes + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {Object} [params.body] - New index template definition to be simulated, if no index template name is specified + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi( params, options, @@ -1421,6 +2131,26 @@ IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi( return this.transport.request(request, options, callback); }; +/** + * Allows you to split an existing index into a new index with more primary shards. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/index-apis/split/ OpenSearch - Split Index} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - The name of the source index to split + * @param {string} params.target - The name of the target index to split into + * @param {boolean} [params.copy_settings] - whether or not to copy settings from the source index (defaults to false) + * @param {string} [params.timeout] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * @param {string} [params.wait_for_active_shards] - Set the number of active shards to wait for on the shrunken index before the operation returns. + * @param {Object} [params.body] - The configuration for the target index (`settings` and `aliases`) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.split = function indicesSplitApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1458,6 +2188,30 @@ IndicesApi.prototype.split = function indicesSplitApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * Provides statistics on operations happening in an index. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.metric] - Limit the information returned the specific metrics. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, suggest) + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {string} [params.completion_fields] - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * @param {string} [params.fielddata_fields] - A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * @param {string} [params.fields] - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * @param {string} [params.groups] - A comma-separated list of search groups for `search` index metric + * @param {string} [params.level] - Return stats aggregated at cluster, index or shard level (options: cluster, indices, shards) + * @param {string} [params.types] - A comma-separated list of document types for the `indexing` index metric + * @param {boolean} [params.include_segment_file_sizes] - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) + * @param {boolean} [params.include_unloaded_segments] - If set to true segment stats will include stats for segments that are not currently loaded into memory + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.forbid_closed_indices] - If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.stats = function indicesStatsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1490,6 +2244,22 @@ IndicesApi.prototype.stats = function indicesStatsApi(params, options, callback) return this.transport.request(request, options, callback); }; +/** + * Update an alias. + *
See Also: {@link https://opensearch.org/docs/latest/opensearch/index-alias/ OpenSearch - Index Aliases} + * + * @memberOf API-Index + * + * @param {Object} params + * @param {Object} params.body - The definition of `actions` to perform + * @param {string} [params.timeout] - Request timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1517,6 +2287,24 @@ IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi(params, op return this.transport.request(request, options, callback); }; +/** + * Upgrades to the current version of Lucene. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.wait_for_completion=false] - Specify whether the request should block until the all segments are upgraded + * @param {boolean} [params.only_ancient_segments] - If true, only ancient (an older Lucene major release) segments will be upgraded + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.upgrade = function indicesUpgradeApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -1538,6 +2326,32 @@ IndicesApi.prototype.upgrade = function indicesUpgradeApi(params, options, callb return this.transport.request(request, options, callback); }; +/** + * Allows a user to validate a potentially expensive query without executing it. + * + * @memberOf API-Index + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices + * @param {boolean} [params.explain] - Return detailed information about the error + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {string} [params.q] - Query in the Lucene query string syntax + * @param {string} [params.analyzer] - The analyzer to use for the query string + * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed + * @param {string} [params.default_operator=OR] - The default operator for query string query (options: AND, OR) + * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string + * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {boolean} [params.rewrite] - Provide a more detailed explanation showing the actual Lucene query that will be executed. + * @param {boolean} [params.all_shards] - Execute validation on all shards instead of one random shard per index + * @param {Object} [params.body] - The query definition specified with the Query DSL + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IndicesApi.prototype.validateQuery = function indicesValidateQueryApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/info.js b/api/api/info.js index 186389c0a..1eec14383 100644 --- a/api/api/info.js +++ b/api/api/info.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; +/** + * Returns basic information about the cluster. + * + * @memberOf API-Cluster + * + * @param {Object} params - (Unused) + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function infoApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/ingest.js b/api/api/ingest.js index 67a0c3d82..70c303c3b 100644 --- a/api/api/ingest.js +++ b/api/api/ingest.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Ingest */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'cluster_manager_timeout', @@ -58,6 +59,22 @@ function IngestApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +/** + * Deletes a pipeline. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/ OpenSearch - Delete a pipeline} + * + * @memberOf API-Ingest + * + * @param {Object} params + * @param {string} params.id - Pipeline ID + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/#response Delete Pipeline Response} + */ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -85,6 +102,17 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi(params, op return this.transport.request(request, options, callback); }; +/** + * Returns statistical information about geoip databases + * + * @memberOf API-Ingest + * + * @param {Object} params - (Unused) + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -106,6 +134,22 @@ IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi(params, options, c return this.transport.request(request, options, callback); }; +/** + * Returns a pipeline. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/ OpenSearch - Get pipeline} + * + * @memberOf API-Ingest + * + * @param {Object} params + * @param {string} [params.id] - Comma separated list of pipeline ids. Wildcards supported + * @param {boolean} [params.summary=false] - Return pipelines without their definitions + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/#response Get Pipeline Response} + */ IngestApi.prototype.getPipeline = function ingestGetPipelineApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -132,6 +176,17 @@ IngestApi.prototype.getPipeline = function ingestGetPipelineApi(params, options, return this.transport.request(request, options, callback); }; +/** + * Returns a list of the built-in patterns. + * + * @memberOf API-Ingest + * + * @param {Object} params - (Unused) + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IngestApi.prototype.processorGrok = function ingestProcessorGrokApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -153,6 +208,23 @@ IngestApi.prototype.processorGrok = function ingestProcessorGrokApi(params, opti return this.transport.request(request, options, callback); }; +/** + * Creates or updates a pipeline. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/ OpenSearch - Create/Update pipeline} + * + * @memberOf API-Ingest + * + * @param {Object} params + * @param {string} params.id - Pipeline ID + * @param {Object} params.body - Ingest definition + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/#response Create/Update Pipeline Response} + */ IngestApi.prototype.putPipeline = function ingestPutPipelineApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -184,6 +256,22 @@ IngestApi.prototype.putPipeline = function ingestPutPipelineApi(params, options, return this.transport.request(request, options, callback); }; +/** + * Allows to simulate a pipeline with example documents. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/ OpenSearch - Simulate Pipeline} + * + * @memberOf API-Ingest + * + * @param {Object} params + * @param {string} [params.id] - Pipeline ID + * @param {boolean} [params.verbose] - Verbose mode. Display data output for each processor in executed pipeline + * @param {Object} params.body - Simulate definition + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ IngestApi.prototype.simulate = function ingestSimulateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/mget.js b/api/api/mget.js index 3eb882cf3..344ffd655 100644 --- a/api/api/mget.js +++ b/api/api/mget.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -61,6 +60,30 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Retrieve multiple documents + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/ OpenSearch - Multi-get Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {string} params.id - Document ID. + * @param {string} params.body - {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/#request-body Multi-get Request Body} + * @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards. + * @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. + * @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {string} [params.routing] - A value used to route the operation to a specific shard. + * @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index. + * @param {string} [params._source=true] - Whether to include the '_source' field in the response body. + * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response. + * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/#response Multi-get Response} + */ function mgetApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/msearch.js b/api/api/msearch.js index e39228ddf..06e3e4c75 100644 --- a/api/api/msearch.js +++ b/api/api/msearch.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -60,6 +59,28 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Allows to execute several search operations in one request. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/multi-search/ OpenSearch - Multi-Search} + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names to use as default + * @param {Object} params.body - The request definitions (metadata-search request definition pairs), separated by newlines + * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch) + * @param {number} [params.max_concurrent_searches] - Controls the maximum number of concurrent searches the multi search api will execute + * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {number} [params.pre_filter_shard_size] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * @param {number} [params.max_concurrent_shard_requests] - The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/multi-search/#response Multi-search Response} + */ function msearchApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/msearch_template.js b/api/api/msearch_template.js index 8d23bd422..89313e660 100644 --- a/api/api/msearch_template.js +++ b/api/api/msearch_template.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -56,6 +55,25 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Allows to execute several search template operations in one request. + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names to use as default + * @param {Object} params.body - The request definitions (metadata-search request definition pairs), separated by newlines + * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch) + * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {number} [params.max_concurrent_searches] - Controls the maximum number of concurrent searches the multi search api will execute + * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function msearchTemplateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/mtermvectors.js b/api/api/mtermvectors.js index 089452006..134b0c424 100644 --- a/api/api/mtermvectors.js +++ b/api/api/mtermvectors.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/api/api/nodes.js b/api/api/nodes.js index c1b0eac6c..c6cb83a9c 100644 --- a/api/api/nodes.js +++ b/api/api/nodes.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Nodes */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'pretty', @@ -156,6 +157,25 @@ NodesApi.prototype.getMeteringInfo = function nodesGetMeteringInfoApi(params, op return this.transport.request(request, options, callback); }; +/** + * Returns information about hot threads on each node in the cluster. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ OpenSearch - Nodes Hot Threads} + * @memberOf API-Nodes + * + * @param {Object} params + * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * @param {string} [params.interval] - The interval for the second sampling of threads + * @param {number} [params.snapshots] - Number of samples of thread stacktrace (default: 10) + * @param {number} [params.threads] - Specify the number of threads to provide information for (default: 3) + * @param {boolean} [params.ignore_idle_threads] - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) + * @param {string} [params.type] - The type to sample (default: cpu) (options: cpu, wait, block) + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ NodesApi.prototype.hotThreads = function nodesHotThreadsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -207,6 +227,22 @@ NodesApi.prototype.hotThreads = function nodesHotThreadsApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * Returns information about hot threads on each node in the cluster. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ OpenSearch - Nodes Info} + * @memberOf API-Nodes + * + * @param {Object} params + * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * @param {string} [params.metric] - A comma-separated list of metrics you wish returned. Leave empty to return all. (options: settings, os, process, jvm, thread_pool, transport, http, plugins, ingest) + * @param {boolean} [params.flat_settings] - Return settings in flat format (default: false) + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ NodesApi.prototype.info = function nodesInfoApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -245,6 +281,21 @@ NodesApi.prototype.info = function nodesInfoApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * Reloads secure settings. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-reload-secure/ OpenSearch - Nodes Reload Security Settings} + * @memberOf API-Nodes + * + * @param {Object} params + * @param {string} [params.node_id] - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. + * @param {string} [params.timeout] - Explicit operation timeout + * @param {Object} [params.body] - An object containing the password for the opensearch keystore + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi( params, options, @@ -276,6 +327,30 @@ NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi( return this.transport.request(request, options, callback); }; +/** + * Returns statistical information about nodes in the cluster. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-stats/ OpenSearch - Nodes Stats} + * @memberOf API-Nodes + * + * @param {Object} params + * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * @param {string} [params.metric] - Limit the information returned to the specified metrics (options: _all, breaker, fs, http, indices, jvm, os, process, thread_pool, transport, discovery, indexing_pressure) + * @param {string} [params.index_metric] - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, suggest) + * @param {string} [params.completion_fields] - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) + * @param {string} [params.fielddata_fields] - A comma-separated list of fields for `fielddata` index metric (supports wildcards) + * @param {string} [params.fields] - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) + * @param {boolean} [params.groups] - A comma-separated list of search groups for `search` index metric + * @param {string} [params.level] - Return indices stats aggregated at index, node or shard level (options: indices, node, shards) + * @param {string} [params.types] - A comma-separated list of document types for the `indexing` index metric + * @param {string} [params.timeout] - Explicit operation timeout + * @param {boolean} [params.include_segment_file_sizes] - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) + * @param {boolean} [params.include_unloaded_segments] - If set to true segment stats will include stats for segments that are not currently loaded into memory + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ NodesApi.prototype.stats = function nodesStatsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -340,6 +415,21 @@ NodesApi.prototype.stats = function nodesStatsApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * Returns low-level information about REST actions usage on nodes. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ OpenSearch - Nodes Usage} + * @memberOf API-Nodes + * + * @param {Object} params + * @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * @param {string} [params.metric] - Limit the information returned to the specified metrics (options: _all, rest_actions) + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ NodesApi.prototype.usage = function nodesUsageApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/ping.js b/api/api/ping.js index 005313b4d..0c617f26c 100644 --- a/api/api/ping.js +++ b/api/api/ping.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; +/** + * Returns whether the cluster is running. + * + * @memberOf API-Cluster + * + * @param {Object} params - (Unused) + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function pingApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/put_script.js b/api/api/put_script.js index 434489c5a..e2c8453fe 100644 --- a/api/api/put_script.js +++ b/api/api/put_script.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -52,6 +51,23 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Creates or updates a script. + *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ OpenSearch - Create or update stored script} + * @memberOf API-Script + * + * @param {Object} params + * @param {string} params.id - Stored script or search template name + * @param {string} params.body - The script + * @param {string} [params.context] - Context in which the script or search template is to run. To prevent errors, the API immediately compiles the script or template in this context. + * @param {string} [params.timeout=30s] - Explicit operation timeout + * @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function putScriptApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/rank_eval.js b/api/api/rank_eval.js index ea3c59f18..0648fcce9 100644 --- a/api/api/rank_eval.js +++ b/api/api/rank_eval.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -54,6 +53,25 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Allows to evaluate the quality of ranked search results over a set of typical search queries + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/rank-eval/ OpenSearch - Ranking evaluation} + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {Object} params.body - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch) + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/rank-eval/#sample-response Ranking Evaluation Response} + */ function rankEvalApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/reindex.js b/api/api/reindex.js index ae5167174..ffbc66de5 100644 --- a/api/api/reindex.js +++ b/api/api/reindex.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -58,6 +57,28 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Copy all or a subset of your data from a source index into a destination index. + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/reindex/ OpenSearch - Reindex Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {Object} params.body The search definition using the Query DSL and the prototype for the index request. + * @param {boolean} [params.refresh=false] Should the affected indexes be refreshed? + * @param {string} [params.timeout=30s] Time each individual bulk request should wait for shards that are unavailable. + * @param {string} [params.wait_for_active_shards] Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {boolean} [params.wait_for_completion=false] Should the request should block until the reindex is complete. + * @param {number} [params.requests_per_second=-1] The throttle to set on this request in sub-requests per second. -1 means no throttle. + * @param {string} [params.scroll=5m] Control how long to keep the search context alive + * @param {number|string} [params.slices=1] The number of slices this task should be divided into. 1 means the task isn't sliced into subtasks. Can be set to `auto`. + * @param {number} [params.max_docs] Maximum number of documents to process (default: all documents) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/reindex/#response Reindex Document Response} + */ function reindexApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/reindex_rethrottle.js b/api/api/reindex_rethrottle.js index 5e8b93606..dfab5d02c 100644 --- a/api/api/reindex_rethrottle.js +++ b/api/api/reindex_rethrottle.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -48,6 +47,20 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Changes the number of requests per second for a particular Reindex operation. + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.task_id - The task id to rethrottle + * @param {number} params.requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function reindexRethrottleApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/render_search_template.js b/api/api/render_search_template.js index a5614ddb5..6353ef760 100644 --- a/api/api/render_search_template.js +++ b/api/api/render_search_template.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,6 +36,20 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; +/** + * Allows to use the Mustache language to pre-render a search definition. + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} [params.id] - The id of the stored search template + * @param {Object} [params.body] - The search definition template and its params + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function renderSearchTemplateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/scripts_painless_execute.js b/api/api/scripts_painless_execute.js index 587695262..9ec8a894b 100644 --- a/api/api/scripts_painless_execute.js +++ b/api/api/scripts_painless_execute.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,6 +36,19 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; +/** + * Execute Painless script + *
See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/ OpenSearch - Execute Painless script} + * @memberOf API-Script + * + * @param {Object} params + * @param {string} params.body - The painless script + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function scriptsPainlessExecuteApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/scroll.js b/api/api/scroll.js index 66f024146..045b22dbe 100644 --- a/api/api/scroll.js +++ b/api/api/scroll.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -51,6 +50,23 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Allows to retrieve a large numbers of results from a single search request. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ OpenSearch - Scroll } + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} [params.scroll_id] - The scroll ID *Deprecated* + * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {Object} [params.body] - The scroll ID if not passed by URL or query parameter. + * + * @param {Object} [options] - Options for {@link Transport#request} + * @param {function} [callback] - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function scrollApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/search.js b/api/api/search.js index eea4843b9..f8e9fc2d9 100644 --- a/api/api/search.js +++ b/api/api/search.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Search */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'analyzer', @@ -121,6 +122,64 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Allows to execute several search operations in one request. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/search/ OpenSearch - Search} + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {string} [params.analyzer] - The analyzer to use for the query string + * @param {boolean} [params.analyze_wildcard] - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + * @param {string} [params.default_operator] - The default operator for query string query (AND or OR) (options: AND, OR) + * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string + * @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit + * @param {string} [params.stored_fields] - A comma-separated list of stored fields to return as part of a hit + * @param {string} [params.docvalue_fields] - A comma-separated list of fields to return as the docvalue representation of a field for each hit + * @param {number} [params.from] - Starting offset (default: 0) + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random) + * @param {string} [params.q] - Query in the Lucene query string syntax + * @param {string} [params.routing] - A comma-separated list of specific routing values + * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch) + * @param {number} [params.size] - Number of hits to return (default: 10) + * @param {string} [params.sort] - A comma-separated list of : pairs + * @param {string} [params._source] - True or false to return the _source field or not, or a list of fields to return + * @param {string} [params._source_excludes] - A list of fields to exclude from the returned _source field + * @param {string} [params._source_includes] - A list of fields to extract and return from the _source field + * @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {string} [params.stats] - Specific 'tag' of the request for logging and statistical purposes + * @param {string} [params.suggest_field] - Specify which field to use for suggestions + * @param {string} [params.suggest_mode] - Specify suggest mode (options: missing, popular, always) + * @param {number} [params.suggest_size] - How many suggestions to return in response + * @param {string} [params.suggest_text] - The source text for which the suggestions should be returned + * @param {string} [params.timeout] - Explicit operation timeout + * @param {boolean} [params.track_scores] - Whether to calculate and return scores even if they are not used for sorting + * @param {boolean} [params.track_total_hits] - Indicate if the number of documents that match the query should be tracked + * @param {boolean} [params.allow_partial_search_results] - Indicate if an error should be returned if there is a partial search failure or timeout + * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {boolean} [params.version] - Specify whether to return document version as part of a hit + * @param {boolean} [params.seq_no_primary_term] - Specify whether to return sequence number and primary term of the last modification of each hit + * @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {number} [params.batched_reduce_size] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. + * @param {number} [params.max_concurrent_shard_requests] - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + * @param {number} [params.pre_filter_shard_size] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {string} [params.min_compatible_shard_node] - The minimum compatible version that all shards involved in search should have for this request to be successful + * @param {Object} [params.body] - The search definition using the Query DSL + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/latest/api-reference/search/#response-body Search Response} + */ function searchApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/search_shards.js b/api/api/search_shards.js index e65b8c5f4..5190463c9 100644 --- a/api/api/search_shards.js +++ b/api/api/search_shards.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -55,6 +54,25 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Returns information about the indices and shards that a search request would be executed against. + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} [params.index] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random) + * @param {string} [params.routing] - Specific routing value + * @param {boolean} [params.local] - Return local information, do not retrieve the state from cluster_manager node (default: false) + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function searchShardsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/search_template.js b/api/api/search_template.js index c16af488b..c45c6ef16 100644 --- a/api/api/search_template.js +++ b/api/api/search_template.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -67,6 +66,33 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Allows to use the Mustache language to pre-render a search definition. + * + * @memberOf API-Search + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + * @param {Object} params.body - The search definition template and its params + * @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled + * @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + * @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random) + * @param {string} [params.routing] - A comma-separated list of specific routing values + * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch) + * @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit + * @param {boolean} [params.profile] - Specify whether to profile the query execution + * @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response + * @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response + * @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function searchTemplateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/shutdown.js b/api/api/shutdown.js index 86c6b1625..6f1d5e213 100644 --- a/api/api/shutdown.js +++ b/api/api/shutdown.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -42,6 +41,7 @@ function ShutdownApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +// TODO: Remove. Added in ES 7.15 ShutdownApi.prototype.deleteNode = function shutdownDeleteNodeApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -69,6 +69,7 @@ ShutdownApi.prototype.deleteNode = function shutdownDeleteNodeApi(params, option return this.transport.request(request, options, callback); }; +// TODO: Remove. Added in ES 7.15 ShutdownApi.prototype.getNode = function shutdownGetNodeApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -95,6 +96,7 @@ ShutdownApi.prototype.getNode = function shutdownGetNodeApi(params, options, cal return this.transport.request(request, options, callback); }; +// TODO: Remove. Added in ES 7.15 ShutdownApi.prototype.putNode = function shutdownPutNodeApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/snapshot.js b/api/api/snapshot.js index 06e2c2769..aa5c2b18f 100644 --- a/api/api/snapshot.js +++ b/api/api/snapshot.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Snapshot */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'cluster_manager_timeout', @@ -84,6 +85,21 @@ function SnapshotApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +/** + * Removes stale data from repository. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} params.repository - A repository name + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi( params, options, @@ -115,6 +131,23 @@ SnapshotApi.prototype.cleanupRepository = function snapshotCleanupRepositoryApi( return this.transport.request(request, options, callback); }; +/** + * Clones indices from one snapshot into another snapshot in the same repository. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} params.repository - A repository name + * @param {string} params.snapshot - The name of the snapshot to clone from + * @param {Object} params.body - The snapshot clone definition + * @param {string} [params.target_snapshot] - The name of the cloned snapshot to create + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.clone = function snapshotCloneApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -181,6 +214,23 @@ SnapshotApi.prototype.clone = function snapshotCloneApi(params, options, callbac return this.transport.request(request, options, callback); }; +/** + * Creates a snapshot in a repository. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} params.repository - A repository name + * @param {string} params.snapshot - A snapshot name + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.wait_for_completion] - Should this request wait until the operation has completed before returning + * @param {Object} [params.body] - The snapshot definition + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.create = function snapshotCreateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -219,6 +269,23 @@ SnapshotApi.prototype.create = function snapshotCreateApi(params, options, callb return this.transport.request(request, options, callback); }; +/** + * Creates a repository. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} params.repository - A repository name + * @param {Object} params.body - The repository definition + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {string} [params.timeout] - Explicit operation timeout + * @param {boolean} [params.verify] - Whether to verify the repository after creation + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi( params, options, @@ -254,6 +321,22 @@ SnapshotApi.prototype.createRepository = function snapshotCreateRepositoryApi( return this.transport.request(request, options, callback); }; +/** + * Deletes a snapshot. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} [params.repository] - A repository name + * @param {string} [params.snapshot] - A snapshot name + * @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.delete = function snapshotDeleteApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -292,6 +375,22 @@ SnapshotApi.prototype.delete = function snapshotDeleteApi(params, options, callb return this.transport.request(request, options, callback); }; +/** + * Deletes a repository. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} [params.repository] - Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. + * @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi( params, options, @@ -323,6 +422,26 @@ SnapshotApi.prototype.deleteRepository = function snapshotDeleteRepositoryApi( return this.transport.request(request, options, callback); }; +/** + * Returns information about a snapshot. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} [params.repository] - A repository name + * @param {string} [params.snapshot] - A comma-separated list of snapshot names + * @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.ignore_unavailable] - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * @param {boolean} [params.index_details] - Whether to include details of each index in the snapshot, if those details are available. Defaults to false. + * @param {boolean} [params.include_repository] - Whether to include the repository name in the snapshot info. Defaults to true. + * @param {boolean} [params.verbose] - Whether to show verbose snapshot info or only show the basic info found in the repository index blob + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.get = function snapshotGetApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -361,6 +480,21 @@ SnapshotApi.prototype.get = function snapshotGetApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * Returns information about a snapshot. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} [params.repository] - A comma-separated list of repository names + * @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.local] - Return local information, do not retrieve the state from cluster_manager node (default: false) + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -387,6 +521,30 @@ SnapshotApi.prototype.getRepository = function snapshotGetRepositoryApi(params, return this.transport.request(request, options, callback); }; +/** + * Analyzes a repository for correctness and performance + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} [params.repository] - A repository name + * @param {number} [params.blob_count] - Number of blobs to create during the test. Defaults to 100. + * @param {number} [params.concurrency] - Number of operations to run concurrently during the test. Defaults to 10. + * @param {number} [params.read_node_count] - Number of nodes on which to read a blob after writing. Defaults to 10. + * @param {number} [params.early_read_node_count] - Number of nodes on which to perform an early read on a blob, i.e. before writing has completed. Early reads are rare actions so the 'rare_action_probability' parameter is also relevant. Defaults to 2. + * @param {number} [params.seed] - Seed for the random number generator used to create the test workload. Defaults to a random value. + * @param {number} [params.rare_action_probability] - Probability of taking a rare action such as an early read or an overwrite. Defaults to 0.02. + * @param {string} [params.max_blob_size] - Maximum size of a blob to create during the test, e.g '1gb' or '100mb'. Defaults to '10mb'. + * @param {string} [params.max_total_data_size] - Maximum total size of all blobs to create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'. + * @param {string} [params.timeout] - Explicit operation timeout. Defaults to '30s'. + * @param {boolean} [params.detailed] - Whether to return detailed results or a summary. Defaults to 'false' so that only the summary is returned. + * @param {boolean} [params.rarely_abort_writes] - Whether to rarely abort writes before they complete. Defaults to 'true'. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi( params, options, @@ -418,6 +576,24 @@ SnapshotApi.prototype.repositoryAnalyze = function snapshotRepositoryAnalyzeApi( return this.transport.request(request, options, callback); }; +/** + * Restores a snapshot. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} [params.repository] - A repository name + * @param {string} [params.snapshot] - A snapshot name + * @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.wait_for_completion] - Should this request wait until the operation has completed before returning + * @param {Object} [params.body] - Details of what to restore + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.restore = function snapshotRestoreApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -463,6 +639,23 @@ SnapshotApi.prototype.restore = function snapshotRestoreApi(params, options, cal return this.transport.request(request, options, callback); }; +/** + * Returns information about the status of a snapshot. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} [params.repository] - A repository name + * @param {string} [params.snapshot] - A comma-separated list of snapshot names + * @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {boolean} [params.ignore_unavailable] - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.status = function snapshotStatusApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -506,6 +699,22 @@ SnapshotApi.prototype.status = function snapshotStatusApi(params, options, callb return this.transport.request(request, options, callback); }; +/** + * Verifies a repository. + * + * @memberOf API-Snapshot + * + * @param {Object} params + * @param {string} [params.repository] - A repository name + * @param {string} [params.master_timeout] - (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node + * @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ SnapshotApi.prototype.verifyRepository = function snapshotVerifyRepositoryApi( params, options, diff --git a/api/api/tasks.js b/api/api/tasks.js index b745ee98c..a57df45cf 100644 --- a/api/api/tasks.js +++ b/api/api/tasks.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -33,6 +32,8 @@ /* eslint camelcase: 0 */ /* eslint no-unused-vars: 0 */ +/** @namespace API-Tasks */ + const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils'); const acceptedQuerystring = [ 'nodes', @@ -61,6 +62,24 @@ function TasksApi(transport, ConfigurationError) { this[kConfigurationError] = ConfigurationError; } +/** + * Cancels a task, if it can be cancelled through an API. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/tasks/#task-canceling OpenSearch - Task Cancelling} + * + * @memberOf API-Tasks + * + * @param {Object} params + * @param {string} [params.task_id] - Cancel the task with specified task id (node_id:task_number) + * @param {string} [params.nodes] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * @param {string} [params.actions] - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. + * @param {string} [params.parent_task_id] - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. + * @param {boolean} [params.wait_for_completion] - Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ TasksApi.prototype.cancel = function tasksCancelApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -87,6 +106,22 @@ TasksApi.prototype.cancel = function tasksCancelApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * Returns information about a task. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/tasks OpenSearch - Tasks} + * + * @memberOf API-Tasks + * + * @param {Object} params + * @param {string} [params.task_id] - Return the task with specified id (node_id:task_number) + * @param {boolean} [params.wait_for_completion] - Wait for the matching tasks to complete (default: false) + * @param {string} [params.timeout] - Explicit operation timeoutompletion] - Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ TasksApi.prototype.get = function tasksGetApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); @@ -114,6 +149,26 @@ TasksApi.prototype.get = function tasksGetApi(params, options, callback) { return this.transport.request(request, options, callback); }; +/** + * Returns a list of tasks. + *
See Also: {@link https://opensearch.org/docs/latest/api-reference/tasks OpenSearch - Tasks} + * + * @memberOf API-Tasks + * + * @param {Object} params + * @param {string} [params.nodes] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + * @param {string} [params.actions] - A comma-separated list of actions that should be returned. Leave empty to return all. + * @param {boolean} [params.detailed] - Return detailed task information (default: false) + * @param {string} [params.parent_task_id] - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. + * @param {boolean} [params.wait_for_completion] - Wait for the matching tasks to complete (default: false) + * @param {string} [params.group_by] - Group tasks by nodes or parent/child relationships (options: nodes, parents, none) + * @param {string} [params.timeout] - Explicit operation timeout + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ TasksApi.prototype.list = function tasksListApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/terms_enum.js b/api/api/terms_enum.js index 015a5dd18..847f3229f 100644 --- a/api/api/terms_enum.js +++ b/api/api/terms_enum.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,6 +36,7 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path']; const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' }; +// TODO: Remove. Added in ES 7.14 function termsEnumApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/termvectors.js b/api/api/termvectors.js index c982af9b5..e08c623b3 100644 --- a/api/api/termvectors.js +++ b/api/api/termvectors.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -60,6 +59,32 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Returns information and statistics about terms in the fields of a particular document. + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - The index in which the document resides. + * @param {string} [params.id] - The id of the document, when not specified a doc param should be supplied. + * @param {boolean} [params.term_statistics] - Specifies if total term frequency and document frequency should be returned. + * @param {boolean} [params.field_statistics] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. + * @param {string} [params.fields] - A comma-separated list of fields to return. + * @param {boolean} [params.offsets] - Specifies if term offsets should be returned. + * @param {boolean} [params.positions] - Specifies if term positions should be returned. + * @param {boolean} [params.payloads] - Specifies if term payloads should be returned. + * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random). + * @param {string} [params.routing] - Specific routing value. + * @param {boolean} [params.realtime] - Specifies if request is real-time as opposed to near-real-time (default: true). + * @param {number} [params.version] - Explicit version number for concurrency control + * @param {string} [params.version_type] - Specific version type (options: internal, external, external_gte, force) + * @param {Object} [params.body] - Define parameters and or supply a document to get termvectors for. See documentation. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function termvectorsApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/update.js b/api/api/update.js index f8646d46c..8f8f361b1 100644 --- a/api/api/update.js +++ b/api/api/update.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -69,6 +68,34 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Update an existing document + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/update-document/ OpenSearch - Update Document} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - Name of the index. + * @param {string} params.id - A unique identifier to attach to the document. + * @param {Object} params.body - The request definition requires either `script` or partial `doc`. + * @param {number} [params.if_seq_no] - Only perform the update operation if the document has the specified sequence number. + * @param {number} [params.if_primary_term] - Only perform the update operation if the document has the specified primary term. + * @param {string} [params.lang=painless] - Language of the script. + * @param {string} [params.routing] - Value used to assign the index operation to a specific shard. + * @param {string} [params._source=true] - Whether to include the '_source' field in the response body. + * @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response. + * @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response. + * @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation. + * @param {number} [params.retry_on_conflict=0] - The amount of times OpenSearch should retry the operation if there’s a document conflict. + * @param {string} [params.timeout=1m] - How long to wait for a response from the cluster. + * @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed. + * @param {boolean} [params.require_alias=false] - Specifies whether the target index must be an index alias. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/update-document/#response Update Response} + */ function updateApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/update_by_query.js b/api/api/update_by_query.js index 94d2e651a..682516d61 100644 --- a/api/api/update_by_query.js +++ b/api/api/update_by_query.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -102,6 +101,56 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Run a script to update all documents that match the query. + *
See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/update-by-query/ OpenSearch - Update by query} + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.index - A comma-separated list of index names to search; use '_all' or empty string to perform the operation on all indices + * @param {Object} [params.body] - The search definition using the Query DSL + * @param {string} [params.analyzer] - The analyzer to use for the query string + * @param {boolean} [params.analyze_wildcard=false] - Specify whether wildcard and prefix queries should be analyzed (default: false) + * @param {string} [params.default_operator=OR] - The default operator for query string query (options: AND, OR) + * @param {string} [params.df] - The field to use as default where no field prefix is given in the query string + * @param {number} [params.from=0] - Starting offset + * @param {boolean} [params.ignore_unavailable=false] - Whether specified concrete indices should be ignored when unavailable (missing or closed) + * @param {boolean} [params.allow_no_indices=true] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes '_all' string or when no indices have been specified) + * @param {string} [params.conflicts=abort] - What to do when the update by query hits version conflicts? (options: abort, proceed) + * @param {string} [params.expand_wildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + * @param {boolean} [params.lenient=false] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + * @param {string} [params.pipeline] - Ingest pipeline to set on index requests made by this action. (default: none) + * @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random) + * @param {string} [params.q] - Query in the Lucene query string syntax + * @param {string} [params.routing] - A comma-separated list of specific routing values + * @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search + * @param {string} [params.search_type=query_then_fetch] - Search operation type (options: query_then_fetch, dfs_query_then_fetch) + * @param {string} [params.search_timeout] - Explicit timeout for each search request. Defaults to no timeout. + * @param {number} [params.size] - Deprecated, please use 'max_docs' instead + * @param {number} [params.max_docs] - Maximum number of documents to process (default: all documents) + * @param {string} [params.sort] - A comma-separated list of : pairs + * @param {string} [params._source] - True or false to return the _source field or not, or a list of fields to return + * @param {string} [params._source_excludes] - A list of fields to exclude from the returned _source field + * @param {string} [params._source_includes] - A list of fields to extract and return from the _source field + * @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. + * @param {string} [params.stats] - Specific 'tag' of the request for logging and statistical purposes + * @param {boolean} [params.version] - Specify whether to return document version as part of a hit + * @param {boolean} [params.version_type] - Should the document increment the version number (internal) on hit or not (reindex) + * @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting + * @param {boolean} [params.refresh=false] - Should the affected indexes be refreshed? + * @param {string} [params.timeout] - Time each individual bulk request should wait for shards that are unavailable. + * @param {string} [params.wait_for_active_shards=1] - Sets the number of shard copies that must be active before proceeding with the update by query operation. 1 means the primary shard only. Set to 'all' for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) + * @param {number} [params.scroll_size=1000] - Size on the scroll request powering the update by query + * @param {boolean} [params.wait_for_completion=true] - Should the request should block until the update by query operation is complete. + * @param {number} [params.requests_per_second=-1] - The throttle to set on this request in sub-requests per second. -1 means no throttle. + * @param {string} [params.slices=1] - The number of slices this task should be divided into. 1 means the task isn't sliced into subtasks. Can be set to 'auto'. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/update-by-query/#response Update by query Response} + */ function updateByQueryApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/api/update_by_query_rethrottle.js b/api/api/update_by_query_rethrottle.js index 41790cf2a..24e295904 100644 --- a/api/api/update_by_query_rethrottle.js +++ b/api/api/update_by_query_rethrottle.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -48,6 +47,20 @@ const snakeCase = { filterPath: 'filter_path', }; +/** + * Changes the number of requests per second for a particular Update By Query operation. + * + * @memberOf API-Document + * + * @param {Object} params + * @param {string} params.task_id - The task id to rethrottle + * @param {number} params.requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. + * + * @param {Object} options - Options for {@link Transport#request} + * @param {function} callback - Callback that handles errors and response + * + * @returns {{abort: function(), then: function(), catch: function()}|Promise|*} + */ function updateByQueryRethrottleApi(params, options, callback) { [params, options, callback] = normalizeArguments(params, options, callback); diff --git a/api/index.js b/api/index.js index a94b3b8fe..8f58c93f5 100644 --- a/api/index.js +++ b/api/index.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -36,10 +35,13 @@ const clearScrollApi = require('./api/clear_scroll'); const ClusterApi = require('./api/cluster'); const countApi = require('./api/count'); const createApi = require('./api/create'); +const createPitApi = require('./api/create_pit'); const DanglingIndicesApi = require('./api/dangling_indices'); const deleteApi = require('./api/delete'); +const deleteAllPitsApi = require('./api/delete_all_pits'); const deleteByQueryApi = require('./api/delete_by_query'); const deleteByQueryRethrottleApi = require('./api/delete_by_query_rethrottle'); +const deletePitApi = require('./api/delete_pit'); const deleteScriptApi = require('./api/delete_script'); const existsApi = require('./api/exists'); const existsSourceApi = require('./api/exists_source'); @@ -47,6 +49,7 @@ const explainApi = require('./api/explain'); const FeaturesApi = require('./api/features'); const fieldCapsApi = require('./api/field_caps'); const getApi = require('./api/get'); +const getAllPitsApi = require('./api/get_all_pits'); const getScriptApi = require('./api/get_script'); const getScriptContextApi = require('./api/get_script_context'); const getScriptLanguagesApi = require('./api/get_script_languages'); @@ -110,15 +113,19 @@ OpenSearchAPI.prototype.bulk = bulkApi; OpenSearchAPI.prototype.clearScroll = clearScrollApi; OpenSearchAPI.prototype.count = countApi; OpenSearchAPI.prototype.create = createApi; +OpenSearchAPI.prototype.createPit = createPitApi; OpenSearchAPI.prototype.delete = deleteApi; +OpenSearchAPI.prototype.deleteAllPits = deleteAllPitsApi; OpenSearchAPI.prototype.deleteByQuery = deleteByQueryApi; OpenSearchAPI.prototype.deleteByQueryRethrottle = deleteByQueryRethrottleApi; +OpenSearchAPI.prototype.deletePit = deletePitApi; OpenSearchAPI.prototype.deleteScript = deleteScriptApi; OpenSearchAPI.prototype.exists = existsApi; OpenSearchAPI.prototype.existsSource = existsSourceApi; OpenSearchAPI.prototype.explain = explainApi; OpenSearchAPI.prototype.fieldCaps = fieldCapsApi; OpenSearchAPI.prototype.get = getApi; +OpenSearchAPI.prototype.getAllPits = getAllPitsApi; OpenSearchAPI.prototype.getScript = getScriptApi; OpenSearchAPI.prototype.getScriptContext = getScriptContextApi; OpenSearchAPI.prototype.getScriptLanguages = getScriptLanguagesApi; @@ -168,6 +175,11 @@ Object.defineProperties(OpenSearchAPI.prototype, { return this[kCluster]; }, }, + create_pit: { + get() { + return this.createPit; + }, + }, danglingIndices: { get() { if (this[kDanglingIndices] === null) { @@ -181,6 +193,11 @@ Object.defineProperties(OpenSearchAPI.prototype, { return this.danglingIndices; }, }, + delete_all_pits: { + get() { + return this.deleteAllPits; + }, + }, delete_by_query: { get() { return this.deleteByQuery; @@ -191,6 +208,11 @@ Object.defineProperties(OpenSearchAPI.prototype, { return this.deleteByQueryRethrottle; }, }, + delete_pit: { + get() { + return this.deletePit; + }, + }, delete_script: { get() { return this.deleteScript; @@ -214,6 +236,11 @@ Object.defineProperties(OpenSearchAPI.prototype, { return this.fieldCaps; }, }, + get_all_pits: { + get() { + return this.getAllPits; + }, + }, get_script: { get() { return this.getScript; diff --git a/api/new.d.ts b/api/new.d.ts index d3f186079..782f06725 100644 --- a/api/new.d.ts +++ b/api/new.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -488,6 +487,22 @@ declare class Client { options: TransportRequestOptions, callback: callbackFn ): TransportRequestCallback; + createPit( + params?: T.PointInTimeCreateRequest, + options?: TransportRequestOptions + ): TransportRequestPromise>; + createPit( + callback: callbackFn + ): TransportRequestCallback; + createPit( + params: T.PointInTimeCreateRequest, + callback: callbackFn + ): TransportRequestCallback; + createPit( + params: T.PointInTimeCreateRequest, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; danglingIndices: { deleteDanglingIndex( params?: TODO, @@ -551,6 +566,22 @@ declare class Client { options: TransportRequestOptions, callback: callbackFn ): TransportRequestCallback; + deleteAllPits( + params?: T.PointInTimeDeleteAllRequest, + options?: TransportRequestOptions + ): TransportRequestPromise>; + deleteAllPits( + callback: callbackFn + ): TransportRequestCallback; + deleteAllPits( + params: T.PointInTimeDeleteAllRequest, + callback: callbackFn + ): TransportRequestCallback; + deleteAllPits( + params: T.PointInTimeDeleteAllRequest, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; deleteByQuery( params: T.DeleteByQueryRequest, options?: TransportRequestOptions @@ -577,6 +608,22 @@ declare class Client { options: TransportRequestOptions, callback: callbackFn ): TransportRequestCallback; + deletePit( + params?: T.PointInTimeDeleteRequest, + options?: TransportRequestOptions + ): TransportRequestPromise>; + deletePit( + callback: callbackFn + ): TransportRequestCallback; + deletePit( + params: T.PointInTimeDeleteRequest, + callback: callbackFn + ): TransportRequestCallback; + deletePit( + params: T.PointInTimeDeleteRequest, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; deleteScript( params: T.DeleteScriptRequest, options?: TransportRequestOptions @@ -690,6 +737,22 @@ declare class Client { options: TransportRequestOptions, callback: callbackFn, TContext> ): TransportRequestCallback; + getAllPits( + params?: T.PointInTimeGetAllRequest, + options?: TransportRequestOptions + ): TransportRequestPromise>; + getAllPits( + callback: callbackFn + ): TransportRequestCallback; + getAllPits( + params: T.PointInTimeGetAllRequest, + callback: callbackFn + ): TransportRequestCallback; + getAllPits( + params: T.PointInTimeGetAllRequest, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; getScript( params: T.GetScriptRequest, options?: TransportRequestOptions diff --git a/api/opensearch_dashboards.d.ts b/api/opensearch_dashboards.d.ts index 21b25cd48..67dbb9756 100644 --- a/api/opensearch_dashboards.d.ts +++ b/api/opensearch_dashboards.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -137,14 +136,17 @@ interface OpenSearchDashboardsClient { } count(params?: T.CountRequest, options?: TransportRequestOptions): TransportRequestPromise> create(params: T.CreateRequest, options?: TransportRequestOptions): TransportRequestPromise> + createPit(params?: T.PointInTimeCreateRequest, options?: TransportRequestOptions): TransportRequestPromise> danglingIndices: { deleteDanglingIndex(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> importDanglingIndex(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> listDanglingIndices(params?: TODO, options?: TransportRequestOptions): TransportRequestPromise> } delete(params: T.DeleteRequest, options?: TransportRequestOptions): TransportRequestPromise> + deleteAllPits(params: T.PointInTimeDeleteAllRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteByQuery(params: T.DeleteByQueryRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteByQueryRethrottle(params: T.DeleteByQueryRethrottleRequest, options?: TransportRequestOptions): TransportRequestPromise> + deletePit(params: T.PointInTimeDeleteRequest, options?: TransportRequestOptions): TransportRequestPromise> deleteScript(params: T.DeleteScriptRequest, options?: TransportRequestOptions): TransportRequestPromise> exists(params: T.ExistsRequest, options?: TransportRequestOptions): TransportRequestPromise> existsSource(params: T.ExistsSourceRequest, options?: TransportRequestOptions): TransportRequestPromise> @@ -155,6 +157,7 @@ interface OpenSearchDashboardsClient { } fieldCaps(params?: T.FieldCapsRequest, options?: TransportRequestOptions): TransportRequestPromise> get(params: T.GetRequest, options?: TransportRequestOptions): TransportRequestPromise, TContext>> + getAllPits(params: T.PointInTimeGetAllRequest, options?: TransportRequestOptions): TransportRequestPromise> getScript(params: T.GetScriptRequest, options?: TransportRequestOptions): TransportRequestPromise> getScriptContext(params?: T.GetScriptContextRequest, options?: TransportRequestOptions): TransportRequestPromise> getScriptLanguages(params?: T.GetScriptLanguagesRequest, options?: TransportRequestOptions): TransportRequestPromise> diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 651055772..3afc4fc57 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -524,6 +523,14 @@ export interface Create extends Generic { body: T; } +export interface CreatePit extends Generic { + index: string | string[]; + allow_partial_pit_creation?: boolean; + keep_alive: string; + preference?: string; + routing?: string | string[]; +} + export interface DanglingIndicesDeleteDanglingIndex extends Generic { index_uuid: string; accept_data_loss?: boolean; @@ -561,6 +568,8 @@ export interface Delete extends Generic { version_type?: 'internal' | 'external' | 'external_gte' | 'force'; } +export interface DeleteAllPits extends Generic { } + export interface DeleteByQuery extends Generic { index: string | string[]; _source_exclude?: string | string[]; @@ -606,6 +615,10 @@ export interface DeleteByQueryRethrottle extends Generic { requests_per_second: number; } +export interface DeletePit extends Generic { + body: T; +} + export interface DeleteScript extends Generic { id: string; timeout?: string; @@ -706,6 +719,8 @@ export interface Get extends Generic { version_type?: 'internal' | 'external' | 'external_gte' | 'force'; } +export interface GetAllPits extends Generic { } + export interface GetScript extends Generic { id: string; cluster_manager_timeout?: string; diff --git a/api/types.d.ts b/api/types.d.ts index 6ebe2e0ac..6628ce5da 100644 --- a/api/types.d.ts +++ b/api/types.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -41,12 +40,12 @@ export interface BulkIndexOperation extends BulkOperation { } export interface BulkIndexResponseItem extends BulkResponseItemBase { } export interface BulkOperation { - _id: Id; - _index: IndexName; - retry_on_conflict: integer; - routing: Routing; - version: VersionNumber; - version_type: VersionType; + _id?: Id; + _index?: IndexName; + retry_on_conflict?: integer; + routing?: Routing; + version?: VersionNumber; + version_type?: VersionType; } export interface BulkOperationContainer { @@ -9964,3 +9963,50 @@ export interface SpecUtilsCommonCatQueryParameters { s?: string[] v?: boolean } + +export interface PointInTime { + pit_id: string; + creation_time: Time; + keep_alive: Time +} + +export interface PointInTimeDelete { + pit_id: string; + successful: boolean +} + +export interface PointInTimeCreateRequest extends RequestBase { + index: Indices; + keep_alive: string; + preference?: string; + routing?: string; + expand_wildcards?: ExpandWildcards; + allow_partial_pit_creation?: boolean +} + +export interface PointInTimeCreateResponse extends ShardsOperationResponseBase { + pit_id: string; + creation_time: Time; +} + +export interface PointInTimeGetAllRequest extends RequestBase { } + +export interface PointInTimeGetAllResponse { + pits: PointInTime[]; +} + +export interface PointInTimeDeleteAllRequest extends RequestBase { } + +export interface PointInTimeDeleteAllResponse { + pits: PointInTimeDelete[]; +} + +export interface PointInTimeDeleteRequest extends RequestBase { + body?: { + pit_id: string[] + }; +} + +export interface PointInTimeDeleteResponse { + pits: PointInTimeDelete[]; +} diff --git a/api/utils.js b/api/utils.js index fc7d1c3c3..671e7b7bb 100644 --- a/api/utils.js +++ b/api/utils.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/guides/advanced_index_actions.md b/guides/advanced_index_actions.md new file mode 100644 index 000000000..faf5dc43d --- /dev/null +++ b/guides/advanced_index_actions.md @@ -0,0 +1,91 @@ +# Advanced Index Actions +In this guide, we will look at some advanced index actions that are not covered in the [Index Lifecycle](index_lifecycle.md) guide. + + +## Setup +Let's create a client instance, and an index named `movies`: +```javascript +const { Client } = require('@opensearch-project/opensearch'); +const client = new Client({ + node: 'https://admin:admin@localhost:9200', + ssl: { rejectUnauthorized: false } +}); +client.indices.create({index: 'movies'}) +``` +## API Actions +### Clear index cache +You can clear the cache of an index or indices by using the `indices.clear_cache` API action. The following example clears the cache of the `movies` index: + +```javascript +client.indices.clear_cache({index: 'movies'}) +``` + +By default, the `indices.clear_cache` API action clears all types of cache. To clear specific types of cache pass the the `query`, `fielddata`, or `request` parameter to the API action: + +```javascript +client.indices.clear_cache({index: 'movies', query: true}) +client.indices.clear_cache({index: 'movies', fielddata: true, request: true}) +``` + +### Flush index +Sometimes you might want to flush an index or indices to make sure that all data in the transaction log is persisted to the index. To flush an index or indices use the `indices.flush` API action. The following example flushes the `movies` index: + +```javascript +client.indices.flush({index: 'movies'}) +``` + +### Refresh index +You can refresh an index or indices to make sure that all changes are available for search. To refresh an index or indices use the `indices.refresh` API action: + +```javascript +client.indices.refresh({index: 'movies'}) +``` + +### Open/Close index +You can close an index to prevent read and write operations on the index. A closed index does not have to maintain certain data structures that an opened index require, reducing the memory and disk space required by the index. The following example closes and reopens the `movies` index: + +```javascript +client.indices.close({index: 'movies'}) +client.indices.open({index: 'movies'}) +``` +### Force merge index +You can force merge an index or indices to reduce the number of segments in the index. This can be useful if you have a large number of small segments in the index. Merging segments reduces the memory footprint of the index. Do note that this action is resource intensive and it is only recommended for read-only indices. The following example force merges the `movies` index: + +```javascript +client.indices.forcemerge({index: 'movies'}) +``` + +### Clone index +You can clone an index to create a new index with the same mappings, data, and MOST of the settings. The source index must be in read-only state for cloning. The following example blocks write operations from `movies` index, clones the said index to create a new index named `movies_clone`, then re-enables write: + +```javascript +client.indices.add_block({index: 'movies', block: 'write'}) +client.indices.clone({index: 'movies', target: 'movies_clone'}) +client.indices.put_settings({index: 'movies', body: { index: { blocks: { write: false } } } }) +``` + +### Split index +You can split an index into another index with more primary shards. The source index must be in read-only state for splitting. The following example create the read-only `books` index with 30 routing shards and 5 shards (which is divisible by 30), splits index into `bigger_books` with 10 shards (which is also divisible by 30), then re-enables write: + +```javascript +client.indices.create({ + index: 'books', + body: { settings: { + index: { number_of_shards: 5, + number_of_routing_shards: 30, + blocks: { write: true } } } } }) + +client.indices.split({ + index: 'books', + target: 'bigger_books', + body: { settings: { index: { number_of_shards: 10 } } } }) + +client.indices.put_settings({index: 'books', body: { index: { blocks: { write: false } } } }) +``` + +## Cleanup + +Let's delete all the indices we created in this guide: +```javascript +client.indices.delete({index: ['movies', 'books', 'movies_clone', 'bigger_books']}); +``` \ No newline at end of file diff --git a/guides/bulk.md b/guides/bulk.md new file mode 100644 index 000000000..4e76a5f60 --- /dev/null +++ b/guides/bulk.md @@ -0,0 +1,166 @@ +# Bulk + +In this guide, you'll learn how to use the OpenSearch JavaScript Client API to perform bulk operations. You'll learn how to index, update, and delete multiple documents in a single request. + +## Setup +First, create a client instance with the following code: + +```javascript +const { Client } = require('@opensearch-project/opensearch'); + +const client = new Client({ + node: 'http://localhost:9200', +}); +``` + +Next, create an index named `movies` and another named `books` with the default settings: + +```javascript +const movies = 'movies'; +const books = 'books'; + +client.indices.create({ index: movies }).then(() => { + console.log(`Index ${movies} created`); +}); + +client.indices.create({ index: books }).then(() => { + console.log(`Index ${books} created`); +}); +``` + + +## Bulk API + +The `bulk` API action allows you to perform document operations in a single request. The body of the request is an array of objects that contains the bulk operations and the target documents to index, create, update, or delete. + +### Indexing multiple documents +The following code creates two documents in the `movies` index and one document in the `books` index: + +```javascript +client.bulk({ + body: [ + { index: { _index: movies, _id: 1 } }, + { title: 'Beauty and the Beast', year: 1991 }, + { index: { _index: movies, _id: 2 } }, + { title: 'Beauty and the Beast - Live Action', year: 2017 }, + { index: { _index: books, _id: 1 } }, + { title: 'The Lion King', year: 1994 } + ] +}).then((response) => { + console.log(response); +}); +``` +As you can see, each bulk operation is comprised of two objects. The first object contains the operation type and the target document's `_index` and `_id`. The second object contains the document's data. As a result, the body of the request above contains six objects for three index actions. + +Alternatively, the `bulk` method can accept an array of hashes where each hash represents a single operation. The following code is equivalent to the previous example: + +```javascript +client.bulk({ + body: [ + { index: { _index: movies, _id: 1, data: { title: 'Beauty and the Beast', year: 1991 } } }, + { index: { _index: movies, _id: 2, data: { title: 'Beauty and the Beast - Live Action', year: 2017 } } }, + { index: { _index: books, _id: 1, data: { title: 'The Lion King', year: 1994 } } } + ] +}).then((response) => { + console.log(response); +}); +``` + +We will use this format for the rest of the examples in this guide. + +### Creating multiple documents + +Similarly, instead of calling the `create` method for each document, you can use the `bulk` API to create multiple documents in a single request. The following code creates three documents in the `movies` index and one in the `books` index: + +```javascript +client.bulk({ + index: movies, + body: [ + { create: { data: { title: 'Beauty and the Beast 2', year: 2030 } } }, + { create: { data: { title: 'Beauty and the Beast 3', year: 2031 } } }, + { create: { data: { title: 'Beauty and the Beast 4', year: 2049 } } }, + { create: { _index: books, data: { title: 'The Lion King 2', year: 1998 } } } + ] +}).then((response) => { + console.log(response); +}); +``` +Note that we specified only the `_index` for the last document in the request body. This is because the `bulk` method accepts an `index` parameter that specifies the default `_index` for all bulk operations in the request body. Moreover, we omit the `_id` for each document and let OpenSearch generate them for us in this example, just like we can with the `create` method. + +### Updating multiple documents +```javascript +client.bulk({ + index: movies, + body: [ + { update: { _id: 1, data: { doc: { year: 1992 } } } }, + { update: { _id: 2, data: { doc: { year: 2018 } } } } + ] +}).then((response) => { + console.log(response); +}); +``` +Note that the updated data is specified in the `doc` field of the `data` object. + + +### Deleting multiple documents +```javascript +client.bulk({ + index: movies, + body: [ + { delete: { _id: 1 } }, + { delete: { _id: 2 } } + ] +}).then((response) => { + console.log(response); +}); +``` + +### Mix and match operations +You can mix and match the different operations in a single request. The following code creates two documents, updates one document, and deletes another document: + +```javascript +client.bulk({ + index: movies, + body: [ + { create: { data: { title: 'Beauty and the Beast 5', year: 2050 } } }, + { create: { data: { title: 'Beauty and the Beast 6', year: 2051 } } }, + { update: { _id: 3, data: { doc: { year: 2052 } } } }, + { delete: { _id: 4 } } + ] +}).then((response) => { + console.log(response); +}); +``` + +### Handling errors +The `bulk` API returns an array of responses for each operation in the request body. Each response contains a `status` field that indicates whether the operation was successful or not. If the operation was successful, the `status` field is set to a `2xx` code. Otherwise, the response contains an error message in the `error` field. + +The following code shows how to look for errors in the response: + +```javascript +client.bulk({ + index: movies, + body: [ + { create: { _id: 1, data: { title: 'Beauty and the Beast', year: 1991 } } }, + { create: { _id: 2, data: { title: 'Beauty and the Beast 2', year: 2030 } } }, + { create: { _id: 1, data: { title: 'Beauty and the Beast 3', year: 2031 } } }, // document already exists error + { create: { _id: 2, data: { title: 'Beauty and the Beast 4', year: 2049 } } } // document already exists error + ] +}).then((response) => { + response.body.forEach((item) => { + const createStatus = item.create && item.create.status; + if (createStatus && !createStatus.toString().match(/2\d{2}/)) { + console.log(item.create.error.reason); + } + }); +}).catch((error) => { + console.error(error); +}); +``` + +## Cleanup +To clean up the resources created in this guide, delete the `movies` and `books` indices: + +```javascript +client.indices.delete({ index: [movies, books] }); +``` \ No newline at end of file diff --git a/guides/document_lifecycle.md b/guides/document_lifecycle.md new file mode 100644 index 000000000..06d27bf12 --- /dev/null +++ b/guides/document_lifecycle.md @@ -0,0 +1,162 @@ +# Document Lifecycle +This guide covers OpenSearch JavaScript Client API actions for Document Lifecycle. You'll learn how to create, read, update, and delete documents in your OpenSearch cluster. Whether you're new to OpenSearch or an experienced user, this guide provides the information you need to manage your document lifecycle effectively. + +## Setup +Assuming you have OpenSearch running locally on port 9200, you can create a client instance +with the following code: +```javascript +const { Client } = require('@opensearch-project/opensearch'); + +const client = new Client({ + node: 'http://localhost:9200', +}); +``` +Next, create an index named `movies` with the default settings: +```javascript +const index = 'movies'; +client.indices.exists({ index: index }) + .then(exists => { + if (!exists) { + return client.indices.create({ index: index }); + } + }) + .then(response => console.log(`Index ${response.body.index} created`)); +``` + +## Document API Actions +### Create a new document with specified ID +To create a new document, use the `create` or `index` API action. The following code creates two new documents with IDs of `1` and `2`: +```javascript +client.create({index: index, id: 1, body: { title: 'Beauty and the Beast', year: 1991 }}) +client.create({index: index, id: 2, body: { title: 'Beauty and the Beast - Live Action', year: 2017 }}) +``` +Note that the `create` action is NOT idempotent. If you try to create a document with an ID that already exists, the request will fail: + +```javascript +client.create({ index: index, id: 1, body: { title: 'Just Another Movie' } }) + .catch(err => console.log(`Error creating document: ${err}`)); +``` + +The `index` action, on the other hand, is idempotent. If you try to index a document with an existing ID, the request will succeed and overwrite the existing document. Note that no new document will be created in this case. You can think of the `index` action as an upsert: + +```javascript +client.index({index: index, id: 2, body: { title: 'Updated Title' }}) +client.index({index: index, id: 2, body: { title: 'The Lion King', year: 1994 }}) +``` + +### Create a new document with auto-generated ID +You can also create a new document with an auto-generated ID by omitting the `id` parameter. The following code creates documents with an auto-generated IDs in the `movies` index: +```javascript +puts client.create({index: index, body: { title: 'The Lion King 2', year: 1998 }}) +# OR client.index({index: index, body: { title: 'The Lion King 2', year: 1998 }}) +``` +In this case, the ID of the created document in the `result` field of the response body: +```javascript +{ + "_index": "movies", + "_type": "_doc", + "_id": "1", + "_version": 1, + "result": "created", + "_shards": { + "total": 2, + "successful": 1, + "failed": 0 + }, + "_seq_no": 0, + "_primary_term": 1 +} +``` + +### Get a document +To get a document, use the `get` API action. The following code gets the document with ID `1` from the `movies` index: +```javascript +client.get({ + index: index, + id: 1 +}).then(response => console.log(response._source)); +// OUTPUT: {"title": "Beauty and the Beast", "year": 1991} +``` +You can also use `_source_include` and `_source_exclude` parameters to specify which fields to include or exclude in the response: +```javascript +client.get({ + index: index, + id: 1, + _source_includes: ['title'] +}).then(response => console.log(response._source)); +// OUTPUT: {"title": "Beauty and the Beast"} +client.get({ + index: index, + id: 1, + _source_excludes: ['title'] +}).then(response => console.log(response._source)); +// OUTPUT: {"year": 1991} +``` + +### Get multiple documents +To get multiple documents, use the `mget` API action: +```javascript +client.mget({ + index: index, + body: { docs: [{ _id: 1 }, { _id: 2 }] } +}).then(response => { + const sources = response.docs.map(doc => doc._source); + console.log(sources); +}); +// OUTPUT: [ { title: 'Beauty and the Beast', year: 1991 }, { title: 'Beauty and the Beast - Live Action', year: 2017 } ] +``` + +### Check if a document exists +To check if a document exists, use the `exists` API action. The following code checks if the document with ID `1` exists in the `movies` index: +```javascript +client.exists({ + index: index, + id: 1 +}).then(response => { + console.log(response.body); +}); +``` + +### Update a document +To update a document, use the `update` API action. The following code updates the `year` field of the document with ID `1` in the `movies` index: +```javascript +client.update({index: index, id: 1, body: { doc: { year: 1995 } }}) +``` +Alternatively, you can use the `script` parameter to update a document using a script. The following code increments the `year` field of the of document with ID `1` by 5 using painless script, the default scripting language in OpenSearch: +```javascript +client.update({index: index, id: 1, body: { script: { source: 'ctx._source.year += 5' } }}) +``` +Note that while both `update` and `index` actions perform updates, they are not the same. The `update` action is a partial update, while the `index` action is a full update. The `update` action only updates the fields that are specified in the request body, while the `index` action overwrites the entire document with the new document. + +### Update multiple documents by query +To update documents that match a query, use the `update_by_query` API action. The following code decreases the `year` field of all documents with `year` greater than 2023: +```javascript +client.update_by_query({index: index, body: { + script: { source: 'ctx._source.year -= 1' }, + query: { range: { year: { gt: 2023 } } } +}}) +``` + +### Delete a document +To delete a document, use the `delete` API action. The following code deletes the document with ID `1`: +```javascript +client.delete({index: index, id: 1}) +``` +By default, the `delete` action is not idempotent. If you try to delete a document that does not exist, or delete the same document twice, you will run into Not Found (404) error. You can make the `delete` action idempotent by setting the `ignore` parameter to `404`: +```javascript +client.delete({index: index, id: 1, ignore: 404}) +``` + +### Delete multiple documents by query +To delete documents that match a query, use the `delete_by_query` API action. The following code deletes all documents with `year` greater than 2023: +```javascript +client.delete_by_query({index: index, body: { + query: { range: { year: { gt: 2023 } } } +}}) +``` + +## Cleanup +To clean up the resources created in this guide, delete the `movies` index: +```javascript +client.indices.delete({index: index}) +``` diff --git a/guides/index_lifecycle.md b/guides/index_lifecycle.md new file mode 100644 index 000000000..dbf19ebeb --- /dev/null +++ b/guides/index_lifecycle.md @@ -0,0 +1,152 @@ +# Index Lifecycle +This guide covers OpenSearch JavaScript Client API actions for Index Lifecycle. You'll learn how to create, read, update, and delete indices in your OpenSearch cluster. We will also leverage index templates to create default settings and mappings for indices of certain patterns. + +## Setup + +In this guide, we will need an OpenSearch cluster with more than one node. Let's use the sample [docker-compose.yml](https://opensearch.org/samples/docker-compose.yml) to start a cluster with two nodes. The cluster's API will be available at `localhost:9200` with basic authentication enabled with default username and password of `admin:admin`. + +To start the cluster, run the following command: + +```bash +cd /path/to/docker-compose.yml +docker-compose up -d +``` + +Let's create a client instance to access this cluster: + +```javascript +const { Client } = require('@opensearch-project/opensearch'); + +const client = new Client({ + node: 'https://admin:admin@localhost:9200', + ssl: { rejectUnauthorized: false } +}); + +client.info().then(response => { + console.log(response.body); +}); // Check server info and make sure the client is connected +``` + +## Index API Actions + +### Create a new index +You can quickly create an index with default settings and mappings by using the `indices.create` API action. The following example creates an index named `paintings` with default settings and mappings: + +```javascript +client.indices.create({index: 'paintings'}) +``` +To specify settings and mappings, you can pass them as the `body` of the request. The following example creates an index named `movies` with custom settings and mappings: + +```javascript +client.indices.create({ + index: 'movies', + body: { + settings: { + index: { + number_of_shards: 2, + number_of_replicas: 1 + } + }, + mappings: { + properties: { + title: { type: 'text' }, + year: { type: 'integer' } + } + } + } +}) +``` +When you create a new document for an index, OpenSearch will automatically create the index if it doesn't exist: + +```javascript +client.indices.exists({ index: 'burner' }).then((exists) => { + console.log(exists); // => false +}); +client.create({index: 'burner', body: { lorem: 'ipsum' }}); +client.indices.exists({ index: 'burner' }).then((exists) => { + console.log(exists); // => true +}); +``` + + +### Update an Index +You can update an index's settings and mappings by using the `indices.put_settings` and `indices.put_mapping` API actions. + +The following example updates the `movies` index's number of replicas to `0`: + +```javascript +client.indices.put_settings({ + index: 'movies', + body: { + index: { + number_of_replicas: 0 + } + } +}) +``` +The following example updates the `movies` index's mappings to add a new field named `director`: + +```javascript +client.indices.put_mapping({ + index: 'movies', + body: { + properties: { + director: { type: 'text' } + } + } +}) +``` + +### Get Metadata for an Index +Let's check if the index's settings and mappings have been updated by using the `indices.get` API action: + +```javascript +client.indices.get({ index: 'movies' }) + .then(response => console.log(response)) +``` +The response body contains the index's settings and mappings: + +```javascript +{ + "movies": { + "aliases": {}, + "mappings": { + "properties": { + "title": { "type": "text" }, + "year": { "type": "integer" }, + "director": { "type": "text" } + } + }, + "settings": { + "index": { + "creation_date": "1680297372024", + "number_of_shards": "2", + "number_of_replicas": "0", + "uuid": "FEDWXgmhSLyrCqWa8F_aiA", + "version": { "created": "136277827" }, + "provided_name": "movies" + } + } + } +} +``` +### Delete an Index +Let's delete the `movies` index by using the `indices.delete` API action: + +```javascript +client.indices.delete({index: 'movies'}) +``` +We can also delete multiple indices at once: + +```javascript +client.indices.delete({index: ['movies', 'paintings', 'burner'], ignore: 404}) +``` +Notice that we are passing `ignore: 404` to the request. This tells the client to ignore the `404` error if the index doesn't exist for deletion. Without it, the above `delete` request will throw an error because the `movies` index has already been deleted in the previous example. + +## Cleanup + +All resources created in this guide are automatically deleted when the cluster is stopped. You can stop the cluster by running the following command: + +```bash +docker-compose down +``` diff --git a/guides/index_template.md b/guides/index_template.md new file mode 100644 index 000000000..356ddcdf6 --- /dev/null +++ b/guides/index_template.md @@ -0,0 +1,228 @@ +# Index Template +Index templates are a convenient way to define settings, mappings, and aliases for one or more indices when they are created. In this guide, you'll learn how to create an index template and apply it to an index. + +## Setup + +Assuming you have OpenSearch running locally on port 9200, you can create a client instance +with the following code: +```javascript +const { Client } = require('@opensearch-project/opensearch'); + +const client = new Client({ + node: 'http://localhost:9200', +}); +``` + +## Index Template API Actions + +### Create an Index Template +You can create an index template to define default settings and mappings for indices of certain patterns. The following example creates an index template named `books` with default settings and mappings for indices of the `books-*` pattern: + +```javascript +client.indices.put_index_template({ + name: 'books', + body: { + index_patterns: ['books-*'], + settings: { + index: { + number_of_shards: 3, + number_of_replicas: 0 + } + }, + mappings: { + properties: { + title: { type: 'text' }, + author: { type: 'text' }, + published_on: { type: 'date' }, + pages: { type: 'integer' } + } + } + } +}).then(resp => { + console.log(`Index template created: ${resp}`); +}); +``` + +Now, when you create an index that matches the `books-*` pattern, OpenSearch will automatically apply the template's settings and mappings to the index. +Let's create an index named `books-nonfiction` and verify that its settings and mappings match those of the template: + +```javascript +client.indices.create({ index: 'books-nonfiction' }) +.then(() => { + return client.indices.get({ index: 'books-nonfiction' }); +}) +.then(response => { + console.log(response); +}); +``` + +### Multiple Index Templates +If multiple index templates match the index's name, OpenSearch will apply the template with the highest priority. The following example creates two index templates named `books-*` and `books-fiction-*` with different settings: + +```javascript +client.indices.put_index_template({ + name: 'books', + body: { + index_patterns: ['books-*'], + settings: { + index: { + number_of_shards: 3, + number_of_replicas: 0 + } + } + } +}) +.then(resp => { + console.log(`Index template created: ${resp}`); +}); + +client.indices.put_index_template({ + name: 'books-fiction', + body: { + index_patterns: ['books-fiction-*'], + priority: 1, # higher priority than the `books` template + template: { + settings: { + index: { + number_of_shards: 1, + number_of_replicas: 1 + } + } + } + } +}) +.then(resp => { + console.log(`Index template created: ${resp}`); +}); +``` + +When we create an index named `books-fiction-romance`, OpenSearch will apply the `books-fiction-*` template's settings to the index: + +```javascript +client.indices.create({ index: 'books-fiction-romance' }) +.then(() => { + return client.indices.get({ index: 'books-fiction-romance' }); +}) +.then(response => { + console.log(response); +}); +``` + +### Composable Index Templates +Composable index templates are a new type of index template that allow you to define multiple component templates and compose them into a final template. The following example creates a component template named `books_mappings` with default mappings for indices of the `books-*` and `books-fiction-*` patterns: + +```javascript +client.cluster.put_component_template({ + name: 'books_mappings', + body: { + template: { + mappings: { + properties: { + title: { type: 'text' }, + author: { type: 'text' }, + published_on: { type: 'date' }, + pages: { type: 'integer' } + } + } + } + } +}) +.then(resp => { + console.log(`Component template created: ${resp}`); +}); + +client.indices.put_index_template({ + name: 'books', + body: { + index_patterns: ['books-*'], + composed_of: ['books_mappings'], # use the `books_mappings` component template + priority: 0, + template: { + settings: { + index: { + number_of_shards: 3, + number_of_replicas: 0 + } + } + } + } +}) +.then(resp => { + console.log(`Index template created: ${resp}`); +}); + +client.indices.put_index_template({ + name: 'books', + body: { + index_patterns: ['books-*'], + composed_of: ['books_mappings'], # use the `books_mappings` component template + priority: 1, + template: { + settings: { + index: { + number_of_shards: 1, + number_of_replicas: 1 + } + } + } + } +}) +.then(resp => { + console.log(`Index template created: ${resp}`); +}); +``` + +When we create an index named `books-fiction-horror`, OpenSearch will apply the `books-fiction-*` template's settings, and `books_mappings` template mappings to the index: + +```javascript +client.indices.create({ index: 'books-fiction-horror' }) +.then(() => { + return client.indices.get({ index: 'books-fiction-horror' }); +}) +.then(response => { + console.log(response); +}); +``` + +### Get an Index Template +You can get an index template with the `get_index_template` API action: + +```javascript +client.indices.get_index_template({name: 'books'}).then(response => { + console.log(response.body); +}); +``` + +### Delete an Index Template +You can delete an index template with the `delete_template` API action: + +```javascript +client.indices.delete_index_template({ + name: 'books' +}).then((response) => { + console.log(`Index template deleted: ${response}`); +}); +``` + +## Cleanup +Let's delete all resources created in this guide: + +```javascript +client.indices.delete({ + index: 'books-*' +}).then(response => { + console.log(`Index deleted: ${response}`) +}); + +client.indices.delete_index_template({ + name: 'books-fiction' +}).then(response => { + console.log(`Index template deleted: ${response}`) +}); + +client.cluster.delete_index_template({ + name: 'books_mappings' +}).then(response => { + console.log(`Component template deleted: ${response}`) +}); +``` diff --git a/guides/search.md b/guides/search.md new file mode 100644 index 000000000..7421e9708 --- /dev/null +++ b/guides/search.md @@ -0,0 +1,217 @@ +# Search +OpenSearch provides a powerful search API that allows you to search for documents in an index. The search API supports a number of parameters that allow you to customize the search operation. In this guide, we will explore the search API and its parameters. +# Setup +Let's start by creating an index and adding some documents to it: +```javascript +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) + }, +}); + +await client.indices.create({index: 'movies'}); + +for(let i = 0; i < 10; i++) { + await client.index({ + index: 'movies', + id: i, + body: { + title: `The Dark Knight ${i}`, + director: 'Christopher Nolan', + year: 2008 + i + } + }); +} + +await client.index({ + index: 'movies', + body: { + title: 'The Godfather', + director: 'Francis Ford Coppola', + year: 1972 + } +}); + +await client.index({ + index: 'movies', + body: { + title: 'The Shawshank Redemption', + director: 'Frank Darabont', + year: 1994 + } +}); + +await client.index({index: 'movies', refresh: true}); +``` +# Search API +### Basic Search +The search API allows you to search for documents in an index. The following example searches for ALL documents in the movies index: + +```javascript +const response = await client.search({ + index: 'movies' +}); +``` +You can also search for documents that match a specific query. The following example searches for documents that match the query `dark knight`: +```javascript +const response = await client.search({ + index: 'movies', + body: { + query: { + match: { + title: 'dark knight' + } + } + } +}); +console.log(response.body.hits.hits); +``` + +OpenSearch query DSL allows you to specify complex queries. Check out the [OpenSearch query DSL documentation](https://opensearch.org/docs/latest/query-dsl/) for more information. + +### Basic Pagination +The search API allows you to paginate through the search results. The following example searches for documents that match the query `dark knight`, sorted by `year` in ascending order, and returns the first 2 results after skipping the first 5 results: +```javascript +search_body = { + query: { + match: { + title: 'dark knight' + } + }, + sort: [ + { + year: { + order: 'asc' + } + } + ] +} + +await client.search({ + index: 'movies', + size: 2, + from: 5, + body: search_body +}); +``` + +With sorting, you can also use the `search_after` parameter to paginate through the search results. Let's say you have already displayed the first page of results, and you want to display the next page. You can use the `search_after` parameter to paginate through the search results. The following example will demonstrate how to get the first 3 pages of results using the search query of the previous example: +```javascript +const page_1 = await client.search({ + index: 'movies', + size: 2, + body: search_body +}); + +const page_2 = await client.search({ + index: 'movies', + size: 2, + body: { + ...search_body, + search_after: page_1[page_1.length - 1].sort + } +}); + +const page_3 = await client.search({ + index: 'movies', + size: 2, + body: { + ...search_body, + search_after: page_2[page_2.length - 1].sort + } +}) +``` +### Pagination with scroll +When retrieving large amounts of non-real-time data, you can use the `scroll` parameter to paginate through the search results. +```javascript +const page_1 = await client.search({ + index: 'movies', + scroll: '1m', + size: 2, + body: search_body +}); + +const page_2 = await client.scroll({ + scroll_id: page_1._scroll_id, + scroll: '1m' +}); + +const page_3 = await client.scroll({ + scroll_id: page_2._scroll_id, + scroll: '1m' +}); +``` +### Pagination with point in time +The scroll example above has one weakness: if the index is updated while you are scrolling through the results, they will be paginated inconsistently. To avoid this, you should use the "Point in Time" feature. The following example demonstrates how to use the `point_in_time` and `pit_id` parameters to paginate through the search results: +```javascript +/** Create a point in time */ +const pit = client.create_pit({ + index: 'movies', + keep_alive: '1m' +}); + +/** Include pit info in the search body */ +const pit_search_body = { + ..search_body, + pit: { + id: pit.pit_id, + keep_alive: '1m' + } +} + +/** Get the first 3 pages of results */ +const page_1 = await client.search({ + size: 2, + body: pit_search_body +}); +console.log(page_1.body.hits.hits); + +const page_2 = await client.search({ + size: 2, + body: { + ...pit_search_body, + search_after: page_1[page_1.length - 1].sort + } +}); +console.log(page_2.body.hits.hits); + +const page_3 = await client.search({ + size: 2, + body: { + ...pit_search_body, + search_after: page2[page_2.length-1].sort + } +}); +console.log(page_3.body.hits.hits); + +/** Print out the titles of the first 3 pages of results */ +console.log(page_1.map(hit => hit._source.title)); +console.log(page_2.map(hit => hit._source.title)); +console.log(page_3.map(hit => hit._source.title)); + +/** Delete the point in time */ +client.delete_pit({body: {pit_id: pit.pit_id}}); +``` +Note that a point-in-time is associated with an index or a set of index. So, when performing a search with a point-in-time, you DO NOT specify the index in the search. +# Cleanup +```javascript +await client.indices.delete({index: 'movies'}); +``` \ No newline at end of file diff --git a/index.d.ts b/index.d.ts index 328664ea4..2adf63aa3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -45,6 +44,7 @@ import Transport, { RequestBody, RequestNDBody, Context, + MemoryCircuitBreakerOptions, } from './lib/Transport'; import { URL } from 'url'; import Connection, { AgentOptions, agentFn } from './lib/Connection'; @@ -91,7 +91,7 @@ interface NodeOptions { ssl?: TlsConnectionOptions; headers?: Record; roles?: { - cluster_manager?: boolean + cluster_manager?: boolean; /** * @deprecated use cluster_manager instead */ @@ -137,10 +137,7 @@ interface ClientOptions { password?: string; }; disablePrototypePoisoningProtection?: boolean | 'proto' | 'constructor'; - memoryCircuitBreaker?: { - enabled: boolean; - maxPercentage: number; - }; + memoryCircuitBreaker?: MemoryCircuitBreakerOptions; } declare class Client { @@ -196,123 +193,451 @@ declare class Client { callback: callbackFn ): TransportRequestCallback; cat: { - aliases, TContext = Context>(params?: RequestParams.CatAliases, options?: TransportRequestOptions): TransportRequestPromise> - aliases, TContext = Context>(callback: callbackFn): TransportRequestCallback - aliases, TContext = Context>(params: RequestParams.CatAliases, callback: callbackFn): TransportRequestCallback - aliases, TContext = Context>(params: RequestParams.CatAliases, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - allocation, TContext = Context>(params?: RequestParams.CatAllocation, options?: TransportRequestOptions): TransportRequestPromise> - allocation, TContext = Context>(callback: callbackFn): TransportRequestCallback - allocation, TContext = Context>(params: RequestParams.CatAllocation, callback: callbackFn): TransportRequestCallback - allocation, TContext = Context>(params: RequestParams.CatAllocation, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - cluster_manager, TContext = Context>(params?: RequestParams.CatClusterManager, options?: TransportRequestOptions): TransportRequestPromise> - cluster_manager, TContext = Context>(callback: callbackFn): TransportRequestCallback - cluster_manager, TContext = Context>(params: RequestParams.CatClusterManager, callback: callbackFn): TransportRequestCallback - cluster_manager, TContext = Context>(params: RequestParams.CatClusterManager, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - count, TContext = Context>(params?: RequestParams.CatCount, options?: TransportRequestOptions): TransportRequestPromise> - count, TContext = Context>(callback: callbackFn): TransportRequestCallback - count, TContext = Context>(params: RequestParams.CatCount, callback: callbackFn): TransportRequestCallback - count, TContext = Context>(params: RequestParams.CatCount, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - fielddata, TContext = Context>(params?: RequestParams.CatFielddata, options?: TransportRequestOptions): TransportRequestPromise> - fielddata, TContext = Context>(callback: callbackFn): TransportRequestCallback - fielddata, TContext = Context>(params: RequestParams.CatFielddata, callback: callbackFn): TransportRequestCallback - fielddata, TContext = Context>(params: RequestParams.CatFielddata, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - health, TContext = Context>(params?: RequestParams.CatHealth, options?: TransportRequestOptions): TransportRequestPromise> - health, TContext = Context>(callback: callbackFn): TransportRequestCallback - health, TContext = Context>(params: RequestParams.CatHealth, callback: callbackFn): TransportRequestCallback - health, TContext = Context>(params: RequestParams.CatHealth, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - help, TContext = Context>(params?: RequestParams.CatHelp, options?: TransportRequestOptions): TransportRequestPromise> - help, TContext = Context>(callback: callbackFn): TransportRequestCallback - help, TContext = Context>(params: RequestParams.CatHelp, callback: callbackFn): TransportRequestCallback - help, TContext = Context>(params: RequestParams.CatHelp, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - indices, TContext = Context>(params?: RequestParams.CatIndices, options?: TransportRequestOptions): TransportRequestPromise> - indices, TContext = Context>(callback: callbackFn): TransportRequestCallback - indices, TContext = Context>(params: RequestParams.CatIndices, callback: callbackFn): TransportRequestCallback - indices, TContext = Context>(params: RequestParams.CatIndices, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + aliases, TContext = Context>( + params?: RequestParams.CatAliases, + options?: TransportRequestOptions + ): TransportRequestPromise>; + aliases, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + aliases, TContext = Context>( + params: RequestParams.CatAliases, + callback: callbackFn + ): TransportRequestCallback; + aliases, TContext = Context>( + params: RequestParams.CatAliases, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + allocation, TContext = Context>( + params?: RequestParams.CatAllocation, + options?: TransportRequestOptions + ): TransportRequestPromise>; + allocation, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + allocation, TContext = Context>( + params: RequestParams.CatAllocation, + callback: callbackFn + ): TransportRequestCallback; + allocation, TContext = Context>( + params: RequestParams.CatAllocation, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + cluster_manager, TContext = Context>( + params?: RequestParams.CatClusterManager, + options?: TransportRequestOptions + ): TransportRequestPromise>; + cluster_manager, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + cluster_manager, TContext = Context>( + params: RequestParams.CatClusterManager, + callback: callbackFn + ): TransportRequestCallback; + cluster_manager, TContext = Context>( + params: RequestParams.CatClusterManager, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + count, TContext = Context>( + params?: RequestParams.CatCount, + options?: TransportRequestOptions + ): TransportRequestPromise>; + count, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + count, TContext = Context>( + params: RequestParams.CatCount, + callback: callbackFn + ): TransportRequestCallback; + count, TContext = Context>( + params: RequestParams.CatCount, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + fielddata, TContext = Context>( + params?: RequestParams.CatFielddata, + options?: TransportRequestOptions + ): TransportRequestPromise>; + fielddata, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + fielddata, TContext = Context>( + params: RequestParams.CatFielddata, + callback: callbackFn + ): TransportRequestCallback; + fielddata, TContext = Context>( + params: RequestParams.CatFielddata, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + health, TContext = Context>( + params?: RequestParams.CatHealth, + options?: TransportRequestOptions + ): TransportRequestPromise>; + health, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + health, TContext = Context>( + params: RequestParams.CatHealth, + callback: callbackFn + ): TransportRequestCallback; + health, TContext = Context>( + params: RequestParams.CatHealth, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + help, TContext = Context>( + params?: RequestParams.CatHelp, + options?: TransportRequestOptions + ): TransportRequestPromise>; + help, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + help, TContext = Context>( + params: RequestParams.CatHelp, + callback: callbackFn + ): TransportRequestCallback; + help, TContext = Context>( + params: RequestParams.CatHelp, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + indices, TContext = Context>( + params?: RequestParams.CatIndices, + options?: TransportRequestOptions + ): TransportRequestPromise>; + indices, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + indices, TContext = Context>( + params: RequestParams.CatIndices, + callback: callbackFn + ): TransportRequestCallback; + indices, TContext = Context>( + params: RequestParams.CatIndices, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; /** - * // TODO: delete cat.master when it is removed from OpenSearch - * @deprecated use cat.cluster_manager instead - */ - master, TContext = Context>(params?: RequestParams.CatMaster, options?: TransportRequestOptions): TransportRequestPromise> + * // TODO: delete cat.master when it is removed from OpenSearch + * @deprecated use cat.cluster_manager instead + */ + master, TContext = Context>( + params?: RequestParams.CatMaster, + options?: TransportRequestOptions + ): TransportRequestPromise>; /** - * // TODO: delete cat.master when it is removed from OpenSearch - * @deprecated use cat.cluster_manager instead - */ - master, TContext = Context>(callback: callbackFn): TransportRequestCallback + * // TODO: delete cat.master when it is removed from OpenSearch + * @deprecated use cat.cluster_manager instead + */ + master, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; /** - * // TODO: delete cat.master when it is removed from OpenSearch - * @deprecated use cat.cluster_manager instead - */ - master, TContext = Context>(params: RequestParams.CatMaster, callback: callbackFn): TransportRequestCallback + * // TODO: delete cat.master when it is removed from OpenSearch + * @deprecated use cat.cluster_manager instead + */ + master, TContext = Context>( + params: RequestParams.CatMaster, + callback: callbackFn + ): TransportRequestCallback; /** - * // TODO: delete cat.master when it is removed from OpenSearch - * @deprecated use cat.cluster_manager instead - */ - master, TContext = Context>(params: RequestParams.CatMaster, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - nodeattrs, TContext = Context>(params?: RequestParams.CatNodeattrs, options?: TransportRequestOptions): TransportRequestPromise> - nodeattrs, TContext = Context>(callback: callbackFn): TransportRequestCallback - nodeattrs, TContext = Context>(params: RequestParams.CatNodeattrs, callback: callbackFn): TransportRequestCallback - nodeattrs, TContext = Context>(params: RequestParams.CatNodeattrs, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - nodes, TContext = Context>(params?: RequestParams.CatNodes, options?: TransportRequestOptions): TransportRequestPromise> - nodes, TContext = Context>(callback: callbackFn): TransportRequestCallback - nodes, TContext = Context>(params: RequestParams.CatNodes, callback: callbackFn): TransportRequestCallback - nodes, TContext = Context>(params: RequestParams.CatNodes, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - pending_tasks, TContext = Context>(params?: RequestParams.CatPendingTasks, options?: TransportRequestOptions): TransportRequestPromise> - pending_tasks, TContext = Context>(callback: callbackFn): TransportRequestCallback - pending_tasks, TContext = Context>(params: RequestParams.CatPendingTasks, callback: callbackFn): TransportRequestCallback - pending_tasks, TContext = Context>(params: RequestParams.CatPendingTasks, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - pendingTasks, TContext = Context>(params?: RequestParams.CatPendingTasks, options?: TransportRequestOptions): TransportRequestPromise> - pendingTasks, TContext = Context>(callback: callbackFn): TransportRequestCallback - pendingTasks, TContext = Context>(params: RequestParams.CatPendingTasks, callback: callbackFn): TransportRequestCallback - pendingTasks, TContext = Context>(params: RequestParams.CatPendingTasks, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - plugins, TContext = Context>(params?: RequestParams.CatPlugins, options?: TransportRequestOptions): TransportRequestPromise> - plugins, TContext = Context>(callback: callbackFn): TransportRequestCallback - plugins, TContext = Context>(params: RequestParams.CatPlugins, callback: callbackFn): TransportRequestCallback - plugins, TContext = Context>(params: RequestParams.CatPlugins, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - recovery, TContext = Context>(params?: RequestParams.CatRecovery, options?: TransportRequestOptions): TransportRequestPromise> - recovery, TContext = Context>(callback: callbackFn): TransportRequestCallback - recovery, TContext = Context>(params: RequestParams.CatRecovery, callback: callbackFn): TransportRequestCallback - recovery, TContext = Context>(params: RequestParams.CatRecovery, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - repositories, TContext = Context>(params?: RequestParams.CatRepositories, options?: TransportRequestOptions): TransportRequestPromise> - repositories, TContext = Context>(callback: callbackFn): TransportRequestCallback - repositories, TContext = Context>(params: RequestParams.CatRepositories, callback: callbackFn): TransportRequestCallback - repositories, TContext = Context>(params: RequestParams.CatRepositories, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - segments, TContext = Context>(params?: RequestParams.CatSegments, options?: TransportRequestOptions): TransportRequestPromise> - segments, TContext = Context>(callback: callbackFn): TransportRequestCallback - segments, TContext = Context>(params: RequestParams.CatSegments, callback: callbackFn): TransportRequestCallback - segments, TContext = Context>(params: RequestParams.CatSegments, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - shards, TContext = Context>(params?: RequestParams.CatShards, options?: TransportRequestOptions): TransportRequestPromise> - shards, TContext = Context>(callback: callbackFn): TransportRequestCallback - shards, TContext = Context>(params: RequestParams.CatShards, callback: callbackFn): TransportRequestCallback - shards, TContext = Context>(params: RequestParams.CatShards, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - snapshots, TContext = Context>(params?: RequestParams.CatSnapshots, options?: TransportRequestOptions): TransportRequestPromise> - snapshots, TContext = Context>(callback: callbackFn): TransportRequestCallback - snapshots, TContext = Context>(params: RequestParams.CatSnapshots, callback: callbackFn): TransportRequestCallback - snapshots, TContext = Context>(params: RequestParams.CatSnapshots, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - tasks, TContext = Context>(params?: RequestParams.CatTasks, options?: TransportRequestOptions): TransportRequestPromise> - tasks, TContext = Context>(callback: callbackFn): TransportRequestCallback - tasks, TContext = Context>(params: RequestParams.CatTasks, callback: callbackFn): TransportRequestCallback - tasks, TContext = Context>(params: RequestParams.CatTasks, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - templates, TContext = Context>(params?: RequestParams.CatTemplates, options?: TransportRequestOptions): TransportRequestPromise> - templates, TContext = Context>(callback: callbackFn): TransportRequestCallback - templates, TContext = Context>(params: RequestParams.CatTemplates, callback: callbackFn): TransportRequestCallback - templates, TContext = Context>(params: RequestParams.CatTemplates, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - thread_pool, TContext = Context>(params?: RequestParams.CatThreadPool, options?: TransportRequestOptions): TransportRequestPromise> - thread_pool, TContext = Context>(callback: callbackFn): TransportRequestCallback - thread_pool, TContext = Context>(params: RequestParams.CatThreadPool, callback: callbackFn): TransportRequestCallback - thread_pool, TContext = Context>(params: RequestParams.CatThreadPool, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - threadPool, TContext = Context>(params?: RequestParams.CatThreadPool, options?: TransportRequestOptions): TransportRequestPromise> - threadPool, TContext = Context>(callback: callbackFn): TransportRequestCallback - threadPool, TContext = Context>(params: RequestParams.CatThreadPool, callback: callbackFn): TransportRequestCallback - threadPool, TContext = Context>(params: RequestParams.CatThreadPool, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - } - clear_scroll, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.ClearScroll, options?: TransportRequestOptions): TransportRequestPromise> - clear_scroll, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - clear_scroll, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.ClearScroll, callback: callbackFn): TransportRequestCallback - clear_scroll, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.ClearScroll, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback - clearScroll, TRequestBody extends RequestBody = Record, TContext = Context>(params?: RequestParams.ClearScroll, options?: TransportRequestOptions): TransportRequestPromise> - clearScroll, TRequestBody extends RequestBody = Record, TContext = Context>(callback: callbackFn): TransportRequestCallback - clearScroll, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.ClearScroll, callback: callbackFn): TransportRequestCallback - clearScroll, TRequestBody extends RequestBody = Record, TContext = Context>(params: RequestParams.ClearScroll, options: TransportRequestOptions, callback: callbackFn): TransportRequestCallback + * // TODO: delete cat.master when it is removed from OpenSearch + * @deprecated use cat.cluster_manager instead + */ + master, TContext = Context>( + params: RequestParams.CatMaster, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + nodeattrs, TContext = Context>( + params?: RequestParams.CatNodeattrs, + options?: TransportRequestOptions + ): TransportRequestPromise>; + nodeattrs, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + nodeattrs, TContext = Context>( + params: RequestParams.CatNodeattrs, + callback: callbackFn + ): TransportRequestCallback; + nodeattrs, TContext = Context>( + params: RequestParams.CatNodeattrs, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + nodes, TContext = Context>( + params?: RequestParams.CatNodes, + options?: TransportRequestOptions + ): TransportRequestPromise>; + nodes, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + nodes, TContext = Context>( + params: RequestParams.CatNodes, + callback: callbackFn + ): TransportRequestCallback; + nodes, TContext = Context>( + params: RequestParams.CatNodes, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + pending_tasks, TContext = Context>( + params?: RequestParams.CatPendingTasks, + options?: TransportRequestOptions + ): TransportRequestPromise>; + pending_tasks, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + pending_tasks, TContext = Context>( + params: RequestParams.CatPendingTasks, + callback: callbackFn + ): TransportRequestCallback; + pending_tasks, TContext = Context>( + params: RequestParams.CatPendingTasks, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + pendingTasks, TContext = Context>( + params?: RequestParams.CatPendingTasks, + options?: TransportRequestOptions + ): TransportRequestPromise>; + pendingTasks, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + pendingTasks, TContext = Context>( + params: RequestParams.CatPendingTasks, + callback: callbackFn + ): TransportRequestCallback; + pendingTasks, TContext = Context>( + params: RequestParams.CatPendingTasks, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + plugins, TContext = Context>( + params?: RequestParams.CatPlugins, + options?: TransportRequestOptions + ): TransportRequestPromise>; + plugins, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + plugins, TContext = Context>( + params: RequestParams.CatPlugins, + callback: callbackFn + ): TransportRequestCallback; + plugins, TContext = Context>( + params: RequestParams.CatPlugins, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + recovery, TContext = Context>( + params?: RequestParams.CatRecovery, + options?: TransportRequestOptions + ): TransportRequestPromise>; + recovery, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + recovery, TContext = Context>( + params: RequestParams.CatRecovery, + callback: callbackFn + ): TransportRequestCallback; + recovery, TContext = Context>( + params: RequestParams.CatRecovery, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + repositories, TContext = Context>( + params?: RequestParams.CatRepositories, + options?: TransportRequestOptions + ): TransportRequestPromise>; + repositories, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + repositories, TContext = Context>( + params: RequestParams.CatRepositories, + callback: callbackFn + ): TransportRequestCallback; + repositories, TContext = Context>( + params: RequestParams.CatRepositories, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + segments, TContext = Context>( + params?: RequestParams.CatSegments, + options?: TransportRequestOptions + ): TransportRequestPromise>; + segments, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + segments, TContext = Context>( + params: RequestParams.CatSegments, + callback: callbackFn + ): TransportRequestCallback; + segments, TContext = Context>( + params: RequestParams.CatSegments, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + shards, TContext = Context>( + params?: RequestParams.CatShards, + options?: TransportRequestOptions + ): TransportRequestPromise>; + shards, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + shards, TContext = Context>( + params: RequestParams.CatShards, + callback: callbackFn + ): TransportRequestCallback; + shards, TContext = Context>( + params: RequestParams.CatShards, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + snapshots, TContext = Context>( + params?: RequestParams.CatSnapshots, + options?: TransportRequestOptions + ): TransportRequestPromise>; + snapshots, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + snapshots, TContext = Context>( + params: RequestParams.CatSnapshots, + callback: callbackFn + ): TransportRequestCallback; + snapshots, TContext = Context>( + params: RequestParams.CatSnapshots, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + tasks, TContext = Context>( + params?: RequestParams.CatTasks, + options?: TransportRequestOptions + ): TransportRequestPromise>; + tasks, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + tasks, TContext = Context>( + params: RequestParams.CatTasks, + callback: callbackFn + ): TransportRequestCallback; + tasks, TContext = Context>( + params: RequestParams.CatTasks, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + templates, TContext = Context>( + params?: RequestParams.CatTemplates, + options?: TransportRequestOptions + ): TransportRequestPromise>; + templates, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + templates, TContext = Context>( + params: RequestParams.CatTemplates, + callback: callbackFn + ): TransportRequestCallback; + templates, TContext = Context>( + params: RequestParams.CatTemplates, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + thread_pool, TContext = Context>( + params?: RequestParams.CatThreadPool, + options?: TransportRequestOptions + ): TransportRequestPromise>; + thread_pool, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + thread_pool, TContext = Context>( + params: RequestParams.CatThreadPool, + callback: callbackFn + ): TransportRequestCallback; + thread_pool, TContext = Context>( + params: RequestParams.CatThreadPool, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + threadPool, TContext = Context>( + params?: RequestParams.CatThreadPool, + options?: TransportRequestOptions + ): TransportRequestPromise>; + threadPool, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + threadPool, TContext = Context>( + params: RequestParams.CatThreadPool, + callback: callbackFn + ): TransportRequestCallback; + threadPool, TContext = Context>( + params: RequestParams.CatThreadPool, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + }; + clear_scroll< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params?: RequestParams.ClearScroll, + options?: TransportRequestOptions + ): TransportRequestPromise>; + clear_scroll< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >(callback: callbackFn): TransportRequestCallback; + clear_scroll< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params: RequestParams.ClearScroll, + callback: callbackFn + ): TransportRequestCallback; + clear_scroll< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params: RequestParams.ClearScroll, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + clearScroll< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params?: RequestParams.ClearScroll, + options?: TransportRequestOptions + ): TransportRequestPromise>; + clearScroll< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >(callback: callbackFn): TransportRequestCallback; + clearScroll< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params: RequestParams.ClearScroll, + callback: callbackFn + ): TransportRequestCallback; + clearScroll< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params: RequestParams.ClearScroll, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; cluster: { allocation_explain< TResponse = Record, @@ -903,6 +1228,38 @@ declare class Client { options: TransportRequestOptions, callback: callbackFn ): TransportRequestCallback; + create_pit, TContext = Context>( + params?: RequestParams.CreatePit, + options?: TransportRequestOptions + ): TransportRequestPromise>; + create_pit, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + create_pit, TContext = Context>( + params: RequestParams.CreatePit, + callback: callbackFn + ): TransportRequestCallback; + create_pit, TContext = Context>( + params: RequestParams.CreatePit, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + createPit, TContext = Context>( + params?: RequestParams.CreatePit, + options?: TransportRequestOptions + ): TransportRequestPromise>; + createPit, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + createPit, TContext = Context>( + params: RequestParams.CreatePit, + callback: callbackFn + ): TransportRequestCallback; + createPit, TContext = Context>( + params: RequestParams.CreatePit, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; dangling_indices: { delete_dangling_index, TContext = Context>( params?: RequestParams.DanglingIndicesDeleteDanglingIndex, @@ -1115,6 +1472,38 @@ declare class Client { options: TransportRequestOptions, callback: callbackFn ): TransportRequestCallback; + delete_all_pits, TContext = Context>( + params?: RequestParams.DeleteAllPits, + options?: TransportRequestOptions + ): TransportRequestPromise>; + delete_all_pits, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + delete_all_pits, TContext = Context>( + params: RequestParams.DeleteAllPits, + callback: callbackFn + ): TransportRequestCallback; + delete_all_pits, TContext = Context>( + params: RequestParams.DeleteAllPits, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + deleteAllPits, TContext = Context>( + params?: RequestParams.DeleteAllPits, + options?: TransportRequestOptions + ): TransportRequestPromise>; + deleteAllPits, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + deleteAllPits, TContext = Context>( + params: RequestParams.DeleteAllPits, + callback: callbackFn + ): TransportRequestCallback; + deleteAllPits, TContext = Context>( + params: RequestParams.DeleteAllPits, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; delete_by_query< TResponse = Record, TRequestBody extends RequestBody = Record, @@ -1207,6 +1596,70 @@ declare class Client { options: TransportRequestOptions, callback: callbackFn ): TransportRequestCallback; + delete_pit< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params?: RequestParams.DeletePit, + options?: TransportRequestOptions + ): TransportRequestPromise>; + delete_pit< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + callback: callbackFn + ): TransportRequestCallback; + delete_pit< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params: RequestParams.DeletePit, + callback: callbackFn + ): TransportRequestCallback; + delete_pit< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params: RequestParams.DeletePit, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + deletePit< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params?: RequestParams.DeletePit, + options?: TransportRequestOptions + ): TransportRequestPromise>; + deletePit< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + callback: callbackFn + ): TransportRequestCallback; + deletePit< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params: RequestParams.DeletePit, + callback: callbackFn + ): TransportRequestCallback; + deletePit< + TResponse = Record, + TRequestBody extends RequestBody = Record, + TContext = Context + >( + params: RequestParams.DeletePit, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; delete_script, TContext = Context>( params?: RequestParams.DeleteScript, options?: TransportRequestOptions @@ -1459,6 +1912,38 @@ declare class Client { options: TransportRequestOptions, callback: callbackFn ): TransportRequestCallback; + get_all_pits, TContext = Context>( + params?: RequestParams.GetAllPits, + options?: TransportRequestOptions + ): TransportRequestPromise>; + get_all_pits, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + get_all_pits, TContext = Context>( + params: RequestParams.GetAllPits, + callback: callbackFn + ): TransportRequestCallback; + get_all_pits, TContext = Context>( + params: RequestParams.GetAllPits, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; + getAllPits, TContext = Context>( + params?: RequestParams.GetAllPits, + options?: TransportRequestOptions + ): TransportRequestPromise>; + getAllPits, TContext = Context>( + callback: callbackFn + ): TransportRequestCallback; + getAllPits, TContext = Context>( + params: RequestParams.GetAllPits, + callback: callbackFn + ): TransportRequestCallback; + getAllPits, TContext = Context>( + params: RequestParams.GetAllPits, + options: TransportRequestOptions, + callback: callbackFn + ): TransportRequestCallback; get_script, TContext = Context>( params?: RequestParams.GetScript, options?: TransportRequestOptions diff --git a/index.js b/index.js index e36a0b679..04a83d5c7 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -286,7 +285,7 @@ class Client extends OpenSearchAPI { close(callback) { if (callback == null) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { this.close(resolve); }); } diff --git a/index.mjs b/index.mjs index 75ef740d9..2d2d89e7f 100644 --- a/index.mjs +++ b/index.mjs @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/lib/Connection.d.ts b/lib/Connection.d.ts index a400c43b3..0dc40d3a1 100644 --- a/lib/Connection.d.ts +++ b/lib/Connection.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/lib/Connection.js b/lib/Connection.js index 66f562c68..680b94026 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -135,7 +134,7 @@ class Connection { request.once('error', () => {}); // we need to catch the request aborted error debug('Request aborted', params); this._openRequests--; - callback(new RequestAbortedError(), null); + callback(new RequestAbortedError('Request aborted'), null); }; request.on('response', onResponse); @@ -218,7 +217,7 @@ class Connection { origin: url.origin, // https://github.com/elastic/elasticsearch-js/issues/843 port: url.port !== '' ? url.port : undefined, - headers: this.headers, + headers: Object.assign({}, this.headers), agent: this.agent, }; @@ -249,7 +248,8 @@ class Connection { // We want to hide `auth`, `agent` and `ssl` since they made // the logs very hard to read. The user can still // 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; return { @@ -265,6 +265,7 @@ class Connection { } toJSON() { + // eslint-disable-next-line no-unused-vars const { authorization, ...headers } = this.headers; return { diff --git a/lib/Helpers.d.ts b/lib/Helpers.d.ts index ed0e5d41a..88b315edb 100644 --- a/lib/Helpers.d.ts +++ b/lib/Helpers.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -82,14 +81,14 @@ export interface BulkStats { aborted: boolean; } -interface IndexAction { +interface IndexActionOperation { index: { _index: string; [key: string]: any; }; } -interface CreateAction { +interface CreateActionOperation { create: { _index: string; [key: string]: any; @@ -110,6 +109,8 @@ interface DeleteAction { }; } +type CreateAction = CreateActionOperation | [CreateActionOperation, unknown]; +type IndexAction = IndexActionOperation | [IndexActionOperation, unknown]; type UpdateAction = [UpdateActionOperation, Record]; type Action = IndexAction | CreateAction | UpdateAction | DeleteAction; type Omit = Pick>; diff --git a/lib/Helpers.js b/lib/Helpers.js index 909da5d1d..a648aea9a 100644 --- a/lib/Helpers.js +++ b/lib/Helpers.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -97,7 +96,6 @@ class Helpers { } params.scroll = params.scroll || '1m'; appendFilterPath('_scroll_id', params, false); - const { method, body, index, ...querystring } = params; let response = null; for (let i = 0; i <= maxRetries; i++) { @@ -132,9 +130,8 @@ class Helpers { for (let i = 0; i <= maxRetries; i++) { response = await this[kClient].scroll( { - 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 }, }, options @@ -199,7 +196,7 @@ class Helpers { let timeoutRef = null; const operationsStream = new Readable({ objectMode: true, - read(size) {}, + read() {}, }); const p = iterate(); @@ -332,7 +329,7 @@ class Helpers { return { semaphore, finish }; function finish() { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { if (running === 0) { resolve(); } else { @@ -346,7 +343,7 @@ class Helpers { running += 1; return pImmediate(send); } else { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { resolveSemaphore = resolve; }); } @@ -532,21 +529,20 @@ class Helpers { for await (const chunk of datasource) { if (shouldAbort === true) break; 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); bulkBody.push(actionBody, payloadBody); } else if (operation === 'delete') { @@ -649,7 +645,7 @@ class Helpers { running += 1; return pImmediate(send); } else { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { resolveSemaphore = resolve; }); } diff --git a/lib/Serializer.d.ts b/lib/Serializer.d.ts index 248dd4a1c..5e9799996 100644 --- a/lib/Serializer.d.ts +++ b/lib/Serializer.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/lib/Serializer.js b/lib/Serializer.js index 143ef0999..37a9710c2 100644 --- a/lib/Serializer.js +++ b/lib/Serializer.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -36,6 +35,60 @@ const sjson = require('secure-json-parse'); const { SerializationError, DeserializationError } = require('./errors'); const kJsonOptions = Symbol('secure json parse options'); +/* In JavaScript, a `Number` is a 64-bit floating-point value which can store 16 digits. However, the + * serializer and deserializer will need to cater to numeric values generated by other languages which + * can have up to 19 digits. Native JSON parser and stringifier, incapable of handling the extra + * digits, corrupt the values, making them unusable. + * + * To work around this limitation, the deserializer converts long sequences of digits into strings and + * marks them before applying the parser. During the parsing, string values that begin with the mark + * are converted to `BigInt` values. + * Similarly, during stringification, the serializer converts `BigInt` values to marked strings and + * when done, it replaces them with plain numerals. + * + * `Number.MAX_SAFE_INTEGER`, 9,007,199,254,740,991, is the largest number that the native methods can + * parse and stringify, and any numeral greater than that would need to be translated using the + * workaround; all 17-digits or longer and only tail-end of the 16-digits need translation. It would + * be unfair to all the 16-digit numbers if the translation applied to `\d{16,}` only to cover the + * less than 10%. Hence, a RegExp is created to only match numerals too long to be a number. + * + * To make the explanation simpler, let's assume that MAX_SAFE_INTEGER is 8921 which has 4 digits. + * Starting from the right, we take each digit onwards, `[-9]`: + * 1) 7922 - 7929: 792[2-9]\d{0} + * 2) 7930 - 7999: 79[3-9]\d{1} + * 9) 9 + 1 = 10 which results in a rollover; no need to do anything. + * 8) 9000 - 9999: [9-9]\d{3} + * Finally we add anything 5 digits or longer: `\d{5,} + * + * PS, a better solution would use AST but considering its performance penalty, RegExp is the next + * the best solution. + */ +const isBigIntSupported = typeof BigInt !== 'undefined'; +const maxIntAsString = String(Number.MAX_SAFE_INTEGER); +const maxIntLength = maxIntAsString.length; +// Sub-patterns for each digit +const bigIntMatcherTokens = [`\\d{${maxIntAsString.length + 1},}`]; +for (let i = 0; i < maxIntLength; i++) { + if (maxIntAsString[i] !== '9') { + bigIntMatcherTokens.push( + maxIntAsString.substring(0, i) + + `[${parseInt(maxIntAsString[i], 10) + 1}-9]` + + `\\d{${maxIntLength - i - 1}}` + ); + } +} + +/* The matcher that looks for `": , ...}` and `[..., , ...]` + * + * The pattern starts by looking for `":` not immediately preceded by a `\`. That should be + * followed by any of the numeric sub-patterns. A comma, end of an array, end of an object, or + * the end of the input are the only acceptable elements after it. + */ +const bigIntMatcher = new RegExp( + `((?:\\[|,|(? { + if (json.indexOf(marker) === -1) { + bigIntMarker = marker; + return true; + } + }); + } while (!bigIntMarker); + + return { + bigIntMarker, + length, + }; + } + + _parseWithBigInt(json) { + const { bigIntMarker, length } = this._getSuitableBigIntMarker(json); + + let hadException; + let markedJSON = json.replace(bigIntMatcher, `$1"${bigIntMarker}$2"$3`); + + /* RegExp cannot replace AST and the process of marking adds quotes. So, any false-positive hit + * will make the JSON string unparseable. + * + * To find those instances, we try to parse and watch for the location of any errors. If an error + * is caused by the marking, we remove that single marking and try again. + */ + do { + try { + hadException = false; + JSON.parse(markedJSON); + } catch (e) { + hadException = true; + /* There are two types of exception objects that can be raised: + * 1) a proper object with lineNumber and columnNumber which we can use + * 2) a textual message with the position that we need to parse + */ + let { lineNumber, columnNumber } = e; + if (!lineNumber || !columnNumber) { + const match = + // ToDo: When support for ancient versions of Node.js are dropped, replace with + // e?.message?.match?.() + e && + e.message && + typeof e.message.match === 'function' && + e.message.match(/^Unexpected token.*at position (\d+)$/); + if (match) { + lineNumber = 1; + // The position is zero-indexed; adding 1 to normalize it for the -2 that comes later + columnNumber = parseInt(match[1], 10) + 1; + } + } + + if (lineNumber < 1 || columnNumber < 2) { + // The problem is not with this replacement; just return a failure. + return; + } + + /* We need to skip e.lineNumber - 1 number of `\n` occurrences. + * Then, we need to go to e.columnNumber - 2 to look for `"\d+"`; we need to `-1` to + * account for the quote but an additional `-1` is needed because columnNumber starts from 1. + */ + const re = new RegExp( + `^((?:.*\\n){${lineNumber - 1}}[^\\n]{${columnNumber - 2}})"${bigIntMarker}(-?\\d+)"` + ); + if (!re.test(markedJSON)) { + // The exception is not caused by adding the marker + return; + } + + // We have found a bad replacement; let's remove it. + markedJSON = markedJSON.replace(re, '$1$2'); + } + } while (hadException); + + const bigIntMarkFinder = new RegExp(`^${bigIntMarker}-?\\d+$`); + + // Exceptions will trickle up to the caller + return sjson.parse( + markedJSON, + (key, val) => + /* Convert marked values to BigInt values. + * The `startsWith` is purely for performance, to avoid running `test` if not needed. + */ + typeof val === 'string' && val.startsWith(bigIntMarker) && bigIntMarkFinder.test(val) + ? BigInt(val.substring(length)) // eslint-disable-line no-undef + : val, + this[kJsonOptions] + ); + } + + _stringifyWithBigInt(object, candidate) { + const { bigIntMarker } = this._getSuitableBigIntMarker(candidate); + + /* The matcher that looks for "" + * Because we have made sure that `bigIntMarker` was never present in the original object, we can + * carelessly assume every "" is due to our marking. + */ + const markedBigIntMatcher = new RegExp(`"${bigIntMarker}(-?\\d+)"`, 'g'); + + return ( + JSON.stringify( + object, + /* Convert BigInt values to a string and mark them. + * Can't be bothered with Number values beyond safe values because they are already corrupted. + */ + (key, val) => (typeof val === 'bigint' ? `${bigIntMarker}${val.toString()}` : val) + ) + // Replace marked substrings with just the numerals + .replace(markedBigIntMatcher, '$1') + ); + } + serialize(object) { debug('Serializing', object); let json; + let numeralsAreNumbers = true; + const checkForBigInts = (key, val) => { + if (typeof val === 'bigint') { + numeralsAreNumbers = false; + // Number() is much faster than parseInt() on BigInt values + return Number(val); + } + return val; + }; try { - json = JSON.stringify(object); + json = JSON.stringify(object, isBigIntSupported ? checkForBigInts : null); + + if (isBigIntSupported && !numeralsAreNumbers) { + const temp = this._stringifyWithBigInt(object, json); + if (temp) json = temp; + } } catch (err) { throw new SerializationError(err.message, object); } @@ -59,8 +274,31 @@ class Serializer { deserialize(json) { debug('Deserializing', json); let object; + let numeralsAreNumbers = true; + const checkForLargeNumerals = (key, val) => { + if ( + numeralsAreNumbers && + typeof val === 'number' && + (val < Number.MAX_SAFE_INTEGER || val > Number.MAX_SAFE_INTEGER) + ) { + numeralsAreNumbers = false; + } + + return val; + }; try { - object = sjson.parse(json, this[kJsonOptions]); + object = sjson.parse( + json, + isBigIntSupported ? checkForLargeNumerals : null, + this[kJsonOptions] + ); + + if (isBigIntSupported && !numeralsAreNumbers) { + const temp = this._parseWithBigInt(json); + if (temp) { + object = temp; + } + } } catch (err) { throw new DeserializationError(err.message, json); } @@ -70,7 +308,7 @@ class Serializer { ndserialize(array) { debug('ndserialize', array); if (Array.isArray(array) === false) { - throw new SerializationError('The argument provided is not an array'); + throw new SerializationError('The argument provided is not an array', array); } let ndjson = ''; for (let i = 0, len = array.length; i < len; i++) { @@ -91,7 +329,7 @@ class Serializer { const keys = Object.keys(object); for (let i = 0, len = keys.length; i < len; i++) { const key = keys[i]; - // OpenSearch will complain for keys without a value + // OpenSearch will complain about keys without a value if (object[key] === undefined) { delete object[key]; } else if (Array.isArray(object[key]) === true) { diff --git a/lib/Transport.d.ts b/lib/Transport.d.ts index 026601b12..d79eabec7 100644 --- a/lib/Transport.d.ts +++ b/lib/Transport.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -29,10 +28,10 @@ */ import { Readable as ReadableStream } from 'stream'; -import { ConnectionPool, CloudConnectionPool } from './pool'; import Connection from './Connection'; -import Serializer from './Serializer'; import * as errors from './errors'; +import { CloudConnectionPool, ConnectionPool } from './pool'; +import Serializer from './Serializer'; export type ApiError = | errors.ConfigurationError @@ -59,6 +58,11 @@ export interface generateRequestIdFn { (params: TransportRequestParams, options: TransportRequestOptions): any; } +export interface MemoryCircuitBreakerOptions { + enabled: boolean; + maxPercentage: number; +} + interface TransportOptions { emit: (event: string | symbol, ...args: any[]) => boolean; connectionPool: ConnectionPool | CloudConnectionPool; @@ -77,6 +81,7 @@ interface TransportOptions { generateRequestId?: generateRequestIdFn; name?: string; opaqueIdPrefix?: string; + memoryCircuitBreaker?: MemoryCircuitBreakerOptions; } export interface RequestEvent, TContext = Context> { @@ -172,6 +177,7 @@ export default class Transport { sniffInterval: number; sniffOnConnectionFault: boolean; opaqueIdPrefix: string | null; + memoryCircuitBreaker: MemoryCircuitBreakerOptions | undefined; sniffEndpoint: string; _sniffEnabled: boolean; _nextSniff: number; diff --git a/lib/Transport.js b/lib/Transport.js index 8d23aea86..399d2641f 100644 --- a/lib/Transport.js +++ b/lib/Transport.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -57,6 +56,7 @@ const HEAP_SIZE_LIMIT = require('v8').getHeapStatistics().heap_size_limit; const kCompatibleCheck = Symbol('compatible check'); const kApiVersioning = Symbol('api versioning'); +/** Default Transport Layer */ class Transport { constructor(opts) { if (typeof opts.compression === 'string' && opts.compression !== 'gzip') { @@ -111,6 +111,27 @@ class Transport { } } + /** + * @param {Object} params + * @param {string} params.method - HTTP Method (e.g. HEAD, GET, POST...) + * @param {string} params.path - Relative URL path + * @param {Object | string} [params.body] - Body of a standard request. + * @param {Object[] | string} [params.bulkBody] - Body of a bulk request. + * @param {Object[] | string} [params.querystring] - Querystring params. + * + * @param {Object} options + * @param {number} [options.id] - Request ID + * @param {Object} [options.context] - Object used for observability + * @param {number} [options.maxRetries] - Max number of retries + * @param {false | 'gzip'} [options.compression] - Request body compression, if any + * @param {boolean} [options.asStream] - Whether to emit the response as stream + * @param {number[]} [options.ignore] - Response's Error Status Codes to ignore + * @param {Object} [options.headers] - Request headers + * @param {Object | string} [options.querystring] - Request's query string + * @param {number} [options.requestTimeout] - Max request timeout in milliseconds + * + * @param {function} callback - Callback that handles errors and response + */ request(params, options, callback) { options = options || {}; if (typeof options === 'function') { @@ -182,10 +203,14 @@ class Transport { let request = { abort: noop }; const transportReturn = { 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); + } }, abort() { meta.aborted = true; @@ -194,7 +219,9 @@ class Transport { return this; }, finally(onFinally) { - return p.finally(onFinally); + if (p != null) { + return p.finally(onFinally); + } }, }; @@ -381,7 +408,7 @@ class Transport { // if the statusCode is 502/3/4 we should run our retry strategy // and mark the connection as dead this.connectionPool.markDead(meta.connection); - // retry logic (we shoukd not retry on "429 - Too Many Requests") + // retry logic (we should not retry on "429 - Too Many Requests") if (meta.attempts < maxRetries && result.statusCode !== 429) { meta.attempts++; debug(`Retrying request, there are still ${maxRetries - meta.attempts} attempts`, params); @@ -676,7 +703,7 @@ function randomSelector(connections) { function generateRequestId() { const maxInt = 2147483647; let nextReqId = 0; - return function genReqId(params, options) { + return function genReqId() { return (nextReqId = (nextReqId + 1) & maxInt); }; } diff --git a/lib/aws/AwsSigv4Signer.js b/lib/aws/AwsSigv4Signer.js new file mode 100644 index 000000000..d46ba351d --- /dev/null +++ b/lib/aws/AwsSigv4Signer.js @@ -0,0 +1,176 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +'use strict'; +const Connection = require('../Connection'); +const Transport = require('../Transport'); +const aws4 = require('aws4'); +const AwsSigv4SignerError = require('./errors'); +const crypto = require('crypto'); + +const getAwsSDKCredentialsProvider = async () => { + // First try V3 + try { + const awsV3 = await import('@aws-sdk/credential-provider-node'); + if (typeof awsV3.defaultProvider === 'function') { + return awsV3.defaultProvider(); + } + } catch (err) { + // Ignore + } + try { + const awsV2 = await import('aws-sdk'); + if (awsV2.default && typeof awsV2.default.config.getCredentials === 'function') { + return () => + new Promise((resolve, reject) => { + awsV2.default.config.getCredentials((err, credentials) => { + if (err) { + reject(err); + } else { + resolve(credentials); + } + }); + }); + } + } catch (err) { + // Ignore + } + + throw new AwsSigv4SignerError( + 'Unable to find a valid AWS SDK, please provide a valid getCredentials function to AwsSigv4Signer options.' + ); +}; + +const awsDefaultCredentialsProvider = () => + new Promise((resolve, reject) => { + getAwsSDKCredentialsProvider() + .then((provider) => { + provider().then(resolve).catch(reject); + }) + .catch((err) => { + reject(err); + }); + }); + +function AwsSigv4Signer(opts = {}) { + const credentialsState = { + credentials: null, + }; + if (!opts.region) { + throw new AwsSigv4SignerError('Region cannot be empty'); + } + if (!opts.service) { + opts.service = 'es'; + } + if (typeof opts.getCredentials !== 'function') { + opts.getCredentials = awsDefaultCredentialsProvider; + } + + function buildSignedRequestObject(request = {}) { + request.service = opts.service; + request.region = opts.region; + request.headers = request.headers || {}; + request.headers['host'] = request.hostname; + const signed = aws4.sign(request, credentialsState.credentials); + signed.headers['x-amz-content-sha256'] = crypto + .createHash('sha256') + .update(request.body || '', 'utf8') + .digest('hex'); + return signed; + } + + class AwsSigv4SignerConnection extends Connection { + buildRequestObject(params) { + const request = super.buildRequestObject(params); + return buildSignedRequestObject(request); + } + } + + class AwsSigv4SignerTransport extends Transport { + request(params, options = {}, callback = undefined) { + // options is optional so if options is a function, it's the callback. + if (typeof options === 'function') { + callback = options; + options = {}; + } + + const currentCredentials = credentialsState.credentials; + let expired = false; + if (!currentCredentials) { + // Credentials haven't been acquired yet. + expired = true; + } + // AWS SDK V2, needsRefresh should be available. + else if (typeof currentCredentials.needsRefresh === 'function') { + expired = currentCredentials.needsRefresh(); + } + // AWS SDK V2, alternative to needsRefresh. + else if (currentCredentials.expired === true) { + expired = true; + } + // AWS SDK V2, alternative to needsRefresh and expired. + else if (currentCredentials.expireTime && currentCredentials.expireTime < new Date()) { + expired = true; + } + // AWS SDK V3, Credentials.expiration is a Date object + else if (currentCredentials.expiration && currentCredentials.expiration < new Date()) { + expired = true; + } + + if (!expired) { + if (typeof callback === 'undefined') { + return super.request(params, options); + } + super.request(params, options, callback); + return; + } + + // In AWS SDK V2 Credentials.refreshPromise should be available. + if (currentCredentials && typeof currentCredentials.refreshPromise === 'function') { + if (typeof callback === 'undefined') { + return currentCredentials.refreshPromise().then(() => { + return super.request(params, options); + }); + } else { + currentCredentials + .refreshPromise() + .then(() => { + super.request(params, options, callback); + }) + .catch(callback); + return; + } + } + + // For AWS SDK V3 or when the client has not acquired credentials yet. + if (typeof callback === 'undefined') { + return opts.getCredentials().then((credentials) => { + credentialsState.credentials = credentials; + return super.request(params, options); + }); + } else { + opts + .getCredentials() + .then((credentials) => { + credentialsState.credentials = credentials; + super.request(params, options, callback); + }) + .catch(callback); + } + } + } + + return { + Transport: AwsSigv4SignerTransport, + Connection: AwsSigv4SignerConnection, + buildSignedRequestObject, + }; +} +module.exports = AwsSigv4Signer; diff --git a/lib/aws/errors.js b/lib/aws/errors.js new file mode 100644 index 000000000..b268dda18 --- /dev/null +++ b/lib/aws/errors.js @@ -0,0 +1,24 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +'use strict'; +const { OpenSearchClientError } = require('../errors'); + +class AwsSigv4SignerError extends OpenSearchClientError { + constructor(message, data) { + super(message, data); + Error.captureStackTrace(this, AwsSigv4SignerError); + this.name = 'AwsSigv4SignerError'; + this.message = message || 'AwsSigv4Signer Error'; + this.data = data; + } +} + +module.exports = AwsSigv4SignerError; diff --git a/lib/aws/index.d.ts b/lib/aws/index.d.ts new file mode 100644 index 000000000..3d8e5c652 --- /dev/null +++ b/lib/aws/index.d.ts @@ -0,0 +1,40 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/// + +import { Credentials } from '@aws-sdk/types'; +import Connection from '../Connection'; +import Transport from '../Transport'; +import * as http from 'http'; +import { OpenSearchClientError } from '../errors'; + +interface AwsSigv4SignerOptions { + getCredentials?: () => Promise; + region: string; + service?: 'es' | 'aoss'; +} + +interface AwsSigv4SignerResponse { + Connection: typeof Connection; + Transport: typeof Transport; + buildSignedRequestObject(request: any): http.ClientRequestArgs; +} + +declare function AwsSigv4Signer (opts: AwsSigv4SignerOptions): AwsSigv4SignerResponse; + +declare class AwsSigv4SignerError extends OpenSearchClientError { + name: string; + message: string; + data: any; + constructor(message: string, data: any); +} + +export { AwsSigv4Signer, AwsSigv4SignerOptions, AwsSigv4SignerResponse, AwsSigv4SignerError }; diff --git a/lib/aws/index.js b/lib/aws/index.js new file mode 100644 index 000000000..a36d7516e --- /dev/null +++ b/lib/aws/index.js @@ -0,0 +1,19 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +'use strict'; + +const AwsSigv4Signer = require('./AwsSigv4Signer'); +const AwsSigv4SignerError = require('./errors'); + +module.exports = { + AwsSigv4Signer, + AwsSigv4SignerError, +}; diff --git a/lib/errors.d.ts b/lib/errors.d.ts index b49485963..a907f5110 100644 --- a/lib/errors.d.ts +++ b/lib/errors.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -52,7 +51,7 @@ export declare class ConnectionError< name: string; message: string; meta: ApiResponse; - constructor(message: string, meta: ApiResponse); + constructor(message: string, meta?: ApiResponse); } export declare class NoLivingConnectionsError< @@ -105,7 +104,7 @@ export declare class RequestAbortedError< name: string; message: string; meta: ApiResponse; - constructor(message: string, meta: ApiResponse); + constructor(message: string, meta?: ApiResponse); } export declare class NotCompatibleError< diff --git a/lib/errors.js b/lib/errors.js index b1675e827..82bedd709 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/lib/pool/BaseConnectionPool.js b/lib/pool/BaseConnectionPool.js index 5c8bcfd44..30c5ad8df 100644 --- a/lib/pool/BaseConnectionPool.js +++ b/lib/pool/BaseConnectionPool.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/lib/pool/CloudConnectionPool.js b/lib/pool/CloudConnectionPool.js index 565e0415d..d512c6f80 100644 --- a/lib/pool/CloudConnectionPool.js +++ b/lib/pool/CloudConnectionPool.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/lib/pool/ConnectionPool.js b/lib/pool/ConnectionPool.js index 127688337..21f728543 100644 --- a/lib/pool/ConnectionPool.js +++ b/lib/pool/ConnectionPool.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -74,7 +73,7 @@ class ConnectionPool extends BaseConnectionPool { /** * Marks a connection as 'dead'. - * If needed adds the connection to the dead list + * If needed, adds the connection to the dead list * and then increments the `deadCount`. * * @param {object} connection @@ -83,9 +82,9 @@ class ConnectionPool extends BaseConnectionPool { const { id } = connection; debug(`Marking as 'dead' connection '${id}'`); if (this.dead.indexOf(id) === -1) { - // It might happen that `markDead` is called jsut after + // It might happen that `markDead` is called just after // a pool update, and in such case we will add to the dead - // list a node that no longer exist. The following check verify + // list a node that no longer exists. The following check verifies // that the connection is still part of the pool before // marking it as dead. for (let i = 0; i < this.size; i++) { diff --git a/lib/pool/index.d.ts b/lib/pool/index.d.ts index 5e3c4fc52..9a1296673 100644 --- a/lib/pool/index.d.ts +++ b/lib/pool/index.d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -116,6 +115,13 @@ declare class BaseConnectionPool { * @returns {object|null} connection */ getConnection(opts?: getConnectionOptions): Connection | null; + + /** + * Creates a new connection instance. + * @param {object|string} opts + * @returns {Connection} + */ + createConnection(opts: ConnectionOptions | string): Connection; /** * Adds a new connection to the pool. * diff --git a/lib/pool/index.js b/lib/pool/index.js index 7e562357c..cf95941cb 100644 --- a/lib/pool/index.js +++ b/lib/pool/index.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/package.json b/package.json index d9326bf1b..c37a477d0 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,24 @@ "exports": { ".": { "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.3.0", "versionCanary": "7.10.0-canary.6", "keywords": [ "opensearch", @@ -23,16 +35,16 @@ "index" ], "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", "test:integration": "node test/integration/index.js", "test:integration:helpers": "tap test/integration/helpers/*.test.js", "test:integration:helpers-secure": "tap test/integration/helpers-secure/*.test.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 .", "lint:fix": "eslint . --fix", "license-checker": "license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause'", @@ -44,44 +56,50 @@ "company": "Elasticsearch BV" }, "devDependencies": { + "@aws-sdk/types": "^3.160.0", + "@babel/eslint-parser": "^7.19.1", "@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1", - "@types/node": "^15.3.1", - "babel-eslint": "^10.1.0", + "@types/node": "^20.1.4", "convert-hrtime": "^5.0.0", "cross-zip": "^4.0.0", "dedent": "^0.7.0", "deepmerge": "^4.2.2", "dezalgo": "^1.0.3", - "eslint": "^7.32.0", + "eslint": "^8.30.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.0.0", "fast-deep-equal": "^3.1.3", "into-stream": "^6.0.0", "js-yaml": "^4.1.0", + "jsdoc": "^4.0.0", "license-checker": "^25.0.1", "minimist": "^1.2.5", - "node-fetch": "^2.6.1", - "ora": "^5.4.0", + "node-fetch": "^3.2.10", + "ora": "^6.1.2", "prettier": "^2.6.2", "pretty-hrtime": "^1.0.3", "proxy": "^1.0.2", - "rimraf": "^3.0.2", + "rimraf": "^5.0.0", "semver": "^7.3.5", - "simple-git": "^3.5.0", + "simple-git": "^3.15.0", "simple-statistics": "^7.7.0", - "split2": "^3.2.2", + "split2": "^4.1.0", "stoppable": "^1.1.0", - "tap": "^15.0.9", - "tsd": "^0.15.1", + "tap": "^16.3.0", + "tsd": "^0.27.0", "workq": "^3.0.0", - "xmlbuilder2": "^2.4.1" + "xmlbuilder2": "^3.0.2" }, "dependencies": { + "aws4": "^1.11.0", "debug": "^4.3.1", - "hpagent": "^0.1.1", + "hpagent": "^1.2.0", "ms": "^2.1.3", "secure-json-parse": "^2.4.0" }, + "resolutions": { + "**/strip-ansi": "^6.0.1" + }, "license": "Apache-2.0", "repository": { "type": "git", @@ -104,4 +122,4 @@ "coverage": false, "jobs-auto": true } -} \ No newline at end of file +} diff --git a/scripts/download-artifacts.js b/scripts/download-artifacts.js index a9dcf17cf..72bb565dc 100644 --- a/scripts/download-artifacts.js +++ b/scripts/download-artifacts.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/scripts/generate.js b/scripts/generate.js index a144dc0af..d23ef4b98 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/scripts/release-canary.js b/scripts/release-canary.js index 6cc9dc88b..93c24d07b 100644 --- a/scripts/release-canary.js +++ b/scripts/release-canary.js @@ -1,3 +1,31 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ 'use strict'; /** @@ -90,8 +118,8 @@ async function release(opts) { await writeFile(join(__dirname, '..', '.npmignore'), originalNpmIgnore, 'utf8'); } -function confirm(question) { - return new Promise((resolve, reject) => { +function confirm() { + return new Promise((resolve) => { const rl = readline.createInterface({ input: process.stdin, output: process.stdout, diff --git a/scripts/utils/clone-opensearch.js b/scripts/utils/clone-opensearch.js index f2ee8d261..ee2ae177a 100644 --- a/scripts/utils/clone-opensearch.js +++ b/scripts/utils/clone-opensearch.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/scripts/utils/generateApis.js b/scripts/utils/generateApis.js index 496697537..c35f9164c 100644 --- a/scripts/utils/generateApis.js +++ b/scripts/utils/generateApis.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -267,7 +266,7 @@ function generateSingleApi(version, spec, common) { documentation: generateDocumentation(spec[api], api), }; - function genRequiredChecks(param) { + function genRequiredChecks() { const code = required.map(_genRequiredCheck).concat(_noBody()).filter(Boolean); if (code.length) { @@ -319,7 +318,7 @@ function generateSingleApi(version, spec, common) { : str.replace(/_([a-z])/g, (k) => k[1].toUpperCase()); }; - return acceptedQuerystring.reduce((acc, val, index) => { + return acceptedQuerystring.reduce((acc, val) => { if (toCamelCase(val) !== val) { acc[toCamelCase(val)] = val; } diff --git a/scripts/utils/generateDocs.js b/scripts/utils/generateDocs.js index d2563c84d..35de635da 100644 --- a/scripts/utils/generateDocs.js +++ b/scripts/utils/generateDocs.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/scripts/utils/generateMain.js b/scripts/utils/generateMain.js index c1d4f005f..651501b84 100644 --- a/scripts/utils/generateMain.js +++ b/scripts/utils/generateMain.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/scripts/utils/generateRequestTypes.js b/scripts/utils/generateRequestTypes.js index e93243b31..a5a3eb8a0 100644 --- a/scripts/utils/generateRequestTypes.js +++ b/scripts/utils/generateRequestTypes.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,14 +36,13 @@ const deprecatedParameters = require('./patch.json'); function generate(version, api) { const release = version.charAt(0); let types = `/* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/scripts/utils/index.js b/scripts/utils/index.js index d3f1005e6..8f374d12a 100644 --- a/scripts/utils/index.js +++ b/scripts/utils/index.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/acceptance/events-order.test.js b/test/acceptance/events-order.test.js index 7030823a9..40fa80cba 100644 --- a/test/acceptance/events-order.test.js +++ b/test/acceptance/events-order.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -57,27 +56,27 @@ test('No errors', (t) => { const order = [events.SERIALIZATION, events.REQUEST, events.DESERIALIZATION, events.RESPONSE]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.error(err); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (err, request) => { + client.on(events.DESERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.DESERIALIZATION); }); - client.on(events.RESPONSE, (err, request) => { + client.on(events.RESPONSE, (err) => { t.error(err); t.equal(order.shift(), events.RESPONSE); }); - client.info((err, result) => { + client.info((err) => { t.error(err); t.equal(order.length, 0); }); @@ -94,26 +93,26 @@ test('Connection error', (t) => { const order = [events.SERIALIZATION, events.REQUEST, events.REQUEST, events.RESPONSE]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.error(err); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (_err, request) => { + client.on(events.DESERIALIZATION, () => { t.fail('Should not be called'); }); - client.on(events.RESPONSE, (err, request) => { + client.on(events.RESPONSE, (err) => { t.ok(err instanceof ConnectionError); t.equal(order.shift(), events.RESPONSE); }); - client.info((err, result) => { + client.info((err) => { t.ok(err instanceof ConnectionError); t.equal(order.length, 0); }); @@ -130,26 +129,26 @@ test('TimeoutError error', (t) => { const order = [events.SERIALIZATION, events.REQUEST, events.REQUEST, events.RESPONSE]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.error(err); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (_err, request) => { + client.on(events.DESERIALIZATION, () => { t.fail('Should not be called'); }); - client.on(events.RESPONSE, (err, request) => { + client.on(events.RESPONSE, (err) => { t.ok(err instanceof TimeoutError); t.equal(order.shift(), events.RESPONSE); }); - client.info((err, result) => { + client.info((err) => { t.ok(err instanceof TimeoutError); t.equal(order.length, 0); }); @@ -166,26 +165,26 @@ test('RequestAbortedError error', (t) => { const order = [events.SERIALIZATION, events.REQUEST, events.RESPONSE]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.error(err); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (_err, request) => { + client.on(events.DESERIALIZATION, () => { t.fail('Should not be called'); }); - client.on(events.RESPONSE, (err, request) => { + client.on(events.RESPONSE, (err) => { t.ok(err instanceof RequestAbortedError); t.equal(order.shift(), events.RESPONSE); }); - const request = client.info((err, result) => { + const request = client.info((err) => { t.ok(err instanceof RequestAbortedError); t.equal(order.length, 0); }); @@ -197,7 +196,7 @@ test('ResponseError error (no retry)', (t) => { t.plan(10); const MockConnection = buildMockConnection({ - onRequest(params) { + onRequest() { return { statusCode: 400, body: { hello: 'world' }, @@ -213,27 +212,27 @@ test('ResponseError error (no retry)', (t) => { const order = [events.SERIALIZATION, events.REQUEST, events.DESERIALIZATION, events.RESPONSE]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.error(err); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (err, request) => { + client.on(events.DESERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.DESERIALIZATION); }); - client.on(events.RESPONSE, (err, request) => { + client.on(events.RESPONSE, (err) => { t.ok(err instanceof ResponseError); t.equal(order.shift(), events.RESPONSE); }); - client.info((err, result) => { + client.info((err) => { t.ok(err instanceof ResponseError); t.equal(order.length, 0); }); @@ -243,7 +242,7 @@ test('ResponseError error (with retry)', (t) => { t.plan(14); const MockConnection = buildMockConnection({ - onRequest(params) { + onRequest() { return { statusCode: 504, body: { hello: 'world' }, @@ -266,27 +265,27 @@ test('ResponseError error (with retry)', (t) => { events.RESPONSE, ]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.error(err); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (err, request) => { + client.on(events.DESERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.DESERIALIZATION); }); - client.on(events.RESPONSE, (err, request) => { + client.on(events.RESPONSE, (err) => { t.ok(err instanceof ResponseError); t.equal(order.shift(), events.RESPONSE); }); - client.info((err, result) => { + client.info((err) => { t.ok(err instanceof ResponseError); t.equal(order.length, 0); }); @@ -303,27 +302,27 @@ test('Serialization Error', (t) => { const order = [events.SERIALIZATION, events.REQUEST]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.ok(err instanceof SerializationError); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (_err, request) => { + client.on(events.DESERIALIZATION, () => { t.fail('Should not be called'); }); - client.on(events.RESPONSE, (_err, request) => { + client.on(events.RESPONSE, () => { t.fail('Should not be called'); }); const body = {}; body.o = body; - client.index({ index: 'test', body }, (err, result) => { + client.index({ index: 'test', body }, (err) => { t.ok(err instanceof SerializationError); t.equal(order.length, 0); }); @@ -357,27 +356,27 @@ test('Deserialization Error', (t) => { const order = [events.SERIALIZATION, events.REQUEST, events.DESERIALIZATION, events.RESPONSE]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.error(err); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (err, request) => { + client.on(events.DESERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.DESERIALIZATION); }); - client.on(events.RESPONSE, (err, request) => { + client.on(events.RESPONSE, (err) => { t.ok(err instanceof DeserializationError); t.equal(order.shift(), events.RESPONSE); }); - client.info((err, result) => { + client.info((err) => { t.ok(err instanceof DeserializationError); t.equal(order.length, 0); }); @@ -408,27 +407,27 @@ test('Socket destroyed while reading the body', (t) => { events.RESPONSE, ]; - client.on(events.SERIALIZATION, (err, request) => { + client.on(events.SERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.SERIALIZATION); }); - client.on(events.REQUEST, (err, request) => { + client.on(events.REQUEST, (err) => { t.error(err); t.equal(order.shift(), events.REQUEST); }); - client.on(events.DESERIALIZATION, (err, request) => { + client.on(events.DESERIALIZATION, (err) => { t.error(err); t.equal(order.shift(), events.DESERIALIZATION); }); - client.on(events.RESPONSE, (err, request) => { + client.on(events.RESPONSE, (err) => { t.ok(err instanceof ConnectionError); t.equal(order.shift(), events.RESPONSE); }); - client.info((err, result) => { + client.info((err) => { t.ok(err instanceof ConnectionError); t.equal(order.length, 0); server.stop(); diff --git a/test/acceptance/observability.test.js b/test/acceptance/observability.test.js index 99ff548ae..15cb00e64 100644 --- a/test/acceptance/observability.test.js +++ b/test/acceptance/observability.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; @@ -385,10 +384,10 @@ test('Client name', (t) => { client.on('resurrect', (err, meta) => { t.error(err); t.equal(meta.name, 'opensearch-js'); - clock.uninstall(); }); client.info({}, { id: 'custom' }, noop); + clock.uninstall(); }); t.test('Resurrect should have the client name configured (child client)', (t) => { @@ -413,10 +412,10 @@ test('Client name', (t) => { client.on('resurrect', (err, meta) => { t.error(err); t.equal(meta.name, 'child-client'); - clock.uninstall(); }); child.info({}, { id: 'custom' }, noop); + clock.uninstall(); }); t.end(); diff --git a/test/acceptance/proxy.test.js b/test/acceptance/proxy.test.js index eac2dfa52..dc2cf1b06 100644 --- a/test/acceptance/proxy.test.js +++ b/test/acceptance/proxy.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; diff --git a/test/acceptance/resurrect.test.js b/test/acceptance/resurrect.test.js index 6f8f12fd7..9b063dd50 100644 --- a/test/acceptance/resurrect.test.js +++ b/test/acceptance/resurrect.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -82,7 +81,7 @@ test('Should execute the recurrect API with the ping strategy', (t) => { }); q.add((q, done) => { - client.info((err, result) => { + client.info((err) => { t.ok(err); done(); }); @@ -90,7 +89,7 @@ test('Should execute the recurrect API with the ping strategy', (t) => { q.add((q, done) => { clock.tick(1000 * 61); - client.info((err, result) => { + client.info((err) => { t.error(err); done(); }); @@ -146,7 +145,7 @@ test('Resurrect a node and handle 502/3/4 status code', (t) => { }); q.add((q, done) => { - client.info((err, result) => { + client.info((err) => { t.ok(err); done(); }); @@ -154,7 +153,7 @@ test('Resurrect a node and handle 502/3/4 status code', (t) => { q.add((q, done) => { clock.tick(1000 * 61); - client.info((err, result) => { + client.info((err) => { t.error(err); done(); }); @@ -162,7 +161,7 @@ test('Resurrect a node and handle 502/3/4 status code', (t) => { q.add((q, done) => { clock.tick(1000 * 10 * 60); - client.info((err, result) => { + client.info((err) => { t.error(err); done(); }); @@ -211,7 +210,7 @@ test('Should execute the recurrect API with the optimistic strategy', (t) => { }); q.add((q, done) => { - client.info((err, result) => { + client.info((err) => { t.ok(err); done(); }); @@ -219,7 +218,7 @@ test('Should execute the recurrect API with the optimistic strategy', (t) => { q.add((q, done) => { clock.tick(1000 * 61); - client.info((err, result) => { + client.info((err) => { t.error(err); done(); }); diff --git a/test/acceptance/sniff.test.js b/test/acceptance/sniff.test.js index ea2896a79..f248fdd35 100644 --- a/test/acceptance/sniff.test.js +++ b/test/acceptance/sniff.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -238,7 +237,7 @@ test('Sniff interval', (t) => { test('Sniff on start', (t) => { t.plan(4); - buildCluster(({ nodes, shutdown, kill }) => { + buildCluster(({ nodes, shutdown }) => { const client = new Client({ node: nodes[Object.keys(nodes)[0]].url, sniffOnStart: true, @@ -259,7 +258,7 @@ test('Sniff on start', (t) => { test('Should not close living connections', (t) => { t.plan(3); - buildCluster(({ nodes, shutdown, kill }) => { + buildCluster(({ nodes, shutdown }) => { class MyConnection extends Connection { close() { t.fail('Should not be called'); @@ -287,7 +286,7 @@ test('Should not close living connections', (t) => { test('Sniff on connection fault', (t) => { t.plan(5); - buildCluster(({ nodes, shutdown, kill }) => { + buildCluster(({ nodes, shutdown }) => { class MyConnection extends Connection { request(params, callback) { if (this.id === 'http://localhost:9200/') { @@ -315,7 +314,7 @@ test('Sniff on connection fault', (t) => { t.equal(reason, Transport.sniffReasons.SNIFF_ON_CONNECTION_FAULT); }); - client.info((err, result) => { + client.info((err) => { t.ok(err instanceof errors.ConnectionError); }); diff --git a/test/benchmarks/macro/complex.bench.js b/test/benchmarks/macro/complex.bench.js index 723711462..a547f90c4 100644 --- a/test/benchmarks/macro/complex.bench.js +++ b/test/benchmarks/macro/complex.bench.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; diff --git a/test/benchmarks/macro/simple.bench.js b/test/benchmarks/macro/simple.bench.js index 148e8d4ae..1a56bffac 100644 --- a/test/benchmarks/macro/simple.bench.js +++ b/test/benchmarks/macro/simple.bench.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; diff --git a/test/benchmarks/micro/basic.bench.js b/test/benchmarks/micro/basic.bench.js index 33c6eb8fa..ce5699572 100644 --- a/test/benchmarks/micro/basic.bench.js +++ b/test/benchmarks/micro/basic.bench.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; @@ -24,7 +23,7 @@ const { connection } = require('../../utils'); bench('Initialization', { warmup: 5, measure: 10, iterations: 1000 }, async (b) => { b.start(); for (let i = 0; i < b.iterations; i++) { - const client = new Client({ + new Client({ // eslint-disable-line node: 'http://localhost:9200', }); diff --git a/test/benchmarks/suite.js b/test/benchmarks/suite.js index 2baf27469..f557eba17 100644 --- a/test/benchmarks/suite.js +++ b/test/benchmarks/suite.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; @@ -125,7 +124,7 @@ function buildBenchmark(options = {}) { } // task that elaborate the collected stats - async function elaborateStats(q) { + async function elaborateStats() { const times = stats[title].map((s) => s.milliseconds / b.iterations); reports.push({ description: title, diff --git a/test/bundlers/parcel-test/index.js b/test/bundlers/parcel-test/index.js index d122d9c47..738bc65c6 100644 --- a/test/bundlers/parcel-test/index.js +++ b/test/bundlers/parcel-test/index.js @@ -1,18 +1,17 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; const { Client } = require('../../../index'); const client = new Client({ node: 'http://localhost:9200' }); -client.info((err, result) => { +client.info((err) => { process.exit(err ? 1 : 0); }); diff --git a/test/bundlers/rollup-test/index.js b/test/bundlers/rollup-test/index.js index d122d9c47..738bc65c6 100644 --- a/test/bundlers/rollup-test/index.js +++ b/test/bundlers/rollup-test/index.js @@ -1,18 +1,17 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; const { Client } = require('../../../index'); const client = new Client({ node: 'http://localhost:9200' }); -client.info((err, result) => { +client.info((err) => { process.exit(err ? 1 : 0); }); diff --git a/test/bundlers/rollup-test/rollup.config.js b/test/bundlers/rollup-test/rollup.config.js index 80aad33f3..7c864dde9 100644 --- a/test/bundlers/rollup-test/rollup.config.js +++ b/test/bundlers/rollup-test/rollup.config.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import resolve from '@rollup/plugin-node-resolve'; diff --git a/test/bundlers/webpack-test/index.js b/test/bundlers/webpack-test/index.js index d122d9c47..738bc65c6 100644 --- a/test/bundlers/webpack-test/index.js +++ b/test/bundlers/webpack-test/index.js @@ -1,18 +1,17 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; const { Client } = require('../../../index'); const client = new Client({ node: 'http://localhost:9200' }); -client.info((err, result) => { +client.info((err) => { process.exit(err ? 1 : 0); }); diff --git a/test/bundlers/webpack-test/webpack.config.js b/test/bundlers/webpack-test/webpack.config.js index 1b14bb813..0600ecc0b 100644 --- a/test/bundlers/webpack-test/webpack.config.js +++ b/test/bundlers/webpack-test/webpack.config.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; diff --git a/test/fixtures/longnumerals-dataset.ndjson b/test/fixtures/longnumerals-dataset.ndjson new file mode 100644 index 000000000..673862301 --- /dev/null +++ b/test/fixtures/longnumerals-dataset.ndjson @@ -0,0 +1,3 @@ +{"number":18014398509481982,"description":"-18014398509481982 , -1 , 1 , 18014398509481982"} +{"number":-18014398509481982,"description":"෴18014398509481982"} +{"number":9007199254740891,"description":"Safer than [18014398509481982]"} diff --git a/test/integration/helper.js b/test/integration/helper.js index 221e1f525..6a1c56af2 100644 --- a/test/integration/helper.js +++ b/test/integration/helper.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/integration/helpers-secure/search.test.js b/test/integration/helpers-secure/search.test.js index 1f672d3e8..0e3ff61d3 100644 --- a/test/integration/helpers-secure/search.test.js +++ b/test/integration/helpers-secure/search.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; @@ -15,7 +14,7 @@ const { createReadStream } = require('fs'); const { join } = require('path'); const split = require('split2'); const { test, beforeEach, afterEach } = require('tap'); -const { waitCluster } = require('../../utils'); + const { Client } = require('../../..'); const INDEX = `test-helpers-${process.pid}`; @@ -31,13 +30,12 @@ const client = new Client({ }); beforeEach(async () => { - await waitCluster(client); await client.indices.create({ index: INDEX }); const stream = createReadStream(join(__dirname, '..', '..', 'fixtures', 'stackoverflow.ndjson')); const result = await client.helpers.bulk({ datasource: stream.pipe(split()), refreshOnCompletion: true, - onDocument(doc) { + onDocument() { return { index: { _index: INDEX }, }; diff --git a/test/integration/helpers/bulk.test.js b/test/integration/helpers/bulk.test.js index 15521ffa7..8fd9ac825 100644 --- a/test/integration/helpers/bulk.test.js +++ b/test/integration/helpers/bulk.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -34,7 +33,6 @@ const { createReadStream } = require('fs'); const { join } = require('path'); const split = require('split2'); const { test, beforeEach, afterEach } = require('tap'); -const { waitCluster } = require('../../utils'); const { Client } = require('../../../'); const datasetPath = join(__dirname, '..', '..', 'fixtures', 'stackoverflow.ndjson'); @@ -44,7 +42,6 @@ const client = new Client({ }); beforeEach(async () => { - await waitCluster(client); await client.indices.create({ index: INDEX }); }); @@ -57,10 +54,10 @@ test('bulk index', async (t) => { const result = await client.helpers.bulk({ datasource: stream.pipe(split()), refreshOnCompletion: INDEX, - onDrop(doc) { + onDrop() { t.fail('It should not drop any document'); }, - onDocument(doc) { + onDocument() { return { index: { _index: INDEX }, }; @@ -85,7 +82,7 @@ test('bulk index with custom id', async (t) => { const stream = createReadStream(datasetPath); const result = await client.helpers.bulk({ datasource: stream.pipe(split(JSON.parse)), - onDrop(doc) { + onDrop() { t.fail('It should not drop any document'); }, onDocument(doc) { @@ -159,7 +156,7 @@ test('bulk delete', async (t) => { const indexResult = await client.helpers.bulk({ datasource: createReadStream(datasetPath).pipe(split(JSON.parse)), refreshOnCompletion: true, - onDrop(doc) { + onDrop() { t.fail('It should not drop any document'); }, onDocument(doc) { @@ -188,7 +185,7 @@ test('bulk delete', async (t) => { const deleteResult = await client.helpers.bulk({ datasource: createReadStream(datasetPath).pipe(split(JSON.parse)), refreshOnCompletion: true, - onDrop(doc) { + onDrop() { t.fail('It should not drop any document'); }, onDocument(doc) { diff --git a/test/integration/helpers/msearch.test.js b/test/integration/helpers/msearch.test.js index 6815e13f6..c3495e04e 100644 --- a/test/integration/helpers/msearch.test.js +++ b/test/integration/helpers/msearch.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -34,7 +33,7 @@ const { createReadStream } = require('fs'); const { join } = require('path'); const split = require('split2'); const { test, beforeEach, afterEach } = require('tap'); -const { waitCluster } = require('../../utils'); + const { Client, errors } = require('../../../'); const INDEX = `test-helpers-${process.pid}`; @@ -43,13 +42,12 @@ const client = new Client({ }); beforeEach(async () => { - await waitCluster(client); await client.indices.create({ index: INDEX }); const stream = createReadStream(join(__dirname, '..', '..', 'fixtures', 'stackoverflow.ndjson')); const result = await client.helpers.bulk({ datasource: stream.pipe(split()), refreshOnCompletion: true, - onDocument(doc) { + onDocument() { return { index: { _index: INDEX }, }; @@ -90,7 +88,7 @@ test('Bad request', (t) => { t.equal(result.body.hits.total.value, 106); }); - m.search({ index: INDEX }, { query: { foo: { title: 'ruby' } } }, (err, result) => { + m.search({ index: INDEX }, { query: { foo: { title: 'ruby' } } }, (err) => { t.ok(err instanceof errors.ResponseError); }); diff --git a/test/integration/helpers/scroll.test.js b/test/integration/helpers/scroll.test.js index 54cb46528..6b4b80a3f 100644 --- a/test/integration/helpers/scroll.test.js +++ b/test/integration/helpers/scroll.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -34,7 +33,7 @@ const { createReadStream } = require('fs'); const { join } = require('path'); const split = require('split2'); const { test, beforeEach, afterEach } = require('tap'); -const { waitCluster } = require('../../utils'); + const { Client } = require('../../../'); const INDEX = `test-helpers-${process.pid}`; @@ -43,13 +42,12 @@ const client = new Client({ }); beforeEach(async () => { - await waitCluster(client); await client.indices.create({ index: INDEX }); const stream = createReadStream(join(__dirname, '..', '..', 'fixtures', 'stackoverflow.ndjson')); const result = await client.helpers.bulk({ datasource: stream.pipe(split()), refreshOnCompletion: true, - onDocument(doc) { + onDocument() { return { index: { _index: INDEX }, }; diff --git a/test/integration/helpers/search.test.js b/test/integration/helpers/search.test.js index fc3a3307b..213db0a1a 100644 --- a/test/integration/helpers/search.test.js +++ b/test/integration/helpers/search.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -34,7 +33,7 @@ const { createReadStream } = require('fs'); const { join } = require('path'); const split = require('split2'); const { test, beforeEach, afterEach } = require('tap'); -const { waitCluster } = require('../../utils'); + const { Client } = require('../../../'); const INDEX = `test-helpers-${process.pid}`; @@ -43,13 +42,12 @@ const client = new Client({ }); beforeEach(async () => { - await waitCluster(client); await client.indices.create({ index: INDEX }); const stream = createReadStream(join(__dirname, '..', '..', 'fixtures', 'stackoverflow.ndjson')); const result = await client.helpers.bulk({ datasource: stream.pipe(split()), refreshOnCompletion: true, - onDocument(doc) { + onDocument() { return { index: { _index: INDEX }, }; diff --git a/test/integration/index.js b/test/integration/index.js index a61703203..d1978d0c9 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -41,7 +40,6 @@ const yaml = require('js-yaml'); const ms = require('ms'); const { Client } = require('../../index'); const build = require('./test-runner'); -const { sleep } = require('./helper'); const createJunitReporter = require('./reporter'); const downloadArtifacts = require('../../scripts/download-artifacts'); @@ -82,22 +80,8 @@ function runner(opts = {}) { }); } -async function waitCluster(client, times = 0) { - try { - await client.cluster.health({ waitForStatus: 'green', timeout: '50s' }); - } catch (err) { - if (++times < 10) { - await sleep(5000); - return waitCluster(client, times); - } - console.error(err); - process.exit(1); - } -} - async function start({ client }) { log('Waiting for OpenSearch'); - await waitCluster(client); const { body } = await client.info(); const { number: version, build_hash: hash } = body.version; diff --git a/test/integration/reporter.js b/test/integration/reporter.js index d856cbcb4..59e973b70 100644 --- a/test/integration/reporter.js +++ b/test/integration/reporter.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; diff --git a/test/integration/serializer/longnumerals.test.js b/test/integration/serializer/longnumerals.test.js new file mode 100644 index 000000000..2e5675d2f --- /dev/null +++ b/test/integration/serializer/longnumerals.test.js @@ -0,0 +1,90 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict'; + +const { createReadStream } = require('fs'); +const { join } = require('path'); +const split = require('split2'); +const { test, beforeEach, afterEach } = require('tap'); + +const { Client } = require('../../../'); + +const INDEX = `test-serializer-${process.pid}`; +const client = new Client({ + node: process.env.TEST_OPENSEARCH_SERVER || 'http://localhost:9200', +}); + +beforeEach(async () => { + await client.indices.create({ index: INDEX }); + const stream = createReadStream( + join(__dirname, '..', '..', 'fixtures', 'longnumerals-dataset.ndjson') + ); + const result = await client.helpers.bulk({ + datasource: stream.pipe(split()), + refreshOnCompletion: true, + onDocument() { + return { + index: { _index: INDEX }, + }; + }, + }); + if (result.failed > 0) { + throw new Error('Failed bulk indexing docs'); + } +}); + +afterEach(async () => { + await client.indices.delete({ index: INDEX }, { ignore: 404 }); +}); + +test('long numerals', async (t) => { + const results = await client.helpers.search({ + index: INDEX, + body: { + query: { + range: { + number: { + lt: 999999999999999999n, + }, + }, + }, + }, + }); + t.equal(results.length, 3); + const object = {}; + for (const result of results) { + object[result.description] = result.number; + } + t.same(object, { + '-18014398509481982 , -1 , 1 , 18014398509481982': 18014398509481982n, + '෴18014398509481982': -18014398509481982n, + 'Safer than [18014398509481982]': 9007199254740891, + }); +}); diff --git a/test/integration/test-runner.js b/test/integration/test-runner.js index 051bb8ab1..54539ad3a 100644 --- a/test/integration/test-runner.js +++ b/test/integration/test-runner.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/types/api-response-body.test-d.ts b/test/types/api-response-body.test-d.ts index 3d799bf6a..e9bd9f5cc 100644 --- a/test/types/api-response-body.test-d.ts +++ b/test/types/api-response-body.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/types/api-response.test-d.ts b/test/types/api-response.test-d.ts index c0ed20df4..25668d672 100644 --- a/test/types/api-response.test-d.ts +++ b/test/types/api-response.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/types/awssigv4signer.test-d.ts b/test/types/awssigv4signer.test-d.ts new file mode 100644 index 000000000..33d2d82db --- /dev/null +++ b/test/types/awssigv4signer.test-d.ts @@ -0,0 +1,33 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ +import { expectType } from 'tsd'; +const { v4: uuidv4 } = require('uuid'); +import { AwsSigv4SignerResponse, AwsSigv4Signer } from '../../lib/aws'; + +const mockCreds = { + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + expired: false, + expireTime: new Date(), + sessionToken: uuidv4(), +}; + +const mockRegion = 'us-east-1'; + +{ + const AwsSigv4SignerOptions = { + getCredentials: () => Promise.resolve(mockCreds), + region: mockRegion, + }; + + const auth = AwsSigv4Signer(AwsSigv4SignerOptions); + + expectType(auth); +} diff --git a/test/types/client-options.test-d.ts b/test/types/client-options.test-d.ts index 0ff77158c..25b490194 100644 --- a/test/types/client-options.test-d.ts +++ b/test/types/client-options.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/types/client.test-d.ts b/test/types/client.test-d.ts index 99f2253a9..cf924aa5d 100644 --- a/test/types/client.test-d.ts +++ b/test/types/client.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -122,7 +121,7 @@ client.on('resurrect', (err, meta) => { try { expectType(await promise); } catch (err) { - expectType(err); + expectType(err); } } @@ -133,7 +132,7 @@ client.on('resurrect', (err, meta) => { try { expectType(await promise); } catch (err) { - expectType(err); + expectType(err); } } @@ -144,6 +143,6 @@ client.on('resurrect', (err, meta) => { try { expectType(await promise); } catch (err) { - expectType(err); + expectType(err); } } diff --git a/test/types/connection-pool.test-d.ts b/test/types/connection-pool.test-d.ts index d9817edf1..e4acf1988 100644 --- a/test/types/connection-pool.test-d.ts +++ b/test/types/connection-pool.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -61,6 +60,7 @@ import { ConnectionOptions } from '../../lib/Connection'; now: Date.now(), }) ); + expectType(pool.createConnection({ url: new URL('url') })); expectType(pool.addConnection({ url: new URL('url') })); expectType(pool.removeConnection(new Connection())); expectType(pool.empty()); diff --git a/test/types/connection.test-d.ts b/test/types/connection.test-d.ts index 7e7606c69..f174dbc2d 100644 --- a/test/types/connection.test-d.ts +++ b/test/types/connection.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -42,8 +41,8 @@ import { ConnectionOptions } from '../../lib/Connection'; agent: { keepAlive: false }, status: 'alive', roles: {}, - auth: { username: 'username', password: 'password' } - }) + auth: { username: 'username', password: 'password' }, + }); expectType(conn); expectType(conn.url); diff --git a/test/types/errors.test-d.ts b/test/types/errors.test-d.ts index 96718d160..af41dca25 100644 --- a/test/types/errors.test-d.ts +++ b/test/types/errors.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/types/helpers.test-d.ts b/test/types/helpers.test-d.ts index 94e9edf03..f07630569 100644 --- a/test/types/helpers.test-d.ts +++ b/test/types/helpers.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/types/new-types.test-d.ts b/test/types/new-types.test-d.ts index dc4f7ca04..18f8dc08a 100644 --- a/test/types/new-types.test-d.ts +++ b/test/types/new-types.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/types/serializer.test-d.ts b/test/types/serializer.test-d.ts index d27dac9e6..cdd9fb902 100644 --- a/test/types/serializer.test-d.ts +++ b/test/types/serializer.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/types/transport.test-d.ts b/test/types/transport.test-d.ts index 67c8dc2e4..3381f97cf 100644 --- a/test/types/transport.test-d.ts +++ b/test/types/transport.test-d.ts @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/unit/api-async.js b/test/unit/api-async.js index 312e2fb88..a7b85de02 100644 --- a/test/unit/api-async.js +++ b/test/unit/api-async.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/unit/api.test.js b/test/unit/api.test.js index 058bb60bd..e7fcfdf28 100644 --- a/test/unit/api.test.js +++ b/test/unit/api.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -106,7 +105,7 @@ test('Error (callback)', (t) => { index: 'test', q: 'foo:bar', }, - (err, { body }) => { + (err) => { t.ok(err); server.stop(); } @@ -306,7 +305,7 @@ test('If the API uses the same key for both url and query parameter, the url sho index: 'index', body: [], }, - (err, { body, warnings }) => { + (err) => { t.error(err); server.stop(); } @@ -325,7 +324,7 @@ test('ConfigurationError (callback)', (t) => { { body: { foo: 'bar' }, }, - (err, { body }) => { + (err) => { t.ok(err instanceof errors.ConfigurationError); } ); @@ -353,7 +352,7 @@ test('The callback with a sync error should be called in the next tick', (t) => node: 'http://localhost:9200', }); - const transportReturn = client.index({ body: { foo: 'bar' } }, (err, result) => { + const transportReturn = client.index({ body: { foo: 'bar' } }, (err) => { t.ok(err instanceof errors.ConfigurationError); }); diff --git a/test/unit/base-connection-pool.test.js b/test/unit/base-connection-pool.test.js index 424819db8..5b2ea5fc7 100644 --- a/test/unit/base-connection-pool.test.js +++ b/test/unit/base-connection-pool.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/unit/child.test.js b/test/unit/child.test.js index 854c95e7f..c5fea466d 100644 --- a/test/unit/child.test.js +++ b/test/unit/child.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -61,9 +60,9 @@ test('Should create a child client (headers check)', (t) => { headers: { 'x-baz': 'faz' }, }); - client.info((err, res) => { + client.info((err) => { t.error(err); - child.info((err, res) => { + child.info((err) => { t.error(err); server.stop(); }); @@ -85,9 +84,9 @@ test('Should create a child client (timeout check)', (t) => { const client = new Client({ node: `http://localhost:${port}` }); const child = client.child({ requestTimeout: 25, maxRetries: 0 }); - client.info((err, res) => { + client.info((err) => { t.error(err); - child.info((err, res) => { + child.info((err) => { t.ok(err instanceof errors.TimeoutError); server.stop(); }); @@ -156,11 +155,11 @@ test('Should share the event emitter', (t) => { }); const child = client.child(); - client.on('response', (err, meta) => { + client.on('response', (err) => { t.error(err); }); - child.info((err, res) => { + child.info((err) => { t.error(err); }); }); @@ -175,11 +174,11 @@ test('Should share the event emitter', (t) => { const child = client.child(); const grandchild = child.child(); - client.on('response', (err, meta) => { + client.on('response', (err) => { t.error(err); }); - grandchild.info((err, res) => { + grandchild.info((err) => { t.error(err); }); }); @@ -193,11 +192,11 @@ test('Should share the event emitter', (t) => { }); const child = client.child(); - child.on('response', (err, meta) => { + child.on('response', (err) => { t.error(err); }); - child.info((err, res) => { + child.info((err) => { t.error(err); }); }); @@ -212,11 +211,11 @@ test('Should share the event emitter', (t) => { const child = client.child(); const grandchild = child.child(); - child.on('response', (err, meta) => { + child.on('response', (err) => { t.error(err); }); - grandchild.info((err, res) => { + grandchild.info((err) => { t.error(err); }); }); @@ -310,9 +309,9 @@ test('Should create a child client (auth check)', (t) => { }, }); - client.info((err, res) => { + client.info((err) => { t.error(err); - child.info((err, res) => { + child.info((err) => { t.error(err); server.stop(); }); diff --git a/test/unit/client.test.js b/test/unit/client.test.js index 4a4f2bf98..e1d3557f2 100644 --- a/test/unit/client.test.js +++ b/test/unit/client.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -34,8 +33,15 @@ const { test } = require('tap'); const { URL } = require('url'); const buffer = require('buffer'); const intoStream = require('into-stream'); -const { ConnectionPool, Transport, Connection, errors } = require('../../index'); -const { Client, buildServer } = require('../utils'); +const { + ConnectionPool, + Transport, + Connection, + errors, + Client: ProductClient, +} = require('../../index'); +const { Client, buildServer, connection } = require('../utils'); +const { buildMockConnection } = connection; let clientVersion = require('../../package.json').version; if (clientVersion.includes('-')) { clientVersion = clientVersion.slice(0, clientVersion.indexOf('-')) + 'p'; @@ -650,7 +656,7 @@ test('Extend client APIs', (t) => { node: 'http://localhost:9200', Transport: MyTransport, }); - client.extend('method', ({ makeRequest, result, ConfigurationError }) => { + client.extend('method', ({ makeRequest }) => { return (params, options) => makeRequest(params, options); }); @@ -661,7 +667,7 @@ test('Extend client APIs', (t) => { t.plan(2); const client = new Client({ node: 'http://localhost:9200' }); - client.extend('method', ({ makeRequest, result, ConfigurationError }) => { + client.extend('method', () => { return (params, options, callback) => { callback(null, { hello: 'world' }); }; @@ -677,9 +683,9 @@ test('Extend client APIs', (t) => { t.plan(1); const client = new Client({ node: 'http://localhost:9200' }); - client.extend('method', ({ makeRequest, result, ConfigurationError }) => { - return (params, options) => { - return new Promise((resolve, reject) => { + client.extend('method', () => { + return () => { + return new Promise((resolve) => { resolve({ hello: 'world' }); }); }; @@ -928,7 +934,7 @@ test('Bad content length', (t) => { buildServer(handler, ({ port }, server) => { const client = new Client({ node: `http://localhost:${port}`, maxRetries: 1 }); - client.info((err, { body }) => { + client.info((err) => { t.ok(err instanceof errors.ConnectionError); t.equal(err.message, 'Response aborted while reading the body'); t.equal(count, 2); @@ -954,7 +960,7 @@ test('Socket destryed while reading the body', (t) => { buildServer(handler, ({ port }, server) => { const client = new Client({ node: `http://localhost:${port}`, maxRetries: 1 }); - client.info((err, { body }) => { + client.info((err) => { t.ok(err instanceof errors.ConnectionError); t.equal(err.message, 'Response aborted while reading the body'); t.equal(count, 2); @@ -1106,7 +1112,7 @@ test('Prototype poisoning protection enabled by default', (t) => { Connection: MockConnection, }); - client.info((err, result) => { + client.info((err) => { t.ok(err instanceof errors.DeserializationError); }); }); @@ -1135,7 +1141,7 @@ test('Disable prototype poisoning protection', (t) => { disablePrototypePoisoningProtection: true, }); - client.info((err, result) => { + client.info((err) => { t.error(err); }); }); @@ -1189,3 +1195,90 @@ test('API compatibility header (x-ndjson)', (t) => { }); }); }); + +test('Issue #253 with promises', async (t) => { + t.plan(1); + + const delay = () => new Promise((resolve) => setTimeout(resolve, 10)); + + const MockConnection = buildMockConnection({ + onRequest() { + return { + statusCode: 200, + headers: {}, + body: {}, + }; + }, + }); + + class MyTransport extends Transport { + request(params, options = {}, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + if (typeof callback === 'undefined') { + return delay().then(() => super.request(params, options)); + } + + // Callback support + delay().then(() => super.request(params, options, callback)); + } + } + + const client = new ProductClient({ + node: 'http://localhost:9200', + Transport: MyTransport, + Connection: MockConnection, + }); + + try { + await client.search({}); + t.pass('ok'); + } catch (err) { + t.fail(err); + } +}); + +test('Issue #253 with callbacks', (t) => { + t.plan(1); + + const delay = () => new Promise((resolve) => setTimeout(resolve, 10)); + + const MockConnection = buildMockConnection({ + onRequest() { + return { + statusCode: 200, + headers: {}, + body: {}, + }; + }, + }); + + class MyTransport extends Transport { + request(params, options = {}, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + if (typeof callback === 'undefined') { + return delay().then(() => super.request(params, options)); + } + + // Callback support + delay().then(() => super.request(params, options, callback)); + } + } + + const client = new ProductClient({ + node: 'http://localhost:9200', + Transport: MyTransport, + Connection: MockConnection, + }); + + client.search({}, (err) => { + t.error(err); + }); +}); diff --git a/test/unit/cloud-connection-pool.test.js b/test/unit/cloud-connection-pool.test.js index ae20658b9..f251f4393 100644 --- a/test/unit/cloud-connection-pool.test.js +++ b/test/unit/cloud-connection-pool.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/unit/connection-pool.test.js b/test/unit/connection-pool.test.js index 1d7054522..a571b4ae5 100644 --- a/test/unit/connection-pool.test.js +++ b/test/unit/connection-pool.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/unit/connection.test.js b/test/unit/connection.test.js index 38ad78477..3724de112 100644 --- a/test/unit/connection.test.js +++ b/test/unit/connection.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -289,7 +288,7 @@ test('Timeout support', (t) => { method: 'GET', timeout: 500, }, - (err, res) => { + (err) => { t.ok(err instanceof TimeoutError); server.stop(); } @@ -316,7 +315,7 @@ test('querystring', (t) => { method: 'GET', querystring: 'hello=world&you_know=for%20search', }, - (err, res) => { + (err) => { t.error(err); server.stop(); } @@ -342,7 +341,7 @@ test('querystring', (t) => { method: 'GET', querystring: null, }, - (err, res) => { + (err) => { t.error(err); server.stop(); } @@ -379,7 +378,7 @@ test('Body request', (t) => { method: 'POST', body: 'hello', }, - (err, res) => { + (err) => { t.error(err); server.stop(); } @@ -413,7 +412,7 @@ test('Send body as buffer', (t) => { method: 'POST', body: Buffer.from('hello'), }, - (err, res) => { + (err) => { t.error(err); server.stop(); } @@ -447,7 +446,7 @@ test('Send body as stream', (t) => { method: 'POST', body: intoStream('hello'), }, - (err, res) => { + (err) => { t.error(err); server.stop(); } @@ -558,7 +557,7 @@ test('Url with auth', (t) => { path: '/hello', method: 'GET', }, - (err, res) => { + (err) => { t.error(err); server.stop(); } @@ -584,7 +583,7 @@ test('Url with querystring', (t) => { method: 'GET', querystring: 'baz=faz', }, - (err, res) => { + (err) => { t.error(err); server.stop(); } @@ -616,7 +615,38 @@ test('Custom headers for connection', (t) => { 'X-Custom-Test': true, }, }, - (err, res) => { + (err) => { + t.error(err); + // should not update the default + t.same(connection.headers, { 'x-foo': 'bar' }); + server.stop(); + } + ); + }); +}); + +test('mutability of connection headers', (t) => { + t.plan(3); + + function handler(req, res) { + t.match(req.headers, { + 'x-foo': 'bar', + }); + req.headers['x-custom-test'] = true; + res.end('ok'); + } + + buildServer(handler, ({ port }, server) => { + const connection = new Connection({ + url: new URL(`http://localhost:${port}`), + headers: { 'x-foo': 'bar' }, + }); + connection.request( + { + path: '/hello', + method: 'GET', + }, + (err) => { t.error(err); // should not update the default t.same(connection.headers, { 'x-foo': 'bar' }); @@ -704,7 +734,7 @@ test('Should disallow two-byte characters in URL path', (t) => { path: '/thisisinvalid\uffe2', method: 'GET', }, - (err, res) => { + (err) => { t.equal(err.message, 'ERR_UNESCAPED_CHARACTERS: /thisisinvalid\uffe2'); } ); @@ -971,7 +1001,7 @@ test('Should not add agent and ssl to the serialized connection', (t) => { test('Abort a request syncronously', (t) => { t.plan(1); - function handler(req, res) { + function handler() { t.fail('The server should not be contacted'); } @@ -984,7 +1014,7 @@ test('Abort a request syncronously', (t) => { path: '/hello', method: 'GET', }, - (err, res) => { + (err) => { t.ok(err instanceof RequestAbortedError); server.stop(); } @@ -1010,7 +1040,7 @@ test('Abort a request asyncronously', (t) => { path: '/hello', method: 'GET', }, - (err, res) => { + (err) => { t.ok(err instanceof RequestAbortedError); server.stop(); } @@ -1065,7 +1095,38 @@ test('Abort with a slow body', (t) => { }); const slowBody = new Readable({ - read(size) { + read() { + setTimeout(() => { + this.push('{"size":1, "query":{"match_all":{}}}'); + this.push(null); // EOF + }, 1000).unref(); + }, + }); + + const request = connection.request( + { + method: 'GET', + path: '/', + body: slowBody, + }, + (err) => { + t.ok(err instanceof RequestAbortedError); + } + ); + + setImmediate(() => request.abort()); +}); + +test('Abort with message', (t) => { + t.plan(2); + + const connection = new Connection({ + url: new URL('https://localhost:9200'), + proxy: 'http://localhost:8080', + }); + + const slowBody = new Readable({ + read() { setTimeout(() => { this.push('{"size":1, "query":{"match_all":{}}}'); this.push(null); // EOF @@ -1079,8 +1140,9 @@ test('Abort with a slow body', (t) => { path: '/', body: slowBody, }, - (err, response) => { + (err) => { t.ok(err instanceof RequestAbortedError); + t.equal(err.message, 'Request aborted'); } ); diff --git a/test/unit/errors.test.js b/test/unit/errors.test.js index 1477e678e..cf250b31d 100644 --- a/test/unit/errors.test.js +++ b/test/unit/errors.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -65,6 +64,14 @@ test('NoLivingConnectionsError', (t) => { t.end(); }); +test('NotCompatibleError', (t) => { + const err = new errors.NotCompatibleError(); + t.ok(err instanceof Error); + t.ok(err instanceof errors.OpenSearchClientError); + t.ok(err.hasOwnProperty('meta')); + t.end(); +}); + test('SerializationError', (t) => { const err = new errors.SerializationError(); t.ok(err instanceof Error); diff --git a/test/unit/esm/index.mjs b/test/unit/esm/index.mjs index ac86bdaa3..4368f720e 100644 --- a/test/unit/esm/index.mjs +++ b/test/unit/esm/index.mjs @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import t from 'tap'; diff --git a/test/unit/esm/index.test.js b/test/unit/esm/index.test.js index 03c2e1b8c..24c7debd8 100644 --- a/test/unit/esm/index.test.js +++ b/test/unit/esm/index.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ 'use strict'; diff --git a/test/unit/events.test.js b/test/unit/events.test.js index 70ce3e649..6848f3290 100644 --- a/test/unit/events.test.js +++ b/test/unit/events.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -80,7 +79,7 @@ test('Should emit a request event when a request is performed', (t) => { index: 'test', q: 'foo:bar', }, - (err, result) => { + (err) => { t.error(err); } ); @@ -128,7 +127,7 @@ test('Should emit a request event once when a request is performed', (t) => { index: 'test', q: 'foo:bar', }, - (err, result) => { + (err) => { t.error(err); } ); @@ -138,7 +137,7 @@ test('Should emit a request event once when a request is performed', (t) => { index: 'test', q: 'foo:bar', }, - (err, result) => { + (err) => { t.error(err); } ); @@ -189,7 +188,7 @@ test('Remove an event', (t) => { index: 'test', q: 'foo:bar', }, - (err, result) => { + (err) => { t.error(err); } ); @@ -199,7 +198,7 @@ test('Remove an event', (t) => { index: 'test', q: 'foo:bar', }, - (err, result) => { + (err) => { t.error(err); } ); @@ -250,7 +249,7 @@ test('Should emit a response event in case of a successful response', (t) => { index: 'test', q: 'foo:bar', }, - (err, result) => { + (err) => { t.error(err); } ); @@ -304,7 +303,7 @@ test('Should emit a response event with the error set', (t) => { { requestTimeout: 500, }, - (err, result) => { + (err) => { t.ok(err instanceof TimeoutError); } ); diff --git a/test/unit/helpers/bulk.test.js b/test/unit/helpers/bulk.test.js index c03ae5532..f0d375e44 100644 --- a/test/unit/helpers/bulk.test.js +++ b/test/unit/helpers/bulk.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -73,12 +72,12 @@ test('bulk index', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -116,12 +115,12 @@ test('bulk index', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 3, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -155,12 +154,12 @@ test('bulk index', (t) => { datasource: dataset.slice(), flushBytes: 5000000, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -203,7 +202,7 @@ test('bulk index', (t) => { flushBytes: 1, concurrency: 1, refreshOnCompletion: true, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; @@ -248,7 +247,7 @@ test('bulk index', (t) => { flushBytes: 1, concurrency: 1, refreshOnCompletion: 'test', - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; @@ -288,7 +287,7 @@ test('bulk index', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test', @@ -296,7 +295,7 @@ test('bulk index', (t) => { }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -359,7 +358,7 @@ test('bulk index', (t) => { concurrency: 1, wait: 10, retries: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; @@ -410,7 +409,7 @@ test('bulk index', (t) => { concurrency: 1, wait: 10, retries: 0, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; @@ -485,7 +484,7 @@ test('bulk index', (t) => { flushBytes: 1, concurrency: 1, wait: 10, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; @@ -515,7 +514,7 @@ test('bulk index', (t) => { t.test('Server error', async (t) => { const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { statusCode: 500, body: { somothing: 'went wrong' }, @@ -531,12 +530,12 @@ test('bulk index', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -551,7 +550,7 @@ test('bulk index', (t) => { t.test('Server error (high flush size, to trigger the finish error)', async (t) => { const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { statusCode: 500, body: { somothing: 'went wrong' }, @@ -567,12 +566,12 @@ test('bulk index', (t) => { datasource: dataset.slice(), flushBytes: 5000000, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -632,12 +631,12 @@ test('bulk index', (t) => { flushBytes: 1, concurrency: 1, wait: 10, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { b.abort(); }, }); @@ -658,7 +657,7 @@ test('bulk index', (t) => { t.test('Invalid operation', (t) => { t.plan(2); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { errors: false, items: [{}] } }; }, }); @@ -672,7 +671,7 @@ test('bulk index', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { foo: { _index: 'test' }, }; @@ -684,6 +683,56 @@ test('bulk index', (t) => { }); }); + t.test('Should use payload returned by `onDocument`', async (t) => { + let count = 0; + const updatedAt = '1970-01-01T12:00:00.000Z'; + const MockConnection = connection.buildMockConnection({ + onRequest(params) { + t.equal(params.path, '/_bulk'); + t.match(params.headers, { + 'content-type': 'application/x-ndjson', + }); + const [action, payload] = params.body.split('\n'); + t.same(JSON.parse(action), { index: { _index: 'test' } }); + t.same(JSON.parse(payload), { ...dataset[count++], updatedAt }); + return { body: { errors: false, items: [{}] } }; + }, + }); + + const client = new Client({ + node: 'http://localhost:9200', + Connection: MockConnection, + }); + const result = await client.helpers.bulk({ + datasource: dataset.slice(), + flushBytes: 1, + concurrency: 1, + onDocument(doc) { + return [ + { + index: { + _index: 'test', + }, + }, + { ...doc, updatedAt }, + ]; + }, + onDrop() { + t.fail('This should never be called'); + }, + }); + + t.type(result.time, 'number'); + t.type(result.bytes, 'number'); + t.match(result, { + total: 3, + successful: 3, + retry: 0, + failed: 0, + aborted: false, + }); + }); + t.end(); }); @@ -715,7 +764,7 @@ test('bulk index', (t) => { datasource: stream.pipe(split()), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test', @@ -723,7 +772,7 @@ test('bulk index', (t) => { }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -772,12 +821,12 @@ test('bulk index', (t) => { datasource: generator(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -821,7 +870,7 @@ test('bulk create', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { create: { _index: 'test', @@ -829,7 +878,7 @@ test('bulk create', (t) => { }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -844,6 +893,57 @@ test('bulk create', (t) => { aborted: false, }); }); + + t.test('Should perform a bulk request', async (t) => { + let count = 0; + const updatedAt = '1970-01-01T12:00:00.000Z'; + const MockConnection = connection.buildMockConnection({ + onRequest(params) { + t.equal(params.path, '/_bulk'); + t.match(params.headers, { 'content-type': 'application/x-ndjson' }); + const [action, payload] = params.body.split('\n'); + t.same(JSON.parse(action), { create: { _index: 'test', _id: count } }); + t.same(JSON.parse(payload), { ...dataset[count++], updatedAt }); + return { body: { errors: false, items: [{}] } }; + }, + }); + + const client = new Client({ + node: 'http://localhost:9200', + Connection: MockConnection, + }); + let id = 0; + const result = await client.helpers.bulk({ + datasource: dataset.slice(), + flushBytes: 1, + concurrency: 1, + onDocument(doc) { + return [ + { + create: { + _index: 'test', + _id: id++, + }, + }, + { ...doc, updatedAt }, + ]; + }, + onDrop() { + t.fail('This should never be called'); + }, + }); + + t.type(result.time, 'number'); + t.type(result.bytes, 'number'); + t.match(result, { + total: 3, + successful: 3, + retry: 0, + failed: 0, + aborted: false, + }); + }); + t.end(); }); @@ -870,7 +970,7 @@ test('bulk update', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return [ { update: { @@ -883,7 +983,7 @@ test('bulk update', (t) => { }, ]; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -921,7 +1021,7 @@ test('bulk update', (t) => { datasource: dataset.map((d) => JSON.stringify(d)), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return [ { update: { @@ -931,7 +1031,7 @@ test('bulk update', (t) => { }, ]; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -951,11 +1051,11 @@ test('bulk update', (t) => { let count = 0; const MockConnection = connection.buildMockConnection({ onRequest(params) { - t.strictEqual(params.path, '/_bulk'); + t.equal(params.path, '/_bulk'); t.match(params.headers, { 'content-type': 'application/x-ndjson' }); const [action, payload] = params.body.split('\n'); - t.deepEqual(JSON.parse(action), { update: { _index: 'test', _id: count } }); - t.deepEqual(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true }); + t.same(JSON.parse(action), { update: { _index: 'test', _id: count } }); + t.same(JSON.parse(payload), { doc: dataset[count++], doc_as_upsert: true }); return { body: { errors: false, items: [{ update: { result: 'noop' } }] } }; }, }); @@ -969,7 +1069,7 @@ test('bulk update', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return [ { update: { @@ -982,7 +1082,7 @@ test('bulk update', (t) => { }, ]; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -1023,7 +1123,7 @@ test('bulk delete', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { delete: { _index: 'test', @@ -1031,7 +1131,7 @@ test('bulk delete', (t) => { }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -1094,7 +1194,7 @@ test('bulk delete', (t) => { flushBytes: 1, concurrency: 1, wait: 10, - onDocument(doc) { + onDocument() { return { delete: { _index: 'test', @@ -1161,10 +1261,10 @@ test('transport options', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' } }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, refreshOnCompletion: true, @@ -1199,7 +1299,7 @@ test('errors', (t) => { try { await client.helpers.bulk({ datasource: 'hello', - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; @@ -1220,7 +1320,7 @@ test('errors', (t) => { }); try { await client.helpers.bulk({ - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; @@ -1280,12 +1380,12 @@ test('Flush interval', (t) => { })(), flushBytes: 5000000, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -1338,12 +1438,12 @@ test('Flush interval', (t) => { })(), flushBytes: 5000000, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); @@ -1365,13 +1465,13 @@ test('Flush interval', (t) => { let count = 0; const MockConnection = connection.buildMockConnection({ onRequest(params) { - t.strictEqual(params.path, '/_bulk'); + t.equal(params.path, '/_bulk'); t.match(params.headers, { 'content-type': 'application/x-ndjson', }); const [action, payload] = params.body.split('\n'); - t.deepEqual(JSON.parse(action), { index: { _index: 'test' } }); - t.deepEqual(JSON.parse(payload), dataset[count++]); + t.same(JSON.parse(action), { index: { _index: 'test' } }); + t.same(JSON.parse(payload), dataset[count++]); return { body: { errors: false, items: [{}] } }; }, }); @@ -1384,12 +1484,12 @@ test('Flush interval', (t) => { datasource: dataset.slice(), flushBytes: 1, concurrency: 1, - onDocument(doc) { + onDocument() { return { index: { _index: 'test' }, }; }, - onDrop(doc) { + onDrop() { t.fail('This should never be called'); }, }); diff --git a/test/unit/helpers/msearch.test.js b/test/unit/helpers/msearch.test.js index 42bef148f..7997d04be 100644 --- a/test/unit/helpers/msearch.test.js +++ b/test/unit/helpers/msearch.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -37,7 +36,7 @@ const FakeTimers = require('@sinonjs/fake-timers'); test('Basic', async (t) => { const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [ @@ -86,7 +85,7 @@ test('Multiple searches (inside async iterator)', (t) => { t.plan(6); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [ @@ -162,7 +161,7 @@ test('Multiple searches (async iterator exits)', (t) => { t.plan(6); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [ @@ -236,7 +235,7 @@ test('Multiple searches (async iterator exits)', (t) => { test('Stop a msearch processor (promises)', async (t) => { const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return {}; }, }); @@ -263,7 +262,7 @@ test('Stop a msearch processor (callbacks)', (t) => { t.plan(1); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return {}; }, }); @@ -277,7 +276,7 @@ test('Stop a msearch processor (callbacks)', (t) => { m.stop(); - m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => { + m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err) => { t.equal(err.message, 'The msearch processor has been stopped'); }); }); @@ -286,7 +285,7 @@ test('Bad header', (t) => { t.plan(2); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return {}; }, }); @@ -298,7 +297,7 @@ test('Bad header', (t) => { const m = client.helpers.msearch(); - m.search(null, { query: { match: { foo: 'bar' } } }, (err, result) => { + m.search(null, { query: { match: { foo: 'bar' } } }, (err) => { t.equal(err.message, 'The header should be an object'); }); @@ -313,7 +312,7 @@ test('Bad body', (t) => { t.plan(2); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return {}; }, }); @@ -325,7 +324,7 @@ test('Bad body', (t) => { const m = client.helpers.msearch(); - m.search({ index: 'test' }, null, (err, result) => { + m.search({ index: 'test' }, null, (err) => { t.equal(err.message, 'The body should be an object'); }); @@ -339,7 +338,7 @@ test('Bad body', (t) => { test('Retry on 429', async (t) => { let count = 0; const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { if (count++ === 0) { return { body: { @@ -399,7 +398,7 @@ test('Retry on 429', async (t) => { test('Single search errors', async (t) => { const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [ @@ -433,7 +432,7 @@ test('Entire msearch fails', (t) => { t.plan(4); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { statusCode: 500, body: { @@ -468,7 +467,7 @@ test('Resolves the msearch helper', (t) => { t.plan(1); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return {}; }, }); @@ -484,17 +483,17 @@ test('Resolves the msearch helper', (t) => { m.then( () => t.pass('called'), - (e) => t.fail('Should not fail') + () => t.fail('Should not fail') ); - m.catch((e) => t.fail('Should not fail')); + m.catch(() => t.fail('Should not fail')); }); test('Stop the msearch helper with an error', (t) => { t.plan(3); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return {}; }, }); @@ -515,7 +514,7 @@ test('Stop the msearch helper with an error', (t) => { m.catch((err) => t.equal(err.message, 'kaboom')); - m.search({ index: 'test' }, { query: {} }, (err, result) => { + m.search({ index: 'test' }, { query: {} }, (err) => { t.equal(err.message, 'kaboom'); }); }); @@ -524,7 +523,7 @@ test('Multiple searches (concurrency = 1)', (t) => { t.plan(6); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [ @@ -592,7 +591,7 @@ test('Flush interval', (t) => { t.teardown(() => clock.uninstall()); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [ @@ -648,7 +647,7 @@ test('Flush interval - early stop', (t) => { t.plan(3); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [ @@ -681,7 +680,7 @@ test('Flush interval - early stop', (t) => { }); setImmediate(() => { - m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err, result) => { + m.search({ index: 'test' }, { query: { match: { foo: 'bar' } } }, (err) => { t.ok(err instanceof errors.ConfigurationError); }); }); @@ -693,7 +692,7 @@ test('Stop should resolve the helper', (t) => { t.plan(1); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [], @@ -717,7 +716,7 @@ test('Stop should resolve the helper (error)', (t) => { t.plan(3); const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { return { body: { responses: [], diff --git a/test/unit/helpers/scroll.test.js b/test/unit/helpers/scroll.test.js index 13731691f..34f268f24 100644 --- a/test/unit/helpers/scroll.test.js +++ b/test/unit/helpers/scroll.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -191,7 +190,7 @@ test('Scroll search (retry throws and maxRetries)', async (t) => { const expectedAttempts = maxRetries + 1; let count = 0; const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { count += 1; return { body: {}, statusCode: 429 }; }, @@ -215,8 +214,8 @@ test('Scroll search (retry throws and maxRetries)', async (t) => { ); try { + // eslint-disable-next-line no-unused-vars for await (const result of scrollSearch) { - // eslint-disable-line t.fail('we should not be here'); } } catch (err) { @@ -340,7 +339,7 @@ test('Should not retry if maxRetries = 0', async (t) => { const expectedAttempts = 1; let count = 0; const MockConnection = connection.buildMockConnection({ - onRequest(params) { + onRequest() { count += 1; return { body: {}, statusCode: 429 }; }, @@ -364,8 +363,8 @@ test('Should not retry if maxRetries = 0', async (t) => { ); try { + // eslint-disable-next-line no-unused-vars for await (const result of scrollSearch) { - // eslint-disable-line t.fail('we should not be here'); } } catch (err) { diff --git a/test/unit/helpers/search.test.js b/test/unit/helpers/search.test.js index 5e77f80fa..24177d1c0 100644 --- a/test/unit/helpers/search.test.js +++ b/test/unit/helpers/search.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/unit/lib/aws/awssigv4signer.test.js b/test/unit/lib/aws/awssigv4signer.test.js new file mode 100644 index 000000000..7c8636fe3 --- /dev/null +++ b/test/unit/lib/aws/awssigv4signer.test.js @@ -0,0 +1,474 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + */ +const { test } = require('tap'); +const { URL } = require('url'); +const { v4: uuidv4 } = require('uuid'); +const AwsSigv4Signer = require('../../../../lib/aws/AwsSigv4Signer'); +const AwsSigv4SignerError = require('../../../../lib/aws/errors'); +const { Connection } = require('../../../../index'); +const { Client, buildServer } = require('../../../utils'); + +test('Sign with SigV4', (t) => { + t.plan(4); + + const mockCreds = { + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + }; + + const mockRegion = 'us-west-2'; + + const AwsSigv4SignerOptions = { + getCredentials: () => + new Promise((resolve) => { + setTimeout(() => resolve(mockCreds), 100); + }), + region: mockRegion, + }; + + const auth = AwsSigv4Signer(AwsSigv4SignerOptions); + + const connection = new Connection({ + url: new URL('https://localhost:9200'), + }); + + const request = connection.buildRequestObject({ + path: '/hello', + method: 'GET', + headers: { + 'X-Custom-Test': true, + }, + }); + + const signedRequest = auth.buildSignedRequestObject(request); + t.hasProp(signedRequest.headers, 'X-Amz-Date'); + t.hasProp(signedRequest.headers, 'Authorization'); + t.same( + signedRequest.headers['x-amz-content-sha256'], + 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' + ); + t.same(signedRequest.service, 'es'); +}); + +test('Sign with SigV4 failure (with empty region)', (t) => { + const mockCreds = { + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + }; + + const mockRegions = [{ region: undefined }, { region: null }, { region: '' }, {}]; + + const AwsSigv4SignerOptions = { + getCredentials: () => + new Promise((resolve) => { + setTimeout(() => resolve(mockCreds), 100); + }), + }; + + mockRegions.forEach((region) => { + try { + AwsSigv4Signer(Object.assign({}, AwsSigv4SignerOptions, region)); + t.fail('Should fail'); + } catch (err) { + t.ok(err instanceof AwsSigv4SignerError); + t.same(err.message, 'Region cannot be empty'); + } + }); + + t.end(); +}); + +test('Sign with SigV4 and provided service', (t) => { + t.plan(1); + + const mockCreds = { + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + }; + + const mockRegion = 'us-west-2'; + const mockService = 'foo'; + + const AwsSigv4SignerOptions = { + getCredentials: () => + new Promise((resolve) => { + setTimeout(() => resolve(mockCreds), 100); + }), + region: mockRegion, + service: mockService, + }; + + const auth = AwsSigv4Signer(AwsSigv4SignerOptions); + + const connection = new Connection({ + url: new URL('https://localhost:9200'), + }); + + const request = connection.buildRequestObject({ + path: '/hello', + method: 'GET', + }); + + const signedRequest = auth.buildSignedRequestObject(request); + t.same(signedRequest.service, mockService); +}); + +test('Sign with SigV4 using default getCredentials provider', (t) => { + t.plan(2); + + function handler(req, res) { + res.setHeader('Content-Type', 'application/json;utf=8'); + res.end(JSON.stringify({ hello: 'world' })); + } + + buildServer(handler, ({ port }, server) => { + const mockRegion = 'us-east-1'; + + const AwsSigv4SignerOptions = { + region: mockRegion, + }; + const client = new Client({ + ...AwsSigv4Signer(AwsSigv4SignerOptions), + node: `http://localhost:${port}`, + }); + + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(() => { + t.fail('Should fail'); + }) + .catch((err) => { + t.ok(err instanceof AwsSigv4SignerError); + t.same( + err.message, + 'Unable to find a valid AWS SDK, please provide a valid getCredentials function to AwsSigv4Signer options.' + ); + }) + .finally(() => { + server.stop(); + }); + }); +}); + +test('Basic aws (promises)', (t) => { + t.plan(4); + + function handler(req, res) { + res.setHeader('Content-Type', 'application/json;utf=8'); + res.end(JSON.stringify({ hello: 'world' })); + } + + buildServer(handler, ({ port }, server) => { + const mockRegion = 'us-east-1'; + + let getCredentialsCalled = 0; + const AwsSigv4SignerOptions = { + region: mockRegion, + getCredentials: () => + new Promise((resolve) => { + setTimeout(() => { + getCredentialsCalled++; + resolve({ + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + expired: false, + expireTime: new Date(Date.now() + 1000 * 60 * 60), + }); + }, 100); + }), + }; + const client = new Client({ + ...AwsSigv4Signer(AwsSigv4SignerOptions), + node: `http://localhost:${port}`, + }); + + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(({ body }) => { + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 1); + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(({ body }) => { + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 1); + + server.stop(); + }) + .catch(t.fail); + }) + .catch(t.fail); + }); +}); + +test('Basic with expired token (promises)', (t) => { + t.plan(4); + + function handler(req, res) { + res.setHeader('Content-Type', 'application/json;utf=8'); + res.end(JSON.stringify({ hello: 'world' })); + } + + buildServer(handler, ({ port }, server) => { + const mockRegion = 'us-east-1'; + + let getCredentialsCalled = 0; + const getCredentials = () => + new Promise((resolve) => { + setTimeout(() => { + getCredentialsCalled++; + resolve({ + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + expired: true, + expireTime: new Date(Date.now() - 1000), + }); + }, 100); + }); + + const AwsSigv4SignerOptions = { + getCredentials: getCredentials, + region: mockRegion, + }; + + const auth = AwsSigv4Signer(AwsSigv4SignerOptions); + + const client = new Client({ + ...auth, + node: `http://localhost:${port}`, + }); + + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(({ body }) => { + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 1); + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(({ body }) => { + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 2); + + server.stop(); + }) + .catch(t.fail); + }) + .catch(t.fail); + }); +}); + +test('Basic with expired token and credentials sdk refresh (promises)', (t) => { + t.plan(6); + + function handler(req, res) { + res.setHeader('Content-Type', 'application/json;utf=8'); + res.end(JSON.stringify({ hello: 'world' })); + } + + buildServer(handler, ({ port }, server) => { + const mockRegion = 'us-east-1'; + + let getCredentialsCalled = 0; + let refreshPromiseCalled = 0; + const getCredentials = () => + new Promise((resolve) => { + setTimeout(() => { + getCredentialsCalled++; + resolve({ + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + needsRefresh: () => true, + refreshPromise: () => + new Promise((resolve) => { + refreshPromiseCalled++; + resolve({ + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + expired: false, + }); + }), + }); + }, 100); + }); + + const AwsSigv4SignerOptions = { + getCredentials: getCredentials, + region: mockRegion, + }; + + const auth = AwsSigv4Signer(AwsSigv4SignerOptions); + + const client = new Client({ + ...auth, + node: `http://localhost:${port}`, + }); + + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(({ body }) => { + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 1); + t.same(refreshPromiseCalled, 0); + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(({ body }) => { + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 1); + t.same(refreshPromiseCalled, 1); + + server.stop(); + }) + .catch(t.fail); + }) + .catch(t.fail); + }); +}); + +test('Basic aws (callback)', (t) => { + t.plan(6); + + function handler(req, res) { + res.setHeader('Content-Type', 'application/json;utf=8'); + res.end(JSON.stringify({ hello: 'world' })); + } + + buildServer(handler, ({ port }, server) => { + const mockRegion = 'us-east-1'; + + let getCredentialsCalled = 0; + const AwsSigv4SignerOptions = { + region: mockRegion, + getCredentials: () => + new Promise((resolve) => { + setTimeout(() => { + getCredentialsCalled++; + resolve({ + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + expiration: new Date(Date.now() + 1000 * 60 * 60), + }); + }, 100); + }), + }; + const client = new Client({ + ...AwsSigv4Signer(AwsSigv4SignerOptions), + node: `http://localhost:${port}`, + }); + + client.search( + { + index: 'test', + q: 'foo:bar', + }, + (err, { body }) => { + t.error(err); + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 1); + client.search( + { + index: 'test', + q: 'foo:bar', + }, + (err, { body }) => { + t.error(err); + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 1); + server.stop(); + } + ); + } + ); + }); +}); + +test('Basic aws failure to refresh credentials', (t) => { + t.plan(4); + + function handler(req, res) { + res.setHeader('Content-Type', 'application/json;utf=8'); + res.end(JSON.stringify({ hello: 'world' })); + } + + buildServer(handler, ({ port }, server) => { + const mockRegion = 'us-east-1'; + + let getCredentialsCalled = 0; + const AwsSigv4SignerOptions = { + region: mockRegion, + getCredentials: () => + new Promise((resolve, reject) => { + setTimeout(() => { + getCredentialsCalled++; + if (getCredentialsCalled === 1) { + resolve({ + accessKeyId: uuidv4(), + secretAccessKey: uuidv4(), + expireTime: new Date(Date.now() - 1000 * 60 * 60), + }); + } else { + reject(new Error('Failed to refresh credentials')); + } + }, 100); + }), + }; + const client = new Client({ + ...AwsSigv4Signer(AwsSigv4SignerOptions), + node: `http://localhost:${port}`, + }); + + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(({ body }) => { + t.same(body, { hello: 'world' }); + t.same(getCredentialsCalled, 1); + client + .search({ + index: 'test', + q: 'foo:bar', + }) + .then(() => { + t.same(getCredentialsCalled, 2); + t.fail('Should fail'); + }) + .catch((err) => { + t.ok(err); + t.same(getCredentialsCalled, 2); + }) + .finally(() => { + server.stop(); + }); + }) + .catch(t.fail); + }); +}); diff --git a/test/unit/selectors.test.js b/test/unit/selectors.test.js index 6e7bbc349..9980d617c 100644 --- a/test/unit/selectors.test.js +++ b/test/unit/selectors.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/unit/serializer.test.js b/test/unit/serializer.test.js index d171ccab7..f6c6339a7 100644 --- a/test/unit/serializer.test.js +++ b/test/unit/serializer.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -44,6 +43,32 @@ test('Basic', (t) => { t.same(s.deserialize(json), obj); }); +test('Long numerals', (t) => { + t.plan(7); + const s = new Serializer(); + const longPositive = BigInt(Number.MAX_SAFE_INTEGER) * 2n; // eslint-disable-line no-undef + const longNegative = BigInt(Number.MIN_SAFE_INTEGER) * 2n; // eslint-disable-line no-undef + const json = + `{` + + // The space before and after the values, and the lack of spaces before comma are intentional + `"\\":${longPositive}": "[ ${longNegative.toString()}, ${longPositive.toString()} ]", ` + + `"positive": ${longPositive.toString()}, ` + + `"array": [ ${longNegative.toString()}, ${longPositive.toString()} ], ` + + `"negative": ${longNegative.toString()},` + + `"hardcoded": 102931203123987` + + `}`; + const obj = s.deserialize(json); + const res = s.serialize(obj); + t.equal(obj.positive, longPositive); + t.equal(obj.negative, longNegative); + t.same(obj.array, [longNegative, longPositive]); + // The space before and after the values, and the lack of spaces before comma are intentional + t.equal(obj['":' + longPositive], `[ ${longNegative.toString()}, ${longPositive.toString()} ]`); + t.equal(obj.hardcoded, 102931203123987); + t.equal(res.replace(/\s+/g, ''), json.replace(/\s+/g, '')); + t.match(res, `"[ ${longNegative.toString()}, ${longPositive.toString()} ]"`); +}); + test('ndserialize', (t) => { t.plan(1); const s = new Serializer(); diff --git a/test/unit/transport.test.js b/test/unit/transport.test.js index c60ee5e0e..6c56813b0 100644 --- a/test/unit/transport.test.js +++ b/test/unit/transport.test.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -452,7 +451,7 @@ test('NoLivingConnectionsError (null connection)', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof NoLivingConnectionsError); } ); @@ -484,7 +483,7 @@ test('NoLivingConnectionsError (undefined connection)', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof NoLivingConnectionsError); } ); @@ -514,7 +513,7 @@ test('SerializationError', (t) => { path: '/hello', body, }, - (err, { body }) => { + (err) => { t.ok(err instanceof SerializationError); } ); @@ -544,7 +543,7 @@ test('SerializationError (bulk)', (t) => { path: '/hello', bulkBody, }, - (err, { body }) => { + (err) => { t.ok(err instanceof SerializationError); } ); @@ -577,7 +576,7 @@ test('DeserializationError', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof DeserializationError); server.stop(); } @@ -617,7 +616,7 @@ test('TimeoutError (should call markDead on the failing connection)', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof TimeoutError); } ); @@ -655,7 +654,7 @@ test('ConnectionError (should call markDead on the failing connection)', (t) => method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof ConnectionError); } ); @@ -761,7 +760,7 @@ test('Should not retry if the body is a stream', (t) => { path: '/hello', body: intoStream(JSON.stringify({ hello: 'world' })), }, - (err, { body }) => { + (err) => { t.ok(err instanceof ResponseError); t.equal(count, 1); server.stop(); @@ -814,7 +813,7 @@ test('Should not retry if the bulkBody is a stream', (t) => { path: '/hello', bulkBody: intoStream(JSON.stringify([{ hello: 'world' }])), }, - (err, { body }) => { + (err) => { t.ok(err instanceof ResponseError); t.equal(count, 1); server.stop(); @@ -870,7 +869,7 @@ test('No retry', (t) => { { maxRetries: 0, }, - (err, { body }) => { + (err) => { t.ok(err instanceof ResponseError); t.equal(count, 1); server.stop(); @@ -982,7 +981,7 @@ test('Should not retry on 429', (t) => { method: 'GET', path: '/hello', }, - (err, result) => { + (err) => { t.ok(err); t.equal(err.statusCode, 429); server.stop(); @@ -1096,7 +1095,7 @@ test('Should return a request aborter utility', (t) => { method: 'GET', path: '/hello', }, - (err, result) => { + (err) => { t.ok(err instanceof RequestAbortedError); } ); @@ -1152,7 +1151,7 @@ test('Retry mechanism and abort', (t) => { method: 'GET', path: '/hello', }, - (err, result) => { + (err) => { t.ok(err instanceof RequestAbortedError); server.stop(); } @@ -1225,7 +1224,7 @@ test('ResponseError', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof ResponseError); t.same(err.body, { status: 500 }); t.equal(err.statusCode, 500); @@ -1331,7 +1330,7 @@ test('sniff', (t) => { method: 'GET', path: '/', }, - (err, { body }) => { + (err) => { t.ok(err instanceof TimeoutError); } ); @@ -1397,7 +1396,7 @@ test('sniff', (t) => { }); skipCompatibleCheck(transport); - transport.sniff((err, hosts) => { + transport.sniff((err) => { t.ok(err instanceof ConnectionError); }); }); @@ -1439,7 +1438,7 @@ test(`Should mark as dead connections where the statusCode is 502/3/4 method: 'GET', path: `/${statusCode}`, }, - (err, { body }) => { + (err) => { t.ok(err instanceof ResponseError); t.match(err, { body: { hello: 'world' }, @@ -1472,7 +1471,7 @@ test('Should retry the request if the statusCode is 502/3/4', (t) => { } class CustomConnectionPool extends ConnectionPool { - markDead(connection) { + markDead() { t.ok('called'); } } @@ -1546,7 +1545,7 @@ test('Ignore status code', (t) => { method: 'GET', path: '/404', }, - (err, { body }) => { + (err) => { t.ok(err instanceof ResponseError); } ); @@ -1559,7 +1558,7 @@ test('Ignore status code', (t) => { { ignore: [403, 405], }, - (err, { body }) => { + (err) => { t.ok(err instanceof ResponseError); } ); @@ -1597,7 +1596,7 @@ test('Should serialize the querystring', (t) => { you_know: 'for search', }, }, - (err, { body }) => { + (err) => { t.error(err); server.stop(); } @@ -1640,7 +1639,7 @@ test('timeout option', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof TimeoutError); server.stop(); } @@ -1677,7 +1676,7 @@ test('timeout option', (t) => { { requestTimeout: 500, }, - (err, { body }) => { + (err) => { t.ok(err instanceof TimeoutError); server.stop(); } @@ -1715,7 +1714,7 @@ test('timeout option', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof TimeoutError); server.stop(); } @@ -1752,7 +1751,7 @@ test('timeout option', (t) => { { requestTimeout: '0.5s', }, - (err, { body }) => { + (err) => { t.ok(err instanceof TimeoutError); server.stop(); } @@ -1847,7 +1846,7 @@ test('Should cast to boolean HEAD request', (t) => { method: 'HEAD', path: '/400', }, - (err, { body, statusCode }) => { + (err, { statusCode }) => { t.ok(err instanceof ResponseError); t.notOk(typeof err.body === 'boolean'); t.equal(statusCode, 400); @@ -1876,7 +1875,7 @@ test('Should cast to boolean HEAD request', (t) => { method: 'HEAD', path: '/500', }, - (err, { body, statusCode }) => { + (err, { statusCode }) => { t.ok(err instanceof ResponseError); t.notOk(typeof err.body === 'boolean'); t.equal(statusCode, 500); @@ -1966,7 +1965,7 @@ test('Broken compression', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err); server.stop(); } @@ -2362,7 +2361,7 @@ test('Compress request', (t) => { path: '/hello', body: '', }, - (err, { body }) => { + (err) => { t.error(err); transport.request( { @@ -2370,7 +2369,7 @@ test('Compress request', (t) => { path: '/hello', body: null, }, - (err, { body }) => { + (err) => { t.error(err); transport.request( { @@ -2378,7 +2377,7 @@ test('Compress request', (t) => { path: '/hello', body: undefined, }, - (err, { body }) => { + (err) => { t.error(err); server.stop(); } @@ -2443,7 +2442,7 @@ test('Compress request', (t) => { { compression: 'gzip', }, - (err, { body, meta }) => { + (err, { body }) => { t.error(err); t.same(body, { you_know: 'for search' }); t.equal(count, 2); @@ -2748,7 +2747,7 @@ test('Should add an User-Agent header', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.error(err); server.stop(); } @@ -2812,7 +2811,7 @@ test('Secure json parsing', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof DeserializationError); t.equal(err.message, 'Object contains forbidden prototype property'); server.stop(); @@ -2848,7 +2847,7 @@ test('Secure json parsing', (t) => { method: 'GET', path: '/hello', }, - (err, { body }) => { + (err) => { t.ok(err instanceof DeserializationError); t.equal(err.message, 'Object contains forbidden prototype property'); server.stop(); @@ -2920,7 +2919,7 @@ test('The callback with a sync error should be called in the next tick - json', path: '/hello', body, }, - (err, { body }) => { + (err) => { t.ok(err instanceof SerializationError); } ); @@ -2955,7 +2954,7 @@ test('The callback with a sync error should be called in the next tick - ndjson' path: '/hello', bulkBody: [field], }, - (err, { body }) => { + (err) => { t.ok(err instanceof SerializationError); } ); diff --git a/test/utils/MockConnection.js b/test/utils/MockConnection.js index 336c471dc..132dc0230 100644 --- a/test/utils/MockConnection.js +++ b/test/utils/MockConnection.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/utils/buildCluster.js b/test/utils/buildCluster.js index 7e27b293d..359ddc691 100644 --- a/test/utils/buildCluster.js +++ b/test/utils/buildCluster.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* diff --git a/test/utils/buildProxy.js b/test/utils/buildProxy.js index 06ba00f9f..5b0dfdfec 100644 --- a/test/utils/buildProxy.js +++ b/test/utils/buildProxy.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ // Licensed to Elasticsearch B.V under one or more agreements. @@ -27,7 +26,7 @@ const ssl = { }; function createProxy() { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { const server = proxy(http.createServer()); server.listen(0, '127.0.0.1', () => { resolve(server); @@ -36,7 +35,7 @@ function createProxy() { } function createSecureProxy() { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { const server = proxy(https.createServer(ssl)); server.listen(0, '127.0.0.1', () => { resolve(server); @@ -44,8 +43,8 @@ function createSecureProxy() { }); } -function createServer(handler, callback) { - return new Promise((resolve, reject) => { +function createServer() { + return new Promise((resolve) => { const server = http.createServer(); server.listen(0, '127.0.0.1', () => { resolve(server); @@ -53,8 +52,8 @@ function createServer(handler, callback) { }); } -function createSecureServer(handler, callback) { - return new Promise((resolve, reject) => { +function createSecureServer() { + return new Promise((resolve) => { const server = https.createServer(ssl); server.listen(0, '127.0.0.1', () => { resolve(server); diff --git a/test/utils/buildServer.js b/test/utils/buildServer.js index 7021379ed..b3d9794c7 100644 --- a/test/utils/buildServer.js +++ b/test/utils/buildServer.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -65,7 +64,7 @@ function buildServer(handler, opts, cb) { process.exit(1); }); if (cb === undefined) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { server.listen(0, () => { const port = server.address().port; debug(`Server '${serverId}' booted on port ${port}`); diff --git a/test/utils/index.js b/test/utils/index.js index b94e0a487..6d7098d11 100644 --- a/test/utils/index.js +++ b/test/utils/index.js @@ -1,12 +1,11 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* @@ -30,29 +29,12 @@ 'use strict'; -const { promisify } = require('util'); -const sleep = promisify(setTimeout); const buildServer = require('./buildServer'); const buildCluster = require('./buildCluster'); const buildProxy = require('./buildProxy'); const connection = require('./MockConnection'); const { Client } = require('../../'); -async function waitCluster(client, waitForStatus = 'green', timeout = '50s', times = 0) { - if (!client) { - throw new Error('waitCluster helper: missing client instance'); - } - try { - await client.cluster.health({ waitForStatus, timeout }); - } catch (err) { - if (++times < 10) { - await sleep(5000); - return waitCluster(client, waitForStatus, timeout, times); - } - throw err; - } -} - function skipCompatibleCheck(client) { const tSymbol = Object.getOwnPropertySymbols(client.transport || client).filter( (symbol) => symbol.description === 'compatible check' @@ -72,7 +54,6 @@ module.exports = { buildCluster, buildProxy, connection, - waitCluster, skipCompatibleCheck, Client: NoCompatibleCheckClient, }; diff --git a/yarn.lock b/yarn.lock index ff5ff630e..3620f3318 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,12 +2,12 @@ # yarn lockfile v1 -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== +"@aws-sdk/types@^3.160.0": + version "3.341.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.341.0.tgz#b4282a2d3a9f7ae85650a4b61a80326588ca9400" + integrity sha512-2KJf64BhJly/Ty35oWKlCElIqUP4kQ0LA+meSrgAmwl7oE0AYuO7V0ar1nsTGlsubYkLRvOuEhMcuNuumaUdoQ== dependencies: - "@babel/highlight" "^7.10.4" + tslib "^2.5.0" "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.14.5": version "7.14.5" @@ -16,13 +16,6 @@ dependencies: "@babel/highlight" "^7.14.5" -"@babel/code-frame@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - "@babel/compat-data@^7.14.7", "@babel/compat-data@^7.15.0": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" @@ -49,6 +42,15 @@ semver "^6.3.0" source-map "^0.5.0" +"@babel/eslint-parser@^7.19.1": + version "7.21.8" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.21.8.tgz#59fb6fc4f3b017ab86987c076226ceef7b2b2ef2" + integrity sha512-HLhI+2q+BP3sf78mFUZNCGc10KEmoUqtUT1OCdMZsN+qr4qFeLUod62/zAnF3jNQstwyasDkZnVXwfK2Bml7MQ== + dependencies: + "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.0" + "@babel/generator@^7.15.0": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.0.tgz#a7d0c172e0d814974bad5aa77ace543b97917f15" @@ -58,15 +60,6 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.0.tgz#46d28e8a18fc737b028efb25ab105d74473af43f" - integrity sha512-81YO9gGx6voPXlvYdZBliFXAZU8vZ9AZ6z+CjlmcnaeOcYSFbMTpdeDUO9xD9dh/68Vq03I8ZspfUTPfitcDHg== - dependencies: - "@babel/types" "^7.18.0" - "@jridgewell/gen-mapping" "^0.3.0" - jsesc "^2.5.1" - "@babel/helper-annotate-as-pure@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz#7bf478ec3b71726d56a8ca5775b046fc29879e61" @@ -84,13 +77,6 @@ browserslist "^4.16.6" semver "^6.3.0" -"@babel/helper-environment-visitor@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" - integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== - dependencies: - "@babel/types" "^7.16.7" - "@babel/helper-function-name@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4" @@ -100,14 +86,6 @@ "@babel/template" "^7.14.5" "@babel/types" "^7.14.5" -"@babel/helper-function-name@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" - "@babel/helper-get-function-arity@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" @@ -122,13 +100,6 @@ dependencies: "@babel/types" "^7.14.5" -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== - dependencies: - "@babel/types" "^7.16.7" - "@babel/helper-member-expression-to-functions@^7.15.0": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.0.tgz#0ddaf5299c8179f27f37327936553e9bba60990b" @@ -193,23 +164,11 @@ dependencies: "@babel/types" "^7.14.5" -"@babel/helper-split-export-declaration@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" - integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== - dependencies: - "@babel/types" "^7.16.7" - "@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9": version "7.14.9" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== -"@babel/helper-validator-identifier@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" - integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== - "@babel/helper-validator-option@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" @@ -224,15 +183,6 @@ "@babel/traverse" "^7.14.8" "@babel/types" "^7.14.8" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.16.7": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.17.12.tgz#257de56ee5afbd20451ac0a75686b6b404257351" - integrity sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - chalk "^2.0.0" - js-tokens "^4.0.0" - "@babel/highlight@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" @@ -242,15 +192,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.14.5", "@babel/parser@^7.15.0": - version "7.15.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.2.tgz#08d4ffcf90d211bf77e7cc7154c6f02d468d2b1d" - integrity sha512-bMJXql1Ss8lFnvr11TZDH4ArtwlAS5NG9qBmdiFW2UHHm6MVoR+GDc5XE2b9K938cyjc9O6/+vjjcffLDtfuDg== - -"@babel/parser@^7.16.7", "@babel/parser@^7.18.0", "@babel/parser@^7.7.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.0.tgz#10a8d4e656bc01128d299a787aa006ce1a91e112" - integrity sha512-AqDccGC+m5O/iUStSJy3DGRIUFu7WbY/CppZYwrEUB4N0tZlnI8CSTsgL7v5fHVFmUbRv2sd+yy27o8Ydt4MGg== +"@babel/parser@^7.14.5", "@babel/parser@^7.15.0", "@babel/parser@^7.20.15": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.4.tgz#94003fdfc520bbe2875d4ae557b43ddb6d880f17" + integrity sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw== "@babel/plugin-proposal-object-rest-spread@^7.5.5": version "7.14.7" @@ -311,15 +256,6 @@ "@babel/parser" "^7.14.5" "@babel/types" "^7.14.5" -"@babel/template@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" - "@babel/traverse@^7.14.8", "@babel/traverse@^7.15.0": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.0.tgz#4cca838fd1b2a03283c1f38e141f639d60b3fc98" @@ -335,22 +271,6 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.7.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.0.tgz#0e5ec6db098660b2372dd63d096bf484e32d27ba" - integrity sha512-oNOO4vaoIQoGjDQ84LgtF/IAlxlyqL4TUuoQ7xLkQETFaHkY1F7yazhB4Kt3VcZGL0ZF/jhrEpnXqUb0M7V3sw== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.0" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.18.0" - "@babel/types" "^7.18.0" - debug "^4.1.0" - globals "^11.1.0" - "@babel/types@^7.14.5", "@babel/types@^7.14.8", "@babel/types@^7.14.9", "@babel/types@^7.15.0": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.0.tgz#61af11f2286c4e9c69ca8deb5f4375a73c72dcbd" @@ -359,43 +279,72 @@ "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" -"@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.18.0", "@babel/types@^7.7.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.0.tgz#ef523ea349722849cb4bf806e9342ede4d071553" - integrity sha512-vhAmLPAiC8j9K2GnsnLPCIH5wCrPpYIVBCWRBFDCB7Y/BXLqi/O+1RSTTM2bsmg6U/551+FCf9PNPxjABmxHTw== +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - to-fast-properties "^2.0.0" + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.0.tgz#f6f729b02feee2c749f57e334b7a1b5f40a81724" + integrity sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ== -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@eslint/eslintrc@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz#4910db5505f4d503f27774bf356e3704818a0331" + integrity sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^13.9.0" - ignore "^4.0.6" + debug "^4.3.2" + espree "^9.5.2" + globals "^13.19.0" + ignore "^5.2.0" import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" + js-yaml "^4.1.0" + minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== +"@eslint/js@8.41.0": + version "8.41.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.41.0.tgz#080321c3b68253522f7646b55b577dd99d2950b3" + integrity sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA== + +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== dependencies: - "@humanwhocodes/object-schema" "^1.2.0" + "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" - minimatch "^3.0.4" + minimatch "^3.0.5" -"@humanwhocodes/object-schema@^1.2.0": +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@isaacs/import-jsx@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@isaacs/import-jsx/-/import-jsx-4.0.1.tgz#493cab5fc543a0703dba7c3f5947d6499028a169" + integrity sha512-l34FEsEqpdYdGcQjRCxWy+7rHY6euUbOBz9FI+Mq6oQeVhNegHcXFSJxVxrJvOpO31NbnDjS74quKXDlPDearA== + dependencies: + "@babel/core" "^7.5.5" + "@babel/plugin-proposal-object-rest-spread" "^7.5.5" + "@babel/plugin-transform-destructuring" "^7.5.0" + "@babel/plugin-transform-react-jsx" "^7.3.0" + caller-path "^3.0.1" + find-cache-dir "^3.2.0" + make-dir "^3.0.2" + resolve-from "^3.0.0" + rimraf "^3.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -412,37 +361,12 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jridgewell/gen-mapping@^0.3.0": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz#cf92a983c83466b8c0ce9124fadeaf09f7c66ea9" - integrity sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" - -"@jridgewell/resolve-uri@^3.0.3": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz#30cd49820a962aff48c8fffc5cd760151fca61fe" - integrity sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA== - -"@jridgewell/set-array@^1.0.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.1.tgz#36a6acc93987adcf0ba50c66908bd0b70de8afea" - integrity sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ== - -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.13" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz#b6461fb0c2964356c469e115f504c95ad97ab88c" - integrity sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w== - -"@jridgewell/trace-mapping@^0.3.9": - version "0.3.13" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" - integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== +"@jsdoc/salty@^0.2.1": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@jsdoc/salty/-/salty-0.2.2.tgz#567017ddda2048c5ff921aeffd38564a0578fdca" + integrity sha512-A1FrVnc7L9qI2gUGsfN0trTiJNK72Y0CL/VAyrmYEmeKI3pnHDawP64CEev31XLyAAOx2xmDo3tbadPxC0CSbw== dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" + lodash "^4.17.21" "@kwsites/file-exists@^1.1.1": version "1.1.1" @@ -456,6 +380,13 @@ resolved "https://registry.yarnpkg.com/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz#8ace5259254426ccef57f3175bc64ed7095ed919" integrity sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw== +"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": + version "5.1.1-v1" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" + integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== + dependencies: + eslint-scope "5.1.1" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -469,7 +400,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3": +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -477,10 +408,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@oozcitak/dom@1.15.8": - version "1.15.8" - resolved "https://registry.yarnpkg.com/@oozcitak/dom/-/dom-1.15.8.tgz#0c0c7bb54cfdaadc07fd637913e706101721d15d" - integrity sha512-MoOnLBNsF+ok0HjpAvxYxR4piUhRDCEWK0ot3upwOOHYudJd30j6M+LNcE8RKpwfnclAX9T66nXXzkytd29XSw== +"@oozcitak/dom@1.15.10": + version "1.15.10" + resolved "https://registry.yarnpkg.com/@oozcitak/dom/-/dom-1.15.10.tgz#dca7289f2b292cff2a901ea4fbbcc0a1ab0b05c2" + integrity sha512-0JT29/LaxVgRcGKvHmSrUTEvZ8BXvZhGl2LASRUgHqDTC1M5g1pLmVv56IYNyt3bG2CUjDkc67wnyZC14pbQrQ== dependencies: "@oozcitak/infra" "1.0.8" "@oozcitak/url" "1.0.4" @@ -506,11 +437,6 @@ resolved "https://registry.yarnpkg.com/@oozcitak/util/-/util-8.3.8.tgz#10f65fe1891fd8cde4957360835e78fd1936bfdd" integrity sha512-T8TbSnGsxo6TDBJx/Sgv/BlVJL3tshxZP7Aq5R1mSnM5OcHY2dQaxLMu2+E8u3gN0MLOzdjurqN4ZRVuzQycOQ== -"@sindresorhus/is@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" - integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== - "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -524,12 +450,10 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@szmarczak/http-timer@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" - integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== - dependencies: - defer-to-connect "^1.0.1" +"@tsd/typescript@~4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@tsd/typescript/-/typescript-4.9.5.tgz#85daafcf51f4af92bd8caf0e82b655ceaf948f99" + integrity sha512-+UgxOvJUl5rQdPFSSOOwhmSmpThm8DJ3HwHxAOq5XYe7CcmG1LcM2QeqWwILzUIT5tbeMqY8qABiCsRtIjk/2g== "@types/eslint@^7.2.13": version "7.28.0" @@ -549,20 +473,33 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== +"@types/linkify-it@*": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" + integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== + +"@types/markdown-it@^12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51" + integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ== + dependencies: + "@types/linkify-it" "*" + "@types/mdurl" "*" + +"@types/mdurl@*": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" + integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== + "@types/minimist@^1.2.0": version "1.2.2" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*": - version "16.4.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.13.tgz#7dfd9c14661edc65cccd43a29eb454174642370d" - integrity sha512-bLL69sKtd25w7p1nvg9pigE4gtKVpGTPojBFLMkGHXuUgap2sLqQt2qUnqmVCDfzGUL0DRNZP+1prIZJbMeAXg== - -"@types/node@^15.3.1": - version "15.14.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.7.tgz#29fea9a5b14e2b75c19028e1c7a32edd1e89fe92" - integrity sha512-FA45p37/mLhpebgbPWWCKfOisTjxGK9lwcHlJ6XVLfu3NgfcazOJHdYUZCWPMK8QX4LhNZdmfo6iMz9FqpUbaw== +"@types/node@^20.1.4": + version "20.2.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.2.5.tgz#26d295f3570323b2837d322180dfbf1ba156fefb" + integrity sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -574,10 +511,10 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== -"@types/react@^16.9.23": - version "16.14.12" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.12.tgz#1e38e2114e568f6541f88628a207f72630ee161f" - integrity sha512-7nOJgNsRbARhZhvwPm7cnzahtzEi5VJ9OvcQk8ExEEb1t+zaFklwLVkJz7G1kfxX4X/mDa/icTmzE0vTmqsqBg== +"@types/react@^17.0.52": + version "17.0.53" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.53.tgz#10d4d5999b8af3d6bc6a9369d7eb953da82442ab" + integrity sha512-1yIpQR2zdYu1Z/dc1OxC+MA6GR240u3gcnP4l6mvj/PJiVaqHsQPmWttsvHsfnhfPbU2FuGmo0wSITPygjBmsw== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -598,15 +535,15 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -acorn-jsx@^5.3.1: +acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== +acorn@^8.8.0: + version "8.8.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" + integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== aggregate-error@^3.0.0: version "3.1.0" @@ -616,7 +553,7 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: +ajv@^6.10.0, ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -626,33 +563,6 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: - version "8.11.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" - integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ansi-align@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" - integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== - dependencies: - string-width "^3.0.0" - -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -660,32 +570,12 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -761,74 +651,30 @@ arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= -arrify@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" - integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== - asap@^2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-hook-domain@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/async-hook-domain/-/async-hook-domain-2.0.3.tgz#702d86fc21866bcb0f38b32214d04c2e5a311429" - integrity sha512-MadiLLDEZRZzZwcm0dgS+K99qXZ4H2saAUwUgwzFulbAkXrKi3AX5FvWS3FFTQtLMwrqcGqAJe6o12KrObejQA== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= +async-hook-domain@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/async-hook-domain/-/async-hook-domain-2.0.4.tgz#5a24910982c04394ea33dd442860f80cce2d972c" + integrity sha512-14LjCmlK1PK8eDtTezR6WX8TMaYNIzBIsd2D1sGoGjgx0BuNMMoSdk7i/drlbtamy0AWv9yv2tkB+ASdmeqFIw== -auto-bind@^4.0.0: +auto-bind@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-4.0.0.tgz#e3589fc6c2da8f7ca43ba9f84fa52a744fc997fb" integrity sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ== -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - -babel-eslint@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" +aws4@^1.11.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" + integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== balanced-match@^1.0.0: version "1.0.2" @@ -845,13 +691,6 @@ basic-auth-parser@0.0.2: resolved "https://registry.yarnpkg.com/basic-auth-parser/-/basic-auth-parser-0.0.2.tgz#ce9e71a77f23c1279eecd2659b2a46244c156e41" integrity sha1-zp5xp38jwSee7NJlmypGJEwVbkE= -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" @@ -862,28 +701,19 @@ bind-obj-methods@^3.0.0: resolved "https://registry.yarnpkg.com/bind-obj-methods/-/bind-obj-methods-3.0.0.tgz#65b66544d9d668d80dfefe2089dd347ad1dbcaed" integrity sha512-nLEaaz3/sEzNSyPWRsN9HNsqwk1AUyECtGj+XwGdIi3xABnEqecvXtIJ0wehQXuuER5uZ/5fTs2usONgYjG+iw== -bl@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== +bl@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-5.1.0.tgz#183715f678c7188ecef9fe475d90209400624273" + integrity sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ== dependencies: - buffer "^5.5.0" + buffer "^6.0.3" inherits "^2.0.4" readable-stream "^3.4.0" -boxen@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" - integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^5.3.1" - chalk "^3.0.0" - cli-boxes "^2.2.0" - string-width "^4.1.0" - term-size "^2.1.0" - type-fest "^0.8.1" - widest-line "^3.1.0" +bluebird@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== brace-expansion@^1.1.7: version "1.1.11" @@ -893,6 +723,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -916,26 +753,13 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== dependencies: base64-js "^1.3.1" - ieee754 "^1.1.13" - -cacheable-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" - integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^3.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^1.0.2" + ieee754 "^1.2.1" caching-transform@^4.0.0: version "4.0.0" @@ -947,26 +771,21 @@ caching-transform@^4.0.0: package-hash "^4.0.0" write-file-atomic "^3.0.0" -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= +caller-callsite@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-4.1.0.tgz#3e33cb1d910e7b09332d59a3503b9af7462f7295" + integrity sha512-99nnnGlJexTc41xwQTr+mWl15OI5PPczUJzM4YRE7QjkefMKCXGa5gfQjCOuVrD+1TjI/fevIDHg2nz3iYN5Ig== dependencies: - callsites "^2.0.0" + callsites "^3.1.0" -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= +caller-path@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-3.0.1.tgz#bc932ecec3f943e10c2f8922146e23b132f932e4" + integrity sha512-fhmztL4wURO/BzwJUJ4aVRdnKEFskPBbrJ8fNgl7XdUiD1ygzzlt+nhPgUBSRq2ciEVubo6x+W8vJQzm55QLLQ== dependencies: - caller-callsite "^2.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= + caller-callsite "^4.1.0" -callsites@^3.0.0: +callsites@^3.0.0, callsites@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== @@ -991,9 +810,9 @@ camelcase@^5.0.0, camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30001248: - version "1.0.30001249" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001249.tgz#90a330057f8ff75bfe97a94d047d5e14fabb2ee8" - integrity sha512-vcX4U8lwVXPdqzPWi6cAJ3FnQaqXbBqy/GZseKNQzRj37J7qZdGcBtxq/QLFNLLlfsoXLUdHw8Iwenri86Tagw== + version "1.0.30001469" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001469.tgz#3dd505430c8522fdc9f94b4a19518e330f5c945a" + integrity sha512-Rcp7221ScNqQPP3W+lVOYDyjdR6dC+neEQCttoNr5bAyz54AboB4iwpnWgyi8P4YUsPybVzT4LgWiBbI3drL4g== cardinal@^2.1.1: version "2.1.1" @@ -1003,10 +822,12 @@ cardinal@^2.1.1: ansicolors "~0.3.2" redeyed "~2.1.0" -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +catharsis@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121" + integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A== + dependencies: + lodash "^4.17.15" chalk@2.4.2, chalk@^2.0.0, chalk@^2.4.1: version "2.4.2" @@ -1033,6 +854,11 @@ chalk@^4.0.0, chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3" + integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== + chokidar@^3.3.0: version "3.5.2" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" @@ -1063,13 +889,6 @@ cli-boxes@^2.2.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -1077,10 +896,17 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-spinners@^2.5.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.0.tgz#36c7dc98fb6a9a76bd6238ec3f77e2425627e939" - integrity sha512-t+4/y50K/+4xcCRosKkA7W4gTr1MySvLV0q+PxmG7FJ5g+66ChKurYjxBCjHggHH3HA5Hh9cy+lcUGWDqVH+4Q== +cli-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea" + integrity sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg== + dependencies: + restore-cursor "^4.0.0" + +cli-spinners@^2.6.1: + version "2.7.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" + integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== cli-truncate@^2.1.0: version "2.1.0" @@ -1090,15 +916,6 @@ cli-truncate@^2.1.0: slice-ansi "^3.0.0" string-width "^4.2.0" -cliui@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - cliui@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" @@ -1108,22 +925,26 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= +cliui@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: - mimic-response "^1.0.0" + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" clone@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= +code-excerpt@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/code-excerpt/-/code-excerpt-3.0.0.tgz#fcfb6748c03dba8431c19f5474747fad3f250f10" + integrity sha512-VHNTVhd7KsLGOqfX3SyeO8RyYPMp1GJOg194VITk04WMYCv4plV68YWe6TJZxd9MhobjtpMRnVky01gqZsalaw== + dependencies: + convert-to-spaces "^1.0.1" color-convert@^1.9.0: version "1.9.3" @@ -1159,13 +980,6 @@ colorette@^1.2.2: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.3.0.tgz#ff45d2f0edb244069d3b772adeb04fed38d0a0af" integrity sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w== -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -1174,19 +988,7 @@ commondir@^1.0.1: concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -configstore@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" - integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== - dependencies: - dot-prop "^5.2.0" - graceful-fs "^4.1.2" - make-dir "^3.0.0" - unique-string "^2.0.0" - write-file-atomic "^3.0.0" - xdg-basedir "^4.0.0" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== convert-hrtime@^5.0.0: version "5.0.0" @@ -1200,23 +1002,17 @@ convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" -core-util-is@1.0.2, core-util-is@~1.0.0: +convert-to-spaces@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz#7e3e48bbe6d997b1417ddca2868204b4d3d85715" + integrity sha512-cj09EBuObp9gZNQCzc7hByQyrs6jVGE+o9kSJmeUoj+GiPiJvi5LYqEH/Hmme4+MTLHM+Ejtq+FChpjjEnsPdQ== + +core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -coveralls@^3.0.11: - version "3.1.1" - resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.1.tgz#f5d4431d8b5ae69c5079c8f8ca00d64ac77cf081" - integrity sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww== - dependencies: - js-yaml "^3.13.1" - lcov-parse "^1.0.0" - log-driver "^1.2.7" - minimist "^1.2.5" - request "^2.88.2" - -cross-spawn@^7.0.0, cross-spawn@^7.0.2: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -1230,22 +1026,15 @@ cross-zip@^4.0.0: resolved "https://registry.yarnpkg.com/cross-zip/-/cross-zip-4.0.0.tgz#c29bfb2c001659a6d480ae9596f3bee83b48a230" integrity sha512-MEzGfZo0rqE10O/B+AEcCSJLZsrWuRUvmqJTqHNqBtALhaJc3E3ixLGLJNTRzEA2K34wbmOHC4fwYs9sVsdcCA== -crypto-random-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" - integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== - csstype@^3.0.2: version "3.0.8" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw== -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" +data-uri-to-buffer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b" + integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA== debug@^3.1.0: version "3.2.7" @@ -1254,7 +1043,7 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1279,32 +1068,20 @@ decamelize@^1.1.0, decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= -decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= - dependencies: - mimic-response "^1.0.0" - dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - deep-is@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= deepmerge@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== default-require-extensions@^3.0.0: version "3.0.0" @@ -1320,20 +1097,10 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -defer-to-connect@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" - integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - dezalgo@^1.0.0, dezalgo@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" - integrity sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY= + version "1.0.4" + resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.4.tgz#751235260469084c132157dfa857f386d4c33d81" + integrity sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig== dependencies: asap "^2.0.0" wrappy "1" @@ -1357,54 +1124,20 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dot-prop@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" - integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== - dependencies: - is-obj "^2.0.0" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - electron-to-chromium@^1.3.793: version "1.3.801" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.801.tgz#f41c588e408ad1a4f794f91f38aa94a89c492f51" integrity sha512-xapG8ekC+IAHtJrGBMQSImNuN+dm+zl7UP1YbhvTkwQn8zf/yYuoxfTSAEiJ9VDD+kjvXaAhNDPSxJ+VImtAJA== -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" +entities@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" + integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== error-ex@^1.3.1: version "1.3.2" @@ -1423,11 +1156,6 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-goat@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" - integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1444,11 +1172,11 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" - integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" + integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== -eslint-formatter-pretty@^4.0.0: +eslint-formatter-pretty@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/eslint-formatter-pretty/-/eslint-formatter-pretty-4.1.0.tgz#7a6877c14ffe2672066c853587d89603e97c7708" integrity sha512-IsUTtGxF1hrH6lMWiSl1WbGaiP01eT6kzywdY1U+zLc0MP+nwEnUiS9UI8IaOTUhTeQJLlCEWIbXINBH4YJbBQ== @@ -1463,9 +1191,9 @@ eslint-formatter-pretty@^4.0.0: supports-hyperlinks "^2.0.0" eslint-plugin-prettier@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" - integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" + integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== dependencies: prettier-linter-helpers "^1.0.0" @@ -1474,7 +1202,7 @@ eslint-rule-docs@^1.1.5: resolved "https://registry.yarnpkg.com/eslint-rule-docs/-/eslint-rule-docs-1.1.231.tgz#648b978bc5a1bb740be5f28d07470f0926b9cdf1" integrity sha512-egHz9A1WG7b8CS0x1P6P/Rj5FqZOjray/VjpJa14tMZalfRKvpE2ONJ3plCM7+PcinmU4tcmbPLv0VtwzSdLVA== -eslint-scope@^5.1.1: +eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -1482,87 +1210,87 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== +eslint-scope@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" + integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + esrecurse "^4.3.0" + estraverse "^5.2.0" -eslint-visitor-keys@^2.0.0: +eslint-visitor-keys@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint@^7.32.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" + integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== + +eslint@^8.30.0: + version "8.41.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.41.0.tgz#3062ca73363b4714b16dbc1e60f035e6134b6f1c" + integrity sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.4.0" + "@eslint/eslintrc" "^2.0.3" + "@eslint/js" "8.41.0" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" + debug "^4.3.2" doctrine "^3.0.0" - enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" + eslint-scope "^7.2.0" + eslint-visitor-keys "^3.4.1" + espree "^9.5.2" + esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.0.4" + minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" strip-json-comments "^3.1.0" - table "^6.0.9" text-table "^0.2.0" - v8-compile-cache "^2.0.3" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^9.5.2: + version "9.5.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.2.tgz#e994e7dc33a082a7a82dceaf12883a829353215b" + integrity sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw== dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" esprima@^4.0.0, esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: estraverse "^5.1.0" @@ -1593,21 +1321,6 @@ events-to-array@^1.0.1: resolved "https://registry.yarnpkg.com/events-to-array/-/events-to-array-1.1.2.tgz#2d41f563e1fe400ed4962fe1a4d5c6a7539df7f6" integrity sha1-LUH1Y+H+QA7Uli/hpNXGp1Od9/Y= -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -1646,6 +1359,14 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -1677,6 +1398,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + findit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/findit/-/findit-2.0.0.tgz#6509f0126af4c178551cfa99394e032e13a4d56e" @@ -1703,19 +1432,12 @@ foreground-child@^2.0.0: cross-spawn "^7.0.0" signal-exit "^3.0.2" -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" + fetch-blob "^3.1.2" from2@^2.3.0: version "2.3.0" @@ -1755,11 +1477,6 @@ function-loop@^2.0.1: resolved "https://registry.yarnpkg.com/function-loop/-/function-loop-2.0.1.tgz#799c56ced01698cf12a1b80e4802e9dafc2ebada" integrity sha512-ktIR+O6i/4h+j/ZhZJNdzeI4i9lEPeEK6UPR2EVyTVBqOwcU3Za9xYKLH64ZR9HmcROyRrOkizNyjjtWJzDDkQ== -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -1775,27 +1492,6 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -1803,34 +1499,44 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob@^7.0.5, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.1.0.tgz#baa48c6a157cfa34ca7887f2a29c6156bc6b65f8" + integrity sha512-daGobsYuT0G4hng24B5LbeLNvwKZYRhWyDl3RvqqAGZjJnCopWWK6PWnAGBY1M/vdA63QE+jddhZcYp+74Bq6Q== + dependencies: + fs.realpath "^1.0.0" + minimatch "^9.0.0" + minipass "^5.0.0" + path-scurry "^1.7.0" + +glob@^7.0.5, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.4" + minimatch "^3.1.1" once "^1.3.0" path-is-absolute "^1.0.0" -global-dirs@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.1.0.tgz#e9046a49c806ff04d6c1825e196c8f0091e8df4d" - integrity sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ== - dependencies: - ini "1.3.7" - globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.6.0, globals@^13.9.0: - version "13.15.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.15.0.tgz#38113218c907d2f7e98658af246cef8b77e90bac" - integrity sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog== +globals@^13.19.0: + version "13.19.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8" + integrity sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ== dependencies: type-fest "^0.20.2" @@ -1846,40 +1552,20 @@ globby@^11.0.1: merge2 "^1.3.0" slash "^3.0.0" -got@^9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== - dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" - graceful-fs@^4.1.15, graceful-fs@^4.1.2: version "4.2.8" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= +graceful-fs@^4.1.9: + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== hard-rejection@^2.1.0: version "2.1.0" @@ -1896,11 +1582,6 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-yarn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" - integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== - has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -1921,44 +1602,32 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== -hpagent@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/hpagent/-/hpagent-0.1.2.tgz#cab39c66d4df2d4377dbd212295d878deb9bdaa9" - integrity sha512-ePqFXHtSQWAFXYmj+JtOTHr84iNrII4/QRlAAPPE+zqnKy4xJo7Ie1Y4kC7AdB+LxLxSTTzBMASsEcy0q8YyvQ== - +hosted-git-info@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" + integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== + dependencies: + lru-cache "^6.0.0" + +hpagent@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/hpagent/-/hpagent-1.2.0.tgz#0ae417895430eb3770c03443456b8d90ca464903" + integrity sha512-A91dYTeIB6NoXG+PxTQpCCDDnfHsW9kc06Lvpu1TEe9gnd6ZFeiBoRO9JvzEv6xK7EX97/dUE8g/vBMTqTS3CA== + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -ieee754@^1.1.13: +ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^5.1.4, ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" @@ -1968,26 +1637,6 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-jsx@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/import-jsx/-/import-jsx-4.0.0.tgz#2f31fd8e884e14f136751448841ffd2d3144dce1" - integrity sha512-CnjJ2BZFJzbFDmYG5S47xPQjMlSbZLyLJuG4znzL4TdPtJBxHtFP1xVmR+EYX4synFSldiY3B6m00XkPM3zVnA== - dependencies: - "@babel/core" "^7.5.5" - "@babel/plugin-proposal-object-rest-spread" "^7.5.5" - "@babel/plugin-transform-destructuring" "^7.5.0" - "@babel/plugin-transform-react-jsx" "^7.3.0" - caller-path "^2.0.0" - find-cache-dir "^3.2.0" - make-dir "^3.0.2" - resolve-from "^3.0.0" - rimraf "^3.0.0" - -import-lazy@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" - integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -2011,39 +1660,34 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ini@1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" - integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== - -ini@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -ink@^2.6.0, ink@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/ink/-/ink-2.7.1.tgz#ff1c75b4b022924e2993af62297fa0e48e85618b" - integrity sha512-s7lJuQDJEdjqtaIWhp3KYHl6WV3J04U9zoQ6wVc+Xoa06XM27SXUY57qC5DO46xkF0CfgXMKkKNcgvSu/SAEpA== +ink@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ink/-/ink-3.2.0.tgz#434793630dc57d611c8fe8fffa1db6b56f1a16bb" + integrity sha512-firNp1q3xxTzoItj/eOOSZQnYSlyrWks5llCTVX37nJ59K3eXbQ8PtzCguqo8YI19EELo5QxaKnJd4VxzhU8tg== dependencies: ansi-escapes "^4.2.1" - arrify "^2.0.1" - auto-bind "^4.0.0" - chalk "^3.0.0" + auto-bind "4.0.0" + chalk "^4.1.0" + cli-boxes "^2.2.0" cli-cursor "^3.1.0" cli-truncate "^2.1.0" + code-excerpt "^3.0.0" + indent-string "^4.0.0" is-ci "^2.0.0" - lodash.throttle "^4.1.1" - log-update "^3.0.0" - prop-types "^15.6.2" - react-reconciler "^0.24.0" - scheduler "^0.18.0" + lodash "^4.17.20" + patch-console "^1.0.0" + react-devtools-core "^4.19.1" + react-reconciler "^0.26.2" + scheduler "^0.20.2" signal-exit "^3.0.2" slice-ansi "^3.0.0" - string-length "^3.1.0" + stack-utils "^2.0.2" + string-width "^4.2.2" + type-fest "^0.12.0" widest-line "^3.1.0" wrap-ansi "^6.2.0" - yoga-layout-prebuilt "^1.9.3" + ws "^7.5.5" + yoga-layout-prebuilt "^1.9.6" into-stream@^6.0.0: version "6.0.0" @@ -2084,10 +1728,10 @@ is-core-module@^2.2.0: dependencies: has "^1.0.3" -is-core-module@^2.8.1: - version "2.9.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" - integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== +is-core-module@^2.5.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" + integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== dependencies: has "^1.0.3" @@ -2096,59 +1740,29 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" -is-installed-globally@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141" - integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g== - dependencies: - global-dirs "^2.0.1" - is-path-inside "^3.0.1" - -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - -is-npm@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" - integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== +is-interactive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-2.0.0.tgz#40c57614593826da1100ade6059778d597f16e90" + integrity sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ== is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-obj@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" - integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== - -is-path-inside@^3.0.1: +is-path-inside@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== @@ -2163,7 +1777,7 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-typedarray@^1.0.0, is-typedarray@~1.0.0: +is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= @@ -2173,16 +1787,16 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== +is-unicode-supported@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz#d824984b616c292a2e198207d4a609983842f714" + integrity sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ== + is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -is-yarn-global@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" - integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== - isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2193,16 +1807,16 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.0.0-alpha.1: +istanbul-lib-coverage@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== +istanbul-lib-coverage@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + istanbul-lib-hook@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz#8f84c9434888cc6b1d0a9d7092a76d239ebf0cc6" @@ -2220,18 +1834,17 @@ istanbul-lib-instrument@^4.0.0: istanbul-lib-coverage "^3.0.0" semver "^6.3.0" -istanbul-lib-processinfo@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz#e1426514662244b2f25df728e8fd1ba35fe53b9c" - integrity sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw== +istanbul-lib-processinfo@^2.0.2, istanbul-lib-processinfo@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz#366d454cd0dcb7eb6e0e419378e60072c8626169" + integrity sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg== dependencies: archy "^1.0.0" - cross-spawn "^7.0.0" - istanbul-lib-coverage "^3.0.0-alpha.1" - make-dir "^3.0.0" + cross-spawn "^7.0.3" + istanbul-lib-coverage "^3.2.0" p-map "^3.0.0" rimraf "^3.0.0" - uuid "^3.3.3" + uuid "^8.3.2" istanbul-lib-report@^3.0.0: version "3.0.0" @@ -2259,27 +1872,19 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jackspeak@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-1.4.0.tgz#4eb2c7935c5e6d28179b50829711d1372a1c9a2a" - integrity sha512-VDcSunT+wcccoG46FtzuBAyQKlzhHjli4q31e1fIHGOsRspqNUFjVzGb+7eIFDlTvqLygxapDHPHS0ouT2o/tw== +jackspeak@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-1.4.2.tgz#30ad5e4b7b36f9f3ae580e23272b1a386b4f6b93" + integrity sha512-GHeGTmnuaHnvS+ZctRB01bfxARuu9wW83ENbuiweu07SFcVlZrJpcshSre/keGT7YGBhLHg/+rXCNSrsEHKU4Q== dependencies: - cliui "^4.1.0" + cliui "^7.0.4" "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@3.14.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@^3.13.1: +js-yaml@3.14.1, js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -2294,21 +1899,39 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +js2xmlparser@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a" + integrity sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA== + dependencies: + xmlcreate "^2.0.4" + +jsdoc@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-4.0.2.tgz#a1273beba964cf433ddf7a70c23fd02c3c60296e" + integrity sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg== + dependencies: + "@babel/parser" "^7.20.15" + "@jsdoc/salty" "^0.2.1" + "@types/markdown-it" "^12.2.3" + bluebird "^3.7.2" + catharsis "^0.9.0" + escape-string-regexp "^2.0.0" + js2xmlparser "^4.0.2" + klaw "^3.0.0" + markdown-it "^12.3.2" + markdown-it-anchor "^8.4.1" + marked "^4.0.10" + mkdirp "^1.0.4" + requizzle "^0.2.3" + strip-json-comments "^3.1.0" + underscore "~1.13.2" jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= - json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -2319,66 +1942,27 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -keyv@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== - dependencies: - json-buffer "3.0.0" + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -latest-version@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" - integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== +klaw@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-3.0.0.tgz#b11bec9cf2492f06756d6e809ab73a2910259146" + integrity sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g== dependencies: - package-json "^6.3.0" - -lcov-parse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" - integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= + graceful-fs "^4.1.9" leven@2.1.0: version "2.1.0" @@ -2393,25 +1977,24 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -libtap@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/libtap/-/libtap-1.1.1.tgz#927057f505b3641f66043d89f04bd509185ccc2b" - integrity sha512-Fye8fh1+G7E8qqmjQaY+pXGxy7HM0S6bqCCJFLa16+g2jODBByxbJFDpjbDNF69wfRVyvJ+foLZc1WTIv7dx+g== +libtap@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/libtap/-/libtap-1.4.0.tgz#5c6dea65d2d95f2c855d819a457e1fa7d2af5bf0" + integrity sha512-STLFynswQ2A6W14JkabgGetBNk6INL1REgJ9UeNKw5llXroC2cGLgKTqavv0sl8OLVztLLipVKMcQ7yeUcqpmg== dependencies: - async-hook-domain "^2.0.1" + async-hook-domain "^2.0.4" bind-obj-methods "^3.0.0" diff "^4.0.2" function-loop "^2.0.1" - minipass "^3.1.1" + minipass "^3.1.5" own-or "^1.0.0" - own-or-env "^1.0.1" - signal-exit "^3.0.2" - stack-utils "^2.0.1" - tap-parser "^10.0.1" + own-or-env "^1.0.2" + signal-exit "^3.0.4" + stack-utils "^2.0.4" + tap-parser "^11.0.0" tap-yaml "^1.0.0" - tcompare "^5.0.1" + tcompare "^5.0.6" trivial-deferred "^1.0.1" - yapool "^1.0.0" license-checker@^25.0.1: version "25.0.1" @@ -2434,6 +2017,13 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= +linkify-it@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" + integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== + dependencies: + uc.micro "^1.0.1" + locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -2441,6 +2031,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash.flattendeep@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" @@ -2451,22 +2048,12 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.throttle@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" - integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= - -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= +lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-driver@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" - integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== - -log-symbols@^4.0.0, log-symbols@^4.1.0: +log-symbols@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -2474,32 +2061,21 @@ log-symbols@^4.0.0, log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -log-update@^3.0.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-3.4.0.tgz#3b9a71e00ac5b1185cc193a36d654581c48f97b9" - integrity sha512-ILKe88NeMt4gmDvk/eb615U/IVn7K9KWGkoYbdatQ69Z65nj1ZzjM6fHXfcs0Uge+e+EGnMW7DY4T9yko8vWFg== +log-symbols@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-5.1.0.tgz#a20e3b9a5f53fac6aeb8e2bb22c07cf2c8f16d93" + integrity sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA== dependencies: - ansi-escapes "^3.2.0" - cli-cursor "^2.1.0" - wrap-ansi "^5.0.0" + chalk "^5.0.0" + is-unicode-supported "^1.1.0" -loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" -lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -2507,6 +2083,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +lru-cache@^9.0.0: + version "9.0.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.0.3.tgz#8a04f282df5320227bb7215c55df2660d3e4e25b" + integrity sha512-cyjNRew29d4kbgnz1sjDqxg7qg8NW4s+HQzCGjeon7DV5T2yDije16W9HaUFV1dhVEMh+SjrOcK0TomBmf3Egg== + make-dir@^3.0.0, make-dir@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -2524,22 +2105,49 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.2.1.tgz#e4ea399dbc979ae735c83c863dd31bdf364277b7" integrity sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ== -meow@^7.0.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/meow/-/meow-7.1.1.tgz#7c01595e3d337fcb0ec4e8eed1666ea95903d306" - integrity sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA== +markdown-it-anchor@^8.4.1: + version "8.6.6" + resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.6.6.tgz#4a12e358c9c2167ee28cb7a5f10e29d6f1ffd7ca" + integrity sha512-jRW30YGywD2ESXDc+l17AiritL0uVaSnWsb26f+68qaW9zgbIIr1f4v2Nsvc0+s0Z2N3uX6t/yAw7BwCQ1wMsA== + +markdown-it@^12.3.2: + version "12.3.2" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" + integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== + dependencies: + argparse "^2.0.1" + entities "~2.1.0" + linkify-it "^3.0.1" + mdurl "^1.0.1" + uc.micro "^1.0.5" + +marked@^4.0.10: + version "4.2.4" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.4.tgz#5a4ce6c7a1ae0c952601fce46376ee4cf1797e1c" + integrity sha512-Wcc9ikX7Q5E4BYDPvh1C6QNSxrjC9tBgz+A/vAhp59KXUgachw++uMvMKiSW8oA85nopmPZcEvBoex/YLMsiyA== + +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== + +meow@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" + integrity sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ== dependencies: "@types/minimist" "^1.2.0" camelcase-keys "^6.2.2" + decamelize "^1.2.0" decamelize-keys "^1.1.0" hard-rejection "^2.1.0" minimist-options "4.1.0" - normalize-package-data "^2.5.0" + normalize-package-data "^3.0.0" read-pkg-up "^7.0.1" redent "^3.0.0" trim-newlines "^3.0.0" - type-fest "^0.13.1" - yargs-parser "^18.1.3" + type-fest "^0.18.0" + yargs-parser "^20.2.3" merge2@^1.3.0: version "1.4.1" @@ -2554,45 +2162,30 @@ micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.49.0: - version "1.49.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed" - integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.32" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5" - integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A== - dependencies: - mime-db "1.49.0" - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -mimic-response@^1.0.0, mimic-response@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.0.tgz#bfc8e88a1c40ffd40c172ddac3decb8451503b56" + integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -2602,18 +2195,23 @@ minimist-options@4.1.0: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@^1.2.0, minimist@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== +minimist@^1.2.5: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -minipass@^3.0.0, minipass@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd" - integrity sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg== +minipass@^3.1.5, minipass@^3.1.6, minipass@^3.3.4: + version "3.3.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== dependencies: yallist "^4.0.0" +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + mkdirp@^0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -2646,12 +2244,19 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -node-fetch@^2.6.1: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== +node-domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== + +node-fetch@^3.2.10: + version "3.3.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.1.tgz#b3eea7b54b3a48020e46f4f88b9c5a7430d20b2e" + integrity sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow== dependencies: - whatwg-url "^5.0.0" + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" node-preload@^0.2.1: version "0.2.1" @@ -2683,26 +2288,26 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.5.0: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" +normalize-package-data@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" + integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== + dependencies: + hosted-git-info "^4.0.1" + is-core-module "^2.5.0" + semver "^7.3.4" + validate-npm-package-license "^3.0.1" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -normalize-url@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" - integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== - npm-normalize-package-bin@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - nyc@^15.1.0: version "15.1.0" resolved "https://registry.yarnpkg.com/nyc/-/nyc-15.1.0.tgz#1335dae12ddc87b6e249d5a1994ca4bdaea75f02" @@ -2736,30 +2341,18 @@ nyc@^15.1.0: test-exclude "^6.0.0" yargs "^15.0.2" -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - onetime@^5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" @@ -2784,19 +2377,19 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -ora@^5.4.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" - integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== - dependencies: - bl "^4.1.0" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-spinners "^2.5.0" - is-interactive "^1.0.0" - is-unicode-supported "^0.1.0" - log-symbols "^4.1.0" - strip-ansi "^6.0.0" +ora@^6.1.2: + version "6.3.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-6.3.1.tgz#a4e9e5c2cf5ee73c259e8b410273e706a2ad3ed6" + integrity sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ== + dependencies: + chalk "^5.0.0" + cli-cursor "^4.0.0" + cli-spinners "^2.6.1" + is-interactive "^2.0.0" + is-unicode-supported "^1.1.0" + log-symbols "^5.1.0" + stdin-discarder "^0.1.0" + strip-ansi "^7.0.1" wcwidth "^1.0.1" os-homedir@^1.0.0: @@ -2817,10 +2410,10 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -own-or-env@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/own-or-env/-/own-or-env-1.0.1.tgz#54ce601d3bf78236c5c65633aa1c8ec03f8007e4" - integrity sha512-y8qULRbRAlL6x2+M0vIe7jJbJx/kmUTzYonRAa2ayesR2qWLswninkVyeJe4x3IEXhdgoNodzjQRKAoEs6Fmrw== +own-or-env@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/own-or-env/-/own-or-env-1.0.2.tgz#84e78d2d5128f7ee8a59f741ad5aafb4256a7c89" + integrity sha512-NQ7v0fliWtK7Lkb+WdFqe6ky9XAzYmlkXthQrBbzlYbmFKoAYbDDcwmOm6q8kOuwSRXW8bdL5ORksploUJmWgw== dependencies: own-or "^1.0.0" @@ -2829,11 +2422,6 @@ own-or@^1.0.0: resolved "https://registry.yarnpkg.com/own-or/-/own-or-1.0.0.tgz#4e877fbeda9a2ec8000fbc0bcae39645ee8bf8dc" integrity sha1-Tod/vtqaLsgAD7wLyuOWRe6L+Nw= -p-cancelable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" - integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== - p-is-promise@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-3.0.0.tgz#58e78c7dfe2e163cf2a04ff869e7c1dba64a5971" @@ -2846,6 +2434,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -2853,6 +2448,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-map@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" @@ -2875,16 +2477,6 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" -package-json@^6.3.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" - integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== - dependencies: - got "^9.6.0" - registry-auth-token "^4.0.0" - registry-url "^5.0.0" - semver "^6.2.0" - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -2902,6 +2494,11 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +patch-console@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/patch-console/-/patch-console-1.0.0.tgz#19b9f028713feb8a3c023702a8cc8cb9f7466f9d" + integrity sha512-nxl9nrnLQmh64iTzMfyylSlRozL7kAXIaxw1fVcLYdyhNkJCRUzirRZTikXGJsg+hc4fqpneTK6iU2H1Q8THSA== + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -2917,21 +2514,24 @@ path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6, path-parse@^1.0.7: +path-parse@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.7.0.tgz#99c741a2cfbce782294a39994d63748b5a24f6db" + integrity sha512-UkZUeDjczjYRE495+9thsgcVgsaCPkaw80slmfVFgllxY+IO8ubTsOpFVjDPROBqJdHfVPUFRHPBV/WciOVfWg== + dependencies: + lru-cache "^9.0.0" + minipass "^5.0.0" + path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" @@ -2956,11 +2556,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= - prettier-linter-helpers@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" @@ -2969,9 +2564,9 @@ prettier-linter-helpers@^1.0.0: fast-diff "^1.1.2" prettier@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" - integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== pretty-hrtime@^1.0.3: version "1.0.3" @@ -2990,20 +2585,6 @@ process-on-spawn@^1.0.0: dependencies: fromentries "^1.2.0" -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -prop-types@^15.6.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.8.1" - proxy@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/proxy/-/proxy-1.0.2.tgz#e0cfbe11c0a7a8b238fd2d7134de4e2867578e7f" @@ -3013,36 +2594,11 @@ proxy@^1.0.2: basic-auth-parser "0.0.2" debug "^4.1.1" -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -punycode@^2.0.0, punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.0.0, punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -pupa@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" - integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== - dependencies: - escape-goat "^2.0.0" - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -3053,39 +2609,30 @@ quick-lru@^4.0.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== -rc@^1.2.8: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== +react-devtools-core@^4.19.1: + version "4.25.0" + resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.25.0.tgz#78b11a2c9f81dd9ebff3745ab4ee2147cc96c12a" + integrity sha512-iewRrnu0ZnmfL+jJayKphXj04CFh6i3ezVnpCtcnZbTPSQgN09XqHAzXbKbqNDl7aTg9QLNkQRP6M3DvdrinWA== dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -react-is@^16.8.1: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" - integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + shell-quote "^1.6.1" + ws "^7" -react-reconciler@^0.24.0: - version "0.24.0" - resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.24.0.tgz#5a396b2c2f5efe8554134a5935f49f546723f2dd" - integrity sha512-gAGnwWkf+NOTig9oOowqid9O0HjTDC+XVGBCAmJYYJ2A2cN/O4gDdIuuUQjv8A4v6GDwVfJkagpBBLW5OW9HSw== +react-reconciler@^0.26.2: + version "0.26.2" + resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.26.2.tgz#bbad0e2d1309423f76cf3c3309ac6c96e05e9d91" + integrity sha512-nK6kgY28HwrMNwDnMui3dvm3rCFjZrcGiuwLc5COUipBK5hWHLOxMJhSnSomirqWwjPBJKV1QcbkI0VJr7Gl1Q== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.18.0" + scheduler "^0.20.2" -react@^16.12.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" - integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== +react@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" read-installed@~4.0.3: version "4.0.3" @@ -3143,7 +2690,7 @@ readable-stream@^2.0.0: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.0.0, readable-stream@^3.4.0: +readable-stream@^3.4.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -3184,25 +2731,6 @@ redeyed@~2.1.0: dependencies: esprima "~4.0.0" -regexpp@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - -registry-auth-token@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250" - integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw== - dependencies: - rc "^1.2.8" - -registry-url@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" - integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== - dependencies: - rc "^1.2.8" - release-zalgo@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" @@ -3210,47 +2738,23 @@ release-zalgo@^1.0.0: dependencies: es6-error "^4.0.1" -request@^2.88.2: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +requizzle@^0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.4.tgz#319eb658b28c370f0c20f968fa8ceab98c13d27c" + integrity sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw== + dependencies: + lodash "^4.17.21" + resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" @@ -3274,30 +2778,6 @@ resolve@^1.10.0: is-core-module "^2.2.0" path-parse "^1.0.6" -resolve@^1.12.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -responselike@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= - dependencies: - lowercase-keys "^1.0.0" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -3306,6 +2786,14 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" +restore-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-4.0.0.tgz#519560a4318975096def6e609d44100edaa4ccb9" + integrity sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -3318,6 +2806,13 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +rimraf@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.0.tgz#5bda14e410d7e4dd522154891395802ce032c2cb" + integrity sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g== + dependencies: + glob "^10.0.0" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -3325,55 +2820,43 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -scheduler@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.18.0.tgz#5901ad6659bc1d8f3fdaf36eb7a67b0d6746b1c4" - integrity sha512-agTSHR1Nbfi6ulI0kYNK0203joW2Y5W4po4l+v03tOoiJKpTBbxpNhWDvqc/4IcOw+KLmSiQLTasZ4cab2/UWQ== +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" secure-json-parse@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.4.0.tgz#5aaeaaef85c7a417f76271a4f5b0cc3315ddca85" - integrity sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg== - -semver-diff@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" - integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== - dependencies: - semver "^6.3.0" + version "2.7.0" + resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.7.0.tgz#5a5f9cd6ae47df23dba3151edd06855d47e09862" + integrity sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw== "semver@2 || 3 || 4 || 5", semver@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== +semver@^7.3.4, semver@^7.3.5: + version "7.5.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== dependencies: lru-cache "^6.0.0" @@ -3394,24 +2877,29 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== +shell-quote@^1.6.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.3.tgz#aa40edac170445b9a431e17bb62c0b881b9c4123" + integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw== + +signal-exit@^3.0.2, signal-exit@^3.0.4, signal-exit@^3.0.6: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -simple-git@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.5.0.tgz#3c3538f4d7a1b3c8f3904412b12740bdcad9c8b1" - integrity sha512-fZsaq5nzdxQRhMNs6ESGLpMUHoL5GRP+boWPhq9pMYMKwOGZV2jHOxi8AbFFA2Y/6u4kR99HoULizSbpzaODkA== +simple-git@^3.15.0: + version "3.18.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.18.0.tgz#2e25adbbc1e3df5ee97c0f1b468ddadf3f0f9adf" + integrity sha512-Yt0GJ5aYrpPci3JyrYcsPz8Xc05Hi4JPSOb+Sgn/BmPX35fn/6Fp9Mef8eMBCrL2siY5w4j49TA5Q+bxPpri1Q== dependencies: "@kwsites/file-exists" "^1.1.1" "@kwsites/promise-deferred" "^1.1.1" - debug "^4.3.3" + debug "^4.3.4" simple-statistics@^7.7.0: - version "7.7.0" - resolved "https://registry.yarnpkg.com/simple-statistics/-/simple-statistics-7.7.0.tgz#cfef964473c940f2adfec85ffde8591a5a933a46" - integrity sha512-TAsZRUJ7FD/yCnm5UBgyWU7bP1gOPsw9n/dVrE8hQ+BF1zJPgDJ5X/MOnxG+HE/7nejSpJLJLdmTh7bkfsFkRw== + version "7.8.3" + resolved "https://registry.yarnpkg.com/simple-statistics/-/simple-statistics-7.8.3.tgz#62998dd7786ba14fa27b07f4f3cd498466f7961a" + integrity sha512-JFvMY00t6SBGtwMuJ+nqgsx9ylkMiJ5JlK9bkj8AdvniIe5615wWQYkKHXe84XtSuc40G/tlrPu0A5/NlJvv8A== slash@^3.0.0: version "3.0.0" @@ -3427,15 +2915,6 @@ slice-ansi@^3.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - slide@~1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" @@ -3520,79 +2999,35 @@ spdx-satisfies@^4.0.0: spdx-expression-parse "^3.0.0" spdx-ranges "^2.0.0" -split2@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" +split2@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -stack-utils@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" - integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== +stack-utils@^2.0.2, stack-utils@^2.0.4: + version "2.0.5" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" + integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== dependencies: escape-string-regexp "^2.0.0" +stdin-discarder@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/stdin-discarder/-/stdin-discarder-0.1.0.tgz#22b3e400393a8e28ebf53f9958f3880622efde21" + integrity sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ== + dependencies: + bl "^5.0.0" + stoppable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/stoppable/-/stoppable-1.1.0.tgz#32da568e83ea488b08e4d7ea2c3bcc9d75015d5b" integrity sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw== -string-length@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837" - integrity sha512-Ttp5YvkGm5v9Ijagtaz1BnN+k9ObpvS0eIBblPMp2YWL8FBmi9qblQ9fexc2k/CXFgrTIteU3jAw3payCnwSTA== - dependencies: - astral-regex "^1.0.0" - strip-ansi "^5.2.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: version "4.2.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" @@ -3602,7 +3037,7 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string-width@^4.2.3: +string-width@^4.2.2: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -3625,35 +3060,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - -strip-ansi@^6.0.1: +strip-ansi@^3.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1, strip-ansi@^7.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -3677,11 +3084,6 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -3704,97 +3106,75 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -table@^6.0.9: - version "6.8.0" - resolved "https://registry.yarnpkg.com/table/-/table-6.8.0.tgz#87e28f14fa4321c3377ba286f07b79b281a3b3ca" - integrity sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA== - dependencies: - ajv "^8.0.1" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - -tap-mocha-reporter@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/tap-mocha-reporter/-/tap-mocha-reporter-5.0.1.tgz#74f00be2ddd2a380adad45e085795137bc39497a" - integrity sha512-1knFWOwd4khx/7uSEnUeaP9IPW3w+sqTgJMhrwah6t46nZ8P25atOKAjSvVDsT67lOPu0nfdOqUwoyKn+3E5pA== +tap-mocha-reporter@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/tap-mocha-reporter/-/tap-mocha-reporter-5.0.3.tgz#3e261b2a43092ba8bc0cb67a89b33e283decee05" + integrity sha512-6zlGkaV4J+XMRFkN0X+yuw6xHbE9jyCZ3WUKfw4KxMyRGOpYSRuuQTRJyWX88WWuLdVTuFbxzwXhXuS2XE6o0g== dependencies: color-support "^1.1.0" debug "^4.1.1" diff "^4.0.1" escape-string-regexp "^2.0.0" glob "^7.0.5" - tap-parser "^10.0.0" + tap-parser "^11.0.0" tap-yaml "^1.0.0" unicode-length "^2.0.2" -tap-parser@^10.0.0, tap-parser@^10.0.1: - version "10.1.0" - resolved "https://registry.yarnpkg.com/tap-parser/-/tap-parser-10.1.0.tgz#7b1aac40dbcaa4716c0b58952686eae65d2b74ad" - integrity sha512-FujQeciDaOiOvaIVGS1Rpb0v4R6XkOjvWCWowlz5oKuhPkEJ8U6pxgqt38xuzYhPt8dWEnfHn2jqpZdJEkW7pA== +tap-parser@^11.0.0, tap-parser@^11.0.2: + version "11.0.2" + resolved "https://registry.yarnpkg.com/tap-parser/-/tap-parser-11.0.2.tgz#5d3e76e2cc521e23a8c50201487b273ca0fba800" + integrity sha512-6qGlC956rcORw+fg7Fv1iCRAY8/bU9UabUAhs3mXRH6eRmVZcNPLheSXCYaVaYeSwx5xa/1HXZb1537YSvwDZg== dependencies: events-to-array "^1.0.1" - minipass "^3.0.0" + minipass "^3.1.6" tap-yaml "^1.0.0" -tap-yaml@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/tap-yaml/-/tap-yaml-1.0.0.tgz#4e31443a5489e05ca8bbb3e36cef71b5dec69635" - integrity sha512-Rxbx4EnrWkYk0/ztcm5u3/VznbyFJpyXO12dDBHKWiDVxy7O2Qw6MRrwO5H6Ww0U5YhRY/4C/VzWmFPhBQc4qQ== +tap-yaml@^1.0.0, tap-yaml@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/tap-yaml/-/tap-yaml-1.0.2.tgz#62032a459e5524e10661c19ee9df5d33d78812fa" + integrity sha512-GegASpuqBnRNdT1U+yuUPZ8rEU64pL35WPBpCISWwff4dErS2/438barz7WFJl4Nzh3Y05tfPidZnH+GaV1wMg== dependencies: - yaml "^1.5.0" + yaml "^1.10.2" -tap@^15.0.9: - version "15.0.9" - resolved "https://registry.yarnpkg.com/tap/-/tap-15.0.9.tgz#21347a789e88798a94aa151d25ea1c92d04c27ef" - integrity sha512-bqY5SxEqYKRd37PIUfKBf9HMs/hklyl/fGXkuStr9rYTIGa0/icpSLsm6IVOmx2qT0/TliPNJ6OvS5kddJYHdg== +tap@^16.3.0: + version "16.3.4" + resolved "https://registry.yarnpkg.com/tap/-/tap-16.3.4.tgz#4dc740a9dcbfa2d890fb2b647720f29980289179" + integrity sha512-SAexdt2ZF4XBgye6TPucFI2y7VE0qeFXlXucJIV1XDPCs+iJodk0MYacr1zR6Ycltzz7PYg8zrblDXKbAZM2LQ== dependencies: - "@types/react" "^16.9.23" + "@isaacs/import-jsx" "^4.0.1" + "@types/react" "^17.0.52" chokidar "^3.3.0" - coveralls "^3.0.11" findit "^2.0.0" foreground-child "^2.0.0" fs-exists-cached "^1.0.0" - glob "^7.1.6" - import-jsx "^4.0.0" - ink "^2.7.1" + glob "^7.2.3" + ink "^3.2.0" isexe "^2.0.0" - istanbul-lib-processinfo "^2.0.2" - jackspeak "^1.4.0" - libtap "^1.1.1" - minipass "^3.1.1" + istanbul-lib-processinfo "^2.0.3" + jackspeak "^1.4.2" + libtap "^1.4.0" + minipass "^3.3.4" mkdirp "^1.0.4" nyc "^15.1.0" opener "^1.5.1" - react "^16.12.0" + react "^17.0.2" rimraf "^3.0.0" - signal-exit "^3.0.0" + signal-exit "^3.0.6" source-map-support "^0.5.16" - tap-mocha-reporter "^5.0.0" - tap-parser "^10.0.1" - tap-yaml "^1.0.0" - tcompare "^5.0.6" - treport "^2.0.2" + tap-mocha-reporter "^5.0.3" + tap-parser "^11.0.2" + tap-yaml "^1.0.2" + tcompare "^5.0.7" + treport "^3.0.4" which "^2.0.2" -tcompare@^5.0.1, tcompare@^5.0.6: - version "5.0.6" - resolved "https://registry.yarnpkg.com/tcompare/-/tcompare-5.0.6.tgz#b809135cca3d165fb17d5eabb9ed292629e38e31" - integrity sha512-OvO7omN/wkdsKzmOqr3sQFfLbghs/2X5mwSkcfgRiXZshfPnTsAs3IRf1RixR/Pff26qG/r9ogcZMpV0YdeGXg== +tcompare@^5.0.6, tcompare@^5.0.7: + version "5.0.7" + resolved "https://registry.yarnpkg.com/tcompare/-/tcompare-5.0.7.tgz#8c2d647208031ed5cac5e573428149e16f795bbf" + integrity sha512-d9iddt6YYGgyxJw5bjsN7UJUO1kGOtjSlNy/4PoGYAjQS5pAT/hzIoLf1bZCw+uUxRmZJh7Yy1aA7xKVRT9B4w== dependencies: diff "^4.0.2" -term-size@^2.1.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" - integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -3814,11 +3194,6 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= -to-readable-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" - integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -3826,36 +3201,23 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - treeify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/treeify/-/treeify-1.1.0.tgz#4e31c6a463accd0943879f30667c4fdaff411bb8" integrity sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A== -treport@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/treport/-/treport-2.0.2.tgz#a007278c01335c1209e3f5c20e98ef14fd736cc2" - integrity sha512-AnHKgHMy3II7Arfvf1tSHAwv9rzcvgbWrOixFJgdExVKd0mMsOp9wD2LGP9RbXy9j8AZoerBVu3OR2Uz9MpUJw== +treport@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/treport/-/treport-3.0.4.tgz#05247fa7820ad3afe92355e4cf08fe41a933084b" + integrity sha512-zUw1sfJypuoZi0I54woo6CNsfvMrv+OwLBD0/wc4LhMW8MA0MbSE+4fNObn22JSR8x9lOYccuAzfBfZ2IemzoQ== dependencies: + "@isaacs/import-jsx" "^4.0.1" cardinal "^2.1.1" chalk "^3.0.0" - import-jsx "^4.0.0" - ink "^2.6.0" + ink "^3.2.0" ms "^2.1.2" - string-length "^3.1.0" - tap-parser "^10.0.1" + tap-parser "^11.0.0" + tap-yaml "^1.0.0" unicode-length "^2.0.2" trim-newlines@^3.0.0: @@ -3868,29 +3230,22 @@ trivial-deferred@^1.0.1: resolved "https://registry.yarnpkg.com/trivial-deferred/-/trivial-deferred-1.0.1.tgz#376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3" integrity sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM= -tsd@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/tsd/-/tsd-0.15.1.tgz#d0c733c623d59de52f180ae7af66a1fde9e6c533" - integrity sha512-8ADO2rPntfNiJV4KiqJiiiitfkXLxCbKEFN672JgwNiaEIuiyurTc1+w3InZ+0DqBz73B6Z3UflZcNGw5xMaDA== +tsd@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/tsd/-/tsd-0.27.0.tgz#5f02d6e75cac36d9db7fe4e52109284ace1268b8" + integrity sha512-G/2Sejk9N21TcuWlHwrvVWwIyIl2mpECFPbnJvFMsFN1xQCIbi2QnvG4fkw3VitFhNF6dy38cXxKJ8Paq8kOGQ== dependencies: - eslint-formatter-pretty "^4.0.0" + "@tsd/typescript" "~4.9.5" + eslint-formatter-pretty "^4.1.0" globby "^11.0.1" - meow "^7.0.1" + meow "^9.0.0" path-exists "^4.0.0" read-pkg-up "^7.0.0" - update-notifier "^4.1.0" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= +tslib@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" @@ -3904,10 +3259,15 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== +type-fest@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.12.0.tgz#f57a27ab81c68d136a51fd71467eff94157fa1ee" + integrity sha512-53RyidyjvkGpnWPMF9bQgFtWp+Sl8O2Rp13VavmJgfAP9WWG6q6TkrKU8iyJdnwnfgHI6k2hTlgqH4aSdjoTbg== + +type-fest@^0.18.0: + version "0.18.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" + integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== type-fest@^0.20.2: version "0.20.2" @@ -3936,6 +3296,16 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +uc.micro@^1.0.1, uc.micro@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" + integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== + +underscore@~1.13.2: + version "1.13.6" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" + integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A== + unicode-length@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/unicode-length/-/unicode-length-2.0.2.tgz#e5eb4c0d523fdf7bebb59ca261c9ca1cf732da96" @@ -3944,32 +3314,6 @@ unicode-length@^2.0.2: punycode "^2.0.0" strip-ansi "^3.0.1" -unique-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" - integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== - dependencies: - crypto-random-string "^2.0.0" - -update-notifier@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3" - integrity sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A== - dependencies: - boxen "^4.2.0" - chalk "^3.0.0" - configstore "^5.0.1" - has-yarn "^2.1.0" - import-lazy "^2.1.0" - is-ci "^2.0.0" - is-installed-globally "^0.3.1" - is-npm "^4.0.0" - is-yarn-global "^0.3.0" - latest-version "^5.0.0" - pupa "^2.0.1" - semver-diff "^3.1.1" - xdg-basedir "^4.0.0" - uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -3977,13 +3321,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= - dependencies: - prepend-http "^2.0.0" - util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -3994,15 +3331,10 @@ util-extend@^1.0.1: resolved "https://registry.yarnpkg.com/util-extend/-/util-extend-1.0.3.tgz#a7c216d267545169637b3b6edc6ca9119e2ff93f" integrity sha1-p8IW0mdUUWljeztu3GypEZ4v+T8= -uuid@^3.3.2, uuid@^3.3.3: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== validate-npm-package-license@^3.0.1: version "3.0.4" @@ -4012,15 +3344,6 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -4028,18 +3351,10 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" +web-streams-polyfill@^3.0.3: + version "3.2.1" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" + integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== which-module@^2.0.0: version "2.0.0" @@ -4072,23 +3387,6 @@ workq@^3.0.0: dependencies: debug "^4.1.1" -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrap-ansi@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -4098,6 +3396,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -4113,21 +3420,25 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -xdg-basedir@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" - integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== +ws@^7, ws@^7.5.5: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== -xmlbuilder2@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/xmlbuilder2/-/xmlbuilder2-2.4.1.tgz#899c783a833188c5a5aa6f3c5428a3963f3e479d" - integrity sha512-vliUplZsk5vJnhxXN/mRcij/AE24NObTUm/Zo4vkLusgayO6s3Et5zLEA14XZnY1c3hX5o1ToR0m0BJOPy0UvQ== +xmlbuilder2@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/xmlbuilder2/-/xmlbuilder2-3.1.1.tgz#b977ef8a6fb27a1ea7ffa7d850d2c007ff343bc0" + integrity sha512-WCSfbfZnQDdLQLiMdGUQpMxxckeQ4oZNMNhLVkcekTu7xhD4tuUDyAPoY8CwXvBYE6LwBHd6QW2WZXlOWr1vCw== dependencies: - "@oozcitak/dom" "1.15.8" + "@oozcitak/dom" "1.15.10" "@oozcitak/infra" "1.0.8" "@oozcitak/util" "8.3.8" - "@types/node" "*" - js-yaml "3.14.0" + js-yaml "3.14.1" + +xmlcreate@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be" + integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== y18n@^4.0.0: version "4.0.3" @@ -4139,17 +3450,12 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.5.0: +yaml@^1.10.2: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yapool@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/yapool/-/yapool-1.0.0.tgz#f693f29a315b50d9a9da2646a7a6645c96985b6a" - integrity sha1-9pPymjFbUNmp2iZGp6ZkXJaYW2o= - -yargs-parser@^18.1.2, yargs-parser@^18.1.3: +yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== @@ -4157,6 +3463,11 @@ yargs-parser@^18.1.2, yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.3: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs@^15.0.2: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" @@ -4174,7 +3485,12 @@ yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.2" -yoga-layout-prebuilt@^1.9.3: +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +yoga-layout-prebuilt@^1.9.6: version "1.10.0" resolved "https://registry.yarnpkg.com/yoga-layout-prebuilt/-/yoga-layout-prebuilt-1.10.0.tgz#2936fbaf4b3628ee0b3e3b1df44936d6c146faa6" integrity sha512-YnOmtSbv4MTf7RGJMK0FvZ+KD8OEe/J5BNnR0GHhD8J/XcG/Qvxgszm0Un6FTHWW4uHlTgP0IztiXQnGyIR45g==