From c8c20588cb4d6c4ecc55b07689ad7a5eb3b383ee Mon Sep 17 00:00:00 2001 From: rolljee Date: Mon, 20 Nov 2023 11:11:37 +0100 Subject: [PATCH 1/8] Using docker compose instead of docker-compose in scripts --- .ci/scripts/run-monkey-tests.sh | 6 +++--- .ci/scripts/run-test-cluster.sh | 6 +++--- .github/actions/build-and-run-kuzzle/action.yml | 6 +++--- CONTRIBUTING.md | 6 +++--- README.md | 2 +- .../guides/getting-started/deploy-your-application/index.md | 2 +- vagrant/kuzzle.sh | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.ci/scripts/run-monkey-tests.sh b/.ci/scripts/run-monkey-tests.sh index 0c77e522f4..f071bf5705 100755 --- a/.ci/scripts/run-monkey-tests.sh +++ b/.ci/scripts/run-monkey-tests.sh @@ -15,16 +15,16 @@ npm install --unsafe-perm if [ "$REBUILD" == "true" ]; then - docker-compose -f ./.ci/test-cluster.yml run kuzzle_node_1 npm rebuild + docker compose -f ./.ci/test-cluster.yml run kuzzle_node_1 npm rebuild fi npm run build-ts echo "[$(date)] - Starting Kuzzle Cluster..." -trap 'docker-compose -f ./.ci/test-cluster.yml logs' err +trap 'docker compose -f ./.ci/test-cluster.yml logs' err -docker-compose -f ./.ci/test-cluster.yml up -d +docker compose -f ./.ci/test-cluster.yml up -d # don't wait on 7512: nginx will accept connections far before Kuzzle does KUZZLE_PORT=17510 ./bin/wait-kuzzle diff --git a/.ci/scripts/run-test-cluster.sh b/.ci/scripts/run-test-cluster.sh index 50836b7808..4395abce57 100755 --- a/.ci/scripts/run-test-cluster.sh +++ b/.ci/scripts/run-test-cluster.sh @@ -16,16 +16,16 @@ npm install if [ "$REBUILD" == "true" ]; then - docker-compose -f ./.ci/test-cluster.yml run kuzzle_node_1 npm rebuild + docker compose -f ./.ci/test-cluster.yml run kuzzle_node_1 npm rebuild fi npm run build-ts echo "[$(date)] - Starting Kuzzle Cluster..." -trap 'docker-compose -f ./.ci/test-cluster.yml logs' err +trap 'docker compose -f ./.ci/test-cluster.yml logs' err -docker-compose -f ./.ci/test-cluster.yml up -d +docker compose -f ./.ci/test-cluster.yml up -d # don't wait on 7512: nginx will accept connections far before Kuzzle does KUZZLE_PORT=17510 ./bin/wait-kuzzle diff --git a/.github/actions/build-and-run-kuzzle/action.yml b/.github/actions/build-and-run-kuzzle/action.yml index 23c1e11913..be5711e8e6 100644 --- a/.github/actions/build-and-run-kuzzle/action.yml +++ b/.github/actions/build-and-run-kuzzle/action.yml @@ -17,15 +17,15 @@ runs: shell: bash - run: | export KUZZLE_IMAGE=${{ inputs.KUZZLE_IMAGE }} - docker-compose -f ./.ci/services.yml up -d + docker compose -f ./.ci/services.yml up -d shell: bash - run: | - trap 'docker-compose -f ./.ci/services.yml logs' err + trap 'docker compose -f ./.ci/services.yml logs' err export MAX_TRIES=60 ./bin/wait-kuzzle trap - err shell: bash - - run: docker-compose -f ./.ci/services.yml down + - run: docker compose -f ./.ci/services.yml down shell: bash diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15b31de502..96b5641082 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ We use most of the [NPM Coding Style](https://www.w3resource.com/npm/npm-coding- ## Tools -For development only, we built a specific docker-compose file: `docker-compose.yml`. You can use it to profile, debug, test a variable on the fly, add breakpoints and so on, thanks to [chrome-devtools](https://developer.chrome.com/devtools). +For development only, we built a specific docker- ompose file: `docker-compose.yml`. You can use it to profile, debug, test a variable on the fly, add breakpoints and so on, thanks to [chrome-devtools](https://developer.chrome.com/devtools). Check the logs at the start of Kuzzle using the development docker image to get the appropriate debug URL. How to run the development stack (needs Docker 1.10+ and Docker Compose 1.8+): @@ -36,7 +36,7 @@ git clone git@github.com:kuzzleio/kuzzle.git cd kuzzle # Start a kuzzle cluster with development tools enabled -docker-compose up +docker compose up ``` ### ENOSPC error @@ -98,7 +98,7 @@ See our [plugins documentation](https://docs.kuzzle.io/core/2/plugins/) ### Using docker, with Kuzzle running in Docker ```bash -$ docker-compose up -d +$ docker compose up -d # Wait for Kuzzle stack to be up, and start the entire test suite (long) $ npm run test diff --git a/README.md b/README.md index 3e13784c83..91e09c4634 100644 --- a/README.md +++ b/README.md @@ -142,5 +142,5 @@ Run the following command to install all the dependencies in your container: npm run docker:install ``` -finally run the command `docker-compose up` to launch your kuzzle stack. +finally run the command `docker compose up` to launch your kuzzle stack. diff --git a/doc/2/guides/getting-started/deploy-your-application/index.md b/doc/2/guides/getting-started/deploy-your-application/index.md index 008f50ee43..654add56b6 100644 --- a/doc/2/guides/getting-started/deploy-your-application/index.md +++ b/doc/2/guides/getting-started/deploy-your-application/index.md @@ -150,7 +150,7 @@ $ ssh @ [...] -$ docker-compose -f deployment/docker-compose.yml up -d +$ docker compose -f deployment/docker-compose.yml up -d ``` Your Kuzzle application is now up and running on port 7512! diff --git a/vagrant/kuzzle.sh b/vagrant/kuzzle.sh index 4b0aa8b8a5..a54ca6418d 100644 --- a/vagrant/kuzzle.sh +++ b/vagrant/kuzzle.sh @@ -10,4 +10,4 @@ echo "launching kuzzle" cd /vagrant -docker-compose -p kuzzle up -d \ No newline at end of file +docker compose -p kuzzle up -d \ No newline at end of file From 0293dc4f1508c855f1447ccf69f36a1a696ab9da Mon Sep 17 00:00:00 2001 From: rolljee Date: Mon, 20 Nov 2023 11:43:39 +0100 Subject: [PATCH 2/8] Use npm ci instead of npm install in ci to avoid issue --- .ci/scripts/install-aarch64-deps.sh | 4 +- .ci/scripts/install-armhf-deps.sh | 4 +- .ci/scripts/install-plugins.sh | 1 - .ci/scripts/run-monkey-tests.sh | 2 +- .ci/scripts/run-test-cluster.sh | 2 +- .ci/scripts/run-test.sh | 2 +- .ci/test-aarch64.yml | 8 --- .ci/test-armhf.yml | 8 --- .ci/test-cluster.yml | 8 --- .ci/test.yml | 8 --- .../actions/build-and-run-kuzzle/action.yml | 7 ++- .github/actions/dockerhub/action.yml | 3 +- .github/actions/es-lint/action.yml | 3 +- .github/actions/unit-tests/action.yml | 5 +- .github/workflows/workflow-deployments.yaml | 4 +- .github/workflows/workflow.yaml | 2 +- README.md | 12 +++-- .../deploy-your-application/index.md | 6 +-- .../getting-started/run-kuzzle/index.md | 51 ++++++++++++------- docker/images/kuzzle/Dockerfile | 4 +- docker/images/kuzzle/README.md | 4 +- docker/images/plugin-dev/Dockerfile | 4 +- docker/scripts/run-plugin.sh | 4 +- package.json | 2 +- 24 files changed, 77 insertions(+), 81 deletions(-) diff --git a/.ci/scripts/install-aarch64-deps.sh b/.ci/scripts/install-aarch64-deps.sh index 1c41c56333..4eb3a1632b 100755 --- a/.ci/scripts/install-aarch64-deps.sh +++ b/.ci/scripts/install-aarch64-deps.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # WARNING: This script needs to be run in sdk-cross:node8-armhf image # Install Kuzzle deps using cross build toolchain -npm install --target_arch=arm64 --target_platform=linux --silent --unsafe-perm \ +npm ci --target_arch=arm64 --target_platform=linux --silent --unsafe-perm \ --build-from-source=boost-geospatial-index \ --build-from-source=espresso-logic-minimizer \ --build-from-source=unix-dgram \ @@ -9,4 +9,4 @@ npm install --target_arch=arm64 --target_platform=linux --silent --unsafe-perm --build-from-source=murmurhash-native \ --build-from-source=dumpme \ --build-from-source=cucumber-expressions -npm install --only=dev --target_arch=arm64 --target_platfrom=linux --unsafe-perm --silent +npm ci --only=dev --target_arch=arm64 --target_platfrom=linux --unsafe-perm --silent diff --git a/.ci/scripts/install-armhf-deps.sh b/.ci/scripts/install-armhf-deps.sh index 10fd403cdc..81094d09f3 100755 --- a/.ci/scripts/install-armhf-deps.sh +++ b/.ci/scripts/install-armhf-deps.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # WARNING: This script needs to be run in sdk-cross:node8-armhf image # Install Kuzzle deps using cross build toolchain -npm install --target_arch=arm --target_platform=linux --silent --unsafe-perm \ +npm ci --target_arch=arm --target_platform=linux --silent --unsafe-perm \ --build-from-source=boost-geospatial-index \ --build-from-source=espresso-logic-minimizer \ --build-from-source=unix-dgram \ @@ -9,4 +9,4 @@ npm install --target_arch=arm --target_platform=linux --silent --unsafe-perm \ --build-from-source=murmurhash-native \ --build-from-source=dumpme \ --build-from-source=cucumber-expressions -npm install --only=dev --target_arch=arm --target_platfrom=linux --unsafe-perm --silent +npm ci --only=dev --target_arch=arm --target_platfrom=linux --unsafe-perm --silent diff --git a/.ci/scripts/install-plugins.sh b/.ci/scripts/install-plugins.sh index a43e7d9445..727a15cef6 100755 --- a/.ci/scripts/install-plugins.sh +++ b/.ci/scripts/install-plugins.sh @@ -8,7 +8,6 @@ protocols_dir="protocols/enabled" cd "$working_dir" -# npm install plugins for target in ${plugins_dir}/* ${protocols_dir}/* ; do if [ -d "$target" ]; then echo 'Installing dependencies for ' $(basename "$target") diff --git a/.ci/scripts/run-monkey-tests.sh b/.ci/scripts/run-monkey-tests.sh index f071bf5705..764c76b2ac 100755 --- a/.ci/scripts/run-monkey-tests.sh +++ b/.ci/scripts/run-monkey-tests.sh @@ -11,7 +11,7 @@ fi echo "Testing Kuzzle against node v$NODE_VERSION" echo "Installing dependencies..." -npm install --unsafe-perm +npm ci --unsafe-perm if [ "$REBUILD" == "true" ]; then diff --git a/.ci/scripts/run-test-cluster.sh b/.ci/scripts/run-test-cluster.sh index 4395abce57..fd792f8aca 100755 --- a/.ci/scripts/run-test-cluster.sh +++ b/.ci/scripts/run-test-cluster.sh @@ -12,7 +12,7 @@ fi echo "Testing Kuzzle against node v$NODE_VERSION" echo "Installing dependencies..." -npm install +npm ci if [ "$REBUILD" == "true" ]; then diff --git a/.ci/scripts/run-test.sh b/.ci/scripts/run-test.sh index 0a6f29f7d5..0739e58629 100755 --- a/.ci/scripts/run-test.sh +++ b/.ci/scripts/run-test.sh @@ -11,7 +11,7 @@ fi echo "Testing Kuzzle against node v$NODE_VERSION" n $NODE_VERSION -npm install --silent --unsafe-perm +npm ci --silent --unsafe-perm npm run build diff --git a/.ci/test-aarch64.yml b/.ci/test-aarch64.yml index 342cd46452..62ff0109de 100644 --- a/.ci/test-aarch64.yml +++ b/.ci/test-aarch64.yml @@ -26,14 +26,6 @@ services: - DEBUG= - SECRETS_FILE_PREFIX=/var/app/ - KUZZLE_FUNCTIONAL_TESTS=${KUZZLE_FUNCTIONAL_TESTS:-test:functional} - # Travis env var must be propagated into the container - - TRAVIS - - TRAVIS_COMMIT - - TRAVIS_JOB_NUMBER - - TRAVIS_BRANCH - - TRAVIS_JOB_ID - - TRAVIS_PULL_REQUEST - - TRAVIS_REPO_SLUG redis: image: redis:6 diff --git a/.ci/test-armhf.yml b/.ci/test-armhf.yml index dc5acaea2a..ef40a31690 100644 --- a/.ci/test-armhf.yml +++ b/.ci/test-armhf.yml @@ -26,14 +26,6 @@ services: - DEBUG= - SECRETS_FILE_PREFIX=/var/app/ - KUZZLE_FUNCTIONAL_TESTS=${KUZZLE_FUNCTIONAL_TESTS:-test:functional} - # Travis env var must be propagated into the container - - TRAVIS - - TRAVIS_COMMIT - - TRAVIS_JOB_NUMBER - - TRAVIS_BRANCH - - TRAVIS_JOB_ID - - TRAVIS_PULL_REQUEST - - TRAVIS_REPO_SLUG redis: image: redis:6 diff --git a/.ci/test-cluster.yml b/.ci/test-cluster.yml index 6db59e6e89..fae78c3c8a 100644 --- a/.ci/test-cluster.yml +++ b/.ci/test-cluster.yml @@ -31,14 +31,6 @@ x-kuzzle-config: &kuzzle-config - NODE_VERSION=${NODE_VERSION:-} - DEBUG=none - SECRETS_FILE_PREFIX=/var/app/ - # Travis env var must be propagated into the container - - TRAVIS - - TRAVIS_COMMIT - - TRAVIS_JOB_NUMBER - - TRAVIS_BRANCH - - TRAVIS_JOB_ID - - TRAVIS_PULL_REQUEST - - TRAVIS_REPO_SLUG # cluster - kuzzle_plugins__cluster__privileged=true - kuzzle_plugins__cluster__minimumNodes=3 diff --git a/.ci/test.yml b/.ci/test.yml index 3800dbaf4a..36df36310d 100644 --- a/.ci/test.yml +++ b/.ci/test.yml @@ -34,14 +34,6 @@ services: - SECRETS_FILE_PREFIX=/var/app/ - KUZZLE_FUNCTIONAL_TESTS=${KUZZLE_FUNCTIONAL_TESTS:-test:functional} - KUZZLE_COMMAND - # Travis env var must be propagated into the container - - TRAVIS - - TRAVIS_COMMIT - - TRAVIS_JOB_NUMBER - - TRAVIS_BRANCH - - TRAVIS_JOB_ID - - TRAVIS_PULL_REQUEST - - TRAVIS_REPO_SLUG redis: image: redis:6 diff --git a/.github/actions/build-and-run-kuzzle/action.yml b/.github/actions/build-and-run-kuzzle/action.yml index be5711e8e6..69050e15f0 100644 --- a/.github/actions/build-and-run-kuzzle/action.yml +++ b/.github/actions/build-and-run-kuzzle/action.yml @@ -9,16 +9,20 @@ inputs: runs: using: "composite" steps: - - run: npm install + - run: npm ci shell: bash + - run: npm run build shell: bash + - run: npm prune --production shell: bash + - run: | export KUZZLE_IMAGE=${{ inputs.KUZZLE_IMAGE }} docker compose -f ./.ci/services.yml up -d shell: bash + - run: | trap 'docker compose -f ./.ci/services.yml logs' err @@ -27,5 +31,6 @@ runs: trap - err shell: bash + - run: docker compose -f ./.ci/services.yml down shell: bash diff --git a/.github/actions/dockerhub/action.yml b/.github/actions/dockerhub/action.yml index 8108b88295..0a491051c8 100644 --- a/.github/actions/dockerhub/action.yml +++ b/.github/actions/dockerhub/action.yml @@ -17,9 +17,10 @@ runs: steps: - name: Create JS from TS files run: | - npm install + npm ci npm run build-ts shell: bash + - name: Build and deploy Docker images run: | ./docker/build-docker-images.sh diff --git a/.github/actions/es-lint/action.yml b/.github/actions/es-lint/action.yml index 47c172b6d4..ba5f0d26ac 100644 --- a/.github/actions/es-lint/action.yml +++ b/.github/actions/es-lint/action.yml @@ -4,7 +4,8 @@ description: Run ESLint runs: using: "composite" steps: - - run: npm install + - run: npm ci shell: bash + - run: npm run test:lint shell: bash diff --git a/.github/actions/unit-tests/action.yml b/.github/actions/unit-tests/action.yml index 4f75b3f39d..e075c368bc 100644 --- a/.github/actions/unit-tests/action.yml +++ b/.github/actions/unit-tests/action.yml @@ -4,11 +4,14 @@ description: Run Node.js unit tests runs: using: "composite" steps: - - run: npm install + - run: npm ci shell: bash + - run: npm run build shell: bash + - run: npm run test:unit shell: bash + - run: npm run codecov shell: bash diff --git a/.github/workflows/workflow-deployments.yaml b/.github/workflows/workflow-deployments.yaml index 8601f2c366..aec96ca014 100644 --- a/.github/workflows/workflow-deployments.yaml +++ b/.github/workflows/workflow-deployments.yaml @@ -120,7 +120,7 @@ jobs: echo "::set-output name=major-version::$(jq -r .version package.json | cut -d. -f 1)" - name: Build TS files run: | - npm install + npm ci npm run build-ts - name: Build and push uses: docker/build-push-action@v2 @@ -142,7 +142,7 @@ jobs: with: node-version: ${{ inputs.node_lts_maintenance_version }} registry-url: "https://registry.npmjs.org" - - run: npm install + - run: npm ci - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 1dcfdcde03..d2b51e070c 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/install-packages - - run: npm install + - run: npm ci - name: Test error codes run: ./.ci/scripts/check-error-codes-documentation.sh diff --git a/README.md b/README.md index 91e09c4634..642199998e 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,19 @@ Check out our [support plans](https://kuzzle.io/pricing/). The easiest way to start a Kuzzle application is to use [Kourou](https://github.com/kuzzleio/kourou): ```bash -npx kourou app:scaffold playground +kourou app:scaffold playground 🚀 Kourou - Scaffolds a new Kuzzle application - ✔ Creating and rendering application files +generic + ✔ Checking destination + ✔ Prepare temporary folder + ✔ Cloning template repository + ✔ Copying template files + ✔ Cleaning up - [✔] Scaffolding complete! Use cd playground && npm run docker npm install install dependencies and then npm run docker:dev to run your application! + [✔] Scaffolding complete! + [✔] Use cd playground && docker compose up -d to start your Kuzzle stack. ``` Then you need to run Kuzzle services, Elasticsearch and Redis: `kourou app:start-services` diff --git a/doc/2/guides/getting-started/deploy-your-application/index.md b/doc/2/guides/getting-started/deploy-your-application/index.md index 654add56b6..48b44c29a0 100644 --- a/doc/2/guides/getting-started/deploy-your-application/index.md +++ b/doc/2/guides/getting-started/deploy-your-application/index.md @@ -112,7 +112,7 @@ Create the `deployment/kuzzle.dockerfile` file with the following content: ```dockerfile # builder image -FROM node:12.18.1-stretch-slim as builder +FROM node:18 as builder RUN set -x \ && apt-get update && apt-get install -y \ @@ -126,10 +126,10 @@ ADD . /var/app WORKDIR /var/app -RUN npm install && npm run build && npm prune --production +RUN npm ci && npm run build && npm prune --production # run image -FROM node:12.18.1-stretch-slim +FROM node:18 COPY --from=builder /var/app /var/app diff --git a/doc/2/guides/getting-started/run-kuzzle/index.md b/doc/2/guides/getting-started/run-kuzzle/index.md index 7ccd8b5e33..2ea68cf754 100644 --- a/doc/2/guides/getting-started/run-kuzzle/index.md +++ b/doc/2/guides/getting-started/run-kuzzle/index.md @@ -53,27 +53,45 @@ kourou app:scaffold playground 🚀 Kourou - Scaffolds a new Kuzzle application - ✔ Creating and rendering application files - - [✔] Scaffolding complete! Use cd playground && npm run docker npm install install dependencies and then npm run docker:dev to run your application! - +generic + ✔ Checking destination + ✔ Prepare temporary folder + ✔ Cloning template repository + ✔ Copying template files + ✔ Cleaning up + + [✔] Scaffolding complete! + [✔] Use cd playground && docker compose up -d to start your Kuzzle stack. ``` This will create the following files and directories: ``` -playground/ -├── lib < application code -├── .eslintignore -├── .gitignore -├── .eslintrc-ts.json -├── .eslintrc.json -├── app.ts < application entrypoint -├── docker-compose.yml < Docker Compose configuration -├── ergol.config.json -├── package.json +. ├── Dockerfile ├── README.md +├── app.ts +├── docker-compose.yml +├── environments +│   ├── local +│   │   ├── kourou.env +│   │   └── kuzzlerc +│   └── main +│   ├── kourou.env +│   └── kuzzlerc +├── ergol.config.json +├── jest.config.ts +├── lib +│   ├── MyApplication.ts +│   └── modules +│   └── index.ts +├── package-lock.json +├── package.json +├── start.sh +├── tests +│   └── unit +│   ├── MyApplication.test.ts +│   └── utils.ts └── tsconfig.json ``` @@ -93,12 +111,9 @@ app ``` ::: info -You can now run `cd playground && npm run docker npm install install dependencies` to install dependencies. After this has run successfully, run our first application with: `npm run docker:dev`. +You can now run `cd playground && docker compose up -d` to start your application. ::: - -Under the hood, the command `npm run docker:dev` uses [nodemon](https://nodemon.io/) and [ts-node](https://www.npmjs.com/package/ts-node) inside the Docker container to run the application. - Now visit [http://localhost:7512](http://localhost:7512) with your browser. You should see the result of the [server:info](/core/2/api/controllers/server/info) action. ### Admin Console diff --git a/docker/images/kuzzle/Dockerfile b/docker/images/kuzzle/Dockerfile index 3f84de942f..d33110b583 100644 --- a/docker/images/kuzzle/Dockerfile +++ b/docker/images/kuzzle/Dockerfile @@ -27,9 +27,7 @@ WORKDIR /app ENV NODE_ENV=production # Install dependencies -RUN npm install --production \ - && npm install -g --unsafe-perm --production \ - pm2 +RUN npm ci --production ADD ./docker/scripts/clean-node.sh /usr/bin/clean-node diff --git a/docker/images/kuzzle/README.md b/docker/images/kuzzle/README.md index a84eca7004..4c78dbe9b4 100644 --- a/docker/images/kuzzle/README.md +++ b/docker/images/kuzzle/README.md @@ -10,13 +10,13 @@ You should use this image as a base build your own application: ```dockerfile # Build image -FROM node:18-bullseye-slim as builder +FROM node:18 as builder ADD . /your-plugin-name WORKDIR /your-plugin-name -RUN npm install --production +RUN npm ci --production # Final image FROM kuzzleio/kuzzle:2 diff --git a/docker/images/plugin-dev/Dockerfile b/docker/images/plugin-dev/Dockerfile index c2c2ff2128..1c147c09d8 100644 --- a/docker/images/plugin-dev/Dockerfile +++ b/docker/images/plugin-dev/Dockerfile @@ -12,7 +12,7 @@ RUN set -x \ libzmq3-dev \ libunwind-dev \ && npm install -g --unsafe-perm --production \ - nodemon \ + ergol \ kourou \ pm2 \ && curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | sh -s -- -b /usr/local/bin @@ -29,7 +29,7 @@ ADD ./.kuzzlerc.sample.jsonc /app/.kuzzlerc.sample.jsonc WORKDIR /app # Install dependencies -RUN npm install --production +RUN npm ci --production ADD ./docker/scripts/clean-node.sh /usr/bin/clean-node diff --git a/docker/scripts/run-plugin.sh b/docker/scripts/run-plugin.sh index 5cb6a69a72..ab8a18c811 100755 --- a/docker/scripts/run-plugin.sh +++ b/docker/scripts/run-plugin.sh @@ -13,7 +13,7 @@ then echo "Installing dependencies for $KUZZLE_PLUGIN_NAME" cd "$plugins_dir/$KUZZLE_PLUGIN_NAME" - npm install --unsafe-perm --force + npm ci --unsafe-perm --force # This is dirty but we are in a development environment, who cares chmod 777 node_modules/ @@ -24,7 +24,7 @@ else echo 'Installing dependencies for ' $(basename "$target") cd "$target" - npm install --unsafe-perm --force + npm ci --unsafe-perm --force # This is dirty but we are in a development environment, who cares chmod 777 node_modules/ diff --git a/package.json b/package.json index 2593b5232a..cd15507420 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dev:test": "npm run dev -- docker/scripts/start-kuzzle-test.ts --enable-plugins functional-test-plugin", "dev": "npx ergol docker/scripts/start-kuzzle-dev.ts -c ./config/ergol.config.json", "doc-error-codes": "node -r ts-node/register doc/build-error-codes", - "docker:install": "docker compose run kuzzle_node_1 npm install", + "docker:install": "docker compose run kuzzle_node_1 npm ci", "docker:npm": "docker compose run kuzzle_node_1 npm run --", "docker:test:unit": "docker compose run kuzzle_node_1 npm run test:unit", "docker": "docker compose run kuzzle_node_1 ", From 93907f36b1f9f3750bb00bc6443f84eb390ce452 Mon Sep 17 00:00:00 2001 From: rolljee Date: Mon, 20 Nov 2023 14:16:39 +0100 Subject: [PATCH 3/8] Update ci, fix packages --- .ci/scripts/run-monkey-tests.sh | 2 +- .ci/scripts/run-test-cluster.sh | 2 +- .github/actions/dockerhub/action.yml | 2 +- .github/workflows/workflow-deployments.yaml | 2 +- .gitignore | 63 +- package-lock.json | 721 +++++++++++++++----- package.json | 110 ++- 7 files changed, 631 insertions(+), 271 deletions(-) diff --git a/.ci/scripts/run-monkey-tests.sh b/.ci/scripts/run-monkey-tests.sh index 764c76b2ac..f27a9aaa74 100755 --- a/.ci/scripts/run-monkey-tests.sh +++ b/.ci/scripts/run-monkey-tests.sh @@ -18,7 +18,7 @@ then docker compose -f ./.ci/test-cluster.yml run kuzzle_node_1 npm rebuild fi -npm run build-ts +npm run build echo "[$(date)] - Starting Kuzzle Cluster..." diff --git a/.ci/scripts/run-test-cluster.sh b/.ci/scripts/run-test-cluster.sh index fd792f8aca..efda069386 100755 --- a/.ci/scripts/run-test-cluster.sh +++ b/.ci/scripts/run-test-cluster.sh @@ -19,7 +19,7 @@ then docker compose -f ./.ci/test-cluster.yml run kuzzle_node_1 npm rebuild fi -npm run build-ts +npm run build echo "[$(date)] - Starting Kuzzle Cluster..." diff --git a/.github/actions/dockerhub/action.yml b/.github/actions/dockerhub/action.yml index 0a491051c8..bd1ddacecb 100644 --- a/.github/actions/dockerhub/action.yml +++ b/.github/actions/dockerhub/action.yml @@ -18,7 +18,7 @@ runs: - name: Create JS from TS files run: | npm ci - npm run build-ts + npm run build shell: bash - name: Build and deploy Docker images diff --git a/.github/workflows/workflow-deployments.yaml b/.github/workflows/workflow-deployments.yaml index aec96ca014..036b82f08d 100644 --- a/.github/workflows/workflow-deployments.yaml +++ b/.github/workflows/workflow-deployments.yaml @@ -121,7 +121,7 @@ jobs: - name: Build TS files run: | npm ci - npm run build-ts + npm run build - name: Build and push uses: docker/build-push-action@v2 with: diff --git a/.gitignore b/.gitignore index cc7fa8286a..bfdc0cb01b 100644 --- a/.gitignore +++ b/.gitignore @@ -84,14 +84,18 @@ docker/scripts/functional-tests-controller.js docker/scripts/start-kuzzle-dev.js docker/scripts/start-kuzzle-test.js features-sdk/support/application/functional-tests-app.js -lib/api/openApiGenerator.js -lib/api/openapi/OpenApiManager.js +lib/api/controllers/authController.js +lib/api/controllers/baseController.js +lib/api/controllers/debugController.js lib/api/openapi/components/document/index.js lib/api/openapi/components/index.js +lib/api/openapi/components/security/index.js lib/api/openapi/document/index.js lib/api/openapi/index.js lib/api/openapi/openApiGenerator.js +lib/api/openapi/OpenApiManager.js lib/api/openapi/tools.js +lib/api/openApiGenerator.js lib/api/request/*.js lib/api/request/index.js lib/api/request/kuzzle-request.js @@ -103,6 +107,7 @@ lib/cluster/idCardHandler.js lib/cluster/state.js lib/cluster/workers/IDCardRenewer.js lib/config/default.config.js +lib/config/documentEventAliases.js lib/core/auth/tokenManager.js lib/core/backend/applicationManager.js lib/core/backend/backend.js @@ -116,9 +121,11 @@ lib/core/backend/backendOpenApi.js lib/core/backend/backendPipe.js lib/core/backend/backendPlugin.js lib/core/backend/backendStorage.js +lib/core/backend/backendSubscription.js lib/core/backend/backendVault.js lib/core/backend/index.js lib/core/backend/internalLogger.js +lib/core/debug/kuzzleDebugger.js lib/core/plugin/pluginContext.js lib/core/realtime/channel.js lib/core/realtime/connectionRooms.js @@ -126,7 +133,9 @@ lib/core/realtime/hotelClerk.js lib/core/realtime/room.js lib/core/realtime/subscription.js lib/core/security/profileRepository.js +lib/core/security/tokenRepository.js lib/core/shared/KoncordeWrapper.js +lib/core/shared/repository.js lib/core/shared/sdk/embeddedSdk.js lib/core/shared/sdk/funnelProtocol.js lib/core/storage/indexCache.js @@ -153,14 +162,34 @@ lib/model/security/profile.js lib/model/security/role.js lib/model/security/token.js lib/model/security/user.js +lib/types/ClientConnection.js +lib/types/config/DumpConfiguration.js +lib/types/config/HttpConfiguration.js +lib/types/config/internalCache/InternalCacheRedisConfiguration.js +lib/types/config/KuzzleConfiguration.js +lib/types/config/LimitsConfiguration.js +lib/types/config/PluginsConfiguration.js +lib/types/config/publicCache/PublicCacheRedisConfiguration.js +lib/types/config/SecurityConfiguration.js +lib/types/config/ServerConfiguration.js +lib/types/config/ServicesConfiguration.js +lib/types/config/storageEngine/StorageEngineElasticsearchConfiguration.js +lib/types/config/StorageService/StorageServiceElasticsearchConfiguration.js lib/types/Controller.js lib/types/ControllerDefinition.js lib/types/ControllerRights.js +lib/types/DebugModule.js lib/types/Deprecation.js +lib/types/errors/ErrorDefinition.js +lib/types/errors/ErrorDomains.js lib/types/EventHandler.js +lib/types/events/EventGenericDocument.js +lib/types/events/EventProtocol.js lib/types/Global.d.ts lib/types/Global.js +lib/types/HttpMessage.js lib/types/HttpStream.js +lib/types/index.js lib/types/InternalLogger.js lib/types/Kuzzle.js lib/types/KuzzleDocument.js @@ -171,6 +200,9 @@ lib/types/PluginManifest.js lib/types/Policy.js lib/types/PolicyRestrictions.js lib/types/ProfileDefinition.js +lib/types/realtime/RealtimeScope.js +lib/types/realtime/RealtimeUsers.js +lib/types/realtime/RoomList.js lib/types/RequestPayload.js lib/types/ResponsePayload.js lib/types/RoleDefinition.js @@ -178,39 +210,16 @@ lib/types/StrategyDefinition.js lib/types/Target.js lib/types/Token.js lib/types/User.js -lib/types/config/DumpConfiguration.js -lib/types/config/HttpConfiguration.js -lib/types/config/KuzzleConfiguration.js -lib/types/config/LimitsConfiguration.js -lib/types/config/PluginsConfiguration.js -lib/types/config/SecurityConfiguration.js -lib/types/config/ServerConfiguration.js -lib/types/config/ServicesConfiguration.js -lib/types/config/StorageService/StorageServiceElasticsearchConfiguration.js -lib/types/config/internalCache/InternalCacheRedisConfiguration.js -lib/types/config/publicCache/PublicCacheRedisConfiguration.js -lib/types/config/storageEngine/StorageEngineElasticsearchConfiguration.js -lib/types/errors/ErrorDefinition.js -lib/types/errors/ErrorDomains.js -lib/types/index.js -lib/types/realtime/RealtimeScope.js -lib/types/realtime/RealtimeUsers.js -lib/types/realtime/RoomList.js lib/util/array.js +lib/util/async.js lib/util/bufferedPassThrough.js lib/util/crypto.js lib/util/dump-collection.js +lib/util/esRequest.js lib/util/Inflector.js lib/util/interfaces.js lib/util/koncordeCompat.js lib/util/mutex.js lib/util/name-generator.js lib/util/readYamlFile.js -lib/api/controllers/debugController.js -lib/api/openapi/components/security/index.js -lib/config/documentEventAliases.js -lib/types/DebugModule.js lib/util/time.js -lib/util/async.js -lib/util/esRequest.js -lib/types/events/EventGenericDocument.js diff --git a/package-lock.json b/package-lock.json index ada374bceb..c4dc8ce7c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,45 +10,45 @@ "license": "Apache-2.0", "dependencies": { "@elastic/elasticsearch": "https://github.com/elastic/elasticsearch-js/archive/refs/tags/v7.13.0.tar.gz", - "aedes": "^0.46.3", - "bluebird": "^3.7.2", - "cli-color": "^2.0.3", - "cookie": "^0.5.0", - "debug": "^4.3.4", - "denque": "^2.1.0", - "didyoumean": "^1.2.2", - "dumpme": "^1.0.3", - "eventemitter3": "^4.0.7", - "inquirer": "^9.1.4", - "ioredis": "^5.3.0", - "js-yaml": "^4.1.0", - "json-stable-stringify": "^1.0.2", - "json2yaml": "^1.1.0", - "jsonwebtoken": "^8.5.1", + "aedes": "0.46.3", + "bluebird": "3.7.2", + "cli-color": "2.0.3", + "cookie": "0.5.0", + "debug": "4.3.4", + "denque": "2.1.0", + "didyoumean": "1.2.2", + "dumpme": "1.0.3", + "eventemitter3": "4.0.7", + "inquirer": "9.1.4", + "ioredis": "5.3.0", + "js-yaml": "4.1.0", + "json-stable-stringify": "1.0.2", + "json2yaml": "1.1.0", + "jsonwebtoken": "8.5.1", "koncorde": "4.3.0", "kuzzle-plugin-auth-passport-local": "6.4.0", - "kuzzle-plugin-logger": "^3.0.3", + "kuzzle-plugin-logger": "3.0.3", "kuzzle-sdk": "7.11.0", - "kuzzle-vault": "^2.0.4", + "kuzzle-vault": "2.0.4", "lodash": "4.17.21", - "long": "^5.2.1", - "moment": "^2.29.4", - "ms": "^2.1.3", - "murmurhash-native": "^3.5.0", - "ndjson": "^2.0.0", - "node-segfault-handler": "^1.4.2", - "passport": "^0.6.0", + "long": "5.2.1", + "moment": "2.29.4", + "ms": "2.1.3", + "murmurhash-native": "3.5.0", + "ndjson": "2.0.0", + "node-segfault-handler": "1.4.2", + "passport": "0.6.0", "protobufjs": "~7.2.1", "rc": "1.2.8", - "semver": "^7.3.8", - "sorted-array": "^2.0.4", + "semver": "7.3.8", + "sorted-array": "2.0.4", "uuid": "9.0.1", "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.32.0.tar.gz", "validator": "13.11.0", "winston": "3.10.0", "winston-elasticsearch": "0.17.4", - "winston-syslog": "^2.7.0", - "winston-transport": "^4.5.0", + "winston-syslog": "2.7.0", + "winston-transport": "4.5.0", "yargs": "17.7.2", "zeromq": "6.0.0-beta.6" }, @@ -56,32 +56,32 @@ "kuzzle": "bin/start-kuzzle-server" }, "devDependencies": { - "@jest/globals": "^29.4.1", - "@types/jest": "^29.4.0", - "@types/js-yaml": "^4.0.5", - "@types/lodash": "^4.14.191", - "async": "^3.2.4", - "chokidar": "^3.5.3", - "codecov": "^3.8.3", - "cucumber": "^6.0.5", - "ergol": "^1.0.2", - "eslint-plugin-kuzzle": "^0.0.6", - "jest": "^29.4.1", - "mocha": "^10.2.0", - "mock-require": "^3.0.3", - "mqtt": "^4.3.7", - "nyc": "^15.1.0", - "request": "^2.88.2", - "request-promise": "^4.2.6", - "rewire": "^5.0.0", + "@jest/globals": "29.4.1", + "@types/jest": "29.4.0", + "@types/js-yaml": "4.0.5", + "@types/lodash": "4.14.191", + "async": "3.2.4", + "chokidar": "3.5.3", + "codecov": "3.8.3", + "cucumber": "6.0.5", + "ergol": "1.0.2", + "eslint-plugin-kuzzle": "0.0.6", + "jest": "29.4.1", + "mocha": "10.2.0", + "mock-require": "3.0.3", + "mqtt": "4.3.7", + "nyc": "15.1.0", + "request": "2.88.2", + "request-promise": "4.2.6", + "rewire": "5.0.0", "should": "13.2.3", "should-sinon": "0.0.6", - "sinon": "^14.0.2", + "sinon": "14.0.2", "strip-json-comments": "https://github.com/sindresorhus/strip-json-comments/archive/refs/tags/v3.1.1.tar.gz", - "ts-jest": "^29.0.5", - "ts-node": "^10.9.1", - "typescript": "^4.9.5", - "yaml": "^2.2.1" + "ts-jest": "29.0.5", + "ts-node": "10.9.1", + "typescript": "4.9.5", + "yaml": "2.2.1" }, "engines": { "node": ">= 12.13.0" @@ -1300,15 +1300,15 @@ } }, "node_modules/@jest/globals": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", - "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "version": "29.4.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.4.1.tgz", + "integrity": "sha512-znoK2EuFytbHH0ZSf2mQK2K1xtIgmaw4Da21R2C/NE/+NnItm5mPEFQmn8gmF3f0rfOlmZ3Y3bIf7bFj7DHxAA==", "dev": true, "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" + "@jest/environment": "^29.4.1", + "@jest/expect": "^29.4.1", + "@jest/types": "^29.4.1", + "jest-mock": "^29.4.1" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -1504,17 +1504,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@ljharb/through": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/@ljharb/through/-/through-2.3.11.tgz", - "integrity": "sha512-ccfcIDlogiXNq5KcbAwbaO7lMh3Tm1i3khMPYpxlK8hH/W53zN81KM9coerRLOnTGu3nfXIniAmQbRI9OxbC0w==", - "dependencies": { - "call-bind": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1847,9 +1836,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", - "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", + "version": "29.4.0", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.4.0.tgz", + "integrity": "sha512-VaywcGQ9tPorCX/Jkkni7RWGFfI11whqzs8dvxF41P17Z+z872thvEvlIbznjPJ02kl1HMX3LmLOonsj2n7HeQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -1857,9 +1846,9 @@ } }, "node_modules/@types/js-yaml": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.8.tgz", - "integrity": "sha512-m6jnPk1VhlYRiLFm3f8X9Uep761f+CK8mHyS65LutH2OhmBF0BeMEjHgg05usH8PLZMWWc/BUR9RPmkvpWnyRA==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.5.tgz", + "integrity": "sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA==", "dev": true }, "node_modules/@types/json-schema": { @@ -1869,9 +1858,9 @@ "dev": true }, "node_modules/@types/lodash": { - "version": "4.14.200", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.200.tgz", - "integrity": "sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q==", + "version": "4.14.191", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.191.tgz", + "integrity": "sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==", "dev": true }, "node_modules/@types/node": { @@ -2309,6 +2298,7 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -2323,6 +2313,7 @@ "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, "engines": { "node": ">=10" }, @@ -3233,6 +3224,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "optional": true, "dependencies": { "function-bind": "^1.1.2", "get-intrinsic": "^1.2.1", @@ -3290,6 +3282,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3395,6 +3388,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, "dependencies": { "restore-cursor": "^3.1.0" }, @@ -3787,9 +3781,9 @@ } }, "node_modules/cucumber": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/cucumber/-/cucumber-6.0.7.tgz", - "integrity": "sha512-pN3AgWxHx8rOi+wOlqjASNETOjf3TgeyqhMNLQam7nSTXgQzju1oAmXkleRQRcXvpVvejcDHiZBLFSfBkqbYpA==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cucumber/-/cucumber-6.0.5.tgz", + "integrity": "sha512-x+W9Fwk6TvcapQsYMxwFU5AsQJDOIJVGrPKmH15OC7jzb9/Dk7Hb0ZAyw4WcpaDcUDRc8bi2k2yJejDp5eTRlg==", "deprecated": "Cucumber is publishing new releases under @cucumber/cucumber", "dev": true, "dependencies": { @@ -3968,6 +3962,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "optional": true, "dependencies": { "get-intrinsic": "^1.2.1", "gopd": "^1.0.1", @@ -5360,6 +5355,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "devOptional": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5474,6 +5470,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "optional": true, "dependencies": { "function-bind": "^1.1.2", "has-proto": "^1.0.1", @@ -5633,6 +5630,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "optional": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -5687,6 +5685,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -5695,6 +5694,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "optional": true, "dependencies": { "get-intrinsic": "^1.2.2" }, @@ -5706,6 +5706,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "optional": true, "engines": { "node": ">= 0.4" }, @@ -5717,6 +5718,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "optional": true, "engines": { "node": ">= 0.4" }, @@ -5773,6 +5775,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "devOptional": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -6028,28 +6031,64 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/inquirer": { - "version": "9.2.11", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.11.tgz", - "integrity": "sha512-B2LafrnnhbRzCWfAdOXisUzL89Kg8cVJlYmhqoi3flSiV/TveO+nsXwgKr9h9PIo+J1hz7nBSk6gegRIMBBf7g==", - "dependencies": { - "@ljharb/through": "^2.3.9", - "ansi-escapes": "^4.3.2", - "chalk": "^5.3.0", - "cli-cursor": "^3.1.0", - "cli-width": "^4.1.0", - "external-editor": "^3.1.0", + "version": "9.1.4", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.1.4.tgz", + "integrity": "sha512-9hiJxE5gkK/cM2d1mTEnuurGTAoHebbkX0BYl3h7iEg7FYfuNIom+nDfBCSWtvSnoSrWCeBxqqBZu26xdlJlXA==", + "dependencies": { + "ansi-escapes": "^6.0.0", + "chalk": "^5.1.2", + "cli-cursor": "^4.0.0", + "cli-width": "^4.0.0", + "external-editor": "^3.0.3", "figures": "^5.0.0", "lodash": "^4.17.21", - "mute-stream": "1.0.0", - "ora": "^5.4.1", - "run-async": "^3.0.0", - "rxjs": "^7.8.1", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^6.2.0" + "mute-stream": "0.0.8", + "ora": "^6.1.2", + "run-async": "^2.4.0", + "rxjs": "^7.5.7", + "string-width": "^5.1.2", + "strip-ansi": "^7.0.1", + "through": "^2.3.6", + "wrap-ansi": "^8.0.1" }, "engines": { - "node": ">=14.18.0" + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-escapes": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "dependencies": { + "type-fest": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/inquirer/node_modules/chalk": { @@ -6063,6 +6102,25 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/inquirer/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, "node_modules/inquirer/node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", @@ -6089,14 +6147,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inquirer/node_modules/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==", - "engines": { - "node": ">=8" - } - }, "node_modules/inquirer/node_modules/is-unicode-supported": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", @@ -6108,17 +6158,76 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/inquirer/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/inquirer/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/install-artifact-from-github": { @@ -6145,9 +6254,9 @@ } }, "node_modules/ioredis": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", - "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.0.tgz", + "integrity": "sha512-Id9jKHhsILuIZpHc61QkagfVdUj2Rag5GzG1TGEvRNeM7dtTOjICgjC+tvqYxi//PuX2wjQ+Xjva2ONBuf92Pw==", "dependencies": { "@ioredis/commands": "^1.1.1", "cluster-key-slot": "^1.1.0", @@ -6337,11 +6446,14 @@ } }, "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-lambda": { @@ -6518,6 +6630,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, "engines": { "node": ">=10" }, @@ -6600,6 +6713,39 @@ "node": ">=10" } }, + "node_modules/istanbul-lib-instrument/node_modules/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==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/istanbul-lib-processinfo": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", @@ -6685,15 +6831,15 @@ } }, "node_modules/jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", - "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "version": "29.4.1", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.4.1.tgz", + "integrity": "sha512-cknimw7gAXPDOmj0QqztlxVtBVCw2lYY9CeIE5N6kD+kET1H4H79HSNISJmijb1HF+qk+G+ploJgiDi5k/fRlg==", "dev": true, "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/core": "^29.4.1", + "@jest/types": "^29.4.1", "import-local": "^3.0.2", - "jest-cli": "^29.7.0" + "jest-cli": "^29.4.1" }, "bin": { "jest": "bin/jest.js" @@ -7113,6 +7259,21 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-runtime/node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/jest-snapshot": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", @@ -7144,6 +7305,39 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-snapshot/node_modules/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==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-snapshot/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/jest-util": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", @@ -7735,6 +7929,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -7771,9 +7966,9 @@ } }, "node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" }, "node_modules/lower-case": { "version": "1.1.4", @@ -7813,6 +8008,39 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/make-dir/node_modules/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==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -8546,12 +8774,9 @@ } }, "node_modules/mute-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", - "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, "node_modules/mz": { "version": "2.7.0", @@ -9433,27 +9658,118 @@ } }, "node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", - "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.1.tgz", + "integrity": "sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==", + "dependencies": { + "chalk": "^5.0.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.1", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "strip-ansi": "^7.0.1", "wcwidth": "^1.0.1" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ora/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/log-symbols": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "dependencies": { + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/original-url": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/original-url/-/original-url-1.2.3.tgz", @@ -10405,6 +10721,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -10863,12 +11180,6 @@ "node": ">= 0.8.0" } }, - "node_modules/rewire/node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, "node_modules/rewire/node_modules/optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -10916,15 +11227,6 @@ "rimraf": "bin.js" } }, - "node_modules/rewire/node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/rewire/node_modules/rxjs": { "version": "6.6.7", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", @@ -11053,9 +11355,9 @@ } }, "node_modules/run-async": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", - "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "engines": { "node": ">=0.12.0" } @@ -11178,9 +11480,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -11246,6 +11548,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "optional": true, "dependencies": { "define-data-property": "^1.1.1", "get-intrinsic": "^1.2.1", @@ -11752,6 +12055,53 @@ "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stdin-discarder/node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/stdin-discarder/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", @@ -11984,6 +12334,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -12198,8 +12549,7 @@ "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, "node_modules/through2": { "version": "4.0.2", @@ -12308,9 +12658,9 @@ "integrity": "sha512-Ck+9CKS+lZ277gvUSbrV99ZKLlgZCEANUIZNmOsf8749LQnJ6vYk92dWwaVdCOj4jdEc1TebC8Fu3i2aK0H6cA==" }, "node_modules/ts-jest": { - "version": "29.1.1", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", - "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "version": "29.0.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.5.tgz", + "integrity": "sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -12319,7 +12669,7 @@ "json5": "^2.2.3", "lodash.memoize": "4.x", "make-error": "1.x", - "semver": "^7.5.3", + "semver": "7.x", "yargs-parser": "^21.0.1" }, "bin": { @@ -12333,7 +12683,7 @@ "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", - "typescript": ">=4.3 <6" + "typescript": ">=4.3" }, "peerDependenciesMeta": { "@babel/core": { @@ -12981,16 +13331,16 @@ } }, "node_modules/winston-transport": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.6.0.tgz", - "integrity": "sha512-wbBA9PbPAHxKiygo7ub7BYRiKxms0tpfU2ljtWzb3SjRjv5yl6Ozuy/TkXf00HTAt+Uylo3gSkNwzc4ME0wiIg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", + "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", "dependencies": { "logform": "^2.3.2", "readable-stream": "^3.6.0", "triple-beam": "^1.3.0" }, "engines": { - "node": ">= 12.0.0" + "node": ">= 6.4.0" } }, "node_modules/word-wrap": { @@ -13012,6 +13362,7 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -13063,6 +13414,7 @@ "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==", + "dev": true, "engines": { "node": ">=8" } @@ -13071,6 +13423,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -13161,9 +13514,9 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yaml": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz", - "integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", "dev": true, "engines": { "node": ">= 14" diff --git a/package.json b/package.json index cd15507420..e9c9e96b57 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.", "bin": "bin/start-kuzzle-server", "scripts": { - "build-ts": "tsc", - "build": "npm run build-ts", + "build": "tsc", "clean": "touch index.ts && npm run build | grep TSFILE | cut -d' ' -f 2 | xargs rm", "codecov": "codecov", "cucumber": "cucumber.js --fail-fast", @@ -23,14 +22,13 @@ "services": "npx kourou app:start-services", "start:dev": "npx ergol docker/scripts/start-kuzzle-dev.ts -c ./config/ergol.config.json --script-args=--enable-plugins functional-test-plugin", "test:functional:http": "KUZZLE_PROTOCOL=http npx cucumber-js --profile http", - "test:functional:jest": "npm run test:jest", + "test:functional:jest": "jest", "test:functional:legacy:http": "npx cucumber-js --format progress-bar --profile http ./features-legacy", "test:functional:legacy:mqtt": "npx cucumber-js --format progress-bar --profile mqtt ./features-legacy", "test:functional:legacy:websocket": "npx cucumber-js --format progress-bar --profile websocket ./features-legacy", "test:functional:legacy": "npm run test:functional:legacy:http && npm run test:functional:legacy:websocket && npm run test:functional:legacy:mqtt", "test:functional:websocket": "KUZZLE_PROTOCOL=websocket npx cucumber-js --profile websocket", - "test:functional": "npm run test:functional:http && npm run test:functional:websocket && npm run test:jest", - "test:jest": "jest", + "test:functional": "npm run test:functional:http && npm run test:functional:websocket && npm run test:functional:jest", "test:lint:js:fix": "eslint --max-warnings=0 --fix ./lib ./test ./bin ./features", "test:lint:js": "eslint --max-warnings=0 ./lib ./test ./bin ./features ./plugins/available/functional-test-plugin", "test:lint:ts:fix": "eslint --max-warnings=0 --fix ./lib --ext .ts --config .eslintc-ts.json", @@ -45,45 +43,45 @@ }, "dependencies": { "@elastic/elasticsearch": "https://github.com/elastic/elasticsearch-js/archive/refs/tags/v7.13.0.tar.gz", - "aedes": "^0.46.3", - "bluebird": "^3.7.2", - "cli-color": "^2.0.3", - "cookie": "^0.5.0", - "debug": "^4.3.4", - "denque": "^2.1.0", - "didyoumean": "^1.2.2", - "dumpme": "^1.0.3", - "eventemitter3": "^4.0.7", - "inquirer": "^9.1.4", - "ioredis": "^5.3.0", - "js-yaml": "^4.1.0", - "json-stable-stringify": "^1.0.2", - "json2yaml": "^1.1.0", - "jsonwebtoken": "^8.5.1", + "aedes": "0.46.3", + "bluebird": "3.7.2", + "cli-color": "2.0.3", + "cookie": "0.5.0", + "debug": "4.3.4", + "denque": "2.1.0", + "didyoumean": "1.2.2", + "dumpme": "1.0.3", + "eventemitter3": "4.0.7", + "inquirer": "9.1.4", + "ioredis": "5.3.0", + "js-yaml": "4.1.0", + "json-stable-stringify": "1.0.2", + "json2yaml": "1.1.0", + "jsonwebtoken": "8.5.1", "koncorde": "4.3.0", "kuzzle-plugin-auth-passport-local": "6.4.0", - "kuzzle-plugin-logger": "^3.0.3", + "kuzzle-plugin-logger": "3.0.3", "kuzzle-sdk": "7.11.0", - "kuzzle-vault": "^2.0.4", + "kuzzle-vault": "2.0.4", "lodash": "4.17.21", - "long": "^5.2.1", - "moment": "^2.29.4", - "ms": "^2.1.3", - "murmurhash-native": "^3.5.0", - "ndjson": "^2.0.0", - "node-segfault-handler": "^1.4.2", - "passport": "^0.6.0", + "long": "5.2.1", + "moment": "2.29.4", + "ms": "2.1.3", + "murmurhash-native": "3.5.0", + "ndjson": "2.0.0", + "node-segfault-handler": "1.4.2", + "passport": "0.6.0", "protobufjs": "~7.2.1", "rc": "1.2.8", - "semver": "^7.3.8", - "sorted-array": "^2.0.4", + "semver": "7.3.8", + "sorted-array": "2.0.4", "uuid": "9.0.1", "uWebSockets.js": "https://github.com/uNetworking/uWebSockets.js/archive/refs/tags/v20.32.0.tar.gz", "validator": "13.11.0", "winston": "3.10.0", "winston-elasticsearch": "0.17.4", - "winston-syslog": "^2.7.0", - "winston-transport": "^4.5.0", + "winston-syslog": "2.7.0", + "winston-transport": "4.5.0", "yargs": "17.7.2", "zeromq": "6.0.0-beta.6" }, @@ -92,32 +90,32 @@ "url": "git://github.com/kuzzleio/kuzzle.git" }, "devDependencies": { - "@jest/globals": "^29.4.1", - "@types/jest": "^29.4.0", - "@types/js-yaml": "^4.0.5", - "@types/lodash": "^4.14.191", - "async": "^3.2.4", - "chokidar": "^3.5.3", - "codecov": "^3.8.3", - "cucumber": "^6.0.5", - "ergol": "^1.0.2", - "eslint-plugin-kuzzle": "^0.0.6", - "jest": "^29.4.1", - "mocha": "^10.2.0", - "mock-require": "^3.0.3", - "mqtt": "^4.3.7", - "nyc": "^15.1.0", - "request": "^2.88.2", - "request-promise": "^4.2.6", - "rewire": "^5.0.0", + "@jest/globals": "29.4.1", + "@types/jest": "29.4.0", + "@types/js-yaml": "4.0.5", + "@types/lodash": "4.14.191", + "async": "3.2.4", + "chokidar": "3.5.3", + "codecov": "3.8.3", + "cucumber": "6.0.5", + "ergol": "1.0.2", + "eslint-plugin-kuzzle": "0.0.6", + "jest": "29.4.1", + "mocha": "10.2.0", + "mock-require": "3.0.3", + "mqtt": "4.3.7", + "nyc": "15.1.0", + "request": "2.88.2", + "request-promise": "4.2.6", + "rewire": "5.0.0", "should": "13.2.3", "should-sinon": "0.0.6", - "sinon": "^14.0.2", + "sinon": "14.0.2", "strip-json-comments": "https://github.com/sindresorhus/strip-json-comments/archive/refs/tags/v3.1.1.tar.gz", - "ts-jest": "^29.0.5", - "ts-node": "^10.9.1", - "typescript": "^4.9.5", - "yaml": "^2.2.1" + "ts-jest": "29.0.5", + "ts-node": "10.9.1", + "typescript": "4.9.5", + "yaml": "2.2.1" }, "engines": { "node": ">= 12.13.0" From 2e47b17362ee36c8ae596da902ff1f1861ae91e6 Mon Sep 17 00:00:00 2001 From: rolljee Date: Mon, 20 Nov 2023 14:42:56 +0100 Subject: [PATCH 4/8] Update CI, remove unused files --- .ci/scripts/install-aarch64-deps.sh | 12 - .ci/scripts/install-armhf-deps.sh | 12 - .ci/scripts/install-plugins.sh | 18 - .ci/test-cluster.yml | 2 - docker/scripts/start-kuzzle-test.ts | 23 +- jest/api/controller/document/mCreate.test.ts | 237 +++---- jest/api/controller/document/metadata.test.ts | 584 ++++++++++-------- jest/api/controller/document/search.test.ts | 138 +++-- 8 files changed, 549 insertions(+), 477 deletions(-) delete mode 100755 .ci/scripts/install-aarch64-deps.sh delete mode 100755 .ci/scripts/install-armhf-deps.sh delete mode 100755 .ci/scripts/install-plugins.sh diff --git a/.ci/scripts/install-aarch64-deps.sh b/.ci/scripts/install-aarch64-deps.sh deleted file mode 100755 index 4eb3a1632b..0000000000 --- a/.ci/scripts/install-aarch64-deps.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# WARNING: This script needs to be run in sdk-cross:node8-armhf image -# Install Kuzzle deps using cross build toolchain -npm ci --target_arch=arm64 --target_platform=linux --silent --unsafe-perm \ - --build-from-source=boost-geospatial-index \ - --build-from-source=espresso-logic-minimizer \ - --build-from-source=unix-dgram \ - --build-from-source=uws \ - --build-from-source=murmurhash-native \ - --build-from-source=dumpme \ - --build-from-source=cucumber-expressions -npm ci --only=dev --target_arch=arm64 --target_platfrom=linux --unsafe-perm --silent diff --git a/.ci/scripts/install-armhf-deps.sh b/.ci/scripts/install-armhf-deps.sh deleted file mode 100755 index 81094d09f3..0000000000 --- a/.ci/scripts/install-armhf-deps.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# WARNING: This script needs to be run in sdk-cross:node8-armhf image -# Install Kuzzle deps using cross build toolchain -npm ci --target_arch=arm --target_platform=linux --silent --unsafe-perm \ - --build-from-source=boost-geospatial-index \ - --build-from-source=espresso-logic-minimizer \ - --build-from-source=unix-dgram \ - --build-from-source=uws \ - --build-from-source=murmurhash-native \ - --build-from-source=dumpme \ - --build-from-source=cucumber-expressions -npm ci --only=dev --target_arch=arm --target_platfrom=linux --unsafe-perm --silent diff --git a/.ci/scripts/install-plugins.sh b/.ci/scripts/install-plugins.sh deleted file mode 100755 index 727a15cef6..0000000000 --- a/.ci/scripts/install-plugins.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -working_dir=$(pwd) -plugins_dir="plugins/enabled" -protocols_dir="protocols/enabled" - -cd "$working_dir" - -for target in ${plugins_dir}/* ${protocols_dir}/* ; do - if [ -d "$target" ]; then - echo 'Installing dependencies for ' $(basename "$target") - cd "$target" - npm ci --silent --unsafe-perm - cd "$working_dir" - fi -done diff --git a/.ci/test-cluster.yml b/.ci/test-cluster.yml index fae78c3c8a..84a798c8a4 100644 --- a/.ci/test-cluster.yml +++ b/.ci/test-cluster.yml @@ -31,8 +31,6 @@ x-kuzzle-config: &kuzzle-config - NODE_VERSION=${NODE_VERSION:-} - DEBUG=none - SECRETS_FILE_PREFIX=/var/app/ - # cluster - - kuzzle_plugins__cluster__privileged=true - kuzzle_plugins__cluster__minimumNodes=3 services: diff --git a/docker/scripts/start-kuzzle-test.ts b/docker/scripts/start-kuzzle-test.ts index f00441ed3f..8a308c0597 100644 --- a/docker/scripts/start-kuzzle-test.ts +++ b/docker/scripts/start-kuzzle-test.ts @@ -238,21 +238,18 @@ app.pipe.register("server:afterNow", async (request) => { return request; }); -app.pipe.register("protocol:http:beforeParsingPayload", async ({ - message, - payload, -}: { - message: HttpMessage; - payload: Buffer; -}) => { - if (message.headers["content-type"] !== "application/x-yaml") { - return { payload }; - } +app.pipe.register( + "protocol:http:beforeParsingPayload", + async ({ message, payload }: { message: HttpMessage; payload: Buffer }) => { + if (message.headers["content-type"] !== "application/x-yaml") { + return { payload }; + } - const convertedPayload = YAML.parse(payload.toString()); + const convertedPayload = YAML.parse(payload.toString()); - return { payload: JSON.stringify(convertedPayload) }; -}); + return { payload: JSON.stringify(convertedPayload) }; + } +); // Hook registration and embedded SDK realtime publish app.hook.register("custom:event", async (name) => { diff --git a/jest/api/controller/document/mCreate.test.ts b/jest/api/controller/document/mCreate.test.ts index 7018cdd866..d5ddd3f2a4 100644 --- a/jest/api/controller/document/mCreate.test.ts +++ b/jest/api/controller/document/mCreate.test.ts @@ -1,8 +1,8 @@ -import { Kuzzle, WebSocket } from 'kuzzle-sdk'; +import { Kuzzle, WebSocket } from "kuzzle-sdk"; -const kuzzle = new Kuzzle(new WebSocket('localhost')); -const index = 'nyc-open-data'; -const collection = 'yellow-taxi'; +const kuzzle = new Kuzzle(new WebSocket("localhost")); +const index = "nyc-open-data"; +const collection = "yellow-taxi"; beforeAll(async () => { await kuzzle.connect(); @@ -11,17 +11,17 @@ beforeAll(async () => { mappings: { properties: { value: { - type: 'keyword' + type: "keyword", }, field: { properties: { path: { - type: 'keyword' - } - } - } - } - } + type: "keyword", + }, + }, + }, + }, + }, }); }); @@ -30,130 +30,155 @@ afterAll(async () => { await kuzzle.disconnect(); }); -describe('mCreate', () => { - afterEach(async () => { - await kuzzle.collection.truncate(index, collection); - }); - +afterEach(async () => { + await kuzzle.collection.truncate(index, collection); +}); - it('It should create document if not exists', async () => { - const mCreateResult = await kuzzle.document.mCreate(index, collection, [ +describe("mCreate", () => { + it("It should create document if not exists", async () => { + const mCreateResult = await kuzzle.document.mCreate( + index, + collection, + [ { - _id: 'A', + _id: "A", body: { - value: 'A' - } - } - ], { - refresh: 'wait_for' - }); + value: "A", + }, + }, + ], + { + refresh: "wait_for", + } + ); - expect(mCreateResult.successes.length).toEqual(1); + expect(mCreateResult.successes.length).toEqual(1); - const result = await kuzzle.document.mGet(index, collection, ['A']); + const result = await kuzzle.document.mGet(index, collection, ["A"]); - expect(result.successes.length).toEqual(1); - expect(result.successes[0]._source).toMatchObject({ - value: 'A' - }); + expect(result.successes.length).toEqual(1); + expect(result.successes[0]._source).toMatchObject({ + value: "A", }); + }); - it('It should not replace the document if not exists', async () => { - let mCreateResult = await kuzzle.document.mCreate(index, collection, [ + it("It should not replace the document if not exists", async () => { + let mCreateResult = await kuzzle.document.mCreate( + index, + collection, + [ { - _id: 'A', + _id: "A", body: { - value: 'A' - } - } - ], { - refresh: 'wait_for' - }); + value: "A", + }, + }, + ], + { + refresh: "wait_for", + } + ); - expect(mCreateResult.successes.length).toEqual(1); + expect(mCreateResult.successes.length).toEqual(1); - mCreateResult = await kuzzle.document.mCreate(index, collection, [ + mCreateResult = await kuzzle.document.mCreate( + index, + collection, + [ { - _id: 'A', + _id: "A", body: { - value: 'FOO' - } - } - ], { - refresh: 'wait_for' - }); - - expect(mCreateResult.successes.length).toEqual(0); - expect(mCreateResult.errors.length).toEqual(1); - - const result = await kuzzle.document.mGet(index, collection, ['A']); - - expect(result.successes.length).toEqual(1); - expect(result.successes[0]._source).toMatchObject({ - value: 'A' - }); - }); + value: "FOO", + }, + }, + ], + { + refresh: "wait_for", + } + ); + + expect(mCreateResult.successes.length).toEqual(0); + expect(mCreateResult.errors.length).toEqual(1); + const result = await kuzzle.document.mGet(index, collection, ["A"]); - it('It should not replace the document even if the previous document did not exist', async () => { - let mCreateResult = await kuzzle.document.mCreate(index, collection, [ + expect(result.successes.length).toEqual(1); + expect(result.successes[0]._source).toMatchObject({ + value: "A", + }); + }); + + it("It should not replace the document even if the previous document did not exist", async () => { + let mCreateResult = await kuzzle.document.mCreate( + index, + collection, + [ { - _id: 'A', + _id: "A", body: { - value: 'A' - } + value: "A", + }, }, { - _id: 'C', + _id: "C", body: { - value: 'C' - } - } - ], { - refresh: 'wait_for' - }); + value: "C", + }, + }, + ], + { + refresh: "wait_for", + } + ); - expect(mCreateResult.successes.length).toEqual(2); + expect(mCreateResult.successes.length).toEqual(2); - mCreateResult = await kuzzle.document.mCreate(index, collection, [ + mCreateResult = await kuzzle.document.mCreate( + index, + collection, + [ { - _id: 'A', + _id: "A", body: { - value: 'FOO' - } + value: "FOO", + }, }, { - _id: 'B', + _id: "B", body: { - value: 'B' - } + value: "B", + }, }, { - _id: 'C', + _id: "C", body: { - value: 'FOO' - } - } - ], { - refresh: 'wait_for' - }); - - expect(mCreateResult.successes.length).toEqual(1); - expect(mCreateResult.errors.length).toEqual(2); - - const result = await kuzzle.document.mGet(index, collection, ['A', 'B', 'C']); - - expect(result.successes.length).toEqual(3); - expect(result.successes[0]._source).toMatchObject({ - value: 'A' - }); - expect(result.successes[1]._source).toMatchObject({ - value: 'B' - }); - expect(result.successes[2]._source).toMatchObject({ - value: 'C' - }); - }); + value: "FOO", + }, + }, + ], + { + refresh: "wait_for", + } + ); - -}); \ No newline at end of file + expect(mCreateResult.successes.length).toEqual(1); + expect(mCreateResult.errors.length).toEqual(2); + + const result = await kuzzle.document.mGet(index, collection, [ + "A", + "B", + "C", + ]); + + expect(result.successes.length).toEqual(3); + expect(result.successes[0]._source).toMatchObject({ + value: "A", + }); + expect(result.successes[1]._source).toMatchObject({ + value: "B", + }); + expect(result.successes[2]._source).toMatchObject({ + value: "C", + }); + }); +}); diff --git a/jest/api/controller/document/metadata.test.ts b/jest/api/controller/document/metadata.test.ts index 4fd0b84dad..cd8bd8fd46 100644 --- a/jest/api/controller/document/metadata.test.ts +++ b/jest/api/controller/document/metadata.test.ts @@ -1,8 +1,8 @@ -import { Kuzzle, WebSocket } from 'kuzzle-sdk'; +import { Kuzzle, WebSocket } from "kuzzle-sdk"; -const kuzzle = new Kuzzle(new WebSocket('localhost')); -const index = 'nyc-open-data'; -const collection = 'yellow-taxi'; +const kuzzle = new Kuzzle(new WebSocket("localhost")); +const index = "nyc-open-data"; +const collection = "yellow-taxi"; beforeAll(async () => { await kuzzle.connect(); @@ -16,579 +16,653 @@ afterAll(async () => { }); describe("document:create", () => { - test('It should add metadata when creating a document', async () => { + test("It should add metadata when creating a document", async () => { const response = await kuzzle.document.create( index, collection, - { foo: 'bar' }, + { foo: "bar" }, undefined, - { refresh: 'wait_for' }); + { refresh: "wait_for" } + ); // @ts-ignore expect(response._source._kuzzle_info).toBeDefined(); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.not.objectContaining({ - customMetadata: 'customized', - })); + expect(response._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + customMetadata: "customized", + }) + ); }); - test('It should not let user add their own metadata when creating a document', async () => { + test("It should not let user add their own metadata when creating a document", async () => { const response = await kuzzle.document.create( index, collection, { - foo: 'bar', + foo: "bar", _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, - } + }, }, undefined, - { refresh: 'wait_for' }); - - expect(response._source._kuzzle_info).toEqual(expect.not.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + { refresh: "wait_for" } + ); + + expect(response._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); - test('It should add custom metadata using the pipe', async () => { + test("It should add custom metadata using the pipe", async () => { const response = await kuzzle.document.create( index, collection, - { foo: 'bar', addCustomMetadata: true }, + { foo: "bar", addCustomMetadata: true }, undefined, - { refresh: 'wait_for' }); + { refresh: "wait_for" } + ); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.objectContaining({ - customMetadata: 'customized', - })); + expect(response._source._kuzzle_info).toEqual( + expect.objectContaining({ + customMetadata: "customized", + }) + ); }); }); describe("document:createOrReplace", () => { - test('It should add metadata when creating or replacing a document', async () => { + test("It should add metadata when creating or replacing a document", async () => { const response = await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); // @ts-ignore expect(response._source._kuzzle_info).toBeDefined(); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.not.objectContaining({ - customMetadata: 'customized', - })); + expect(response._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + customMetadata: "customized", + }) + ); }); - test('It should not let user add their own metadata when creating or replacing a document', async () => { + test("It should not let user add their own metadata when creating or replacing a document", async () => { const response = await kuzzle.document.createOrReplace( index, collection, - 'test', + "test", { - foo: 'bar', + foo: "bar", _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, - } + }, }, - { refresh: 'wait_for' }); - - expect(response._source._kuzzle_info).toEqual(expect.not.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + { refresh: "wait_for" } + ); + + expect(response._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); - test('It should add custom metadata using the pipe', async () => { + test("It should add custom metadata using the pipe", async () => { const response = await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar', addCustomMetadata: true }, - { refresh: 'wait_for' }); + "test", + { foo: "bar", addCustomMetadata: true }, + { refresh: "wait_for" } + ); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.objectContaining({ - customMetadata: 'customized', - })); + expect(response._source._kuzzle_info).toEqual( + expect.objectContaining({ + customMetadata: "customized", + }) + ); }); }); describe("document:update", () => { - test('It should update the metadata when updating a document', async () => { + test("It should update the metadata when updating a document", async () => { await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); const response = await kuzzle.document.update( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for', source: true }); + "test", + { foo: "bar" }, + { refresh: "wait_for", source: true } + ); // @ts-ignore expect(response._source._kuzzle_info).toBeDefined(); }); - test('It should not let user add their own metadata when updating a document', async () => { + test("It should not let user add their own metadata when updating a document", async () => { await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); const response = await kuzzle.document.update( index, collection, - 'test', + "test", { - foo: 'bar', + foo: "bar", _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, - } + }, }, - { refresh: 'wait_for', source: true }); - - expect(response._source._kuzzle_info).toEqual(expect.not.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + { refresh: "wait_for", source: true } + ); + + expect(response._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); - test('It should add custom metadata using the pipe', async () => { + test("It should add custom metadata using the pipe", async () => { const createResponse = await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); // @ts-ignore - expect(createResponse._source._kuzzle_info).toEqual(expect.not.objectContaining({ - customMetadata: 'customized', - })); + expect(createResponse._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + customMetadata: "customized", + }) + ); const response = await kuzzle.document.update( index, collection, - 'test', - { foo: 'bar', addCustomMetadata: true }, - { refresh: 'wait_for', source: true }); + "test", + { foo: "bar", addCustomMetadata: true }, + { refresh: "wait_for", source: true } + ); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.objectContaining({ - customMetadata: 'customized', - })); + expect(response._source._kuzzle_info).toEqual( + expect.objectContaining({ + customMetadata: "customized", + }) + ); }); }); describe("document:replace", () => { - test('It should replace the metadata', async () => { + test("It should replace the metadata", async () => { await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); const response = await kuzzle.document.replace( index, collection, - 'test', - { foo: 'baz' }, - { refresh: 'wait_for' }); + "test", + { foo: "baz" }, + { refresh: "wait_for" } + ); // @ts-ignore expect(response._source._kuzzle_info).toBeDefined(); }); - test('It should not let user add their own metadata', async () => { + test("It should not let user add their own metadata", async () => { await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); const response = await kuzzle.document.replace( index, collection, - 'test', + "test", { - foo: 'bar', + foo: "bar", _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, - } + }, }, - { refresh: 'wait_for' }); + { refresh: "wait_for" } + ); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.not.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + expect(response._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); - test('It should add custom metadata using the pipe', async () => { + test("It should add custom metadata using the pipe", async () => { const createResponse = await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); // @ts-ignore - expect(createResponse._source._kuzzle_info).toEqual(expect.not.objectContaining({ - customMetadata: 'customized', - })); + expect(createResponse._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + customMetadata: "customized", + }) + ); const response = await kuzzle.document.replace( index, collection, - 'test', - { foo: 'bar', addCustomMetadata: true }, - { refresh: 'wait_for' }); + "test", + { foo: "bar", addCustomMetadata: true }, + { refresh: "wait_for" } + ); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.objectContaining({ - customMetadata: 'customized', - })); + expect(response._source._kuzzle_info).toEqual( + expect.objectContaining({ + customMetadata: "customized", + }) + ); }); }); describe("document:mCreate", () => { - test('It should add the metadata when doing an mCreate', async () => { + test("It should add the metadata when doing an mCreate", async () => { const response = await kuzzle.document.mCreate( index, collection, - [ - { body: { foo: 'bar' } }, - ], - { refresh: 'wait_for' }); + [{ body: { foo: "bar" } }], + { refresh: "wait_for" } + ); expect(response.successes[0]._source._kuzzle_info).toBeDefined(); }); - test('It should let user add their own metadata to the document', async () => { + test("It should let user add their own metadata to the document", async () => { const response = await kuzzle.document.mCreate( index, collection, [ { body: { - foo: 'bar', + foo: "bar", _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, - } + }, }, }, ], - { refresh: 'wait_for' }); - - expect(response.successes[0]._source._kuzzle_info).toEqual(expect.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + { refresh: "wait_for" } + ); + + expect(response.successes[0]._source._kuzzle_info).toEqual( + expect.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); }); describe("document:mCreateOrReplace", () => { - test('It should add the metadata', async () => { + test("It should add the metadata", async () => { const response = await kuzzle.document.mCreateOrReplace( index, collection, - [ - { _id: 'test', body: { foo: 'bar' } }, - ], - { refresh: 'wait_for' }); + [{ _id: "test", body: { foo: "bar" } }], + { refresh: "wait_for" } + ); expect(response.successes[0]._source._kuzzle_info).toBeDefined(); }); - test('It should let user add their own metadata to the document', async () => { + test("It should let user add their own metadata to the document", async () => { const response = await kuzzle.document.mCreateOrReplace( index, collection, [ { - _id: 'test', + _id: "test", body: { - foo: 'bar', + foo: "bar", _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, - } + }, }, }, ], - { refresh: 'wait_for' }); - - expect(response.successes[0]._source._kuzzle_info).toEqual(expect.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + { refresh: "wait_for" } + ); + + expect(response.successes[0]._source._kuzzle_info).toEqual( + expect.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); }); describe("document:mReplace", () => { - test('It should add the metadata', async () => { + test("It should add the metadata", async () => { await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); const response = await kuzzle.document.mReplace( index, collection, - [ - { _id: 'test', body: { foo: 'bar' } }, - ], - { refresh: 'wait_for' }); + [{ _id: "test", body: { foo: "bar" } }], + { refresh: "wait_for" } + ); expect(response.successes[0]._source._kuzzle_info).toBeDefined(); }); - test('It should let user add their own metadata to the document', async () => { + test("It should let user add their own metadata to the document", async () => { await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); const response = await kuzzle.document.mReplace( index, collection, [ { - _id: 'test', + _id: "test", body: { - foo: 'bar', + foo: "bar", _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, - } + }, }, }, ], - { refresh: 'wait_for' }); - - expect(response.successes[0]._source._kuzzle_info).toEqual(expect.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + { refresh: "wait_for" } + ); + + expect(response.successes[0]._source._kuzzle_info).toEqual( + expect.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); }); describe("document:upsert", () => { - test('It should add the metadata', async () => { + test("It should add the metadata", async () => { const response = await kuzzle.document.upsert( index, collection, - 'test', - { foo: 'baz' }, - { refresh: 'wait_for', default: { foo: 'bar' }, source: true }); + "test", + { foo: "baz" }, + { refresh: "wait_for", default: { foo: "bar" }, source: true } + ); // @ts-ignore expect(response._source._kuzzle_info).toBeDefined(); }); - test('It should not let user add their own metadata', async () => { + test("It should not let user add their own metadata", async () => { const response = await kuzzle.document.upsert( index, collection, - 'test', + "test", { - foo: 'baz', + foo: "baz", // @ts-ignore _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, }, }, - { refresh: 'wait_for', default: { foo: 'bar' }, source: true }); + { refresh: "wait_for", default: { foo: "bar" }, source: true } + ); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.not.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + expect(response._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); - test('It should add custom metadata using the pipe', async () => { + test("It should add custom metadata using the pipe", async () => { const createResponse = await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); // @ts-ignore - expect(createResponse._source._kuzzle_info).toEqual(expect.not.objectContaining({ - customMetadata: 'customized', - })); + expect(createResponse._source._kuzzle_info).toEqual( + expect.not.objectContaining({ + customMetadata: "customized", + }) + ); const response = await kuzzle.document.upsert( index, collection, - 'test', - { foo: 'bar', addCustomMetadata: true }, - { refresh: 'wait_for', source: true }); + "test", + { foo: "bar", addCustomMetadata: true }, + { refresh: "wait_for", source: true } + ); // @ts-ignore - expect(response._source._kuzzle_info).toEqual(expect.objectContaining({ - customMetadata: 'customized', - })); + expect(response._source._kuzzle_info).toEqual( + expect.objectContaining({ + customMetadata: "customized", + }) + ); }); }); describe("document:mUpsert", () => { - test('It should add the metadata', async () => { + test("It should add the metadata", async () => { const response = await kuzzle.document.mUpsert( index, collection, - [{ - _id: 'test', - changes: { foo: 'baz' }, - default: { foo: 'bar' } - }], - { refresh: 'wait_for', source: true }); + [ + { + _id: "test", + changes: { foo: "baz" }, + default: { foo: "bar" }, + }, + ], + { refresh: "wait_for", source: true } + ); // @ts-ignore expect(response.successes[0]._source._kuzzle_info).toBeDefined(); }); - test('It should let user add their own metadata to the document', async () => { + test("It should let user add their own metadata to the document", async () => { const response = await kuzzle.document.mUpsert( index, collection, [ { - _id: 'test', + _id: "test", changes: { - foo: 'baz', + foo: "baz", // @ts-ignore _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, }, }, - default: { foo: 'bar' }, + default: { foo: "bar" }, }, ], - { refresh: 'wait_for', source: true }); + { refresh: "wait_for", source: true } + ); // @ts-ignore - expect(response.successes[0]._source._kuzzle_info).toEqual(expect.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + expect(response.successes[0]._source._kuzzle_info).toEqual( + expect.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); }); describe("document:updateByQuery", () => { beforeEach(async () => { - await kuzzle.collection.truncate(index, collection, { refresh: 'wait_for' }); + await kuzzle.collection.truncate(index, collection, { + refresh: "wait_for", + }); }); - test('It should update the metadata', async () => { + test("It should update the metadata", async () => { await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); const response = await kuzzle.document.updateByQuery( index, collection, {}, - { foo: 'baz' }, - { refresh: 'wait_for', source: true }); + { foo: "baz" }, + { refresh: "wait_for", source: true } + ); // @ts-ignore expect(response.successes[0]._source._kuzzle_info).toBeDefined(); }); - test('It should let user add their own metadata to the document', async () => { + test("It should let user add their own metadata to the document", async () => { await kuzzle.document.createOrReplace( index, collection, - 'test', - { foo: 'bar' }, - { refresh: 'wait_for' }); + "test", + { foo: "bar" }, + { refresh: "wait_for" } + ); const response = await kuzzle.document.updateByQuery( index, collection, {}, { - foo: 'bar', + foo: "bar", _kuzzle_info: { - author: 'foo', + author: "foo", createdAt: 42, updatedAt: null, updater: null, - } + }, }, - { refresh: 'wait_for', source: true }); - - expect(response.successes[0]._source._kuzzle_info).toEqual(expect.objectContaining({ - author: 'foo', - createdAt: 42, - updatedAt: null, - updater: null, - })); + { refresh: "wait_for", source: true } + ); + + expect(response.successes[0]._source._kuzzle_info).toEqual( + expect.objectContaining({ + author: "foo", + createdAt: 42, + updatedAt: null, + updater: null, + }) + ); }); -}); \ No newline at end of file +}); diff --git a/jest/api/controller/document/search.test.ts b/jest/api/controller/document/search.test.ts index b86cda5117..922b220b60 100644 --- a/jest/api/controller/document/search.test.ts +++ b/jest/api/controller/document/search.test.ts @@ -1,8 +1,8 @@ -import { Kuzzle, WebSocket } from 'kuzzle-sdk'; +import { Kuzzle, WebSocket } from "kuzzle-sdk"; -const kuzzle = new Kuzzle(new WebSocket('localhost')); -const index = 'nyc-open-data'; -const collection = 'yellow-taxi'; +const kuzzle = new Kuzzle(new WebSocket("localhost")); +const index = "nyc-open-data"; +const collection = "yellow-taxi"; beforeAll(async () => { await kuzzle.connect(); @@ -11,17 +11,17 @@ beforeAll(async () => { mappings: { properties: { foo: { - type: 'keyword' + type: "keyword", }, field: { properties: { path: { - type: 'keyword' - } - } - } - } - } + type: "keyword", + }, + }, + }, + }, + }, }); }); @@ -30,90 +30,110 @@ afterAll(async () => { await kuzzle.disconnect(); }); -describe('koncorde query', () => { - afterEach(async () => { - await kuzzle.collection.truncate(index, collection); - }); +afterEach(async () => { + await kuzzle.collection.truncate(index, collection); +}); - describe('exists', () => { - it('should return true if the field exists', async () => { - const document = { foo: 'bar' }; +describe("koncorde query", () => { + describe("exists", () => { + it("should return true if the field exists", async () => { + const document = { foo: "bar" }; await kuzzle.document.create(index, collection, document, undefined, { - refresh: 'wait_for' + refresh: "wait_for", }); - const result = await kuzzle.document.search(index, collection, { - query: { - exists: { - field: 'foo' - } + const result = await kuzzle.document.search( + index, + collection, + { + query: { + exists: { + field: "foo", + }, + }, }, - }, { - lang: 'koncorde' - }); + { + lang: "koncorde", + } + ); expect(result.hits.length).toEqual(1); }); - it('should return false if the field does not exists', async () => { - const document = { foo: 'bar' }; + it("should return false if the field does not exists", async () => { + const document = { foo: "bar" }; await kuzzle.document.create(index, collection, document, undefined, { - refresh: 'wait_for' + refresh: "wait_for", }); - const result = await kuzzle.document.search(index, collection, { - query: { - exists: { - field: 'name' - } + const result = await kuzzle.document.search( + index, + collection, + { + query: { + exists: { + field: "name", + }, + }, + }, + { + lang: "koncorde", } - }, { - lang: 'koncorde' - }); + ); expect(result.hits.length).toEqual(0); }); it('should support the syntax "field.path[value]" and return document if matching', async () => { - const document = { field: { path: ['ALPHA','BETA'] } }; + const document = { field: { path: ["ALPHA", "BETA"] } }; await kuzzle.document.create(index, collection, document, undefined, { - refresh: 'wait_for' + refresh: "wait_for", }); - const result = await kuzzle.document.search(index, collection, { - query: { - exists: { - field: 'field.path["BETA"]' - } + const result = await kuzzle.document.search( + index, + collection, + { + query: { + exists: { + field: 'field.path["BETA"]', + }, + }, + }, + { + lang: "koncorde", } - }, { - lang: 'koncorde' - }); + ); expect(result.hits.length).toEqual(1); }); it('should support the syntax "field.path[value]" and return nothing if not matching', async () => { - const document = { field: { path: ['ALPHA','BETA'] } }; + const document = { field: { path: ["ALPHA", "BETA"] } }; await kuzzle.document.create(index, collection, document, undefined, { - refresh: 'wait_for' + refresh: "wait_for", }); - const result = await kuzzle.document.search(index, collection, { - query: { - exists: { - field: 'field.path["GAMMA"]' - } + const result = await kuzzle.document.search( + index, + collection, + { + query: { + exists: { + field: 'field.path["GAMMA"]', + }, + }, + }, + { + lang: "koncorde", } - }, { - lang: 'koncorde' - }); + ); expect(result.hits.length).toEqual(0); }); }); -}); \ No newline at end of file +}); From 24730a26a70725ba7337f10f4ad58530e697c047 Mon Sep 17 00:00:00 2001 From: rolljee Date: Mon, 20 Nov 2023 14:54:18 +0100 Subject: [PATCH 5/8] Update CI/CD --- .ci/haproxy/haproxy.cfg | 33 -------------- .ci/haproxy/snakeoil.pem | 46 ------------------- .ci/privatebuild/.gitignore | 1 - .ci/privatebuild/Dockerfile | 70 ----------------------------- .ci/privatebuild/build.sh | 18 -------- .ci/scripts/install-aarch64-deps.sh | 12 +++++ .ci/scripts/install-armhf-deps.sh | 12 +++++ .ci/scripts/install-plugins.sh | 18 ++++++++ .ci/test-aarch64.yml | 36 --------------- .ci/test-armhf.yml | 36 --------------- .ci/test-cluster.yml | 2 + 11 files changed, 44 insertions(+), 240 deletions(-) delete mode 100644 .ci/haproxy/haproxy.cfg delete mode 100644 .ci/haproxy/snakeoil.pem delete mode 100644 .ci/privatebuild/.gitignore delete mode 100644 .ci/privatebuild/Dockerfile delete mode 100755 .ci/privatebuild/build.sh create mode 100644 .ci/scripts/install-aarch64-deps.sh create mode 100644 .ci/scripts/install-armhf-deps.sh create mode 100644 .ci/scripts/install-plugins.sh delete mode 100644 .ci/test-aarch64.yml delete mode 100644 .ci/test-armhf.yml diff --git a/.ci/haproxy/haproxy.cfg b/.ci/haproxy/haproxy.cfg deleted file mode 100644 index 9449bd525f..0000000000 --- a/.ci/haproxy/haproxy.cfg +++ /dev/null @@ -1,33 +0,0 @@ -global -log 127.0.0.1 local0 -log 127.0.0.1 local1 notice -maxconn 4096 -tune.ssl.default-dh-param 2048 -daemon - -defaults - log global - option dontlognull - mode http - -# HTTP specific timeouts - timeout connect 5s - timeout client 5s - timeout server 5s -# Websocket specific timeouts - timeout tunnel 2h - -frontend kuzzle_https - bind *:7512 ssl crt /etc/ssl/private/snakeoil.pem - default_backend https - mode http - option httpclose - option forwardfor - tcp-request inspect-delay 500ms - tcp-request content accept if HTTP - -backend https - mode http - option forwardfor - option httpclose - server kuzzleproxy proxy:7512 maxconn 32768 check diff --git a/.ci/haproxy/snakeoil.pem b/.ci/haproxy/snakeoil.pem deleted file mode 100644 index 7ed2e696c2..0000000000 --- a/.ci/haproxy/snakeoil.pem +++ /dev/null @@ -1,46 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDZSbNO86KGt0Sb -k+xECPdpba2EI113UrvJTXY0Pc33hhEPbIGPy4XzmuUC5N4XF3+LSeVDWJ4mSmLR -FxHFlYnPCV6PRe8OvQqFFqOpxRnAj6xDawmm+oK2yu83csZr9r/hDfZUN3tQvaoG -nJKZx4xVyioEUhWYj/qUDkY8jwuzFHh3EHyq4erwH04H6Ugr4ZxCPsmBbOV3tHvJ -aJxx6BCm4JKe8gId2S5XE70sW8J8RWx47iT91l7Vl6gwaZtAcmGWFXfkRn54AdtW -5BlIb+FIrfCcwdhi3GHag/eFr0outlYopxdcxAMECkh82UzTY3KbYQfwGd+0NhN7 -0hN8c3XzAgMBAAECggEBANHU0kuUC4d8w8xZ9PdekU5GlCHe5Qut4ZpsK5IXfSdj -WGZEqnlqWVj+Y9l/mtlB3/Fq0vNOSKtBelvgo1DjL8m3ipFhP5JEDDypuDLiHBRQ -qlIQs6mEkWZkYs5xEByClJmJGjAJxBQclGz+FrRad7MBH8I8Yo6Ju7nubvVcTjgH -7Dr8G6NmKixNVewh2B78BwvPi/vISClXsXUejrJ3YXNrQSbWbCBzqOTbYGX/CCpe -sQHF6S4vD4aELKyVjmjVxV3RpbyuO6CtMdPQNKFdHbggO4ZJc2qTQHPqwB+/eU36 -ZUw9hWqYgoUiLFbYIz+7l2YdT93LwzR5z9fxJG1mrwECgYEA+12lDorxzkNYgVhA -SjoVbrdjkqevJLM3i7IaaaxcE9XxYsY6ug2g9Fg5mjlc9o3tsQCQOCJ64vmSUhWc -KmdpdKDR88oYzLexd4GXgyw/RH8wGsCb3y7ZM3SDWliepmvN07zByke0JnM/2jhL -xildnrBjj3p6Kx6TjN72op/hBZECgYEA3Us4Z22ghCb4TSZCr05tb462fIpgkpVO -x/o/AYxHAzZMl3y32hvOLWfHP9dUbbmyleX5gAvEVuoEi/slOK1ljBcNM5jqpKZb -pCDiSC5N7y/SeXId6K7rzhky+249W2Hgwx1YuPhVrHz3qgAPmtMwe1d5YpqYvnQO -p86XLQp6cUMCgYBV5EfUUlISAx0pBXjiZDqSnIOfx0Cnr72ZNICl/0lvVbmn4MiM -br/C/qqgMl27uf+wbdrZ854+FL2U4uF7894rBhD31uTmfxZbGaMmJWZxB2zul0Yr -2xxI4tVHd+SuRUQNyAAIGLxMLzFwZbAuxE/DO86pZlZ8iXQtvLpWE3+WoQKBgQCZ -POtUA7/xgyLSGbp3trFlXMfVOeVh2+5v4EQdCExsVv92rzCI4lRFcOWyuaOHT93w -mw3Is11Eaky3ujOuKbR168iCgFOLrH8tCnBnV1k0VkNDQdigNfCoCR8aqN3oF8ES -m5HClISPKwI9QEmOBsw9vPcbZr56s9cqMI7S67yaDQKBgGnl5USepMNn92JURuYF -kPrH3fdgRe5kqEqRirxTfTS97HLMHp/MDRHVk2376KtqSiae6fLcPcu/NF5Du5oN -Fop6p169pl8FYUfSDJNCHGGZiSdKaIYq4b8EumanUV08dX+eb6l4ytez+k1KEZ8V -hXf7ALi5gqX5WWcxzS58e9VN ------END PRIVATE KEY----- ------BEGIN CERTIFICATE----- -MIIC2DCCAcCgAwIBAgIJAKnsdD+8wyZoMA0GCSqGSIb3DQEBCwUAMCQxIjAgBgNV -BAMTGWthbGlvcC10ZXN0LTEwLmthbGlvcC5sb2MwHhcNMTYwNDE5MTUzMzU4WhcN -MjYwNDE3MTUzMzU4WjAkMSIwIAYDVQQDExlrYWxpb3AtdGVzdC0xMC5rYWxpb3Au -bG9jMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2UmzTvOihrdEm5Ps -RAj3aW2thCNdd1K7yU12ND3N94YRD2yBj8uF85rlAuTeFxd/i0nlQ1ieJkpi0RcR -xZWJzwlej0XvDr0KhRajqcUZwI+sQ2sJpvqCtsrvN3LGa/a/4Q32VDd7UL2qBpyS -mceMVcoqBFIVmI/6lA5GPI8LsxR4dxB8quHq8B9OB+lIK+GcQj7JgWzld7R7yWic -cegQpuCSnvICHdkuVxO9LFvCfEVseO4k/dZe1ZeoMGmbQHJhlhV35EZ+eAHbVuQZ -SG/hSK3wnMHYYtxh2oP3ha9KLrZWKKcXXMQDBApIfNlM02Nym2EH8BnftDYTe9IT -fHN18wIDAQABow0wCzAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAQkxR6 -M9D8CShUCqlb08EtIc0yXuwtYwILNn55S4MVcALGUIE0P6NR85U5bNs+10Q1l5bx -gOrduNXfwUVb7S3bugFI1N2BKcpC3INhQ3hYIUCNVg0TCurc3Ke/0JbE33Umt0ZW -/n2UzGHH0J6U4iUL26FrQtn1ShxOyqPdX5cM+kxgD6hX4lRp3xeEv8lQ4EWNRBlC -Eam6vKgPBwUTbIWaqcXUTwR8Jn2TbYP8R6E3goiVttxBYRDvcmKrN/AP0Girj7SL -/8s7M2bBBcrySx1qD9Sb6c7LE7XKCCdasqS9a403lyv6QX1irNNnMhdcl26Dl3NG -4JAIr2iWq5WaFmeS ------END CERTIFICATE----- diff --git a/.ci/privatebuild/.gitignore b/.ci/privatebuild/.gitignore deleted file mode 100644 index 10d00b5797..0000000000 --- a/.ci/privatebuild/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.gz diff --git a/.ci/privatebuild/Dockerfile b/.ci/privatebuild/Dockerfile deleted file mode 100644 index 076e03f5f1..0000000000 --- a/.ci/privatebuild/Dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -ARG NODE_TAG=10-stretch-slim - -FROM node:${NODE_TAG} AS dependencies - -ARG CLUSTER_BRANCH=3/fix-js-injection -ARG KONCORDE_BRANCH=fix-js-injection -ARG KUZZLE_VERSION=1.11.0 -ARG SSH_KEY - -ENV GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" -ENV NODE_ENV=production - -WORKDIR /var/app -COPY . /var/app - -RUN set -x \ - \ - && mkdir -p /root/.ssh \ - && echo "${SSH_KEY}" > /root/.ssh/id_rsa \ - && chmod 0600 /root/.ssh/id_rsa \ - \ - && apt-get update \ - && apt-get install -y \ - build-essential \ - gdb \ - git \ - jq \ - python \ - libfontconfig \ - libkrb5-dev \ - libzmq3-dev \ - openssh-client \ - \ - && npm i -g npm \ - && npm set progress=false \ - && npm config set unsafe-perm true \ - \ - && echo "Patch version" \ - && jq ' .version="'${KUZZLE_VERSION}'" ' package.json > package.json.tmp && mv package.json.tmp package.json \ - && jq ' .version="'${KUZZLE_VERSION}'" ' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json \ - \ - && echo "Replace koncorde with last commit from security branch" \ - && npm uninstall koncorde \ - && repo=git@github.com:kuzzleio/koncorde-security-patch.git \ - && sha1=$(git ls-remote ${repo} refs/heads/${KONCORDE_BRANCH} | awk '{ print $1 }') \ - && npm i git://${repo}#${sha1} \ - \ - && npm ci \ - && for plugin in plugins/available/*/; do \ - npm ci --prefix $plugin; \ - done - -# main image -# ----------------------------------------------------------------------------- -FROM node:${NODE_TAG} - -WORKDIR /var/app - -ENV NODE_ENV=production - -COPY --from=dependencies /var/app/ /var/app/ - -RUN ln -s /var/app/docker/scripts/run.sh /usr/local/bin/kuzzle \ - && chmod a+x /usr/local/bin/kuzzle \ - && chmod a+x /var/app/docker/scripts/docker-entrypoint.sh - -ENTRYPOINT ["/var/app/docker/scripts/docker-entrypoint.sh"] - -CMD ["kuzzle", "start"] - diff --git a/.ci/privatebuild/build.sh b/.ci/privatebuild/build.sh deleted file mode 100755 index 0e25c72112..0000000000 --- a/.ci/privatebuild/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -ssh_key_path="${1:-$HOME/.ssh/id_rsa}" - -root="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." >/dev/null 2>&1 && pwd )" -cd "$root" - -docker build \ - -t kuzzleio/kuzzle:1.11.0 \ - -f .ci/privatebuild/Dockerfile \ - --build-arg SSH_KEY="$(cat "$ssh_key_path")" \ - --no-cache \ - . - -docker save kuzzleio/kuzzle:1.11.0 | gzip > ./.ci/privatebuild/kuzzle-1.11.0.docker.tar.gz -docker run -t \ - -v "${root}/.ci/privatebuild:/build" \ - kuzzleio/kuzzle:1.11.0 bash -c "tar -cvzf /build/kuzzle-1.11.0.node-10.tar.gz . && chown $(id -u):$(id -g) /build/*" diff --git a/.ci/scripts/install-aarch64-deps.sh b/.ci/scripts/install-aarch64-deps.sh new file mode 100644 index 0000000000..4eb3a1632b --- /dev/null +++ b/.ci/scripts/install-aarch64-deps.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# WARNING: This script needs to be run in sdk-cross:node8-armhf image +# Install Kuzzle deps using cross build toolchain +npm ci --target_arch=arm64 --target_platform=linux --silent --unsafe-perm \ + --build-from-source=boost-geospatial-index \ + --build-from-source=espresso-logic-minimizer \ + --build-from-source=unix-dgram \ + --build-from-source=uws \ + --build-from-source=murmurhash-native \ + --build-from-source=dumpme \ + --build-from-source=cucumber-expressions +npm ci --only=dev --target_arch=arm64 --target_platfrom=linux --unsafe-perm --silent diff --git a/.ci/scripts/install-armhf-deps.sh b/.ci/scripts/install-armhf-deps.sh new file mode 100644 index 0000000000..81094d09f3 --- /dev/null +++ b/.ci/scripts/install-armhf-deps.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# WARNING: This script needs to be run in sdk-cross:node8-armhf image +# Install Kuzzle deps using cross build toolchain +npm ci --target_arch=arm --target_platform=linux --silent --unsafe-perm \ + --build-from-source=boost-geospatial-index \ + --build-from-source=espresso-logic-minimizer \ + --build-from-source=unix-dgram \ + --build-from-source=uws \ + --build-from-source=murmurhash-native \ + --build-from-source=dumpme \ + --build-from-source=cucumber-expressions +npm ci --only=dev --target_arch=arm --target_platfrom=linux --unsafe-perm --silent diff --git a/.ci/scripts/install-plugins.sh b/.ci/scripts/install-plugins.sh new file mode 100644 index 0000000000..727a15cef6 --- /dev/null +++ b/.ci/scripts/install-plugins.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -ex + +working_dir=$(pwd) +plugins_dir="plugins/enabled" +protocols_dir="protocols/enabled" + +cd "$working_dir" + +for target in ${plugins_dir}/* ${protocols_dir}/* ; do + if [ -d "$target" ]; then + echo 'Installing dependencies for ' $(basename "$target") + cd "$target" + npm ci --silent --unsafe-perm + cd "$working_dir" + fi +done diff --git a/.ci/test-aarch64.yml b/.ci/test-aarch64.yml deleted file mode 100644 index 62ff0109de..0000000000 --- a/.ci/test-aarch64.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: '3' - -services: - kuzzle: - image: kuzzleio/core-dev-aarch64:2 - command: /run-test-arm.sh - volumes: - - "..:/var/app" - - "./scripts/run-test-arm.sh:/run-test-arm.sh" - cap_add: - - SYS_PTRACE - depends_on: - - redis - - elasticsearch - environment: - - kuzzle_services__storageEngine__client__node=http://elasticsearch:9200 - - kuzzle_services__storageEngine__commonMapping__dynamic=true - - kuzzle_services__storageEngine__internalIndex__collections__users__dynamic=true - - kuzzle_services__internalCache__node__host=redis - - kuzzle_services__memoryStorage__node__host=redis - - kuzzle_server__protocols__mqtt__enabled=true - - kuzzle_server__protocols__mqtt__developmentMode=false - - kuzzle_http__accessControlAllowOrigin=localhost - - kuzzle_limits__loginsPerSecond=50 - - NODE_ENV=development - - DEBUG= - - SECRETS_FILE_PREFIX=/var/app/ - - KUZZLE_FUNCTIONAL_TESTS=${KUZZLE_FUNCTIONAL_TESTS:-test:functional} - - redis: - image: redis:6 - - elasticsearch: - image: kuzzleio/elasticsearch:7 - ulimits: - nofile: 65536 diff --git a/.ci/test-armhf.yml b/.ci/test-armhf.yml deleted file mode 100644 index ef40a31690..0000000000 --- a/.ci/test-armhf.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: '3' - -services: - kuzzle: - image: kuzzleio/core-dev-armhf:2 - command: /run-test-arm.sh - volumes: - - "..:/var/app" - - "./scripts/run-test-arm.sh:/run-test-arm.sh" - cap_add: - - SYS_PTRACE - depends_on: - - redis - - elasticsearch - environment: - - kuzzle_services__storageEngine__client__node=http://elasticsearch:9200 - - kuzzle_services__storageEngine__commonMapping__dynamic=true - - kuzzle_services__storageEngine__internalIndex__collections__users__dynamic=true - - kuzzle_services__internalCache__node__host=redis - - kuzzle_services__memoryStorage__node__host=redis - - kuzzle_server__protocols__mqtt__enabled=true - - kuzzle_server__protocols__mqtt__developmentMode=false - - kuzzle_http__accessControlAllowOrigin=localhost - - kuzzle_limits__loginsPerSecond=50 - - NODE_ENV=development - - DEBUG= - - SECRETS_FILE_PREFIX=/var/app/ - - KUZZLE_FUNCTIONAL_TESTS=${KUZZLE_FUNCTIONAL_TESTS:-test:functional} - - redis: - image: redis:6 - - elasticsearch: - image: kuzzleio/elasticsearch:7 - ulimits: - nofile: 65536 diff --git a/.ci/test-cluster.yml b/.ci/test-cluster.yml index 84a798c8a4..fae78c3c8a 100644 --- a/.ci/test-cluster.yml +++ b/.ci/test-cluster.yml @@ -31,6 +31,8 @@ x-kuzzle-config: &kuzzle-config - NODE_VERSION=${NODE_VERSION:-} - DEBUG=none - SECRETS_FILE_PREFIX=/var/app/ + # cluster + - kuzzle_plugins__cluster__privileged=true - kuzzle_plugins__cluster__minimumNodes=3 services: From e5e1582d2bbb7608a3f279c53428b79ac7f48f6a Mon Sep 17 00:00:00 2001 From: rolljee Date: Mon, 20 Nov 2023 16:07:01 +0100 Subject: [PATCH 6/8] Update jest tests --- jest/api/controller/document/mCreate.test.ts | 17 +++++++++++++---- jest/api/controller/document/metadata.test.ts | 10 +++++++--- jest/api/controller/document/search.test.ts | 11 ++++++++--- package-lock.json | 14 +++++++------- package.json | 2 +- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/jest/api/controller/document/mCreate.test.ts b/jest/api/controller/document/mCreate.test.ts index d5ddd3f2a4..c6c722b016 100644 --- a/jest/api/controller/document/mCreate.test.ts +++ b/jest/api/controller/document/mCreate.test.ts @@ -1,11 +1,16 @@ import { Kuzzle, WebSocket } from "kuzzle-sdk"; const kuzzle = new Kuzzle(new WebSocket("localhost")); -const index = "nyc-open-data"; -const collection = "yellow-taxi"; +const index = "food"; +const collection = "fruits"; beforeAll(async () => { await kuzzle.connect(); + + if (await kuzzle.index.exists(index)) { + await kuzzle.index.delete(index); + } + await kuzzle.index.create(index); await kuzzle.collection.create(index, collection, { mappings: { @@ -23,11 +28,15 @@ beforeAll(async () => { }, }, }); + console.log("End beforeAll"); }); afterAll(async () => { - await kuzzle.index.delete(index); - await kuzzle.disconnect(); + if (await kuzzle.index.exists(index)) { + await kuzzle.index.delete(index); + } + + kuzzle.disconnect(); }); afterEach(async () => { diff --git a/jest/api/controller/document/metadata.test.ts b/jest/api/controller/document/metadata.test.ts index cd8bd8fd46..74bfed7184 100644 --- a/jest/api/controller/document/metadata.test.ts +++ b/jest/api/controller/document/metadata.test.ts @@ -1,18 +1,22 @@ import { Kuzzle, WebSocket } from "kuzzle-sdk"; const kuzzle = new Kuzzle(new WebSocket("localhost")); -const index = "nyc-open-data"; -const collection = "yellow-taxi"; +const index = "computer"; +const collection = "macbook"; beforeAll(async () => { await kuzzle.connect(); + if (await kuzzle.index.exists(index)) { + await kuzzle.index.delete(index); + } + await kuzzle.index.create(index); await kuzzle.collection.create(index, collection, {}); }); afterAll(async () => { await kuzzle.index.delete(index); - await kuzzle.disconnect(); + kuzzle.disconnect(); }); describe("document:create", () => { diff --git a/jest/api/controller/document/search.test.ts b/jest/api/controller/document/search.test.ts index 922b220b60..72a84423ff 100644 --- a/jest/api/controller/document/search.test.ts +++ b/jest/api/controller/document/search.test.ts @@ -1,11 +1,16 @@ import { Kuzzle, WebSocket } from "kuzzle-sdk"; const kuzzle = new Kuzzle(new WebSocket("localhost")); -const index = "nyc-open-data"; -const collection = "yellow-taxi"; +const index = "cellular"; +const collection = "iphone"; beforeAll(async () => { await kuzzle.connect(); + + if (await kuzzle.index.exists(index)) { + await kuzzle.index.delete(index); + } + await kuzzle.index.create(index); await kuzzle.collection.create(index, collection, { mappings: { @@ -27,7 +32,7 @@ beforeAll(async () => { afterAll(async () => { await kuzzle.index.delete(index); - await kuzzle.disconnect(); + kuzzle.disconnect(); }); afterEach(async () => { diff --git a/package-lock.json b/package-lock.json index c4dc8ce7c1..752a0a67fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,7 +66,7 @@ "cucumber": "6.0.5", "ergol": "1.0.2", "eslint-plugin-kuzzle": "0.0.6", - "jest": "29.4.1", + "jest": "29.7.0", "mocha": "10.2.0", "mock-require": "3.0.3", "mqtt": "4.3.7", @@ -6831,15 +6831,15 @@ } }, "node_modules/jest": { - "version": "29.4.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.4.1.tgz", - "integrity": "sha512-cknimw7gAXPDOmj0QqztlxVtBVCw2lYY9CeIE5N6kD+kET1H4H79HSNISJmijb1HF+qk+G+ploJgiDi5k/fRlg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "dependencies": { - "@jest/core": "^29.4.1", - "@jest/types": "^29.4.1", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^29.4.1" + "jest-cli": "^29.7.0" }, "bin": { "jest": "bin/jest.js" diff --git a/package.json b/package.json index e9c9e96b57..e73aea61a4 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "cucumber": "6.0.5", "ergol": "1.0.2", "eslint-plugin-kuzzle": "0.0.6", - "jest": "29.4.1", + "jest": "29.7.0", "mocha": "10.2.0", "mock-require": "3.0.3", "mqtt": "4.3.7", From 9a23df6e56b62a384efe4f789c77306f90a6d87a Mon Sep 17 00:00:00 2001 From: Ricky Date: Mon, 20 Nov 2023 16:55:55 +0100 Subject: [PATCH 7/8] Update CONTRIBUTING.md Co-authored-by: Kuruyia <8174691+Kuruyia@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96b5641082..2ad51b48dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ We use most of the [NPM Coding Style](https://www.w3resource.com/npm/npm-coding- ## Tools -For development only, we built a specific docker- ompose file: `docker-compose.yml`. You can use it to profile, debug, test a variable on the fly, add breakpoints and so on, thanks to [chrome-devtools](https://developer.chrome.com/devtools). +For development only, we built a specific Docker Compose file: `docker-compose.yml`. You can use it to profile, debug, test a variable on the fly, add breakpoints and so on, thanks to [chrome-devtools](https://developer.chrome.com/devtools). Check the logs at the start of Kuzzle using the development docker image to get the appropriate debug URL. How to run the development stack (needs Docker 1.10+ and Docker Compose 1.8+): From 32990c257206d8f2a3f228fc80ebdf52f95714b2 Mon Sep 17 00:00:00 2001 From: Ricky Date: Mon, 20 Nov 2023 16:56:04 +0100 Subject: [PATCH 8/8] Update README.md Co-authored-by: Kuruyia <8174691+Kuruyia@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 642199998e..c8e8f27b7c 100644 --- a/README.md +++ b/README.md @@ -148,5 +148,5 @@ Run the following command to install all the dependencies in your container: npm run docker:install ``` -finally run the command `docker compose up` to launch your kuzzle stack. +Finally, run the command `docker compose up` to start your Kuzzle stack.