diff --git a/.ci/doc/templates/default.tpl.java b/.ci/doc/templates/default.tpl.java index 383a675e..b994905a 100644 --- a/.ci/doc/templates/default.tpl.java +++ b/.ci/doc/templates/default.tpl.java @@ -2,6 +2,7 @@ import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; import io.kuzzle.sdk.coreClasses.SearchResult; +import io.kuzzle.sdk.coreClasses.lang.Lang; import java.util.*; public class SnippetTest { diff --git a/.ci/doc/templates/default.tpl.kt b/.ci/doc/templates/default.tpl.kt index efc8c4e4..51aca01e 100644 --- a/.ci/doc/templates/default.tpl.kt +++ b/.ci/doc/templates/default.tpl.kt @@ -4,6 +4,7 @@ import io.kuzzle.sdk.protocol.WebSocket import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response import io.kuzzle.sdk.coreClasses.SearchResult +import io.kuzzle.sdk.coreClasses.lang.Lang fun main() { val ws = WebSocket("kuzzle") diff --git a/.ci/doc/templates/print-result-array.tpl.java b/.ci/doc/templates/print-result-array.tpl.java index 936bc1a6..dc789523 100644 --- a/.ci/doc/templates/print-result-array.tpl.java +++ b/.ci/doc/templates/print-result-array.tpl.java @@ -1,6 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; +import io.kuzzle.sdk.coreClasses.lang.Lang; import java.util.*; public class SnippetTest { diff --git a/.ci/doc/templates/print-result-array.tpl.kt b/.ci/doc/templates/print-result-array.tpl.kt index 7651156e..242fda8f 100644 --- a/.ci/doc/templates/print-result-array.tpl.kt +++ b/.ci/doc/templates/print-result-array.tpl.kt @@ -4,6 +4,7 @@ import io.kuzzle.sdk.protocol.WebSocket import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response import io.kuzzle.sdk.coreClasses.maps.KuzzleMap +import io.kuzzle.sdk.coreClasses.lang.Lang fun main() { val ws = WebSocket("kuzzle") diff --git a/.ci/doc/templates/print-result-arraylist.tpl.java b/.ci/doc/templates/print-result-arraylist.tpl.java index 398b17d5..2afdd574 100644 --- a/.ci/doc/templates/print-result-arraylist.tpl.java +++ b/.ci/doc/templates/print-result-arraylist.tpl.java @@ -1,6 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; +import io.kuzzle.sdk.coreClasses.lang.Lang; import java.util.*; public class SnippetTest { diff --git a/.ci/doc/templates/print-result-arraylist.tpl.kt b/.ci/doc/templates/print-result-arraylist.tpl.kt index 5e1c6ed6..760311fb 100644 --- a/.ci/doc/templates/print-result-arraylist.tpl.kt +++ b/.ci/doc/templates/print-result-arraylist.tpl.kt @@ -3,6 +3,7 @@ import io.kuzzle.sdk.protocol.WebSocket import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response +import io.kuzzle.sdk.coreClasses.lang.Lang fun main() { val ws = WebSocket("kuzzle") diff --git a/.ci/doc/templates/print-result.tpl.java b/.ci/doc/templates/print-result.tpl.java index 385504f2..9c9e666c 100644 --- a/.ci/doc/templates/print-result.tpl.java +++ b/.ci/doc/templates/print-result.tpl.java @@ -1,6 +1,7 @@ import io.kuzzle.sdk.Kuzzle; import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; +import io.kuzzle.sdk.coreClasses.lang.Lang; import java.util.*; public class SnippetTest { diff --git a/.ci/doc/templates/print-result.tpl.kt b/.ci/doc/templates/print-result.tpl.kt index 3eb829be..1ef6b808 100644 --- a/.ci/doc/templates/print-result.tpl.kt +++ b/.ci/doc/templates/print-result.tpl.kt @@ -3,6 +3,7 @@ import io.kuzzle.sdk.protocol.WebSocket import java.util.Date import java.util.concurrent.ExecutionException +import io.kuzzle.sdk.coreClasses.lang.Lang import io.kuzzle.sdk.coreClasses.responses.Response fun main() { diff --git a/.ci/doc/templates/print-search-result.tpl.java b/.ci/doc/templates/print-search-result.tpl.java index 0f301169..adeef117 100644 --- a/.ci/doc/templates/print-search-result.tpl.java +++ b/.ci/doc/templates/print-search-result.tpl.java @@ -3,6 +3,7 @@ import io.kuzzle.sdk.protocol.WebSocket; import io.kuzzle.sdk.coreClasses.responses.Response; import io.kuzzle.sdk.coreClasses.SearchResult; +import io.kuzzle.sdk.coreClasses.lang.Lang; public class SnippetTest { private static Kuzzle kuzzle; diff --git a/.ci/doc/templates/print-search-result.tpl.kt b/.ci/doc/templates/print-search-result.tpl.kt index be36ad44..aa03fa79 100644 --- a/.ci/doc/templates/print-search-result.tpl.kt +++ b/.ci/doc/templates/print-search-result.tpl.kt @@ -4,6 +4,7 @@ import io.kuzzle.sdk.protocol.WebSocket import java.util.concurrent.ExecutionException import io.kuzzle.sdk.coreClasses.responses.Response import io.kuzzle.sdk.coreClasses.SearchResult +import io.kuzzle.sdk.coreClasses.lang.Lang fun main() { val ws = WebSocket("kuzzle") diff --git a/.github/actions/dead-links/action.yml b/.github/actions/dead-links/action.yml new file mode 100644 index 00000000..e8fec33b --- /dev/null +++ b/.github/actions/dead-links/action.yml @@ -0,0 +1,23 @@ +name: Dead Links +description: Run Dead Links Tests +runs: + using: "composite" + steps: + - name: Install deps + run: npm ci + shell: bash + - name: Prepare documentation + run: npm run doc-prepare + shell: bash + - name: Install docs repositories + run: npx kuzdoc iterate-repos:install --repos_path doc/framework/.repos/ + shell: bash + - name: Link kuzdoc + run: npx kuzdoc framework:link -d /sdk/jvm/1/ -v 1 + shell: bash + - name: Install typhoeus + run: sudo gem install typhoeus + shell: bash + - name: Run dead links tests + run: cd doc/framework/ && HYDRA_MAX_CONCURRENCY=20 ruby .ci/dead-links.rb -p src/sdk/jvm/1/ + shell: bash diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml new file mode 100644 index 00000000..29969444 --- /dev/null +++ b/.github/actions/deploy/action.yml @@ -0,0 +1,20 @@ +name: Deploy package +description: Run Deploy package + +inputs: + BINTRAY_KEY: + description: BINTRAY_KEY + required: true + BINTRAY_USER: + description: BINTRAY_USER + required: true + +runs: + using: "composite" + steps: + - name: Deploy to bintray + run: ./gradlew bintrayUpload + env: + BINTRAY_KEY: ${{ inputs.BINTRAY_KEY }} + BINTRAY_USER: ${{ inputs.BINTRAY_USER }} + shell: bash diff --git a/.github/actions/doc-deploy/action.yml b/.github/actions/doc-deploy/action.yml new file mode 100644 index 00000000..0570d8f1 --- /dev/null +++ b/.github/actions/doc-deploy/action.yml @@ -0,0 +1,53 @@ +name: Deploy Documentation +description: Build doc, upload it to S3 and invalidate Cloudfront cache + +inputs: + AWS_ACCESS_KEY_ID: + description: AWS Access key ID + required: true + AWS_SECRET_ACCESS_KEY: + description: AWS secret key + required: true + S3_BUCKET: + description: S3 bucket name + required: true + CLOUDFRONT_ID: + description: Cloudfront distribution ID + required: true + REGION: + description: AWS default region + required: true + FRAMEWORK_BRANCH: + description: Documentation framework branch to use + required: true + +runs: + using: "composite" + steps: + - name: Install AWS CLI + run: | + sudo apt-get update + sudo apt-get install python python-pip + pip install awscli --upgrade --user + shell: bash + - name: Build documentation + run: | + rm -fr doc/framework + npm install --production=false + npm run doc-prepare + npm run doc-build + env: + NODE_ENV: production + FRAMEWORK_BRANCH: ${{ inputs.FRAMEWORK_BRANCH }} + shell: bash + - name: Deploy documentation + run: | + npm run doc-upload + npm run doc-cloudfront + env: + AWS_DEFAULT_REGION: ${{ inputs.REGION }} + AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} + S3_BUCKET: ${{ inputs.S3_BUCKET }} + CLOUDFRONT_DISTRIBUTION_ID: ${{ inputs.CLOUDFRONT_ID }} + shell: bash diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml new file mode 100644 index 00000000..f8bc954b --- /dev/null +++ b/.github/actions/lint/action.yml @@ -0,0 +1,13 @@ +name: Lint +description: Run KTLint +runs: + using: "composite" + steps: + - name: Get ktlint + run: | + curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.40.0/ktlint + chmod a+x ktlint + shell: bash + - name: Run ktlint + run: ./ktlint --disabled_rules="no-wildcard-imports" "src/**/*.kt" + shell: bash diff --git a/.github/actions/snippets-tests/action.yml b/.github/actions/snippets-tests/action.yml new file mode 100644 index 00000000..e935d83f --- /dev/null +++ b/.github/actions/snippets-tests/action.yml @@ -0,0 +1,8 @@ +name: Snippets Tests +description: Run Snippets Testss +runs: + using: "composite" + steps: + - name: Launch Tests + run: docker-compose -f .ci/doc/docker-compose.yml run doc-tests index + shell: bash diff --git a/.github/actions/unit-tests/action.yml b/.github/actions/unit-tests/action.yml new file mode 100644 index 00000000..e056a20b --- /dev/null +++ b/.github/actions/unit-tests/action.yml @@ -0,0 +1,8 @@ +name: Unit Test +description: Run Unit Tests +runs: + using: "composite" + steps: + - name: Launch Tests + run: ./gradlew test + shell: bash diff --git a/.github/workflows/pull_request.workflow.yml b/.github/workflows/pull_request.workflow.yml new file mode 100644 index 00000000..3c44cacd --- /dev/null +++ b/.github/workflows/pull_request.workflow.yml @@ -0,0 +1,72 @@ +name: Pull request checks + +on: [pull_request] + +jobs: + lint: + name: Lint + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: "8" + architecture: x64 + - uses: ./.github/actions/lint + + unit-tests: + name: Unit Tests + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: "8" + architecture: x64 + - uses: ./.github/actions/unit-tests + + documentation-snippets-tests: + name: Documentation - Snippets Tests + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: actions/setup-node@v1.4.4 + with: + node-version: "12" + - uses: ./.github/actions/snippets-tests + + documentation-dead-links: + name: Documentation - Dead links check + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: actions/setup-node@v1.4.4 + with: + node-version: "12" + - uses: ./.github/actions/dead-links diff --git a/.github/workflows/push_dev.workflow.yml b/.github/workflows/push_dev.workflow.yml new file mode 100644 index 00000000..bb0f0de0 --- /dev/null +++ b/.github/workflows/push_dev.workflow.yml @@ -0,0 +1,106 @@ +name: Deployment Doc Dev + +on: + push: + branches: + - 1-dev + +jobs: + lint: + name: Lint + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: "8" + architecture: x64 + - uses: ./.github/actions/lint + + unit-tests: + name: Unit Tests + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: "8" + architecture: x64 + - uses: ./.github/actions/unit-tests + + documentation-snippets-tests: + name: Documentation - Snippets Tests + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: actions/setup-node@v1.4.4 + with: + node-version: "12" + - uses: ./.github/actions/snippets-tests + + documentation-dead-links: + name: Documentation - Dead links check + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: actions/setup-node@v1.4.4 + with: + node-version: "12" + - uses: ./.github/actions/dead-links + + + documentation-staging: + name: Documentation - Deploy to staging + runs-on: ubuntu-18.04 + timeout-minutes: 30 + needs: [lint, unit-tests, documentation-dead-links, documentation-snippets-tests] + steps: + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: actions/setup-node@v1 + with: + node-version: "12" + - uses: ./.github/actions/doc-deploy + with: + REGION: us-west-2 + S3_BUCKET: docs-next.kuzzle.io + CLOUDFRONT_ID: E2ZCCEK9GRB49U + FRAMEWORK_BRANCH: develop + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/push_master.workflow.yml b/.github/workflows/push_master.workflow.yml new file mode 100644 index 00000000..00a60a2c --- /dev/null +++ b/.github/workflows/push_master.workflow.yml @@ -0,0 +1,122 @@ +name: Deployment Doc Dev + +on: + push: + branches: + - master + +jobs: + lint: + name: Lint + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: "8" + architecture: x64 + - uses: ./.github/actions/lint + + unit-tests: + name: Unit Tests + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: "8" + architecture: x64 + - uses: ./.github/actions/unit-tests + + documentation-snippets-tests: + name: Documentation - Snippets Tests + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: actions/setup-node@v1.4.4 + with: + node-version: "12" + - uses: ./.github/actions/snippets-tests + + documentation-dead-links: + name: Documentation - Dead links check + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: actions/setup-node@v1.4.4 + with: + node-version: "12" + - uses: ./.github/actions/dead-links + + + documentation-production: + name: Documentation - Deploy to production + runs-on: ubuntu-18.04 + timeout-minutes: 30 + needs: [lint, unit-tests, documentation-dead-links, documentation-snippets-tests] + steps: + - uses: actions/checkout@v2 + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - uses: actions/setup-node@v1 + with: + node-version: "12" + - uses: ./.github/actions/doc-deploy + with: + REGION: us-west-2 + S3_BUCKET: docs.kuzzle.io + CLOUDFRONT_ID: E3D6RP0POLCJMM + FRAMEWORK_BRANCH: master + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + deploy-bintray: + name: Deploy to Bintray + needs: [lint, unit-tests, documentation-dead-links, documentation-snippets-tests, documentation-production] + runs-on: ubuntu-18.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: "8" + architecture: x64 + - uses: ./.github/actions/deploy + with: + BINTRAY_USER: ${{ secrets.BINTRAY_USER }} + BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e1d8a3e2..00000000 --- a/.travis.yml +++ /dev/null @@ -1,131 +0,0 @@ -env: - global: - # BINTRAY_USER - - secure: YJWM5LX2dCCZjWKen4mLxrXuGk1E/kcyOunO1J+KJdFtEYUeV8e4y5u3mzYDfcU/ovPYBjvNc8nDAnOKq5NuqwqqYegKRa+h90Xzi5ZsVsL7M7NHmnBL1gtxhG2NNYgk6GbPxYfT1FBG6vWyd7DICf87Qt5U9SitPr+XYi/5rxf0hkF6fPIVemOVaRuA3po38eu3oRt5zxtXQ5sRM+NcgxE+ALxeHxX6c8qAARxQcgS+QP8ET7vUI0GYS1j0EAErqvCzz91EwlDMHAv6MUXuz7kzZyeLdWAjEW/xPTsXAehGb/oNmXZUvERh2KXay9NdT8EsipH4f0Rl/KKX2/auweoVPKGcHL1g+mOatyFNNxQZ7wtCv/JqXTj6Y9vwlLHSESy5rmMG7GleZevXLjO/wWd5yWIKmwxhvvUrZeUHLo5w/EgPlx8h3myjl2003Qhg2BCjGw/CVqbDolmVBIf6yNEWd5Fp+UL/govR3x7+EUIe5YCqcVy71XjGxwd7i6R9YKmseZqQmdAzanKnr8Pbe5ppH2bPUJxuWH8MdQUwifGttlh/IyKgqbkoxfvS+5SqipNhJky2bjX+x35EoTlAQkaw0YRiGtfmb6nEUXZgKa+uvR4vi0NHGUe3uzvsZjxtHFkM1T4Ysr3RUmYDfpj2ymCQbzQqC8nnQoeyXEe6Ue4= - # BINTRAY_KEY - - secure: PsUWWzEPYXymGVtnDJmHNxRmPYnw7v0Ucsvx672w6O9tpfyL2dADwGuhxnGjLXuifN8b8LAFPHpt2Ymc++Q9bjK1Gns370klJC1yUGR+EkCMKnS7tVlaStHRt1o9WBl0hlkHada31vMmnm2NYAzR4uHU9O8mMXwiFyYo4CQVLzQajJGSZVI46JNt+hITVemdGZluw7lzmqJ0+e5N2nZNDszPkxy3jar5luLsDyNEzF/iEPhp0pMi6kPSARKZVsRDaND2cnkRQm6KwPE6RbUIr2JE/1rB9Rfz3J7ThipHgl9Czm1TK0FW8auNMwCR99UFuPC8wHGD/20mlxegi1DKniNh1ZZ+CBjVu8IhOItfVjABipzRJUb7GQqdHQWJSF5cXypS1ZVbYbATEciYMLZVCC2qDuH6zLM0JiGQCTteNBj39FjkLG+lDb7qNU2XwIuYTFgBGy3qW1+oS+Hq9q4IVAfpbnTtk0JJTrwoDm4YUotlMGgrMHuzWGvLXXUwo0JhfvAaMfE6PfpoJ0LtdrLcDlXQjeGrkjCldLiIoFEAC5CBapu6nt0b6RpsKnIJrMZZgwgsX8PTzCpL27XLb7BHQb3nRBsQAcejdFbhzOWivlDUxLnL5rHXibT1gYnBLvBEBwJv3QSs3fGGiL96nI62PMQJzJcBnDSRJ/0iMkKW5hY= - # AWS_SECRET_ACCESS_KEY - - secure: pcNtmEXTGmENiFWWbxLxPlix6ZBdYQjyr91g1zq/J7zq6jOTFV082sch1TgE1JfdXQHKpc0euc2E5Nj1i2z+ws5ZFufjg64dBe9O88Zr0HHNjbwP2qPnrJ+dJddfE91/DME9kDpjXYIftRFVoF9LeRx2JgR7XlYIZmmFyw8W+g5qsq5MgQCY2BoRKJ2aZ/raJkwBuqulgzlE66y/Yi4ZPDtxfW03XL6VrqgtFd7HAgXm6Ht0H2L50iHgky9u3TV4RdJQRYivV/mKJwd4NDcejXjdBcVmGnAol2iLnyowVcXZQ2r13/cdVJeGHGw4cUszyiOSC//Zb7Qj0UyLlkpKlje0/uEr68kK+wJ5WMZDlYZ3JiIhE+DkWXEOXtD0YvLwp/rU9hJ4sdGJKWF1VNdxp5Mv7RzkOFEinq9hBYI9SoYS3Z0tcM9waE6V4N11PRgP0sSxOr/YWHFzOZu2hdKzowXN9l5Z+tCHcOtLbLqheFNAm5kKZOY+n6iV9YLE7c8D1f14QVnjpjl2z7uX057Q+rd49NaHQnx3mrsLNrQfHoEI39sP5pWNLePjIu1YyWsiiUnlkPmroQECwWlmPBiqfF+ND+ngVgaFgZxP2QResSt0G3FfwxEA04Da4q6wfH+gNrgUjKCh/gK1Ef/VuONZB7hoEActWnV9iEa7+WlSVI8= - - AWS_ACCESS_KEY_ID=AKIAIYAXFUAHXOWP2MJA - -job: - include: - - stage: Tests - name: Unit tests SDK Kotlin - jdk: openjdk8 - sudo: false - before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ - cache: - directories: - - "$HOME/.gradle/caches/" - - "$HOME/.gradle/wrapper/" - install: - - cd $TRAVIS_BUILD_DIR/ - script: - - "./gradlew test" - - stage: Tests - name: Dead link check - if: type = pull_request OR type = push AND branch =~ /^master|[0-9]+-(dev|stable)$/ - OR type = cron - language: node_js - node_js: 12 - before_script: - - npm ci - - npm run doc-prepare - - "$(npm bin)/kuzdoc iterate-repos:install --repos_path doc/framework/.repos/" - - "$(npm bin)/kuzdoc framework:link -d /sdk/jvm/1/ -v 1" - script: - - gem install typhoeus - - cd doc/framework/ && HYDRA_MAX_CONCURRENCY=20 ruby .ci/dead-links.rb -p src/sdk/jvm/1/ - - stage: Tests - name: Documentation Snippets - if: type = pull_request OR type = push AND branch =~ /^master|[0-9]+-dev$/ OR - type = cron - language: node_js - node_js: 12 - script: docker-compose -f .ci/doc/docker-compose.yml run doc-tests index - - stage: Deployments - name: Deploy documentation to next-docs.kuzzle.io - if: type = push AND branch =~ /^[0-9]+-dev$/ - language: node_js - node_js: 12 - env: - - BRANCH=dev - - NODE_ENV=production - - FRAMEWORK_BRANCH=develop - - S3_BUCKET=docs-next.kuzzle.io - - CLOUDFRONT_DISTRIBUTION_ID=E2ZCCEK9GRB49U - - AWS_DEFAULT_REGION=us-west-2 - addons: - apt: - update: true - packages: - - python - - python-pip - install: - - pip install awscli --upgrade --user - - npm ci - script: - - npm run doc-prepare - - npm run doc-build - deploy: - provider: script - script: - - npm run doc-upload - skip_cleanup: true - on: - all_branches: true - after_deploy: - - npm run doc-cloudfront - - stage: Deployments - name: Deploy documentation to docs.kuzzle.io - if: type = push AND branch =~ /^master|[0-9]+-stable$/ - language: node_js - node_js: 12 - env: - - NODE_ENV=production - - FRAMEWORK_BRANCH=master - - S3_BUCKET=docs.kuzzle.io - - CLOUDFRONT_DISTRIBUTION_ID=E3D6RP0POLCJMM - - AWS_DEFAULT_REGION=us-west-2 - addons: - apt: - packages: - - python - - python-pip - install: - - pip install awscli --upgrade --user - - npm ci - script: - - npm run doc-prepare - - npm run doc-build - deploy: - provider: script - script: - - npm run doc-upload - skip_cleanup: true - on: - all_branches: true - after_deploy: - - npm run doc-cloudfront - - stage: Deployments - name: Deploy to Bintray - if: branch = master AND type = push - language: java - jdk: - - openjdk8 - deploy: - provider: script - script: "./gradlew bintrayUpload" - skip_cleanup: true - on: - condition: "$TRAVIS_BRANCH = master" -stages: -- name: Tests - if: type =~ /(cron|push|pull_request)/ AND branch =~ /^master|[0-9]+-(dev|stable)$/ -- name: Builds - if: type =~ /(cron|push|pull_request)/ AND branch =~ /^master|[0-9]+-(dev|stable)$/ -- name: Deployments - if: type =~ /(cron|push|pull_request)/ AND branch =~ /^master|[0-9]+-(dev|stable)$/ diff --git a/build.gradle.kts b/build.gradle.kts index d46bc8ac..2bd1b891 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,7 @@ plugins { val artifactName = "sdk-jvm" val artifactGroup = "io.kuzzle" -val artifactVersion = "1.0.4" +val artifactVersion = "1.1.0" val pomUrl = "https://github.com/kuzzleio/sdk-jvm" val pomScmUrl = "https://github.com/kuzzleio/sdk-jvm" @@ -94,7 +94,7 @@ bintray { } group = "io.kuzzle.sdk" -version = "1.0.2" +version = "1.1.0" val ktorVersion = "1.3.2" repositories { diff --git a/doc/1/controllers/auth/check-rights/index.md b/doc/1/controllers/auth/check-rights/index.md new file mode 100644 index 00000000..990449ba --- /dev/null +++ b/doc/1/controllers/auth/check-rights/index.md @@ -0,0 +1,74 @@ +--- +code: true +type: page +title: checkRights +description: Using the current authentication information, verify if the network connection can execute the required API request. +--- + +# checkRights + + + + +Using the current authentication information, verify if the network connection can execute the required API request. + +:::: tabs +::: tab Java + +```java +public CompletableFuture checkRights( + Map requestPayload) throws NotConnectedException, InternalException +``` + +| Property | Type | Description | +|--- |--- |--- | +| `requestPayload` |
Map
| Contains a [RequestPayload](/core/2/api/payloads/request) | + +## `requestPayload` + +The [RequestPayload](/core/2/api/payloads/request) must contain at least the following properties: + +- `controller`: API controller +- `action`: API action + +--- + +## Returns + +Returns a boolean indicating whether the provided request would have been allowed or not + +## Usage + +<<< ./snippets/check-rights-java.java + +::: +::: tab Kotlin + +```kotlin + fun checkRights( + requestPayload: Map): CompletableFuture +``` + +| Property | Type | Description | +|--- |--- |--- | +| `requestPayload` |
Map
| Contains a [RequestPayload](/core/2/api/payloads/request) | + +## `requestPayload` + +The [RequestPayload](/core/2/api/payloads/request) must contain at least the following properties: + +- `controller`: API controller +- `action`: API action + +--- + +## Returns + +Returns a boolean indicating whether the provided request would have been allowed or not + +## Usage + +<<< ./snippets/check-rights-kotlin.kt + +::: +:::: diff --git a/doc/1/controllers/auth/check-rights/snippets/check-rights-java.java b/doc/1/controllers/auth/check-rights/snippets/check-rights-java.java new file mode 100644 index 00000000..2fc2e407 --- /dev/null +++ b/doc/1/controllers/auth/check-rights/snippets/check-rights-java.java @@ -0,0 +1,12 @@ +Map body = new HashMap<>(); +body.put("name", "Melis"); + +Map requestPayload = new HashMap<>(); +requestPayload.put("controller", "document"); +requestPayload.put("action", "create"); +requestPayload.put("index", "nyc-open-data"); +requestPayload.put("collection", "yellow-taxi"); +requestPayload.put("body", body); + +Boolean result = + kuzzle.getAuthController().checkRights(requestPayload).get(); diff --git a/doc/1/controllers/auth/check-rights/snippets/check-rights-java.test.yml b/doc/1/controllers/auth/check-rights/snippets/check-rights-java.test.yml new file mode 100644 index 00000000..bde01332 --- /dev/null +++ b/doc/1/controllers/auth/check-rights/snippets/check-rights-java.test.yml @@ -0,0 +1,7 @@ +name: java-auth#checkRights +description: Checks if an API action can be executed by the current user +hooks: + before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' + after: curl -X DELETE kuzzle:7512/users/foo +template: print-result +expected: true \ No newline at end of file diff --git a/doc/1/controllers/auth/check-rights/snippets/check-rights-kotlin.kt b/doc/1/controllers/auth/check-rights/snippets/check-rights-kotlin.kt new file mode 100644 index 00000000..2b8c1780 --- /dev/null +++ b/doc/1/controllers/auth/check-rights/snippets/check-rights-kotlin.kt @@ -0,0 +1,13 @@ +val body = HashMap().apply { + put("name", "Melis") +} + +val requestPayload = HashMap().apply { + put("controller", "document") + put("action", "create") + put("index", "nyc-open-data") + put("collection", "yellow-taxi") + put("body", body) +} + +val result = kuzzle.authController.checkRights(requestPayload).get() diff --git a/doc/1/controllers/auth/check-rights/snippets/check-rights-kotlin.test.yml b/doc/1/controllers/auth/check-rights/snippets/check-rights-kotlin.test.yml new file mode 100644 index 00000000..5ce27aa8 --- /dev/null +++ b/doc/1/controllers/auth/check-rights/snippets/check-rights-kotlin.test.yml @@ -0,0 +1,7 @@ +name: kotlin-auth#checkRights +description: Checks if an API action can be executed by the current user +hooks: + before: curl -X POST kuzzle:7512/users/foo/_create -H "Content-Type:application/json" --data '{"content":{"profileIds":["default"]},"credentials":{"local":{"username":"foo","password":"bar"}}}' + after: curl -X DELETE kuzzle:7512/users/foo +template: print-result +expected: true \ No newline at end of file diff --git a/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt b/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt index 5af8fbe6..5d816c9a 100644 --- a/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt +++ b/doc/1/controllers/auth/check-token/snippets/check-token-kotlin.kt @@ -4,4 +4,4 @@ val response = kuzzle.authController.login("local", HashMap().appl }).get() val responseToken: Map = - kuzzle.authController.checkToken(response["jwt"].toString()).get() \ No newline at end of file + kuzzle.authController.checkToken(response["jwt"].toString()).get() diff --git a/doc/1/controllers/auth/get-current-user/index.md b/doc/1/controllers/auth/get-current-user/index.md index 50c3bf28..525badd8 100644 --- a/doc/1/controllers/auth/get-current-user/index.md +++ b/doc/1/controllers/auth/get-current-user/index.md @@ -7,7 +7,7 @@ description: Returns the profile object for the user linked to the `JSON Web Tok # GetCurrentUserAsync -Returns informations about the user currently loggued with the SDK instance. +Returns information about the user currently logged with the SDK instance. :::: tabs ::: tab Java @@ -57,4 +57,4 @@ A Map representing the User. <<< ./snippets/get-current-user-kotlin.kt ::: -:::: \ No newline at end of file +:::: diff --git a/doc/1/controllers/auth/login/snippets/login-kotlin.kt b/doc/1/controllers/auth/login/snippets/login-kotlin.kt index 8e7afc83..a6a2d89f 100644 --- a/doc/1/controllers/auth/login/snippets/login-kotlin.kt +++ b/doc/1/controllers/auth/login/snippets/login-kotlin.kt @@ -2,4 +2,4 @@ val result: Map = kuzzle.authController.login("local", HashMap().apply { put("username", "foo") put("password", "bar") - }).get() \ No newline at end of file + }).get() diff --git a/doc/1/controllers/auth/search-api-keys/index.md b/doc/1/controllers/auth/search-api-keys/index.md new file mode 100644 index 00000000..aa198020 --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/index.md @@ -0,0 +1,128 @@ +--- +code: true +type: page +title: searchApiKeys +description: Searches API keys for the currently logged user. +--- + +# searchApiKeys + + + + + +Searches API keys for the currently logged user. + +Kuzzle uses the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + + + +This method also supports the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) to match documents by passing the `lang` argument with the value `koncorde`. +Koncorde filters will be translated into an Elasticsearch query. + +::: warning +Koncorde `bool` operator and `regexp` clauses are not supported for search queries. +::: + +An empty or null query will match all documents in the collection. + +:::: tabs +::: tab Java + +## Arguments + +```java +public CompletableFuture searchApiKeys( + Map query) throws NotConnectedException, InternalException + +public CompletableFuture searchApiKeys( + Map query, + Integer from) throws NotConnectedException, InternalException + +public CompletableFuture searchApiKeys( + Map query + Integer from + Integer size) throws NotConnectedException, InternalException + +public CompletableFuture searchApiKeys( + Map query + Integer from + Integer size, + Lang lang) throws NotConnectedException, InternalException +``` + + +| Property | Type | Description | +| --- | --- | --- | +| `query` |
Map
| Search query | +| `from` |
Integer

(`0`) | (optional) Offset of the first document to fetch | +| `size` |
Integer
| (optional) Maximum number of documents to retrieve per page | +| `lang` |
[Lang](/sdk/jvm/1/core-classes/lang)
| Specify the query language to use. By default, it's `elasticsearch` but `koncorde` can also be used. | + +### query + +The search query to apply to API keys content, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-dsl.html) syntax. + +If left empty, the result will return all available API keys for the currently logged user. + +## Return + +Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. + + +## Usage + +With the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + +<<< ./snippets/search-api-keys-es-java.java + +With the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. + + +<<< ./snippets/search-api-keys-koncorde-java.java + +::: +::: tab Kotlin + +## Arguments + +```kotlin +fun searchApiKeys( + query: Map, + from: Int = 0, + size: Int? = null, + lang: Lang = Lang.ELASTICSEARCH): CompletableFuture +``` + + +| Property | Type | Description | +| --- | --- | --- | +| `query` |
Map
| Search query | +| `from` |
Int

(`0`) | (optional) Offset of the first document to fetch | +| `size` |
Int
| (optional) Maximum number of documents to retrieve per page | +| `lang` |
[Lang](/sdk/jvm/1/core-classes/lang)
| Specify the query language to use. By default, it's `elasticsearch` but `koncorde` can also be used. | + +### query + +The search query to apply to API keys content, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-dsl.html) syntax. + +If left empty, the result will return all available API keys of the currently logged user. + +## Return + +Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. + + +## Usage + +With the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + +<<< ./snippets/search-api-keys-es-kotlin.kt + +With the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. + + +<<< ./snippets/search-api-keys-koncorde-kotlin.kt + +::: +:::: diff --git a/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-java.java b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-java.java new file mode 100644 index 00000000..09cd5ac2 --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-java.java @@ -0,0 +1,69 @@ + +Map description = new HashMap<>(); +description.put("description", "LoRa permanent API Key"); + +Map query = new HashMap<>(); +query.put("controller", "security"); +query.put("action", "createApiKey"); +query.put("userId", "jared.doe"); +query.put("refresh", "wait_for"); +query.put("body", description); + +kuzzle.query(query).get(); + +description.put("description", "Sigfox API key"); +query.put("body", description); +kuzzle.query(query).get(); + +description.put("description", "LoRa 6 month API key"); +query.put("body", description); +query.put("expiresIn", 36000); +kuzzle.query(query).get(); + +Map credentials = new HashMap<>(); +credentials.put("username", "jared.doe"); +credentials.put("password", "password"); + +kuzzle.getAuthController().login("local", credentials).get(); + +Map match = new HashMap<>(); +match.put("description", "LoRa"); + +Map squery = new HashMap<>(); +squery.put("match", match); + +SearchResult results = kuzzle + .getAuthController() + .searchApiKeys(squery).get(); + +String output = String.format("Found %d API keys matching 'LoRa'", results.total); + +System.out.println(output); + +/* +{ + "total"=2, + "hits"=[ + { + "_id"="znEwbG8BJASM_0-bWU-q", + "_source"={ + "description"="LoRa permanent API key", + "userId"="jared.doe", + "expiresAt"=-1, + "fingerprint": "4ee98cb8c614e99213e7695f822e42325d86c93cfaf39cb40e860939e784c8e6", + "ttl"=-1 + } + }, + { + "_id"="zXEwbG8BJASM_0-bWU-q", + "_source"={ + "description"="LoRa 6 month API key", + "userId"="jared.doe", + "expiresAt"=31557600000, + "fingerprint": "4ee98cb8c614e99213e7695f822e42325d86c93cfaf39cb40e860939e784c8e6", + "ttl"=360000 + } + } + ] +} +*/ \ No newline at end of file diff --git a/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-java.test.yml b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-java.test.yml new file mode 100644 index 00000000..89ef873c --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-java.test.yml @@ -0,0 +1,20 @@ +name: java-auth#searchApiKeys-es +description: Searches API keys for the currently logged user. +hooks: + before: > + curl --fail -H "Content-type: application/json" -d '{ + "content": { + "profileIds": ["default"] + }, + "credentials": { + "local": { + "username": "jared.doe", + "password": "password" + } + } + }' "kuzzle:7512/users/jared.doe/_create?refresh=wait_for" + after: + curl -XDELETE kuzzle:7512/users/jared.doe +template: default +expected: + - Found 2 API keys matching 'LoRa' diff --git a/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-kotlin.kt b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-kotlin.kt new file mode 100644 index 00000000..6d1b2106 --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-kotlin.kt @@ -0,0 +1,72 @@ + +val description: HashMap = HashMap().apply { + put("description", "LoRa permanent API Key") +} + +val query: HashMap = HashMap().apply { + put("controller", "security") + put("action", "createApiKey") + put("userId", "jared.doe") + put("refresh", "wait_for") + put("body", description) +} + +kuzzle.query(query).get() + +description.put("description", "Sigfox API key") +query.put("body", description); +kuzzle.query(query).get() + +description.put("description", "LoRa 6 month API key") +query.put("body", description); +query.put("expiresIn", 36000); +kuzzle.query(query).get() + +kuzzle.authController.login("local", HashMap().apply { + put("username", "jared.doe") + put("password", "password") + }).get() + +val match: HashMap = + HashMap().apply { + put("description", "LoRa") + } + +val squery: HashMap = + HashMap().apply { + put("match", match) + } + +val results = kuzzle + .authController + .searchApiKeys(squery).get(); + +print("Found ${results.total} API keys matching 'LoRa'"); + +/* +{ + "total"=2, + "hits"=[ + { + "_id"="znEwbG8BJASM_0-bWU-q", + "_source"={ + "description"="LoRa permanent API key", + "userId"="jared.doe", + "expiresAt"=-1, + "fingerprint": "4ee98cb8c614e99213e7695f822e42325d86c93cfaf39cb40e860939e784c8e6", + "ttl"=-1 + } + }, + { + "_id"="zXEwbG8BJASM_0-bWU-q", + "_source"={ + "description"="LoRa 6 month API key", + "userId"="jared.doe", + "expiresAt"=31557600000, + "fingerprint": "4ee98cb8c614e99213e7695f822e42325d86c93cfaf39cb40e860939e784c8e6", + "ttl"=360000 + } + } + ] +} +*/ \ No newline at end of file diff --git a/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-kotlin.test.yml b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-kotlin.test.yml new file mode 100644 index 00000000..ceb857f1 --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-es-kotlin.test.yml @@ -0,0 +1,20 @@ +name: kotlin-auth#searchApiKeys-es +description: Searches API keys for the currently logged user. +hooks: + before: > + curl --fail -H "Content-type: application/json" -d '{ + "content": { + "profileIds": ["default"] + }, + "credentials": { + "local": { + "username": "jared.doe", + "password": "password" + } + } + }' "kuzzle:7512/users/jared.doe/_create?refresh=wait_for" + after: + curl -XDELETE kuzzle:7512/users/jared.doe +template: default +expected: + - Found 2 API keys matching 'LoRa' diff --git a/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-java.java b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-java.java new file mode 100644 index 00000000..def28c28 --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-java.java @@ -0,0 +1,59 @@ + +Map description = new HashMap<>(); +description.put("description", "LoRa permanent API Key"); + +Map query = new HashMap<>(); +query.put("controller", "security"); +query.put("action", "createApiKey"); +query.put("userId", "jared.doe"); +query.put("refresh", "wait_for"); +query.put("body", description); + +kuzzle.query(query).get(); + +description.put("description", "Sigfox API key"); +query.put("body", description); +kuzzle.query(query).get(); + +description.put("description", "LoRa 6 month API key"); +query.put("body", description); +query.put("expiresIn", 36000); +kuzzle.query(query).get(); + +Map credentials = new HashMap<>(); +credentials.put("username", "jared.doe"); +credentials.put("password", "password"); + +kuzzle.getAuthController().login("local", credentials).get(); + +Map equals = new HashMap<>(); +equals.put("ttl", "36000"); + +Map squery = new HashMap<>(); +squery.put("equals", equals); + +SearchResult results = kuzzle + .getAuthController() + .searchApiKeys(squery, Lang.KONCORDE).get(); + +String output = String.format("Found %d API key", results.total); + +System.out.println(output); + +/* +{ + "total"=2, + "hits"=[ + { + "_id"="zXEwbG8BJASM_0-bWU-q", + "_source"={ + "description"="LoRa 6 month API key", + "userId"="jared.doe", + "expiresAt"=31557600000, + "fingerprint": "4ee98cb8c614e99213e7695f822e42325d86c93cfaf39cb40e860939e784c8e6", + "ttl"=360000 + } + } + ] +} +*/ \ No newline at end of file diff --git a/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-java.test.yml b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-java.test.yml new file mode 100644 index 00000000..82be47f3 --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-java.test.yml @@ -0,0 +1,20 @@ +name: java-auth#searchApiKeys-koncorde +description: Searches API keys for the currently logged user. +hooks: + before: > + curl --fail -H "Content-type: application/json" -d '{ + "content": { + "profileIds": ["default"] + }, + "credentials": { + "local": { + "username": "jared.doe", + "password": "password" + } + } + }' "kuzzle:7512/users/jared.doe/_create?refresh=wait_for" + after: + curl -XDELETE kuzzle:7512/users/jared.doe +template: default +expected: + - Found 1 API key diff --git a/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-kotlin.kt b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-kotlin.kt new file mode 100644 index 00000000..5f5814b9 --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-kotlin.kt @@ -0,0 +1,72 @@ + +val description: HashMap = HashMap().apply { + put("description", "LoRa permanent API Key") +} + +val query: HashMap = HashMap().apply { + put("controller", "security") + put("action", "createApiKey") + put("userId", "jared.doe") + put("refresh", "wait_for") + put("body", description) +} + +kuzzle.query(query).get() + +description.put("description", "Sigfox API key") +query.put("body", description); +kuzzle.query(query).get() + +description.put("description", "LoRa 6 month API key") +query.put("body", description); +query.put("expiresIn", 36000); +kuzzle.query(query).get() + +kuzzle.authController.login("local", HashMap().apply { + put("username", "jared.doe") + put("password", "password") + }).get() + +val equals: HashMap = + HashMap().apply { + put("ttl", "36000") + } + +val squery: HashMap = + HashMap().apply { + put("equals", equals) + } + +val results = kuzzle + .authController + .searchApiKeys(squery, lang = Lang.KONCORDE).get(); + +print("Found ${results.total} API key"); + +/* +{ + "total"=2, + "hits"=[ + { + "_id"="znEwbG8BJASM_0-bWU-q", + "_source"={ + "description"="LoRa permanent API key", + "userId"="jared.doe", + "expiresAt"=-1, + "fingerprint": "4ee98cb8c614e99213e7695f822e42325d86c93cfaf39cb40e860939e784c8e6", + "ttl"=-1 + } + }, + { + "_id"="zXEwbG8BJASM_0-bWU-q", + "_source"={ + "description"="LoRa 6 month API key", + "userId"="jared.doe", + "expiresAt"=31557600000, + "fingerprint": "4ee98cb8c614e99213e7695f822e42325d86c93cfaf39cb40e860939e784c8e6", + "ttl"=360000 + } + } + ] +} +*/ diff --git a/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-kotlin.test.yml b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-kotlin.test.yml new file mode 100644 index 00000000..f43a1584 --- /dev/null +++ b/doc/1/controllers/auth/search-api-keys/snippets/search-api-keys-koncorde-kotlin.test.yml @@ -0,0 +1,20 @@ +name: kotlin-auth#searchApiKeys-koncorde +description: Searches API keys for the currently logged user. +hooks: + before: > + curl --fail -H "Content-type: application/json" -d '{ + "content": { + "profileIds": ["default"] + }, + "credentials": { + "local": { + "username": "jared.doe", + "password": "password" + } + } + }' "kuzzle:7512/users/jared.doe/_create?refresh=wait_for" + after: + curl -XDELETE kuzzle:7512/users/jared.doe +template: default +expected: + - Found 1 API key diff --git a/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt b/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt index 536cb97d..ea671d9b 100644 --- a/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt +++ b/doc/1/controllers/bulk/import-data/snippets/import-data-kotlin.kt @@ -39,4 +39,4 @@ val result: Map = "yellow-taxi", bulkData ) - .get() \ No newline at end of file + .get() diff --git a/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt b/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt index 430a3663..1fa4a0fd 100644 --- a/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt +++ b/doc/1/controllers/bulk/m-write/snippets/mwrite-kotlin.kt @@ -6,4 +6,4 @@ val documents: ArrayList> = ArrayList>().app }; val result: Map = -kuzzle.bulkController.mWrite("nyc-open-data", "yellow-taxi", documents).get(); \ No newline at end of file +kuzzle.bulkController.mWrite("nyc-open-data", "yellow-taxi", documents).get(); diff --git a/doc/1/controllers/bulk/write/snippets/write-kotlin.kt b/doc/1/controllers/bulk/write/snippets/write-kotlin.kt index a1de1d27..3429da4b 100644 --- a/doc/1/controllers/bulk/write/snippets/write-kotlin.kt +++ b/doc/1/controllers/bulk/write/snippets/write-kotlin.kt @@ -6,4 +6,4 @@ val content: Map = HashMap().apply { } val result: Map = -kuzzle.bulkController.write("nyc-open-data", "yellow-taxi", content).get(); \ No newline at end of file +kuzzle.bulkController.write("nyc-open-data", "yellow-taxi", content).get(); diff --git a/doc/1/controllers/collection/exists/snippets/exists-kotlin.kt b/doc/1/controllers/collection/exists/snippets/exists-kotlin.kt index 76bd38e1..89ba15b9 100644 --- a/doc/1/controllers/collection/exists/snippets/exists-kotlin.kt +++ b/doc/1/controllers/collection/exists/snippets/exists-kotlin.kt @@ -1,4 +1,4 @@ val result = kuzzle .collectionController .exists("nyc-open-data", "yellow-taxi") - .get(); + .get() diff --git a/doc/1/controllers/collection/get-mapping/snippets/get-mapping-kotlin.kt b/doc/1/controllers/collection/get-mapping/snippets/get-mapping-kotlin.kt index c8c36c5d..6cf8be7d 100644 --- a/doc/1/controllers/collection/get-mapping/snippets/get-mapping-kotlin.kt +++ b/doc/1/controllers/collection/get-mapping/snippets/get-mapping-kotlin.kt @@ -1,7 +1,7 @@ val result = kuzzle .collectionController .getMapping("nyc-open-data", "yellow-taxi") - .get(); + .get() /* { @@ -16,4 +16,4 @@ val result = kuzzle } } } -*/ \ No newline at end of file +*/ diff --git a/doc/1/controllers/collection/get-specifications/snippets/get-specifications-kotlin.kt b/doc/1/controllers/collection/get-specifications/snippets/get-specifications-kotlin.kt index a4776800..5b0ce36e 100644 --- a/doc/1/controllers/collection/get-specifications/snippets/get-specifications-kotlin.kt +++ b/doc/1/controllers/collection/get-specifications/snippets/get-specifications-kotlin.kt @@ -1,7 +1,7 @@ val result = kuzzle .collectionController .getSpecifications("nyc-open-data", "yellow-taxi") - .get(); + .get() /* { @@ -18,4 +18,4 @@ val result = kuzzle strict=true } } -*/ \ No newline at end of file +*/ diff --git a/doc/1/controllers/collection/list/snippets/list-kotlin.kt b/doc/1/controllers/collection/list/snippets/list-kotlin.kt index 6b4f60ac..b1c46524 100644 --- a/doc/1/controllers/collection/list/snippets/list-kotlin.kt +++ b/doc/1/controllers/collection/list/snippets/list-kotlin.kt @@ -1,7 +1,7 @@ val result = kuzzle .collectionController .list("nyc-open-data") - .get(); + .get() /* { @@ -19,4 +19,4 @@ val result = kuzzle from=0, type=all } - */ \ No newline at end of file + */ diff --git a/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt b/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt index d01a9471..85c4d361 100644 --- a/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt +++ b/doc/1/controllers/collection/update-specifications/snippets/update-specifications-kotlin.kt @@ -16,7 +16,7 @@ HashMap().apply{ val result: Map = kuzzle .collectionController .updateSpecifications("nyc-open-data", "yellow-taxi", specifications) - .get(); + .get() /* { diff --git a/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt b/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt index 8d55b1ee..35f21f39 100644 --- a/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt +++ b/doc/1/controllers/collection/validate-specifications/snippets/validate-specifications-kotlin.kt @@ -13,4 +13,4 @@ val specifications: Map = HashMap().apply { val result = kuzzle .collectionController .validateSpecifications("nyc-open-data", "yellow-taxi", specifications) - .get(); + .get() diff --git a/doc/1/controllers/document/count/snippets/count-kotlin.kt b/doc/1/controllers/document/count/snippets/count-kotlin.kt index 1901f0e4..d877cda5 100644 --- a/doc/1/controllers/document/count/snippets/count-kotlin.kt +++ b/doc/1/controllers/document/count/snippets/count-kotlin.kt @@ -6,6 +6,6 @@ val searchQuery : Map = } val result: Int = kuzzle - .documentController - .count("nyc-open-data", "yellow-taxi", searchQuery) - .get(); \ No newline at end of file + .documentController + .count("nyc-open-data", "yellow-taxi", searchQuery) + .get() diff --git a/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt b/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt index 9a62d847..9a2be66d 100644 --- a/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt +++ b/doc/1/controllers/document/create-or-replace/snippets/create-or-replace-kotlin.kt @@ -6,4 +6,4 @@ val result: Map = kuzzle .documentController .createOrReplace("nyc-open-data", "yellow-taxi", "some-id", document) - .get(); \ No newline at end of file + .get() diff --git a/doc/1/controllers/document/create/snippets/create-kotlin.kt b/doc/1/controllers/document/create/snippets/create-kotlin.kt index de6bb50a..9bd6418c 100644 --- a/doc/1/controllers/document/create/snippets/create-kotlin.kt +++ b/doc/1/controllers/document/create/snippets/create-kotlin.kt @@ -4,6 +4,6 @@ val document: Map = HashMap().apply { val result: Map = kuzzle - .documentController - .create("nyc-open-data", "yellow-taxi", document) - .get(); \ No newline at end of file + .documentController + .create("nyc-open-data", "yellow-taxi", document) + .get() diff --git a/doc/1/controllers/document/delete-by-query/index.md b/doc/1/controllers/document/delete-by-query/index.md index f6a118af..53a1552d 100644 --- a/doc/1/controllers/document/delete-by-query/index.md +++ b/doc/1/controllers/document/delete-by-query/index.md @@ -11,6 +11,15 @@ Deletes documents matching the provided search query. Kuzzle uses the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + + +This method also supports the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) to match documents by passing the `lang` argument with the value `koncorde`. +Koncorde filters will be translated into an Elasticsearch query. + +::: warning +Koncorde `bool` operator and `regexp` clauses are not supported for search queries. +::: + An empty or null query will match all documents in the collection. :::: tabs @@ -24,11 +33,24 @@ An empty or null query will match all documents in the collection. String collection, Map searchQuery) throws NotConnectedException, InternalException + public CompletableFuture> deleteByQuery( + String index, + String collection, + Map searchQuery, + Lang lang) throws NotConnectedException, InternalException + public CompletableFuture> deleteByQuery( String index, String collection, Map searchQuery, Boolean waitForRefresh) throws NotConnectedException, InternalException + + public CompletableFuture> deleteByQuery( + String index, + String collection, + Map searchQuery, + Boolean waitForRefresh, + Lang lang) throws NotConnectedException, InternalException ``` | Argument | Type | Description | @@ -36,7 +58,8 @@ An empty or null query will match all documents in the collection. | `index` |
String
| Index name | | `collection` |
String
| Collection name | | `searchQuery` |
Map
| Query to match | -| `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| +| `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | +| `lang` |
[Lang](/sdk/jvm/1/core-classes/lang)
| Specify the query language to use. By default, it's `elasticsearch` but `koncorde` can also be used. | --- @@ -46,7 +69,14 @@ Returns an `ArrayList` containing the deleted document ids. ## Usage -<<< ./snippets/delete-by-query-java.java +With the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + +<<< ./snippets/delete-by-query-es-java.java + +With the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. + + +<<< ./snippets/delete-by-query-koncorde-java.java ::: ::: tab Kotlin @@ -58,7 +88,8 @@ fun deleteByQuery( index: String, collection: String, searchQuery: Map, - waitForRefresh: Boolean? = null): CompletableFuture> + waitForRefresh: Boolean? = null, + lang: Lang = Lang.ELASTICSEARCH): CompletableFuture> ``` | Argument | Type | Description | @@ -66,7 +97,8 @@ fun deleteByQuery( | `index` |
String
| Index name | | `collection` |
String
| Collection name | | `searchQuery` |
Map
| Query to match | -| `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| +| `waitForRefresh` |
Boolean
(optional) | If set to `true`, Kuzzle will wait for the persistence layer to finish indexing | +| `lang` |
[Lang](/sdk/jvm/1/core-classes/lang)
| Specify the query language to use. By default, it's `elasticsearch` but `koncorde` can also be used. | --- @@ -76,7 +108,14 @@ Returns an `ArrayList` containing the deleted document ids. ## Usage -<<< ./snippets/delete-by-query-kotlin.kt +With the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + +<<< ./snippets/delete-by-query-es-kotlin.kt + +With the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. + + +<<< ./snippets/delete-by-query-koncorde-kotlin.kt ::: -:::: \ No newline at end of file +:::: diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-java.java b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-java.java new file mode 100644 index 00000000..3822d913 --- /dev/null +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-java.java @@ -0,0 +1,10 @@ +Map searchQuery = new HashMap<>(); +Map query = new HashMap<>(); +Map match = new HashMap<>(); +match.put("capacity", 4); +query.put("match", match); +searchQuery.put("query", query); +ArrayList result = kuzzle + .getDocumentController() + .deleteByQuery("nyc-open-data", "yellow-taxi", searchQuery) + .get(); diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.test.yml b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-java.test.yml similarity index 95% rename from doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.test.yml rename to doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-java.test.yml index dd258f14..95186544 100644 --- a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.test.yml +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-java.test.yml @@ -1,4 +1,4 @@ -name: kotlin-document#deleteByQuery +name: java-document#deleteByQuery-es description: Delete documents matching query hooks: before: | diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-kotlin.kt b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-kotlin.kt new file mode 100644 index 00000000..e040f3b4 --- /dev/null +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-kotlin.kt @@ -0,0 +1,18 @@ +val searchQuery: Map = HashMap().apply { + put( + "query", + HashMap().apply { + put( + "match", + HashMap().apply { + put("capacity", 4) + } + ) + } + ) +} + +val result: ArrayList = kuzzle + .documentController + .deleteByQuery("nyc-open-data", "yellow-taxi", searchQuery) + .get() diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.test.yml b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-kotlin.test.yml similarity index 94% rename from doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.test.yml rename to doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-kotlin.test.yml index 3f00eb0d..74a72092 100644 --- a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.test.yml +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-es-kotlin.test.yml @@ -1,4 +1,4 @@ -name: java-document#deleteByQuery +name: kotlin-document#deleteByQuery-es description: Delete documents matching query hooks: before: | diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.java b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.java deleted file mode 100644 index ec1e3a2b..00000000 --- a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-java.java +++ /dev/null @@ -1,10 +0,0 @@ - Map searchQuery = new HashMap<>(); - Map query = new HashMap<>(); - Map match = new HashMap<>(); - match.put("capacity", 4); - query.put("match", match); - searchQuery.put("query", query); - ArrayList result = kuzzle - .getDocumentController() - .deleteByQuery("nyc-open-data", "yellow-taxi", searchQuery) - .get(); diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-java.java b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-java.java new file mode 100644 index 00000000..20b02b01 --- /dev/null +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-java.java @@ -0,0 +1,10 @@ +Map searchQuery = new HashMap<>(); +Map query = new HashMap<>(); +Map equals = new HashMap<>(); +equals.put("capacity", 4); +query.put("equals", equals); +searchQuery.put("query", query); +ArrayList result = kuzzle + .getDocumentController() + .deleteByQuery("nyc-open-data", "yellow-taxi", searchQuery, Lang.KONCORDE) + .get(); diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-java.test.yml b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-java.test.yml new file mode 100644 index 00000000..f13c6f91 --- /dev/null +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-java.test.yml @@ -0,0 +1,22 @@ +name: java-document#deleteByQuery-koncorde +description: Delete documents matching query +hooks: + before: | + curl -XDELETE kuzzle:7512/nyc-open-data + curl -XPOST kuzzle:7512/nyc-open-data/_create + curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/document_$i/_create + done + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create + done + curl -XPOST kuzzle:7512/nyc-open-data/_refresh + after: +template: print-result-arraylist +expected: + - "document_1" + - "document_2" + - "document_3" + - "document_4" + - "document_5" diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-kotlin.kt similarity index 62% rename from doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt rename to doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-kotlin.kt index c5249ef7..53d72735 100644 --- a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-kotlin.kt +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-kotlin.kt @@ -1,6 +1,6 @@ val searchQuery: Map = HashMap().apply { put("query", HashMap().apply { - put("match", HashMap().apply { + put("equals", HashMap().apply { put("capacity", 4) }) }) @@ -8,5 +8,5 @@ val searchQuery: Map = HashMap().apply { val result: ArrayList = kuzzle .documentController - .deleteByQuery("nyc-open-data", "yellow-taxi", searchQuery) + .deleteByQuery("nyc-open-data", "yellow-taxi", searchQuery, lang = Lang.KONCORDE) .get() diff --git a/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-kotlin.test.yml b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-kotlin.test.yml new file mode 100644 index 00000000..cde8bc6b --- /dev/null +++ b/doc/1/controllers/document/delete-by-query/snippets/delete-by-query-koncorde-kotlin.test.yml @@ -0,0 +1,22 @@ +name: kotlin-document#deleteByQuery-koncorde +description: Delete documents matching query +hooks: + before: | + curl -XDELETE kuzzle:7512/nyc-open-data + curl -XPOST kuzzle:7512/nyc-open-data/_create + curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/document_$i/_create + done + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create + done + curl -XPOST kuzzle:7512/nyc-open-data/_refresh + after: +template: print-result-arraylist +expected: + - "document_1" + - "document_2" + - "document_3" + - "document_4" + - "document_5" diff --git a/doc/1/controllers/document/exists/snippets/exists-kotlin.kt b/doc/1/controllers/document/exists/snippets/exists-kotlin.kt index 4a5ffbc8..386afd6a 100644 --- a/doc/1/controllers/document/exists/snippets/exists-kotlin.kt +++ b/doc/1/controllers/document/exists/snippets/exists-kotlin.kt @@ -1,4 +1,4 @@ val result: Boolean = kuzzle - .documentController - .exists("nyc-open-data", "yellow-taxi", "some-id") - .get() + .documentController + .exists("nyc-open-data", "yellow-taxi", "some-id") + .get() diff --git a/doc/1/controllers/document/m-delete/snippets/m-delete-kotlin.kt b/doc/1/controllers/document/m-delete/snippets/m-delete-kotlin.kt index 31bbf83d..648c6eb2 100644 --- a/doc/1/controllers/document/m-delete/snippets/m-delete-kotlin.kt +++ b/doc/1/controllers/document/m-delete/snippets/m-delete-kotlin.kt @@ -5,6 +5,6 @@ val ids: ArrayList = ArrayList().apply { val result: Map> = kuzzle - .documentController - .mDelete("nyc-open-data", "yellow-taxi", ids) - .get() \ No newline at end of file + .documentController + .mDelete("nyc-open-data", "yellow-taxi", ids) + .get() diff --git a/doc/1/controllers/document/m-get/snippets/m-get-kotlin.kt b/doc/1/controllers/document/m-get/snippets/m-get-kotlin.kt index 55764e84..fd115201 100644 --- a/doc/1/controllers/document/m-get/snippets/m-get-kotlin.kt +++ b/doc/1/controllers/document/m-get/snippets/m-get-kotlin.kt @@ -5,6 +5,6 @@ val ids: ArrayList = ArrayList().apply { val result: Map> = kuzzle - .documentController - .mGet("nyc-open-data", "yellow-taxi", ids) - .get() + .documentController + .mGet("nyc-open-data", "yellow-taxi", ids) + .get() diff --git a/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt b/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt index c2df6eb4..957dd855 100644 --- a/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt +++ b/doc/1/controllers/document/m-replace/snippets/m-replace-kotlin.kt @@ -25,4 +25,4 @@ val result: Map?> = kuzzle .documentController .mReplace("nyc-open-data", "yellow-taxi", documents) - .get() \ No newline at end of file + .get() diff --git a/doc/1/controllers/document/m-update/index.md b/doc/1/controllers/document/m-update/index.md index a9aeb99f..f185933a 100644 --- a/doc/1/controllers/document/m-update/index.md +++ b/doc/1/controllers/document/m-update/index.md @@ -27,7 +27,15 @@ public CompletableFuture>> mUpdate( String index, String collection, ArrayList> documents, - UpdateOptions options) + Boolean waitForRefresh) +throws NotConnectedException, InternalException + +public CompletableFuture>> mUpdate( + String index, + String collection, + ArrayList> documents, + Boolean waitForRefresh, + Integer retryOnConflict) throws NotConnectedException, InternalException ``` diff --git a/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt b/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt index cbb8f918..0dd9b0d7 100644 --- a/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt +++ b/doc/1/controllers/document/m-update/snippets/m-update-kotlin.kt @@ -25,4 +25,4 @@ val result: Map?> = kuzzle .documentController .mReplace("nyc-open-data", "yellow-taxi", documents) - .get() \ No newline at end of file + .get() diff --git a/doc/1/controllers/document/search/index.md b/doc/1/controllers/document/search/index.md index 30ed0a8a..a3501dc4 100644 --- a/doc/1/controllers/document/search/index.md +++ b/doc/1/controllers/document/search/index.md @@ -28,6 +28,15 @@ It can lead to memory leaks if a scroll duration too great is provided, or if to You can restrict the scroll session maximum duration under the `services.storage.maxScrollDuration` configuration key. ::: + + +This method also supports the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) to match documents by passing the `lang` argument with the value `koncorde`. +Koncorde filters will be translated into an Elasticsearch query. + +::: warning +Koncorde `bool` operator and `regexp` clauses are not supported for search queries. +::: + --- :::: tabs @@ -47,19 +56,34 @@ public CompletableFuture search( Map searchQuery, String scroll) throws NotConnectedException, InternalException +public CompletableFuture search( + String index, + String collection, + Map searchQuery, + Lang lang) throws NotConnectedException, InternalException + public CompletableFuture search( String index, String collection, Map searchQuery, String scroll, - Integer size) throws NotConnectedException, InternalException + Lang lang) throws NotConnectedException, InternalException + +public CompletableFuture search( + String index, + String collection, + Map searchQuery, + String scroll, + Integer size, + Lang lang) throws NotConnectedException, InternalException public CompletableFuture search( String index, String collection, Map searchQuery Integer size, - Integer from) + Integer from, + Lang lang) throws NotConnectedException, InternalException ``` @@ -71,11 +95,12 @@ throws NotConnectedException, InternalException | `from` |
Integer

(`0`) | Offset of the first document to fetch | | `size` |
Integer

(`10`) | Maximum number of documents to retrieve per page | | `scroll` |
String

(`""`) | When set, gets a forward-only cursor having its ttl set to the given value (ie `1s`; cf [elasticsearch time limits](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/common-options.html#time-units)) | +| `lang` |
[Lang](/sdk/jvm/1/core-classes/lang)
| Specify the query language to use. By default, it's `elasticsearch` but `koncorde` can also be used. | --- ### searchQuery body properties: -- `query`: the search query itself, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-dsl.html) syntax. +- `query`: the search query itself, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-dsl.html) or the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. - `aggregations`: control how the search results should be [aggregated](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-aggregations.html) - `sort`: contains a list of fields, used to [sort search results](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-request-sort.html), in order of importance. @@ -87,7 +112,14 @@ Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. ## Usage -<<< ./snippets/search-java.java +With the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + +<<< ./snippets/search-es-java.java + +With the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. + + +<<< ./snippets/search-koncorde-java.java ::: ::: tab Kotlin @@ -102,7 +134,8 @@ Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. searchQuery: Map, scroll: String? = null, size: Int? = null, - from: Int = 0): CompletableFuture + from: Int = 0, + land: Lang = Lang.ELASTICSEARCH): CompletableFuture ``` | Arguments | Type | Description | @@ -113,11 +146,12 @@ Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. | `from` |
Int

(`0`) | Offset of the first document to fetch | | `size` |
Int

(`10`) | Maximum number of documents to retrieve per page | | `scroll` |
String

(`""`) | When set, gets a forward-only cursor having its ttl set to the given value (ie `1s`; cf [elasticsearch time limits](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/common-options.html#time-units)) | +| `lang` |
[Lang](/sdk/jvm/1/core-classes/lang)
| Specify the query language to use. By default, it's `elasticsearch` but `koncorde` can also be used. | --- ### searchQuery body properties: -- `query`: the search query itself, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-dsl.html) syntax. +- `query`: the search query itself, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-dsl.html) or the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. - `aggregations`: control how the search results should be [aggregated](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-aggregations.html) - `sort`: contains a list of fields, used to [sort search results](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-request-sort.html), in order of importance. @@ -129,7 +163,14 @@ Returns a [SearchResult](/sdk/jvm/1/core-classes/search-result) object. ## Usage -<<< ./snippets/search-kotlin.kt +With the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + +<<< ./snippets/search-es-kotlin.kt + +With the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. + + +<<< ./snippets/search-koncorde-kotlin.kt ::: :::: diff --git a/doc/1/controllers/document/search/snippets/search-es-java.java b/doc/1/controllers/document/search/snippets/search-es-java.java new file mode 100644 index 00000000..a5be1c8d --- /dev/null +++ b/doc/1/controllers/document/search/snippets/search-es-java.java @@ -0,0 +1,36 @@ +Map searchQuery = new HashMap<>(); +Map query = new HashMap<>(); +Map match = new HashMap<>(); +match.put("category", "suv"); +query.put("match", match); +searchQuery.put("query", query); + +SearchResult results = kuzzle + .getDocumentController() + .search("nyc-open-data", "yellow-taxi", searchQuery).get(); + + +/* + { + "aggregations"=undefined, + "hits"=[ + { + "_id"="AWgi6A1POQUM6ucJ3q06", + "_score"=0.046520017, + "_source"={ + "category"="suv", + "_kuzzle_info"={ + "author"="-1", + "createdAt"=1546773859655, + "updatedAt"=null, + "updater"=null + } + } + }, + ... + ] + }, + "total"=5, + "fetched"=5, + "scroll_id"=undefined +*/ diff --git a/doc/1/controllers/document/search/snippets/search-java.test.yml b/doc/1/controllers/document/search/snippets/search-es-java.test.yml similarity index 95% rename from doc/1/controllers/document/search/snippets/search-java.test.yml rename to doc/1/controllers/document/search/snippets/search-es-java.test.yml index eea08bf1..ed3d3c84 100644 --- a/doc/1/controllers/document/search/snippets/search-java.test.yml +++ b/doc/1/controllers/document/search/snippets/search-es-java.test.yml @@ -1,4 +1,4 @@ -name: java-document#search +name: java-document#search-es description: Search for documents hooks: before: | diff --git a/doc/1/controllers/document/search/snippets/search-es-kotlin.kt b/doc/1/controllers/document/search/snippets/search-es-kotlin.kt new file mode 100644 index 00000000..5f15e504 --- /dev/null +++ b/doc/1/controllers/document/search/snippets/search-es-kotlin.kt @@ -0,0 +1,41 @@ +val match: Map = + HashMap().apply { + put("category", "suv") + } +val query: Map = + HashMap().apply { + put("match", match) + } + +val searchQuery: Map = + HashMap().apply { + put("query", query) + } +val results = kuzzle + .documentController + .search("nyc-open-data", "yellow-taxi", searchQuery).get(); + +/* + { + "aggregations"=undefined, + "hits"=[ + { + "_id"="AWgi6A1POQUM6ucJ3q06", + "_score"=0.046520017, + "_source"={ + "category"="suv", + "_kuzzle_info"={ + "author"="-1", + "createdAt"=1546773859655, + "updatedAt"=null, + "updater"=null + } + } + }, + ... + ] + }, + "total"=5, + "fetched"=5, + "scroll_id"=undefined +*/ diff --git a/doc/1/controllers/document/search/snippets/search-kotlin.test.yml b/doc/1/controllers/document/search/snippets/search-es-kotlin.test.yml similarity index 95% rename from doc/1/controllers/document/search/snippets/search-kotlin.test.yml rename to doc/1/controllers/document/search/snippets/search-es-kotlin.test.yml index 5cf50699..38fdaecb 100644 --- a/doc/1/controllers/document/search/snippets/search-kotlin.test.yml +++ b/doc/1/controllers/document/search/snippets/search-es-kotlin.test.yml @@ -1,4 +1,4 @@ -name: kotlin-document#search +name: kotlin-document#search-es description: Search for documents hooks: before: | diff --git a/doc/1/controllers/document/search/snippets/search-java.java b/doc/1/controllers/document/search/snippets/search-java.java deleted file mode 100644 index 75470a1d..00000000 --- a/doc/1/controllers/document/search/snippets/search-java.java +++ /dev/null @@ -1,36 +0,0 @@ - Map searchQuery = new HashMap<>(); - Map query = new HashMap<>(); - Map match = new HashMap<>(); - match.put("category", "suv"); - query.put("match", match); - searchQuery.put("query", query); - - SearchResult results = kuzzle - .getDocumentController() - .search("nyc-open-data", "yellow-taxi", searchQuery).get(); - - - /* - { - "aggregations"=undefined, - "hits"=[ - { - "_id"="AWgi6A1POQUM6ucJ3q06", - "_score"=0.046520017, - "_source"={ - "category"="suv", - "_kuzzle_info"={ - "author"="-1", - "createdAt"=1546773859655, - "updatedAt"=null, - "updater"=null - } - } - }, - ... - ] - }, - "total"=5, - "fetched"=5, - "scroll_id"=undefined - */ diff --git a/doc/1/controllers/document/search/snippets/search-koncorde-java.java b/doc/1/controllers/document/search/snippets/search-koncorde-java.java new file mode 100644 index 00000000..5830363b --- /dev/null +++ b/doc/1/controllers/document/search/snippets/search-koncorde-java.java @@ -0,0 +1,36 @@ +Map searchQuery = new HashMap<>(); +Map query = new HashMap<>(); +Map equals = new HashMap<>(); +equals.put("category", "suv"); +query.put("equals", equals); +searchQuery.put("query", query); + +SearchResult results = kuzzle + .getDocumentController() + .search("nyc-open-data", "yellow-taxi", searchQuery, Lang.KONCORDE).get(); + + +/* +{ + "aggregations"=undefined, + "hits"=[ + { + "_id"="AWgi6A1POQUM6ucJ3q06", + "_score"=0.046520017, + "_source"={ + "category"="suv", + "_kuzzle_info"={ + "author"="-1", + "createdAt"=1546773859655, + "updatedAt"=null, + "updater"=null + } + } + }, + ... + ] +}, +"total"=5, +"fetched"=5, +"scroll_id"=undefined +*/ diff --git a/doc/1/controllers/document/search/snippets/search-koncorde-java.test.yml b/doc/1/controllers/document/search/snippets/search-koncorde-java.test.yml new file mode 100644 index 00000000..ad829726 --- /dev/null +++ b/doc/1/controllers/document/search/snippets/search-koncorde-java.test.yml @@ -0,0 +1,17 @@ +name: java-document#search-koncorde +description: Search for documents +hooks: + before: | + curl -XDELETE kuzzle:7512/nyc-open-data + curl -XPOST kuzzle:7512/nyc-open-data/_create + curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"category": "suv"}' kuzzle:7512/nyc-open-data/yellow-taxi/_create + done + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"category": "limousine"}' kuzzle:7512/nyc-open-data/yellow-taxi/_create + done + curl -XPOST kuzzle:7512/nyc-open-data/yellow-taxi/_refresh + after: +template: default +expected: ^Success diff --git a/doc/1/controllers/document/search/snippets/search-koncorde-kotlin.kt b/doc/1/controllers/document/search/snippets/search-koncorde-kotlin.kt new file mode 100644 index 00000000..89b4df0b --- /dev/null +++ b/doc/1/controllers/document/search/snippets/search-koncorde-kotlin.kt @@ -0,0 +1,42 @@ +val equals: Map = + HashMap().apply { + put("category", "suv") + } +val query: Map = + HashMap().apply { + put("equals", equals) + } + +val searchQuery: Map = + HashMap().apply { + put("query", query) + } + +val results = kuzzle + .documentController + .search("nyc-open-data", "yellow-taxi", searchQuery, lang = Lang.KONCORDE).get(); + +/* +{ + "aggregations"=undefined, + "hits"=[ + { + "_id"="AWgi6A1POQUM6ucJ3q06", + "_score"=0.046520017, + "_source"={ + "category"="suv", + "_kuzzle_info"={ + "author"="-1", + "createdAt"=1546773859655, + "updatedAt"=null, + "updater"=null + } + } + }, + ... + ] +}, +"total"=5, +"fetched"=5, +"scroll_id"=undefined +*/ diff --git a/doc/1/controllers/document/search/snippets/search-koncorde-kotlin.test.yml b/doc/1/controllers/document/search/snippets/search-koncorde-kotlin.test.yml new file mode 100644 index 00000000..db85e379 --- /dev/null +++ b/doc/1/controllers/document/search/snippets/search-koncorde-kotlin.test.yml @@ -0,0 +1,17 @@ +name: kotlin-document#search-koncorde +description: Search for documents +hooks: + before: | + curl -XDELETE kuzzle:7512/nyc-open-data + curl -XPOST kuzzle:7512/nyc-open-data/_create + curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"category": "suv"}' kuzzle:7512/nyc-open-data/yellow-taxi/_create + done + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"category": "limousine"}' kuzzle:7512/nyc-open-data/yellow-taxi/_create + done + curl -XPOST kuzzle:7512/nyc-open-data/yellow-taxi/_refresh + after: +template: default +expected: ^Success diff --git a/doc/1/controllers/document/search/snippets/search-kotlin.kt b/doc/1/controllers/document/search/snippets/search-kotlin.kt deleted file mode 100644 index 083cfc1e..00000000 --- a/doc/1/controllers/document/search/snippets/search-kotlin.kt +++ /dev/null @@ -1,16 +0,0 @@ -val match: Map = - HashMap().apply { - put("category", "suv") - } -val query: Map = - HashMap().apply { - put("match", match) - } - -val searchQuery: Map = - HashMap().apply { - put("query", query) - } -val results = kuzzle - .documentController - .search("nyc-open-data", "yellow-taxi", searchQuery).get(); diff --git a/doc/1/controllers/document/update-by-query/index.md b/doc/1/controllers/document/update-by-query/index.md index 47fa5805..964801ee 100644 --- a/doc/1/controllers/document/update-by-query/index.md +++ b/doc/1/controllers/document/update-by-query/index.md @@ -11,6 +11,15 @@ Updates documents matching the provided search query. Kuzzle uses the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + + +This method also supports the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) to match documents by passing the `lang` argument with the value `koncorde`. +Koncorde filters will be translated into an Elasticsearch query. + +::: warning +Koncorde `bool` operator and `regexp` clauses are not supported for search queries. +::: + An empty or null query will match all documents in the collection.
@@ -27,11 +36,45 @@ An empty or null query will match all documents in the collection. Map changes) throws NotConnectedException, InternalException public CompletableFuture>> updateByQuery( - String index, - String collection, - Map searchQuery, - Map changes, - UpdateOptions options) throws NotConnectedException, InternalException + String index, + String collection, + Map searchQuery, + Map changes, + Lang lang) throws NotConnectedException, InternalException + + public CompletableFuture>> updateByQuery( + String index, + String collection, + Map searchQuery, + Map changes, + Boolean waitForRefresh) throws NotConnectedException, InternalException + + public CompletableFuture>> updateByQuery( + String index, + String collection, + Map searchQuery, + Map changes, + Boolean waitForRefresh, + Integer retryOnConflict) throws NotConnectedException, InternalException + + public CompletableFuture>> updateByQuery( + String index, + String collection, + Map searchQuery, + Map changes, + Boolean waitForRefresh, + Integer retryOnConflict, + Boolean source) throws NotConnectedException, InternalException + + public CompletableFuture>> updateByQuery( + String index, + String collection, + Map searchQuery, + Map changes, + Boolean waitForRefresh, + Integer retryOnConflict, + Boolean source, + Lang lang) throws NotConnectedException, InternalException ``` | Argument | Type | Description | @@ -42,6 +85,7 @@ An empty or null query will match all documents in the collection. | `changes` |
Map
| Partial changes to apply to the documents | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| | `source` |
Boolean
| If true, returns the updated document inside the response | +| `lang` |
[Lang](/sdk/jvm/1/core-classes/lang)
| Specify the query language to use. By default, it's `elasticsearch` but `koncorde` can also be used. | --- @@ -67,7 +111,14 @@ Each errored document is an object of the `errors` array with the following prop ## Usage -<<< ./snippets/update-by-query-java.java +With the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + +<<< ./snippets/update-by-query-es-java.java + +With the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. + + +<<< ./snippets/update-by-query-koncorde-java.java ::: ::: tab Kotlin @@ -80,7 +131,8 @@ fun updateByQuery( changes: Map, waitForRefresh: Boolean? = null, retryOnConflict: Int? = null, - source: Boolean? = null): CompletableFuture>> + source: Boolean? = null, + lang: Lang = Lang.ELASTICSEARCH): CompletableFuture>> ``` | Argument | Type | Description | @@ -90,7 +142,9 @@ fun updateByQuery( | `searchQuery` |
Map
| Query to match | | `changes` |
Map
| Partial changes to apply to the documents | | `waitForRefresh` |
Boolean
| If set to `true`, Kuzzle will wait for the persistence layer to finish indexing| +| `retryOnConflict` |
Int
(optional) | The number of times the database layer should retry in case of version conflict | | `source` |
Boolean
| If true, returns the updated document inside the response | +| `lang` |
[Lang](/sdk/jvm/1/core-classes/lang)
| Specify the query language to use. By default, it's `elasticsearch` but `koncorde` can also be used. | --- @@ -116,7 +170,14 @@ Each errored document is an object of the `errors` array with the following prop ## Usage -<<< ./snippets/update-by-query-kotlin.kt +With the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html) syntax. + +<<< ./snippets/update-by-query-es-kotlin.kt + +With the [Koncorde Filters DSL](/core/2/api/koncorde-filters-syntax) syntax. + + +<<< ./snippets/update-by-query-koncorde-kotlin.kt ::: :::: diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-java.java b/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-java.java new file mode 100644 index 00000000..6fbfc96e --- /dev/null +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-java.java @@ -0,0 +1,30 @@ +Map searchQuery = new HashMap<>(); +Map match = new HashMap<>(); +match.put("capacity", 4); +searchQuery.put("match", match); + +Map changes = new HashMap<>(); +changes.put("capacity", 42); + +Map> result = kuzzle + .getDocumentController() + .updateByQuery("nyc-open-data", "yellow-taxi", searchQuery, changes) + .get(); + +/* +{ + successes=[ + { + _id=, + _source= // if source set to true + status=200 + }, + { + _id=, + _source= // if source set to true + status=200 + } + ], + errors=[] +} +*/ \ No newline at end of file diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.test.yml b/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-java.test.yml similarity index 95% rename from doc/1/controllers/document/update-by-query/snippets/update-by-query-java.test.yml rename to doc/1/controllers/document/update-by-query/snippets/update-by-query-es-java.test.yml index 95a45914..9d5e2398 100644 --- a/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.test.yml +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-java.test.yml @@ -1,4 +1,4 @@ -name: java-document#updateByQuery +name: java-document#updateByQuery-es description: Update documents matching query hooks: before: | diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-kotlin.kt b/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-kotlin.kt new file mode 100644 index 00000000..0273d679 --- /dev/null +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-kotlin.kt @@ -0,0 +1,38 @@ +val match: Map = + HashMap().apply { + put("capacity", 4) + } + +val searchQuery: Map = + HashMap().apply { + put("match", match) + } + +val changes: Map = + HashMap().apply { + put("capacity", 42) + } + +val result: Map> = + kuzzle + .documentController + .updateByQuery("nyc-open-data", "yellow-taxi", searchQuery, changes) + .get() + +/* +{ + successes=[ + { + _id=, + _source= // if source set to true + status=200 + }, + { + _id=, + _source= // if source set to true + status=200 + } + ], + errors=[] +} +*/ diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.test.yml b/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-kotlin.test.yml similarity index 94% rename from doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.test.yml rename to doc/1/controllers/document/update-by-query/snippets/update-by-query-es-kotlin.test.yml index 5e8f812c..4a2ea95d 100644 --- a/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.test.yml +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-es-kotlin.test.yml @@ -1,4 +1,4 @@ -name: kotlin-document#updateByQuery +name: kotlin-document#updateByQuery-es description: Update documents matching query hooks: before: | diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.java b/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.java deleted file mode 100644 index 5c5c1e06..00000000 --- a/doc/1/controllers/document/update-by-query/snippets/update-by-query-java.java +++ /dev/null @@ -1,30 +0,0 @@ - Map searchQuery = new HashMap<>(); - Map match = new HashMap<>(); - match.put("capacity", 4); - searchQuery.put("match", match); - - Map changes = new HashMap<>(); - changes.put("capacity", 42); - - Map> result = kuzzle - .getDocumentController() - .updateByQuery("nyc-open-data", "yellow-taxi", searchQuery, changes) - .get(); - - /* - { - successes=[ - { - _id=, - _source= // if source set to true - status=200 - }, - { - _id=, - _source= // if source set to true - status=200 - } - ], - errors=[] - } - */ \ No newline at end of file diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-java.java b/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-java.java new file mode 100644 index 00000000..0d4cc91b --- /dev/null +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-java.java @@ -0,0 +1,30 @@ +Map searchQuery = new HashMap<>(); +Map equals = new HashMap<>(); +equals.put("capacity", 4); +searchQuery.put("equals", equals); + +Map changes = new HashMap<>(); +changes.put("capacity", 42); + +Map> result = kuzzle + .getDocumentController() + .updateByQuery("nyc-open-data", "yellow-taxi", searchQuery, changes, Lang.KONCORDE) + .get(); + +/* +{ + successes=[ + { + _id=, + _source= // if source set to true + status=200 + }, + { + _id=, + _source= // if source set to true + status=200 + } + ], + errors=[] +} +*/ diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-java.test.yml b/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-java.test.yml new file mode 100644 index 00000000..323b19af --- /dev/null +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-java.test.yml @@ -0,0 +1,19 @@ +name: java-document#updateByQuery-koncorde +description: Update documents matching query +hooks: + before: | + curl -XDELETE kuzzle:7512/nyc-open-data + curl -XPOST kuzzle:7512/nyc-open-data/_create + curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi + for i in 1 2 ; do + curl -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/document_$i/_create + done + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create + done + curl -XPOST kuzzle:7512/nyc-open-data/_refresh + after: +template: print-result-array +expected: + - "id=document_1(.*)_version=2(.*)status=200" + - "id=document_2(.*)_version=2(.*)status=200" diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-kotlin.kt b/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-kotlin.kt new file mode 100644 index 00000000..ef90e8fc --- /dev/null +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-kotlin.kt @@ -0,0 +1,39 @@ +val equals: Map = + HashMap().apply { + put("capacity", 4) + } + +val searchQuery: Map = + HashMap().apply { + put("equals", equals) + } + +val changes: Map = + HashMap().apply { + put("capacity", 42) + } + + +val result: Map> = + kuzzle + .documentController + .updateByQuery("nyc-open-data", "yellow-taxi", searchQuery, changes, lang = Lang.KONCORDE) + .get() + +/* +{ + successes=[ + { + _id=, + _source= // if source set to true + status=200 + }, + { + _id=, + _source= // if source set to true + status=200 + } + ], + errors=[] +} +*/ diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-kotlin.test.yml b/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-kotlin.test.yml new file mode 100644 index 00000000..89fd0d89 --- /dev/null +++ b/doc/1/controllers/document/update-by-query/snippets/update-by-query-koncorde-kotlin.test.yml @@ -0,0 +1,17 @@ +name: kotlin-document#updateByQuery-koncorde +description: Update documents matching query +hooks: + before: | + curl -XDELETE kuzzle:7512/nyc-open-data + curl -XPOST kuzzle:7512/nyc-open-data/_create + curl -XPUT kuzzle:7512/nyc-open-data/yellow-taxi + for i in 1 2 ; do + curl -H "Content-type: application/json" -d '{"capacity": 4}' kuzzle:7512/nyc-open-data/yellow-taxi/document_$i/_create + done + for i in 1 2 3 4 5; do + curl -H "Content-type: application/json" -d '{"capacity": 7}' kuzzle:7512/nyc-open-data/yellow-taxi/_create + done + curl -XPOST kuzzle:7512/nyc-open-data/_refresh + after: +template: print-result +expected: "id=document_1(.*)_version=2(.*)status=200(.*)id=document_2(.*)_version=2(.*)status=200" \ No newline at end of file diff --git a/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt b/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt deleted file mode 100644 index d93157f6..00000000 --- a/doc/1/controllers/document/update-by-query/snippets/update-by-query-kotlin.kt +++ /dev/null @@ -1,21 +0,0 @@ -val match: Map = - HashMap().apply { - put("capacity", 4) - } - -val searchQuery: Map = - HashMap().apply { - put("match", match) - } - -val changes: Map = - HashMap().apply { - put("capacity", 42) - } - - -val result: Map> = - kuzzle - .documentController - .updateByQuery("nyc-open-data", "yellow-taxi", searchQuery, changes) - .get() diff --git a/doc/1/controllers/document/validate/snippets/validate-kotlin.kt b/doc/1/controllers/document/validate/snippets/validate-kotlin.kt index 412e1826..fffeaa02 100644 --- a/doc/1/controllers/document/validate/snippets/validate-kotlin.kt +++ b/doc/1/controllers/document/validate/snippets/validate-kotlin.kt @@ -3,10 +3,8 @@ val document: Map = put("key", "value") } - val result: Boolean = - kuzzle - .documentController - .validate("nyc-open-data", "yellow-taxi", document) - .get() - \ No newline at end of file + kuzzle + .documentController + .validate("nyc-open-data", "yellow-taxi", document) + .get() diff --git a/doc/1/controllers/realtime/count/snippets/count-kotlin.kt b/doc/1/controllers/realtime/count/snippets/count-kotlin.kt index 97691ba8..360a35ba 100644 --- a/doc/1/controllers/realtime/count/snippets/count-kotlin.kt +++ b/doc/1/controllers/realtime/count/snippets/count-kotlin.kt @@ -3,14 +3,15 @@ val filters: Map = HashMap().apply { } val roomId: String = kuzzle.realtimeController.subscribe( - "nyc-open-data", - "yellow-taxi", - filters) { + "nyc-open-data", + "yellow-taxi", + filters +) { if (it.scope == "in") { - println("Document entered the scope") + println("Document entered the scope") } else { - println("Document left the scope") + println("Document left the scope") } - }.get() +}.get() -val result: Int = kuzzle.realtimeController.count(roomId).get() \ No newline at end of file +val result: Int = kuzzle.realtimeController.count(roomId).get() diff --git a/doc/1/controllers/server/admin-exists/snippets/admin-exists-kotlin.kt b/doc/1/controllers/server/admin-exists/snippets/admin-exists-kotlin.kt index 6e7a6d5e..774d9571 100644 --- a/doc/1/controllers/server/admin-exists/snippets/admin-exists-kotlin.kt +++ b/doc/1/controllers/server/admin-exists/snippets/admin-exists-kotlin.kt @@ -1,2 +1,2 @@ val result: Boolean = - kuzzle.serverController.adminExists().get() \ No newline at end of file + kuzzle.serverController.adminExists().get() diff --git a/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt b/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt index f08b0195..514a7c75 100644 --- a/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt +++ b/doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt @@ -1,4 +1,4 @@ val result: Map = kuzzle .serverController .getAllStats() - .get() \ No newline at end of file + .get() diff --git a/doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt b/doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt index 955c6434..cc625607 100644 --- a/doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt +++ b/doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt @@ -1,4 +1,4 @@ val result: Map = kuzzle .serverController .getConfig() - .get() \ No newline at end of file + .get() diff --git a/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt b/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt index deb49c10..70743075 100644 --- a/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt +++ b/doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt @@ -1,4 +1,4 @@ val result: Map = kuzzle .serverController .getLastStats() - .get() \ No newline at end of file + .get() diff --git a/doc/1/controllers/server/get-stats/snippets/get-stats-kotlin.kt b/doc/1/controllers/server/get-stats/snippets/get-stats-kotlin.kt index fd504297..52a77364 100644 --- a/doc/1/controllers/server/get-stats/snippets/get-stats-kotlin.kt +++ b/doc/1/controllers/server/get-stats/snippets/get-stats-kotlin.kt @@ -1,7 +1,7 @@ -val startTime = Date(1234567890000); -val stopTime = Date(1541426610000); +val startTime = Date(1234567890000) +val stopTime = Date(1541426610000) val result: Map = kuzzle .serverController .getStats(startTime, stopTime) - .get() \ No newline at end of file + .get() diff --git a/doc/1/controllers/server/info/snippets/info-kotlin.kt b/doc/1/controllers/server/info/snippets/info-kotlin.kt index aa109d1d..84dcefcd 100644 --- a/doc/1/controllers/server/info/snippets/info-kotlin.kt +++ b/doc/1/controllers/server/info/snippets/info-kotlin.kt @@ -1,4 +1,4 @@ val result: Map = kuzzle .serverController .info() - .get() \ No newline at end of file + .get() diff --git a/doc/1/controllers/server/now/snippets/now-kotlin.kt b/doc/1/controllers/server/now/snippets/now-kotlin.kt index e38e5f8b..6f9603bf 100644 --- a/doc/1/controllers/server/now/snippets/now-kotlin.kt +++ b/doc/1/controllers/server/now/snippets/now-kotlin.kt @@ -1,4 +1,4 @@ val result: Date = kuzzle .serverController .now() - .get() \ No newline at end of file + .get() diff --git a/doc/1/core-classes/lang/index.md b/doc/1/core-classes/lang/index.md new file mode 100644 index 00000000..dee7ce07 --- /dev/null +++ b/doc/1/core-classes/lang/index.md @@ -0,0 +1,6 @@ +--- +code: true +type: branch +title: Lang +description: Lang Enum Class +--- \ No newline at end of file diff --git a/doc/1/core-classes/lang/introduction/index.md b/doc/1/core-classes/lang/introduction/index.md new file mode 100644 index 00000000..db09246f --- /dev/null +++ b/doc/1/core-classes/lang/introduction/index.md @@ -0,0 +1,34 @@ +--- +code: false +type: page +title: Introduction +description: Lang object description +order: 0 +--- + +## Response + +`Lang` is an **Enum** class listing the possible query syntax to use for search queries. + +## Properties + +| Property | Type | Description | +|--- |--- |--- | +| `ELASTICSEARCH` |
Lang
| For Elasticsearch query syntax. | +| `KONCORDE` |
Lang
| For Koncorde query syntax. | + +Those enums contain a `lang` value, which is the query language as `String` in lowercase. + +```kotlin +print(Lang.ELASTICSEARCH.lang) +/* +"elasticsearch" +*/ +``` + +```kotlin +print(Lang.KONCORDE.lang) +/* +"koncorde" +*/ +``` \ No newline at end of file diff --git a/doc/1/getting-started/java/index.md b/doc/1/getting-started/java/index.md index 913f72a4..17d8e7e0 100644 --- a/doc/1/getting-started/java/index.md +++ b/doc/1/getting-started/java/index.md @@ -43,7 +43,7 @@ To build the project, add the following lines: io.kuzzle sdk-jvm - 1.0.1 + 1.1.0 pom ``` @@ -57,14 +57,14 @@ repositories { } } dependencies { - compile 'io.kuzzle:sdk-jvm:1.0.1' + compile 'io.kuzzle:sdk-jvm:1.1.0' } ``` ### Ivy ```html - + ``` diff --git a/doc/1/getting-started/kotlin/snippets/document-kotlin.kt b/doc/1/getting-started/kotlin/snippets/document-kotlin.kt index 52af7870..4e246cd8 100644 --- a/doc/1/getting-started/kotlin/snippets/document-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/document-kotlin.kt @@ -1,36 +1,35 @@ -import io.kuzzle.sdk.*; -import io.kuzzle.sdk.protocol.WebSocket; +import io.kuzzle.sdk.* +import io.kuzzle.sdk.protocol.WebSocket fun main() { - // Creates a WebSocket connection. - // Replace "kuzzle" with - // your Kuzzle host name (e.g. "localhost") - val ws = WebSocket("kuzzle"); - - // Instantiates a Kuzzle client - val kuzzle = Kuzzle(ws).apply { - // Connects to the server. - connect() - } - println("Connected!"); + // Creates a WebSocket connection. + // Replace "kuzzle" with + // your Kuzzle host name (e.g. "localhost") + val ws = WebSocket("kuzzle") - try { - // New document content - val content: Map = HashMap().apply { - put("name", "John") - put("birthday", "1995-11-27") - put("license", "B") + // Instantiates a Kuzzle client + val kuzzle = Kuzzle(ws).apply { + // Connects to the server. + connect() } - // Stores the document in the "yellow-taxi" collection. - kuzzle - .documentController - .create( "nyc-open-data", "yellow-taxi", content).get(); - println("New document added to the yellow-taxi collection!") - - } catch(e: Exception) { - e.printStackTrace() - } finally { - // Disconnects the SDK. - kuzzle.disconnect() - } -} + println("Connected!") + + try { + // New document content + val content: Map = HashMap().apply { + put("name", "John") + put("birthday", "1995-11-27") + put("license", "B") + } + // Stores the document in the "yellow-taxi" collection. + kuzzle + .documentController + .create("nyc-open-data", "yellow-taxi", content).get() + println("New document added to the yellow-taxi collection!") + } catch (e: Exception) { + e.printStackTrace() + } finally { + // Disconnects the SDK. + kuzzle.disconnect() + } +} \ No newline at end of file diff --git a/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt b/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt index a81e3f85..75c1e210 100644 --- a/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/firstconnection-kotlin.kt @@ -2,35 +2,35 @@ import io.kuzzle.sdk.*; import io.kuzzle.sdk.protocol.WebSocket; fun main() { - // Creates a WebSocket connection. - // Replace "kuzzle" with - // your Kuzzle hostname like "localhost" - val ws = WebSocket("kuzzle"); + // Creates a WebSocket connection. + // Replace "kuzzle" with + // your Kuzzle hostname like "localhost" + val ws = WebSocket("kuzzle") - // Instantiates a Kuzzle client - val kuzzle = Kuzzle(ws).apply { - // Connects to the server. - connect() - }; - println("Connected!") + // Instantiates a Kuzzle client + val kuzzle = Kuzzle(ws).apply { + // Connects to the server. + connect() + } + println("Connected!") - try { - // Freshly installed Kuzzle servers are empty: we need to create - // a new index. - kuzzle - .indexController - .create("nyc-open-data").get(); - println("Index nyc-open-data created!") + try { + // Freshly installed Kuzzle servers are empty: we need to create + // a new index. + kuzzle + .indexController + .create("nyc-open-data").get() + println("Index nyc-open-data created!") - // Creates a collection - kuzzle - .collectionController - .create("nyc-open-data", "yellow-taxi").get(); - println("Collection yellow-taxi created!") - } catch(e: Exception){ - e.printStackTrace() - } finally { - // Disconnects the SDK - kuzzle.disconnect() - } + // Creates a collection + kuzzle + .collectionController + .create("nyc-open-data", "yellow-taxi").get() + println("Collection yellow-taxi created!") + } catch (e: Exception) { + e.printStackTrace() + } finally { + // Disconnects the SDK + kuzzle.disconnect() + } } diff --git a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt index c3cdc569..47eafe07 100644 --- a/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt +++ b/doc/1/getting-started/kotlin/snippets/realtime-kotlin.kt @@ -1,67 +1,66 @@ -import io.kuzzle.sdk.*; -import io.kuzzle.sdk.protocol.WebSocket; +import io.kuzzle.sdk.* +import io.kuzzle.sdk.protocol.WebSocket fun main() { - // Creates a WebSocket connection. - // Replace "kuzzle" with - // your Kuzzle hostname like "localhost" - val ws = WebSocket("kuzzle"); - - // Instantiates a Kuzzle client - val kuzzle = Kuzzle(ws).apply { - // Connects to the server. - connect() - }; - println("Connected!") + // Creates a WebSocket connection. + // Replace "kuzzle" with + // your Kuzzle hostname like "localhost" + val ws = WebSocket("kuzzle") - try { - // Subscribes to notifications for drivers having a "B" driver license. - val equals: Map = HashMap().apply { - put("license", "B") - } - val filters: Map = HashMap().apply { - put("equals", equals) + // Instantiates a Kuzzle client + val kuzzle = Kuzzle(ws).apply { + // Connects to the server. + connect() } + + try { + // Subscribes to notifications for drivers having a "B" driver license. + val equals: Map = HashMap().apply { + put("license", "B") + } + val filters: Map = HashMap().apply { + put("equals", equals) + } + println("Connected!") - // Sends the subscription - kuzzle - .realtimeController - .subscribe("nyc-open-data", "yellow-taxi", filters) { notification -> - val content: Map = notification.result as Map - println("New created document notification: " + content) - /* - { - _source={ - birthday=1995-11-27, - license=B, - name=John, - _kuzzle_info={ - createdAt=1605694059151,author=-1 - } - }, - _id=9PDS2nUBeGNr7nwl8j2Q, - _version=1 - } - */ - }.get(); - println("Successfully subscribed!") + // Sends the subscription + kuzzle + .realtimeController + .subscribe("nyc-open-data", "yellow-taxi", filters) { notification -> + val content: Map = notification.result as Map + println("New created document notification: " + content) + /* + { + _source={ + birthday=1995-11-27, + license=B, + name=John, + _kuzzle_info={ + createdAt=1605694059151,author=-1 + } + }, + _id=9PDS2nUBeGNr7nwl8j2Q, + _version=1 + } + */ + }.get() + println("Successfully subscribed!") - // Writes a new document. This triggers a notification - // sent to our subscription. - val content: Map = HashMap().apply { - put("name", "John") - put("birthday", "1995-11-27") - put("license", "B") + // Writes a new document. This triggers a notification + // sent to our subscription. + val content: Map = HashMap().apply { + put("name", "John") + put("birthday", "1995-11-27") + put("license", "B") + } + kuzzle + .documentController + .create("nyc-open-data", "yellow-taxi", content).get() + println("New document added to the yellow-taxi collection!") + } catch (e: Exception) { + e.printStackTrace() + } finally { + // Disconnects the SDK. + kuzzle.disconnect() } - - kuzzle - .documentController - .create("nyc-open-data", "yellow-taxi", content).get(); - println("New document added to the yellow-taxi collection!") - } catch (e: Exception) { - e.printStackTrace() - } finally { - // Disconnects the SDK. - kuzzle.disconnect() - } } diff --git a/package-lock.json b/package-lock.json index 5e603da9..1b8fe37d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3,73 +3,65 @@ "requires": true, "lockfileVersion": 1, "dependencies": { + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==" + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, "@oclif/command": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.6.1.tgz", - "integrity": "sha512-pvmMmfGn+zm4e4RwVw63mg9sIaqKqmVsFbImQoUrCO/43UmWzoSHWNXKdgEGigOezWrkZfFucaeZcSbp149OWg==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.8.0.tgz", + "integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==", "requires": { "@oclif/config": "^1.15.1", - "@oclif/errors": "^1.2.2", + "@oclif/errors": "^1.3.3", "@oclif/parser": "^3.8.3", "@oclif/plugin-help": "^3", "debug": "^4.1.1", - "semver": "^5.6.0" - }, - "dependencies": { - "@oclif/plugin-help": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-3.1.0.tgz", - "integrity": "sha512-orSWpXGlJaX16eSjAtI8scA8QhrjQOaCSHodEx52t18JKbIVzG8jcngugyWAOB/V4jhPl0rdiVk9XFsaIIiG2g==", - "requires": { - "@oclif/command": "^1.5.20", - "@oclif/config": "^1.15.1", - "chalk": "^2.4.1", - "indent-string": "^4.0.0", - "lodash.template": "^4.4.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0", - "widest-line": "^2.0.1", - "wrap-ansi": "^4.0.0" - } - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - } + "semver": "^7.3.2" } }, "@oclif/config": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@oclif/config/-/config-1.15.1.tgz", - "integrity": "sha512-GdyHpEZuWlfU8GSaZoiywtfVBsPcfYn1KuSLT1JTfvZGpPG6vShcGr24YZ3HG2jXUFlIuAqDcYlTzOrqOdTPNQ==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@oclif/config/-/config-1.17.0.tgz", + "integrity": "sha512-Lmfuf6ubjQ4ifC/9bz1fSCHc6F6E653oyaRXxg+lgT4+bYf9bk+nqrUpAbrXyABkCqgIBiFr3J4zR/kiFdE1PA==", "requires": { - "@oclif/errors": "^1.0.0", + "@oclif/errors": "^1.3.3", "@oclif/parser": "^3.8.0", "debug": "^4.1.1", - "tslib": "^1.9.3" + "globby": "^11.0.1", + "is-wsl": "^2.1.1", + "tslib": "^2.0.0" } }, "@oclif/errors": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@oclif/errors/-/errors-1.2.2.tgz", - "integrity": "sha512-Eq8BFuJUQcbAPVofDxwdE0bL14inIiwt5EaKRVY9ZDIG11jwdXZqiQEECJx0VfnLyUZdYfRd/znDI/MytdJoKg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@oclif/errors/-/errors-1.3.4.tgz", + "integrity": "sha512-pJKXyEqwdfRTUdM8n5FIHiQQHg5ETM0Wlso8bF9GodczO40mF5Z3HufnYWJE7z8sGKxOeJCdbAVZbS8Y+d5GCw==", "requires": { - "clean-stack": "^1.3.0", - "fs-extra": "^7.0.0", - "indent-string": "^3.2.0", - "strip-ansi": "^5.0.0", - "wrap-ansi": "^4.0.0" + "clean-stack": "^3.0.0", + "fs-extra": "^8.1", + "indent-string": "^4.0.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, "@oclif/linewrap": { @@ -86,36 +78,112 @@ "@oclif/linewrap": "^1.0.0", "chalk": "^2.4.2", "tslib": "^1.9.3" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } } }, "@oclif/plugin-help": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-2.2.3.tgz", - "integrity": "sha512-bGHUdo5e7DjPJ0vTeRBMIrfqTRDBfyR5w0MP41u0n3r7YG5p14lvMmiCXxi6WDaP2Hw5nqx3PnkAIntCKZZN7g==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-3.2.2.tgz", + "integrity": "sha512-SPZ8U8PBYK0n4srFjCLedk0jWU4QlxgEYLCXIBShJgOwPhTTQknkUlsEwaMIevvCU4iCQZhfMX+D8Pz5GZjFgA==", "requires": { - "@oclif/command": "^1.5.13", - "chalk": "^2.4.1", + "@oclif/command": "^1.5.20", + "@oclif/config": "^1.15.1", + "@oclif/errors": "^1.2.2", + "chalk": "^4.1.0", "indent-string": "^4.0.0", "lodash.template": "^4.4.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0", - "widest-line": "^2.0.1", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "widest-line": "^3.1.0", "wrap-ansi": "^4.0.0" }, "dependencies": { - "indent-string": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "has-flag": "^4.0.0" + } + }, + "wrap-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", + "integrity": "sha512-uMTsj9rDb0/7kk1PbcbCcwvHUxp60fGDB/NNXpVa0Q+ic/e7y5+BwTxKfQ33VYgDppSwi/FBzpetYzo8s6tfbg==", + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } } } } @@ -126,18 +194,13 @@ "integrity": "sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw==" }, "@samverschueren/stream-to-observable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", - "integrity": "sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz", + "integrity": "sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ==", "requires": { "any-observable": "^0.3.0" } }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" - }, "@types/listr": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/@types/listr/-/listr-0.14.2.tgz", @@ -148,9 +211,9 @@ } }, "@types/node": { - "version": "14.0.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz", - "integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA==" + "version": "14.14.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz", + "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==" }, "accepts": { "version": "1.3.7", @@ -170,16 +233,16 @@ } }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" } }, "ansicolors": { @@ -205,12 +268,17 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + }, "axios": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", - "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { - "follow-redirects": "1.5.10" + "follow-redirects": "^1.10.0" } }, "body-parser": { @@ -245,6 +313,14 @@ } } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, "bytes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", @@ -267,63 +343,64 @@ "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, "clean-stack": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", - "integrity": "sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", + "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", + "requires": { + "escape-string-regexp": "4.0.0" + } }, "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" } }, "cli-progress": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.8.2.tgz", - "integrity": "sha512-qRwBxLldMSfxB+YGFgNRaj5vyyHe1yMpVeDL79c+7puGujdKJHQHydgqXDcrkvQgJ5U/d3lpf6vffSoVVUftVQ==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.9.0.tgz", + "integrity": "sha512-g7rLWfhAo/7pF+a/STFH/xPyosaL1zgADhI0OM83hl3c7S43iGvJWEAV2QuDOnQ8i6EMBj/u4+NTd0d5L+4JfA==", "requires": { "colors": "^1.1.2", "string-width": "^4.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "cli-truncate": { @@ -369,9 +446,9 @@ } }, "cli-ux": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/cli-ux/-/cli-ux-5.4.6.tgz", - "integrity": "sha512-EeiS2TzEndRVknCqE+8Ri8g0bsP617a1nq6n+3Trwft1JCDzyUNlX2J1fl7fwTgRPWtmBmiF6xIyueL5YGs65g==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/cli-ux/-/cli-ux-5.5.1.tgz", + "integrity": "sha512-t3DT1U1C3rArLGYLpKa3m9dr/8uKZRI8HRm/rXKL7UTjm4c+Yd9zHNWg1tP8uaJkUbhmvx5SQHwb3VWpPUVdHQ==", "requires": { "@oclif/command": "^1.6.0", "@oclif/errors": "^1.2.1", @@ -380,88 +457,73 @@ "ansi-escapes": "^4.3.0", "ansi-styles": "^4.2.0", "cardinal": "^2.1.1", - "chalk": "^2.4.1", - "clean-stack": "^2.0.0", + "chalk": "^4.1.0", + "clean-stack": "^3.0.0", "cli-progress": "^3.4.0", - "extract-stack": "^1.0.0", - "fs-extra": "^7.0.1", + "extract-stack": "^2.0.0", + "fs-extra": "^8.1", "hyperlinker": "^1.0.0", "indent-string": "^4.0.0", - "is-wsl": "^1.1.0", + "is-wsl": "^2.2.0", "js-yaml": "^3.13.1", "lodash": "^4.17.11", "natural-orderby": "^2.0.1", "object-treeify": "^1.1.4", "password-prompt": "^1.1.2", - "semver": "^5.6.0", - "string-width": "^3.1.0", - "strip-ansi": "^5.1.0", - "supports-color": "^5.5.0", - "supports-hyperlinks": "^1.0.1", - "tslib": "^1.9.3" + "semver": "^7.3.2", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "supports-color": "^7.1.0", + "supports-hyperlinks": "^2.1.0", + "tslib": "^2.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "requires": { - "color-name": "~1.1.4" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "indent-string": { + "has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "has-flag": "^4.0.0" } } } }, + "cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==" + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "colors": { "version": "1.4.0", @@ -501,6 +563,13 @@ "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } } }, "date-fns": { @@ -509,11 +578,11 @@ "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==" }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "depd": { @@ -526,6 +595,14 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "requires": { + "path-type": "^4.0.0" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -537,32 +614,24 @@ "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=" }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } - }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "esprima": { "version": "4.0.1", @@ -575,18 +644,18 @@ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, "execa": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.2.tgz", - "integrity": "sha512-QI2zLa6CjGWdiQsmSkZoGtDx2N+cQIGb3yNolGTdjSQzydzLgYYf8LRuagp7S7fPimjcrzUDSUFd/MgzELMi4Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", + "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" }, "dependencies": { @@ -680,18 +749,63 @@ } } }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, "extract-stack": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/extract-stack/-/extract-stack-1.0.0.tgz", - "integrity": "sha1-uXrK+UQe6iMyUpYktzL8WhyBZfo=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/extract-stack/-/extract-stack-2.0.0.tgz", + "integrity": "sha512-AEo4zm+TenK7zQorGK1f9mJ8L14hnTDi2ZQPR+Mub1NX8zimka1mXpV5LpH8x9HoUmFSHZCfLHqWvp0Y4FxxzQ==" + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fastq": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.1.tgz", + "integrity": "sha512-AWuv6Ery3pM+dY7LYS8YIaCiQvUaos9OB1RyNgaOWnaX+Tik7Onvcsf8x8c+YtDeT0maYLniBip2hox5KtEXXA==", + "requires": { + "reusify": "^1.0.4" + } }, "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "requires": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" + "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" } }, "finalhandler": { @@ -724,27 +838,9 @@ } }, "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", - "requires": { - "debug": "=3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz", + "integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==" }, "forwarded": { "version": "0.1.2", @@ -757,27 +853,45 @@ "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "requires": { - "graceful-fs": "^4.1.2", + "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", + "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==" + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", + "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", "requires": { - "pump": "^3.0.0" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" } }, "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, "has-ansi": { "version": "2.0.0", @@ -812,9 +926,9 @@ } }, "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" }, "hyperlinker": { "version": "1.0.0", @@ -829,25 +943,97 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + }, "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "inquirer": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.19", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.6.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-docker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-observable": { "version": "1.1.0", @@ -868,9 +1054,12 @@ "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" }, "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "requires": { + "is-docker": "^2.0.0" + } }, "isexe": { "version": "2.0.0", @@ -878,9 +1067,9 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -895,21 +1084,23 @@ } }, "kuzdoc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/kuzdoc/-/kuzdoc-1.2.2.tgz", - "integrity": "sha512-QXw4dVIh4dRoD/9Vz9tbpfKNT9Y0AEORJyRHIwKuHaxH65Ccr7KHwxSTbJokK/PV4PebRDO96sPodEc/4NrxbQ==", - "requires": { - "@oclif/command": "^1.5.19", - "@oclif/config": "^1.13.3", - "@oclif/plugin-help": "^2.2.3", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/kuzdoc/-/kuzdoc-1.4.5.tgz", + "integrity": "sha512-jppgIJZEyAoOTr/Nd6CcFyLyfskNFzepeJ2KAfD5N5irEYJdGIZGlNgucFhsD8aPPKgbEC4HObaBj3A5Jwi3JQ==", + "requires": { + "@oclif/command": "^1.8.0", + "@oclif/config": "^1.17.0", + "@oclif/errors": "^1.3.4", + "@oclif/plugin-help": "^3.2.1", "@types/listr": "^0.14.2", - "axios": "^0.19.0", - "cli-ux": "^5.4.1", - "execa": "^4.0.0", + "axios": "^0.21.1", + "cli-ux": "^5.5.1", + "execa": "^5.0.0", "express": "^4.17.1", + "inquirer": "^7.3.3", "listr": "^0.14.3", - "tslib": "^1.10.0", - "yaml": "^1.7.2" + "tslib": "^2.1.0", + "yaml": "^1.10.0" } }, "listr": { @@ -977,6 +1168,25 @@ "supports-color": "^2.0.0" } }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -1003,6 +1213,19 @@ "figures": "^2.0.0" }, "dependencies": { + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -1010,13 +1233,35 @@ "requires": { "escape-string-regexp": "^1.0.5" } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } } } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" }, "lodash._reinterpolate": { "version": "3.0.0", @@ -1070,6 +1315,11 @@ "supports-color": "^2.0.0" } }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -1105,6 +1355,50 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -1124,6 +1418,14 @@ } } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -1139,27 +1441,41 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==" }, "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", "requires": { - "mime-db": "1.44.0" + "mime-db": "1.45.0" } }, "mimic-fn": { @@ -1172,6 +1488,11 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, "natural-orderby": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/natural-orderby/-/natural-orderby-2.0.3.tgz", @@ -1213,9 +1534,9 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "object-treeify": { - "version": "1.1.25", - "resolved": "https://registry.npmjs.org/object-treeify/-/object-treeify-1.1.25.tgz", - "integrity": "sha512-6Abx0xlXDnYd50JkQefvoIly3jWOu8/PqH4lh8p2/aMFEx5TjsUGHt0H9NHfzt+pCwOhpPgNYofD8e2YywIXig==" + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/object-treeify/-/object-treeify-1.1.31.tgz", + "integrity": "sha512-kt2UuyHDTH+J6w0pv2c+3uuEApGuwgfjWogbqPWAvk4nOM/T3No0SzDtp6CuJ/XBUy//nFNuerb8ms7CqjD9Tw==" }, "on-finished": { "version": "2.3.0", @@ -1225,22 +1546,19 @@ "ee-first": "1.1.1" } }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, "onetime": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", - "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "requires": { "mimic-fn": "^2.1.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, "p-map": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", @@ -1277,6 +1595,16 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + }, "proxy-addr": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", @@ -1286,20 +1614,16 @@ "ipaddr.js": "1.9.1" } }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" }, + "queue-microtask": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz", + "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==" + }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -1325,35 +1649,45 @@ } }, "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "requires": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" - }, - "dependencies": { - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "requires": { - "mimic-fn": "^1.0.0" - } - } + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==" + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "requires": { + "queue-microtask": "^1.2.2" } }, "rxjs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", - "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", "requires": { "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } } }, "safe-buffer": { @@ -1367,9 +1701,12 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } }, "send": { "version": "0.17.1", @@ -1447,6 +1784,11 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + }, "slice-ansi": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", @@ -1463,35 +1805,21 @@ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" } }, "strip-final-newline": { @@ -1508,18 +1836,26 @@ } }, "supports-hyperlinks": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-1.0.1.tgz", - "integrity": "sha512-HHi5kVSefKaJkGYXbDuKbUGRVxqnWGn3J2e39CYcNJEfWciGq2zYtOhXLTlvrOZW1QU7VX67w7fMmWafHX9Pfw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz", + "integrity": "sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA==", "requires": { - "has-flag": "^2.0.0", - "supports-color": "^5.0.0" + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" }, "dependencies": { "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } } } }, @@ -1528,15 +1864,36 @@ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, "tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" }, "type-fest": { "version": "0.11.0", @@ -1581,42 +1938,27 @@ } }, "widest-line": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", "requires": { - "string-width": "^2.1.1" + "string-width": "^4.0.0" } }, "wrap-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", - "integrity": "sha512-uMTsj9rDb0/7kk1PbcbCcwvHUxp60fGDB/NNXpVa0Q+ic/e7y5+BwTxKfQ33VYgDppSwi/FBzpetYzo8s6tfbg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yaml": { "version": "1.10.0", diff --git a/package.json b/package.json index 3d7b99c5..f91eb691 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,6 @@ "doc-netlify": "npm run doc-prepare && kuzdoc repo:build -d / -v 1" }, "dependencies": { - "kuzdoc": "^1.2.2" + "kuzdoc": "^1.4.5" } } diff --git a/src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt b/src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt index adfb1146..d0479455 100644 --- a/src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt +++ b/src/main/kotlin/io/kuzzle/sdk/Kuzzle.kt @@ -15,7 +15,7 @@ import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.responses.Response import io.kuzzle.sdk.protocol.AbstractProtocol import io.kuzzle.sdk.protocol.ProtocolState -import java.util.* +import java.util.UUID import java.util.concurrent.CompletableFuture import kotlin.collections.HashMap diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/AuthController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/AuthController.kt index c3ef615d..ff423f2c 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/AuthController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/AuthController.kt @@ -1,13 +1,31 @@ package io.kuzzle.sdk.controllers import io.kuzzle.sdk.Kuzzle +import io.kuzzle.sdk.coreClasses.SearchResult +import io.kuzzle.sdk.coreClasses.lang.Lang import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import io.kuzzle.sdk.coreClasses.responses.Response -import java.util.* import java.util.concurrent.CompletableFuture class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { + fun checkRights( + requestPayload: Map + ): CompletableFuture { + val query = KuzzleMap().apply { + put("controller", "auth") + put("action", "checkRights") + put("body", requestPayload) + } + return kuzzle + .query(query) + .thenApplyAsync { response -> + KuzzleMap + .from(response.result as Map) + .getBoolean("allowed") as Boolean + } + } + fun checkToken( token: String ): CompletableFuture> { @@ -165,6 +183,34 @@ class AuthController(kuzzle: Kuzzle) : BaseController(kuzzle) { } } + @JvmOverloads + fun searchApiKeys( + query: Map, + from: Int = 0, + size: Int? = null, + lang: Lang = Lang.ELASTICSEARCH + ): CompletableFuture { + val query = KuzzleMap().apply { + put("controller", "auth") + put("action", "searchApiKeys") + put("body", query) + put("from", from) + put("size", size) + put("lang", lang.lang) + } + return kuzzle + .query(query) + .thenApplyAsync { response -> SearchResult(kuzzle, query, null, from, size, lang.lang, response) } + } + + fun searchApiKeys( + query: Map, + lang: Lang = Lang.ELASTICSEARCH + ): CompletableFuture { + + return searchApiKeys(query, 0, null, lang) + } + fun updateMyCredentials( strategy: String, credentials: Map diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/CollectionController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/CollectionController.kt index a25fbe0f..da0523c8 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/CollectionController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/CollectionController.kt @@ -151,7 +151,7 @@ class CollectionController(kuzzle: Kuzzle) : BaseController(kuzzle) { } return kuzzle .query(query) - .thenApplyAsync { response -> SearchResult(kuzzle, query, scroll, from, size, response) } + .thenApplyAsync { response -> SearchResult(kuzzle, query, scroll, from, size, null, response) } } fun truncate( diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/DocumentController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/DocumentController.kt index db793c32..90c71dbb 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/DocumentController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/DocumentController.kt @@ -3,6 +3,7 @@ package io.kuzzle.sdk.controllers import com.google.gson.internal.LazilyParsedNumber import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.coreClasses.SearchResult +import io.kuzzle.sdk.coreClasses.lang.Lang import io.kuzzle.sdk.coreClasses.maps.KuzzleMap import java.util.concurrent.CompletableFuture @@ -85,7 +86,6 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { put("_id", id) put("waitForRefresh", waitForRefresh) } - return kuzzle .query(query) .thenApplyAsync { response -> response.result as Map } @@ -96,7 +96,8 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { index: String, collection: String, searchQuery: Map, - waitForRefresh: Boolean? = null + waitForRefresh: Boolean? = null, + lang: Lang = Lang.ELASTICSEARCH ): CompletableFuture> { val query = KuzzleMap().apply { put("index", index) @@ -105,12 +106,23 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { put("action", "deleteByQuery") put("body", searchQuery) put("waitForRefresh", waitForRefresh) + put("lang", lang.lang) } return kuzzle .query(query) .thenApplyAsync { response -> (response.result as Map)["ids"] as ArrayList } } + fun deleteByQuery( + index: String, + collection: String, + searchQuery: Map, + lang: Lang = Lang.ELASTICSEARCH + ): CompletableFuture> { + + return deleteByQuery(index, collection, searchQuery, null, lang) + } + fun exists( index: String, collection: String, @@ -284,7 +296,6 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { put("_id", id) put("waitForRefresh", waitForRefresh) } - return kuzzle .query(query) .thenApplyAsync { response -> response.result as Map } @@ -297,7 +308,8 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { searchQuery: Map, scroll: String? = null, size: Int? = null, - from: Int = 0 + from: Int = 0, + lang: Lang = Lang.ELASTICSEARCH ): CompletableFuture { val query = KuzzleMap().apply { put("index", index) @@ -308,14 +320,38 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { put("from", from) put("size", size) put("scroll", scroll) + put("lang", lang.lang) } + if (scroll != null) { query["scroll"] = scroll } return kuzzle .query(query) - .thenApplyAsync { response -> SearchResult(kuzzle, query, scroll, from, size, response) } + .thenApplyAsync { response -> SearchResult(kuzzle, query, scroll, from, size, lang.lang, response) } + } + + fun search( + index: String, + collection: String, + searchQuery: Map, + size: Int? = null, + from: Int = 0, + lang: Lang = Lang.ELASTICSEARCH + ): CompletableFuture { + + return search(index, collection, searchQuery, null, size, from, lang) + } + + fun search( + index: String, + collection: String, + searchQuery: Map, + lang: Lang = Lang.ELASTICSEARCH + ): CompletableFuture { + + return search(index, collection, searchQuery, null, null, 0, lang) } fun search( @@ -326,7 +362,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { from: Int = 0 ): CompletableFuture { - return search(index, collection, searchQuery, null, size, from) + return search(index, collection, searchQuery, null, size, from, Lang.ELASTICSEARCH) } @JvmOverloads @@ -363,7 +399,8 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { changes: Map, waitForRefresh: Boolean? = null, retryOnConflict: Int? = null, - source: Boolean? = null + source: Boolean? = null, + lang: Lang = Lang.ELASTICSEARCH ): CompletableFuture>> { val query = KuzzleMap().apply { put("index", index) @@ -380,6 +417,7 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { put("source", source) put("retryOnConflict", retryOnConflict) put("waitForRefresh", waitForRefresh) + put("lang", lang.lang) } return kuzzle @@ -387,6 +425,17 @@ class DocumentController(kuzzle: Kuzzle) : BaseController(kuzzle) { .thenApplyAsync { response -> response.result as Map> } } + fun updateByQuery( + index: String, + collection: String, + searchQuery: Map, + changes: Map, + lang: Lang = Lang.ELASTICSEARCH + ): CompletableFuture>> { + + return updateByQuery(index, collection, searchQuery, changes, null, null, null, lang) + } + fun validate( index: String, collection: String, diff --git a/src/main/kotlin/io/kuzzle/sdk/controllers/IndexController.kt b/src/main/kotlin/io/kuzzle/sdk/controllers/IndexController.kt index d7ddb9b5..80ceb277 100644 --- a/src/main/kotlin/io/kuzzle/sdk/controllers/IndexController.kt +++ b/src/main/kotlin/io/kuzzle/sdk/controllers/IndexController.kt @@ -2,7 +2,6 @@ package io.kuzzle.sdk.controllers import io.kuzzle.sdk.Kuzzle import io.kuzzle.sdk.coreClasses.maps.KuzzleMap -import java.util.* import java.util.concurrent.CompletableFuture class IndexController(kuzzle: Kuzzle) : BaseController(kuzzle) { diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/SearchResult.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/SearchResult.kt index fe2afda4..7171c500 100644 --- a/src/main/kotlin/io/kuzzle/sdk/coreClasses/SearchResult.kt +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/SearchResult.kt @@ -11,6 +11,7 @@ class SearchResult { private var scroll: String? = null private var from: Int = 0 private var size: Int? = null + private var lang: String? = "elasticsearch" private var request: Map? = null private val scrollAction = "scroll" private var kuzzle: Kuzzle? = null @@ -27,10 +28,11 @@ class SearchResult { @JvmOverloads constructor( kuzzle: Kuzzle?, - request: KuzzleMap, + request: Map?, scroll: String? = null, from: Int = 0, size: Int? = null, + lang: String? = null, response: Response, previouslyFetched: Int? = null ) { @@ -39,6 +41,7 @@ class SearchResult { this.scroll = scroll this.from = from this.size = size + this.lang = lang this.request = request this.aggregations = (_response["result"] as Map<*, *>)["aggregations"] as Map? this.hits = (_response["result"] as Map<*, *>)["hits"] as ArrayList> @@ -98,7 +101,7 @@ class SearchResult { val request: Map = nextRequest return kuzzle!!.query(nextRequest) .thenApplyAsync( - Function { response: Response -> SearchResult(kuzzle, KuzzleMap.from(request), scroll, from, size, response, fetched) } + Function { response: Response -> SearchResult(kuzzle, KuzzleMap.from(request), scroll, from, size, lang, response, fetched) } ) } } diff --git a/src/main/kotlin/io/kuzzle/sdk/coreClasses/lang/Lang.kt b/src/main/kotlin/io/kuzzle/sdk/coreClasses/lang/Lang.kt new file mode 100644 index 00000000..b0b4a0c7 --- /dev/null +++ b/src/main/kotlin/io/kuzzle/sdk/coreClasses/lang/Lang.kt @@ -0,0 +1,6 @@ +package io.kuzzle.sdk.coreClasses.lang + +enum class Lang(val lang: String) { + KONCORDE("koncorde"), + ELASTICSEARCH("elasticsearch") +} diff --git a/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt b/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt index f373170f..569126aa 100644 --- a/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt +++ b/src/test/kotlin/io/kuzzle/sdk/protocolTest/WebSocketTests.kt @@ -11,7 +11,8 @@ import io.ktor.http.headersOf import io.ktor.util.KtorExperimentalAPI import io.kuzzle.sdk.protocol.ProtocolState import io.kuzzle.sdk.protocol.WebSocket -import org.junit.Assert.* +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotEquals import org.junit.Before import org.junit.Test