diff --git a/.github/workflows/pull_request.workflow.yml b/.github/workflows/pull_request.workflow.yml index d393e3c9..aa8eda50 100644 --- a/.github/workflows/pull_request.workflow.yml +++ b/.github/workflows/pull_request.workflow.yml @@ -7,9 +7,9 @@ jobs: name: Lint runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: @@ -19,9 +19,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - uses: ./.github/actions/es-lint build: @@ -29,9 +29,9 @@ jobs: runs-on: ubuntu-22.04 needs: [lint] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: @@ -41,9 +41,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - uses: ./.github/actions/build - name: Store build archive as artifact uses: actions/upload-artifact@v2 @@ -59,9 +59,9 @@ jobs: matrix: test-set: [stdout, cucumber] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules NODE_ENV: test @@ -72,9 +72,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - name: Recover previously built Kourou uses: actions/download-artifact@v2 with: diff --git a/.github/workflows/push_dev.workflow.yml b/.github/workflows/push_dev.workflow.yml index 896b32b4..3ec56539 100644 --- a/.github/workflows/push_dev.workflow.yml +++ b/.github/workflows/push_dev.workflow.yml @@ -10,9 +10,9 @@ jobs: name: Lint runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: @@ -22,9 +22,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - uses: ./.github/actions/es-lint build: @@ -32,9 +32,9 @@ jobs: runs-on: ubuntu-22.04 needs: [lint] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: @@ -44,9 +44,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - uses: ./.github/actions/build - name: Store build archive as artifact uses: actions/upload-artifact@v2 @@ -62,9 +62,9 @@ jobs: matrix: test-set: [stdout, cucumber] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules NODE_ENV: test @@ -75,9 +75,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - name: Recover previously built Kourou uses: actions/download-artifact@v2 with: diff --git a/.github/workflows/push_master.workflow.yml b/.github/workflows/push_master.workflow.yml index e4aeb525..55d09170 100644 --- a/.github/workflows/push_master.workflow.yml +++ b/.github/workflows/push_master.workflow.yml @@ -10,9 +10,9 @@ jobs: name: Lint runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: @@ -22,9 +22,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - uses: ./.github/actions/es-lint build: @@ -32,9 +32,9 @@ jobs: runs-on: ubuntu-22.04 needs: [lint] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules with: @@ -44,9 +44,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - uses: ./.github/actions/build - name: Store build archive as artifact uses: actions/upload-artifact@v2 @@ -62,9 +62,9 @@ jobs: matrix: test-set: [stdout, cucumber] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-node-modules NODE_ENV: test @@ -75,9 +75,9 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + - uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 - name: Recover previously built Kourou uses: actions/download-artifact@v2 with: @@ -95,10 +95,10 @@ jobs: runs-on: ubuntu-22.04 needs: [functional-test] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 18 registry-url: "https://registry.npmjs.org" - run: npm install - run: npm run build diff --git a/README.md b/README.md index cae73ac1..03affadd 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ $ npm install -g kourou $ kourou COMMAND running command... $ kourou (-v|--version|version) -kourou/0.26.0 linux-x64 node-v14.21.2 +kourou/0.26.1 darwin-arm64 node-v18.17.1 $ kourou --help [COMMAND] USAGE $ kourou COMMAND @@ -126,72 +126,64 @@ All other arguments and options will be passed as-is to the `sdk:query` method. # Commands -- [kourou](#kourou) -- [Usage](#usage) - - [Connect and authenticate to Kuzzle API](#connect-and-authenticate-to-kuzzle-api) - - [User impersonation](#user-impersonation) - - [Automatic command infering for API actions](#automatic-command-infering-for-api-actions) -- [Commands](#commands) - - [`kourou api-key:check TOKEN`](#kourou-api-keycheck-token) - - [`kourou api-key:create USER`](#kourou-api-keycreate-user) - - [`kourou api-key:delete USER ID`](#kourou-api-keydelete-user-id) - - [`kourou api-key:search USER`](#kourou-api-keysearch-user) - - [`kourou app:debug-proxy`](#kourou-appdebug-proxy) - - [`kourou app:doctor`](#kourou-appdoctor) - - [`kourou app:scaffold DESTINATION`](#kourou-appscaffold-destination) - - [`kourou app:start-services`](#kourou-appstart-services) - - [`kourou autocomplete [SHELL]`](#kourou-autocomplete-shell) - - [`kourou collection:create INDEX COLLECTION [BODY]`](#kourou-collectioncreate-index-collection-body) - - [`kourou collection:export INDEX COLLECTION`](#kourou-collectionexport-index-collection) - - [`kourou collection:import PATH`](#kourou-collectionimport-path) - - [`kourou collection:migrate SCRIPT PATH`](#kourou-collectionmigrate-script-path) - - [`kourou config:diff FIRST SECOND`](#kourou-configdiff-first-second) - - [`kourou document:search INDEX COLLECTION [QUERY]`](#kourou-documentsearch-index-collection-query) - - [`kourou es:aliases:cat`](#kourou-esaliasescat) - - [`kourou es:indices:cat`](#kourou-esindicescat) - - [`kourou es:indices:get INDEX ID`](#kourou-esindicesget-index-id) - - [`kourou es:indices:insert INDEX`](#kourou-esindicesinsert-index) - - [`kourou es:migrate`](#kourou-esmigrate) - - [`kourou es:snapshot:create REPOSITORY NAME`](#kourou-essnapshotcreate-repository-name) - - [`kourou es:snapshot:create-repository REPOSITORY LOCATION`](#kourou-essnapshotcreate-repository-repository-location) - - [`kourou es:snapshot:list REPOSITORY`](#kourou-essnapshotlist-repository) - - [`kourou file:decrypt FILE`](#kourou-filedecrypt-file) - - [`kourou file:encrypt FILE`](#kourou-fileencrypt-file) - - [`kourou file:test FILE`](#kourou-filetest-file) - - [`kourou help [COMMAND]`](#kourou-help-command) - - [`kourou import PATH`](#kourou-import-path) - - [`kourou index:export INDEX`](#kourou-indexexport-index) - - [`kourou index:import PATH`](#kourou-indeximport-path) - - [`kourou instance:kill`](#kourou-instancekill) - - [`kourou instance:list`](#kourou-instancelist) - - [`kourou instance:logs`](#kourou-instancelogs) - - [`kourou instance:spawn`](#kourou-instancespawn) - - [`kourou paas:deploy ENVIRONMENT APPLICATIONID IMAGE`](#kourou-paasdeploy-environment-applicationid-image) - - [`kourou paas:init PROJECT`](#kourou-paasinit-project) - - [`kourou paas:login`](#kourou-paaslogin) - - [`kourou paas:snapshots:cat ENVIRONMENT APPLICATIONID`](#kourou-paassnapshotscat-environment-applicationid) - - [`kourou paas:snapshots:dump ENVIRONMENT APPLICATIONID`](#kourou-paassnapshotsdump-environment-applicationid) - - [`kourou paas:snapshots:restore ENVIRONMENT APPLICATIONID SNAPSHOTID`](#kourou-paassnapshotsrestore-environment-applicationid-snapshotid) - - [`kourou profile:export`](#kourou-profileexport) - - [`kourou profile:import PATH`](#kourou-profileimport-path) - - [`kourou realtime:subscribe INDEX COLLECTION [FILTERS]`](#kourou-realtimesubscribe-index-collection-filters) - - [`kourou redis:list-keys [MATCH]`](#kourou-redislist-keys-match) - - [`kourou role:export`](#kourou-roleexport) - - [`kourou role:import PATH`](#kourou-roleimport-path) - - [`kourou sdk:execute [CODE]`](#kourou-sdkexecute-code) - - [`kourou sdk:query CONTROLLER:ACTION`](#kourou-sdkquery-controlleraction) - - [`kourou user:export`](#kourou-userexport) - - [`kourou user:export-mappings`](#kourou-userexport-mappings) - - [`kourou user:import PATH`](#kourou-userimport-path) - - [`kourou user:import-mappings PATH`](#kourou-userimport-mappings-path) - - [`kourou vault:add SECRETS-FILE KEY VALUE`](#kourou-vaultadd-secrets-file-key-value) - - [`kourou vault:decrypt FILE`](#kourou-vaultdecrypt-file) - - [`kourou vault:encrypt FILE`](#kourou-vaultencrypt-file) - - [`kourou vault:show SECRETS-FILE [KEY]`](#kourou-vaultshow-secrets-file-key) - - [`kourou vault:test SECRETS-FILE`](#kourou-vaulttest-secrets-file) -- [Where does this weird name come from?](#where-does-this-weird-name-come-from) -- [Have fun with a quine](#have-fun-with-a-quine) -- [Telemetry](#telemetry) +* [`kourou api-key:check TOKEN`](#kourou-api-keycheck-token) +* [`kourou api-key:create USER`](#kourou-api-keycreate-user) +* [`kourou api-key:delete USER ID`](#kourou-api-keydelete-user-id) +* [`kourou api-key:search USER`](#kourou-api-keysearch-user) +* [`kourou app:debug-proxy`](#kourou-appdebug-proxy) +* [`kourou app:doctor`](#kourou-appdoctor) +* [`kourou app:scaffold DESTINATION`](#kourou-appscaffold-destination) +* [`kourou app:start-services`](#kourou-appstart-services) +* [`kourou autocomplete [SHELL]`](#kourou-autocomplete-shell) +* [`kourou collection:create INDEX COLLECTION [BODY]`](#kourou-collectioncreate-index-collection-body) +* [`kourou collection:export INDEX COLLECTION`](#kourou-collectionexport-index-collection) +* [`kourou collection:import PATH`](#kourou-collectionimport-path) +* [`kourou collection:migrate SCRIPT PATH`](#kourou-collectionmigrate-script-path) +* [`kourou config:diff FIRST SECOND`](#kourou-configdiff-first-second) +* [`kourou document:search INDEX COLLECTION [QUERY]`](#kourou-documentsearch-index-collection-query) +* [`kourou es:aliases:cat`](#kourou-esaliasescat) +* [`kourou es:indices:cat`](#kourou-esindicescat) +* [`kourou es:indices:get INDEX ID`](#kourou-esindicesget-index-id) +* [`kourou es:indices:insert INDEX`](#kourou-esindicesinsert-index) +* [`kourou es:migrate`](#kourou-esmigrate) +* [`kourou es:snapshot:create REPOSITORY NAME`](#kourou-essnapshotcreate-repository-name) +* [`kourou es:snapshot:create-repository REPOSITORY LOCATION`](#kourou-essnapshotcreate-repository-repository-location) +* [`kourou es:snapshot:list REPOSITORY`](#kourou-essnapshotlist-repository) +* [`kourou file:decrypt FILE`](#kourou-filedecrypt-file) +* [`kourou file:encrypt FILE`](#kourou-fileencrypt-file) +* [`kourou file:test FILE`](#kourou-filetest-file) +* [`kourou help [COMMAND]`](#kourou-help-command) +* [`kourou import PATH`](#kourou-import-path) +* [`kourou index:export INDEX`](#kourou-indexexport-index) +* [`kourou index:import PATH`](#kourou-indeximport-path) +* [`kourou instance:kill`](#kourou-instancekill) +* [`kourou instance:list`](#kourou-instancelist) +* [`kourou instance:logs`](#kourou-instancelogs) +* [`kourou instance:spawn`](#kourou-instancespawn) +* [`kourou paas:deploy ENVIRONMENT APPLICATIONID IMAGE`](#kourou-paasdeploy-environment-applicationid-image) +* [`kourou paas:init PROJECT`](#kourou-paasinit-project) +* [`kourou paas:login`](#kourou-paaslogin) +* [`kourou paas:logs ENVIRONMENT APPLICATION`](#kourou-paaslogs-environment-application) +* [`kourou paas:snapshots:cat ENVIRONMENT APPLICATIONID`](#kourou-paassnapshotscat-environment-applicationid) +* [`kourou paas:snapshots:dump ENVIRONMENT APPLICATIONID`](#kourou-paassnapshotsdump-environment-applicationid) +* [`kourou paas:snapshots:restore ENVIRONMENT APPLICATIONID SNAPSHOTID`](#kourou-paassnapshotsrestore-environment-applicationid-snapshotid) +* [`kourou profile:export`](#kourou-profileexport) +* [`kourou profile:import PATH`](#kourou-profileimport-path) +* [`kourou realtime:subscribe INDEX COLLECTION [FILTERS]`](#kourou-realtimesubscribe-index-collection-filters) +* [`kourou redis:list-keys [MATCH]`](#kourou-redislist-keys-match) +* [`kourou role:export`](#kourou-roleexport) +* [`kourou role:import PATH`](#kourou-roleimport-path) +* [`kourou sdk:execute [CODE]`](#kourou-sdkexecute-code) +* [`kourou sdk:query CONTROLLER:ACTION`](#kourou-sdkquery-controlleraction) +* [`kourou user:export`](#kourou-userexport) +* [`kourou user:export-mappings`](#kourou-userexport-mappings) +* [`kourou user:import PATH`](#kourou-userimport-path) +* [`kourou user:import-mappings PATH`](#kourou-userimport-mappings-path) +* [`kourou vault:add SECRETS-FILE KEY VALUE`](#kourou-vaultadd-secrets-file-key-value) +* [`kourou vault:decrypt FILE`](#kourou-vaultdecrypt-file) +* [`kourou vault:encrypt FILE`](#kourou-vaultencrypt-file) +* [`kourou vault:show SECRETS-FILE [KEY]`](#kourou-vaultshow-secrets-file-key) +* [`kourou vault:test SECRETS-FILE`](#kourou-vaulttest-secrets-file) ## `kourou api-key:check TOKEN` @@ -377,9 +369,7 @@ ARGUMENTS DESTINATION Directory to scaffold the app OPTIONS - --flavor=flavor [default: generic] Template flavor ("generic", "iot-backend", "iot-console"). - Those can be found here: https://github.com/kuzzleio/project-templates - + --flavor=flavor [default: generic] Template flavor ("generic", "iot"). --help show CLI help ``` @@ -421,7 +411,7 @@ EXAMPLES $ kourou autocomplete --refresh-cache ``` -_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.0/src/commands/autocomplete/index.ts)_ +_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.10/src/commands/autocomplete/index.ts)_ ## `kourou collection:create INDEX COLLECTION [BODY]` @@ -885,7 +875,7 @@ OPTIONS --all see all commands in CLI ``` -_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.2/src/commands/help.ts)_ +_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.18/src/commands/help.ts)_ ## `kourou import PATH` @@ -1108,6 +1098,31 @@ OPTIONS _See code: [src/commands/paas/login.ts](src/commands/paas/login.ts)_ +## `kourou paas:logs ENVIRONMENT APPLICATION` + +Show logs of the targeted application + +``` +USAGE + $ kourou paas:logs ENVIRONMENT APPLICATION + +ARGUMENTS + ENVIRONMENT Kuzzle PaaS environment + APPLICATION Kuzzle PaaS application + +OPTIONS + -f, --follow Follow log output + -n, --tail=tail Number of lines to show from the end of the logs + -t, --timestamp Show timestamp + --help show CLI help + --podName=podName Name of the pod to show logs from + --project=project Current PaaS project + --since=since Display logs from a specific absolute (e.g. 2022/12/02 09:41) or relative (e.g. a minute ago) time + --until=until Display logs until a specific absolute (e.g. 2022/12/02 09:41) or relative (e.g. a minute ago) time +``` + +_See code: [src/commands/paas/logs.ts](src/commands/paas/logs.ts)_ + ## `kourou paas:snapshots:cat ENVIRONMENT APPLICATIONID` List all snapshots for a given kuzzle application in a environment @@ -1124,13 +1139,16 @@ OPTIONS --help show CLI help --project=project Current PaaS project --token=token Authentication token + +EXAMPLE + kourou paas:snapshots:cat --project paas-project-myproject api main ``` _See code: [src/commands/paas/snapshots/cat.ts](src/commands/paas/snapshots/cat.ts)_ ## `kourou paas:snapshots:dump ENVIRONMENT APPLICATIONID` -List all snapshots for a given kuzzle application in a environment +Create a new snapshot of the current application state ``` USAGE @@ -1144,13 +1162,16 @@ OPTIONS --help show CLI help --project=project Current PaaS project --token=token Authentication token + +EXAMPLE + kourou paas:snapshots:dump --project paas-project-myproject api main ``` _See code: [src/commands/paas/snapshots/dump.ts](src/commands/paas/snapshots/dump.ts)_ ## `kourou paas:snapshots:restore ENVIRONMENT APPLICATIONID SNAPSHOTID` -List all snapshots for a given kuzzle application in a environment +Restore a snapshot of the current application state ``` USAGE @@ -1165,6 +1186,9 @@ OPTIONS --help show CLI help --project=project Current PaaS project --token=token Authentication token + +EXAMPLE + kourou paas:snapshots:restore --project paas-project-myproject api main snapshot-id ``` _See code: [src/commands/paas/snapshots/restore.ts](src/commands/paas/snapshots/restore.ts)_ diff --git a/package-lock.json b/package-lock.json index c0fc336f..0573b68a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kourou", - "version": "0.26.0", + "version": "0.26.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "kourou", - "version": "0.26.0", + "version": "0.26.1", "license": "Apache-2.0", "dependencies": { "@elastic/elasticsearch": "^7.12.0", @@ -27,6 +27,7 @@ "ndjson": "^2.0.0", "node-emoji": "^1.10.0", "node-fetch": "^2.6.7", + "production": "^0.0.2", "strip-json-comments": "^3.1.1", "tar": "^6.1.11", "tmp": "^0.2.1", @@ -1599,6 +1600,11 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -1830,8 +1836,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/at-least-node": { "version": "1.0.0", @@ -1895,6 +1900,11 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2097,6 +2107,36 @@ "node": "*" } }, + "node_modules/cheerio": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.10.3.tgz", + "integrity": "sha512-z18iEDVDRpNeLPCGDmDRlex8iLpYxV5KyQz3JHGpzdVX1tSRvtBfwWELW65Ae/FIOGO/YKxKERhz/0n5RI0m7A==", + "dependencies": { + "cheerio-select": "*", + "entities": "0.x", + "htmlparser2": "2.x", + "underscore": "*" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/chokidar": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", @@ -2395,7 +2435,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -2481,6 +2520,32 @@ "node": ">= 8" } }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/cucumber": { "version": "6.0.7", "resolved": "https://registry.npmjs.org/cucumber/-/cucumber-6.0.7.tgz", @@ -2647,7 +2712,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -2699,6 +2763,68 @@ "node": ">=6.0.0" } }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/dom-serializer/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/duration": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/duration/-/duration-0.2.2.tgz", @@ -2763,6 +2889,11 @@ "node": ">=8.6" } }, + "node_modules/entities": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-0.5.0.tgz", + "integrity": "sha512-T5XQtlzuW+PfeSsGp3uryfYQof820zYbnUnUDEkwUVIAfgYeixIN16c4jh8gs0SqJUTGLU0XD6QsvjEPbmdwzQ==" + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -3446,7 +3577,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3808,6 +3938,37 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "node_modules/htmlparser2": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-2.6.0.tgz", + "integrity": "sha512-oR9aps3hDZdU0whPlDjz4HdafpcZclpjrUOwPqDldr+WDubEnVerBNP8I0Wy0VIZO5Mxq/4yALDOYZTWf5Jtog==", + "dependencies": { + "domelementtype": "1", + "domhandler": "2.0", + "domutils": "1.0" + } + }, + "node_modules/htmlparser2/node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + }, + "node_modules/htmlparser2/node_modules/domhandler": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.0.3.tgz", + "integrity": "sha512-D8+qeCUo6LpYvBZsmXWunDJ9zOD8mVg6EwZIdgxmnT+xGWRsReF/TwsZ5EzlIJDipxlE6qJh1dXt9oeplGN3Bg==", + "dependencies": { + "domelementtype": "1" + } + }, + "node_modules/htmlparser2/node_modules/domutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.0.1.tgz", + "integrity": "sha512-EtnpDnVNvVaRBHmc5PV2lGHlgic4IjrYgS1f3U/M7CjihJIKfsJFvwj6JfAjr7f7wNDcloq3rOb08xAiL622gA==", + "dependencies": { + "domelementtype": "1" + } + }, "node_modules/http-call": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/http-call/-/http-call-5.3.0.tgz", @@ -4366,6 +4527,11 @@ "kuzzle-sdk": "^7.0.0" } }, + "node_modules/keypress": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz", + "integrity": "sha512-x0yf9PL/nx9Nw9oLL8ZVErFAk85/lslwEP7Vz7s5SI1ODXZIgit3C5qyWjw4DxOuO/3Hb4866SQh28a1V1d+WA==" + }, "node_modules/knuth-shuffle-seeded": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/knuth-shuffle-seeded/-/knuth-shuffle-seeded-1.0.6.tgz", @@ -5123,7 +5289,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "engines": { "node": ">= 0.6" } @@ -5132,7 +5297,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "dependencies": { "mime-db": "1.52.0" }, @@ -5510,6 +5674,17 @@ "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", "dev": true }, + "node_modules/nopt": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", + "integrity": "sha512-x8vXm7BZ2jE1Txrxh/hO74HTuYZQEbo8edoRcANgdZ4+PCV+pbjd/xdummkmjjC7LU5EjPzlu8zEq/oxWylnKA==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, "node_modules/normalize-package-data": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", @@ -5555,6 +5730,17 @@ "node": ">=4" } }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -6400,6 +6586,28 @@ "node": ">=8" } }, + "node_modules/production": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/production/-/production-0.0.2.tgz", + "integrity": "sha512-5w7rjO1yaPVymK2zA3BGlIFhQMJdu6UufXR1KxUh+1lWGorjcGMzs9kOTHadReT1f8+EHfSFefgZVyDYSz7tOQ==", + "dependencies": { + "cheerio": "0.10.3", + "commander": "1.1.1", + "request": "2.12.0", + "yuglify": "*" + } + }, + "node_modules/production/node_modules/commander": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-1.1.1.tgz", + "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", + "dependencies": { + "keypress": "0.1.x" + }, + "engines": { + "node": ">= 0.6.x" + } + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -6686,6 +6894,66 @@ "node": ">=0.10" } }, + "node_modules/request": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.12.0.tgz", + "integrity": "sha512-GcOI9NyUw2lRke4kdbrjQFxu+cLugShENHvcb9QCSLLc/yH3lP7I/7RESxVbYS+AxC/r9rwzks52MRHVoZdb5w==", + "bundleDependencies": [ + "form-data", + "mime" + ], + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "engines": [ + "node >= 0.3.6" + ], + "dependencies": { + "form-data": "~0.0.3", + "mime": "~1.2.7" + } + }, + "node_modules/request/node_modules/form-data": { + "version": "0.0.3", + "inBundle": true, + "dependencies": { + "async": "~0.1.9", + "combined-stream": "0.0.3", + "mime": "~1.2.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/request/node_modules/form-data/node_modules/async": { + "version": "0.1.9", + "inBundle": true, + "engines": { + "node": "*" + } + }, + "node_modules/request/node_modules/form-data/node_modules/combined-stream": { + "version": "0.0.3", + "inBundle": true, + "dependencies": { + "delayed-stream": "0.0.5" + }, + "engines": { + "node": "*" + } + }, + "node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream": { + "version": "0.0.5", + "inBundle": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/request/node_modules/mime": { + "version": "1.2.7", + "inBundle": true, + "engines": { + "node": "*" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -7668,6 +7936,22 @@ "node": ">=4.2.0" } }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/underscore": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -8101,6 +8385,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ycssmin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ycssmin/-/ycssmin-1.0.1.tgz", + "integrity": "sha512-nSBxAfGA/RlALXyqijYUnIjMXNXWxYHrQJSYwNqypeULl44J8Z/eN5larw7ZEdYLeUHBgPyilve6hqQtWVVs9g==", + "bin": { + "ycssmin": "bin/cssmin" + } + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -8121,6 +8413,19 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/yuglify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yuglify/-/yuglify-2.0.0.tgz", + "integrity": "sha512-H5bf7+JO9htUtORqDGYiFAeZjrAQXVU7l2ZX1EYDQFJENjex2pSixhmE6SMSnntzHMeraQhcIXPFdA3YF9ssMA==", + "dependencies": { + "nopt": "~2.1.1", + "uglify-js": "^3.1.4", + "ycssmin": "~1.0.1" + }, + "bin": { + "yuglify": "bin/yuglify" + } } }, "dependencies": { @@ -9339,6 +9644,11 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -9512,8 +9822,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "at-least-node": { "version": "1.0.0", @@ -9557,6 +9866,11 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -9691,6 +10005,30 @@ "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "dev": true }, + "cheerio": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.10.3.tgz", + "integrity": "sha512-z18iEDVDRpNeLPCGDmDRlex8iLpYxV5KyQz3JHGpzdVX1tSRvtBfwWELW65Ae/FIOGO/YKxKERhz/0n5RI0m7A==", + "requires": { + "cheerio-select": "*", + "entities": "0.x", + "htmlparser2": "2.x", + "underscore": "*" + } + }, + "cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "requires": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + } + }, "chokidar": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", @@ -9918,7 +10256,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -9987,6 +10324,23 @@ "which": "^2.0.1" } }, + "css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "requires": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + } + }, + "css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==" + }, "cucumber": { "version": "6.0.7", "resolved": "https://registry.npmjs.org/cucumber/-/cucumber-6.0.7.tgz", @@ -10122,8 +10476,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, "detect-indent": { "version": "6.1.0", @@ -10160,6 +10513,46 @@ "esutils": "^2.0.2" } }, + "dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "requires": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "dependencies": { + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==" + } + } + }, + "domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==" + }, + "domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "requires": { + "domelementtype": "^2.3.0" + } + }, + "domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "requires": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + } + }, "duration": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/duration/-/duration-0.2.2.tgz", @@ -10212,6 +10605,11 @@ "ansi-colors": "^4.1.1" } }, + "entities": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-0.5.0.tgz", + "integrity": "sha512-T5XQtlzuW+PfeSsGp3uryfYQof820zYbnUnUDEkwUVIAfgYeixIN16c4jh8gs0SqJUTGLU0XD6QsvjEPbmdwzQ==" + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -10751,7 +11149,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -11006,6 +11403,39 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "htmlparser2": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-2.6.0.tgz", + "integrity": "sha512-oR9aps3hDZdU0whPlDjz4HdafpcZclpjrUOwPqDldr+WDubEnVerBNP8I0Wy0VIZO5Mxq/4yALDOYZTWf5Jtog==", + "requires": { + "domelementtype": "1", + "domhandler": "2.0", + "domutils": "1.0" + }, + "dependencies": { + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + }, + "domhandler": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.0.3.tgz", + "integrity": "sha512-D8+qeCUo6LpYvBZsmXWunDJ9zOD8mVg6EwZIdgxmnT+xGWRsReF/TwsZ5EzlIJDipxlE6qJh1dXt9oeplGN3Bg==", + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.0.1.tgz", + "integrity": "sha512-EtnpDnVNvVaRBHmc5PV2lGHlgic4IjrYgS1f3U/M7CjihJIKfsJFvwj6JfAjr7f7wNDcloq3rOb08xAiL622gA==", + "requires": { + "domelementtype": "1" + } + } + } + }, "http-call": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/http-call/-/http-call-5.3.0.tgz", @@ -11420,6 +11850,11 @@ "getmac": "^5.20.0" } }, + "keypress": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz", + "integrity": "sha512-x0yf9PL/nx9Nw9oLL8ZVErFAk85/lslwEP7Vz7s5SI1ODXZIgit3C5qyWjw4DxOuO/3Hb4866SQh28a1V1d+WA==" + }, "knuth-shuffle-seeded": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/knuth-shuffle-seeded/-/knuth-shuffle-seeded-1.0.6.tgz", @@ -12002,14 +12437,12 @@ "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "requires": { "mime-db": "1.52.0" } @@ -12295,6 +12728,14 @@ "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", "dev": true }, + "nopt": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", + "integrity": "sha512-x8vXm7BZ2jE1Txrxh/hO74HTuYZQEbo8edoRcANgdZ4+PCV+pbjd/xdummkmjjC7LU5EjPzlu8zEq/oxWylnKA==", + "requires": { + "abbrev": "1" + } + }, "normalize-package-data": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", @@ -12330,6 +12771,14 @@ } } }, + "nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "requires": { + "boolbase": "^1.0.0" + } + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -12937,6 +13386,27 @@ "fromentries": "^1.2.0" } }, + "production": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/production/-/production-0.0.2.tgz", + "integrity": "sha512-5w7rjO1yaPVymK2zA3BGlIFhQMJdu6UufXR1KxUh+1lWGorjcGMzs9kOTHadReT1f8+EHfSFefgZVyDYSz7tOQ==", + "requires": { + "cheerio": "0.10.3", + "commander": "1.1.1", + "request": "2.12.0", + "yuglify": "*" + }, + "dependencies": { + "commander": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-1.1.1.tgz", + "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", + "requires": { + "keypress": "0.1.x" + } + } + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -13157,6 +13627,49 @@ "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", "dev": true }, + "request": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.12.0.tgz", + "integrity": "sha512-GcOI9NyUw2lRke4kdbrjQFxu+cLugShENHvcb9QCSLLc/yH3lP7I/7RESxVbYS+AxC/r9rwzks52MRHVoZdb5w==", + "requires": { + "form-data": "~0.0.3", + "mime": "~1.2.7" + }, + "dependencies": { + "form-data": { + "version": "0.0.3", + "bundled": true, + "requires": { + "async": "~0.1.9", + "combined-stream": "0.0.3", + "mime": "~1.2.2" + }, + "dependencies": { + "async": { + "version": "0.1.9", + "bundled": true + }, + "combined-stream": { + "version": "0.0.3", + "bundled": true, + "requires": { + "delayed-stream": "0.0.5" + }, + "dependencies": { + "delayed-stream": { + "version": "0.0.5", + "bundled": true + } + } + } + } + }, + "mime": { + "version": "1.2.7", + "bundled": true + } + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -13917,6 +14430,16 @@ "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true }, + "uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==" + }, + "underscore": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -14242,6 +14765,11 @@ } } }, + "ycssmin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ycssmin/-/ycssmin-1.0.1.tgz", + "integrity": "sha512-nSBxAfGA/RlALXyqijYUnIjMXNXWxYHrQJSYwNqypeULl44J8Z/eN5larw7ZEdYLeUHBgPyilve6hqQtWVVs9g==" + }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -14253,6 +14781,16 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true + }, + "yuglify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yuglify/-/yuglify-2.0.0.tgz", + "integrity": "sha512-H5bf7+JO9htUtORqDGYiFAeZjrAQXVU7l2ZX1EYDQFJENjex2pSixhmE6SMSnntzHMeraQhcIXPFdA3YF9ssMA==", + "requires": { + "nopt": "~2.1.1", + "uglify-js": "^3.1.4", + "ycssmin": "~1.0.1" + } } } } diff --git a/package.json b/package.json index 9ac68204..e71198fc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kourou", "description": "The CLI that helps you manage your Kuzzle instances", - "version": "0.26.0", + "version": "0.26.1", "author": "The Kuzzle Team ", "bin": { "kourou": "./bin/run" @@ -37,6 +37,7 @@ "ndjson": "^2.0.0", "node-emoji": "^1.10.0", "node-fetch": "^2.6.7", + "production": "^0.0.2", "strip-json-comments": "^3.1.1", "tar": "^6.1.11", "tmp": "^0.2.1", diff --git a/src/commands/app/scaffold.ts b/src/commands/app/scaffold.ts index 788083af..48a03791 100644 --- a/src/commands/app/scaffold.ts +++ b/src/commands/app/scaffold.ts @@ -6,6 +6,7 @@ import { Kommand } from "../../common"; import { execute } from "../../support/execute"; export default class AppScaffold extends Kommand { + public templatesDir = "/tmp/kuzzle-templates"; static initSdk = false; static description = "Scaffolds a new Kuzzle application"; @@ -14,8 +15,7 @@ export default class AppScaffold extends Kommand { help: flags.help(), flavor: flags.string({ default: "generic", - description: `Template flavor ("generic", "iot-backend", "iot-console"). - Those can be found here: https://github.com/kuzzleio/project-templates`, + description: `Template flavor ("generic", "iot").`, }), }; @@ -33,40 +33,89 @@ export default class AppScaffold extends Kommand { const tasks = new Listr([ { - title: "Creating and rendering application files", - task: async () => this.cloneTemplate(flavor, destination), + title: "Checking destination", + task: async () => this.checkDestination(destination), }, + { + title: "Prepare temporary folder", + task: async () => this.prepareTemplate(), + }, + { + title: "Cloning template repository", + task: async () => this.cloneTemplate(flavor) + }, { + title: "Copying template files", + task: async () => this.copyTemplate(destination) + }, + { + title: "Cleaning up", + task: async () => this.cleanup() + } ]); await tasks.run(); this.log(""); - this.logOk( - `Scaffolding complete! Use ${chalk.grey( - `cd ${destination} && npm run docker npm install` - )} install dependencies and then ${chalk.grey( - `npm run docker:dev` - )} to run your application!` - ); + this.logOk(`Scaffolding complete!`); + this.logOk(`Use ${chalk.blue.bold( + `cd ${destination} && docker compose up -d` + )} to start your Kuzzle stack.`); + } + + getRepo(flavor: string) { + console.log(flavor); + switch (flavor) { + case "generic": + return "template-kuzzle-project"; + case "iot": + return "template-kiotp-project"; + default: + return "template-kuzzle-project"; + } } - async cloneTemplate(flavor: string, destination: string) { - const templatesDir = "/tmp/project-templates"; + async checkDestination(destination: string) { + let process: any; - await execute("rm", "-rf", templatesDir); + try { + process = await execute("test", "-d", destination) + } catch (error: any) { + if (error.result.exitCode === 1) { + // Destination directory does not exist + return; + } + } + + if (process.exitCode === 0) { + throw new Error( + `Destination directory ${destination} already exists.` + ); + } + } + + async prepareTemplate() { + await execute("rm", "-rf", this.templatesDir); + } + + async cloneTemplate(flavor: string) { + const repo = this.getRepo(flavor); await execute( "git", "clone", "--depth=1", - "https://github.com/kuzzleio/project-templates", + `https://github.com/kuzzleio/${repo}`, "--branch", - flavor, + "master", "--single-branch", - templatesDir + this.templatesDir ); + } - await execute("cp", "-r", `${templatesDir}/${flavor}`, `${destination}/`); + async copyTemplate(destination: string) { + await execute("cp", "-r", `${this.templatesDir}/`, `${destination}/`); + } - await execute("rm", "-rf", templatesDir); + async cleanup() { + await execute("rm", "-rf", this.templatesDir); } } diff --git a/src/commands/app/start-services.ts b/src/commands/app/start-services.ts index 7449aa4e..9e3117e9 100644 --- a/src/commands/app/start-services.ts +++ b/src/commands/app/start-services.ts @@ -79,9 +79,9 @@ export default class AppStartServices extends Kommand { "Elasticsearch and Redis are booting in the background right now." ); this.log(chalk.grey("\nTo watch the logs, run")); - this.log(chalk.grey(` docker-compose -f ${docoFilename} logs -f\n`)); - this.log(" Elasticsearch port: 9200"); - this.log(" Redis port: 6379"); + this.log(chalk.blue.bold(` docker-compose -f ${docoFilename} logs -f\n`)); + this.log(` Elasticsearch port: ${chalk.bold("9200")}`); + this.log(` Redis port: ${chalk.bold("6379")}`); } catch (error: any) { this.logKo(` Something went wrong: ${error.message}`); this.log( diff --git a/src/commands/paas/logs.ts b/src/commands/paas/logs.ts index 57de576a..65d8da7e 100644 --- a/src/commands/paas/logs.ts +++ b/src/commands/paas/logs.ts @@ -136,6 +136,31 @@ class PaasLogs extends PaasKommand { until, }); + // Don't continue if an error occurred + if (incomingMessage.statusCode !== 200) { + return new Promise((_, reject) => { + // Collect the whole response body + let responseBody = ""; + + incomingMessage.on("data", (buffer) => { + responseBody += buffer.toString(); + }); + + incomingMessage.on("end", () => { + let response; + + try { + response = JSON.parse(responseBody); + } catch (error: any) { + reject(new Error("An error occurred while parsing the error response body from Kuzzle")); + return; + } + + reject(response.error); + }); + }); + } + // Read the response line by line const lineStream = readline.createInterface({ input: incomingMessage, diff --git a/src/commands/paas/snapshots/cat.ts b/src/commands/paas/snapshots/cat.ts index defcf45f..decada66 100644 --- a/src/commands/paas/snapshots/cat.ts +++ b/src/commands/paas/snapshots/cat.ts @@ -30,6 +30,8 @@ class PaasSnapshotsCat extends PaasKommand { } ]; + static examples = ["kourou paas:snapshots:cat --project paas-project-myproject api main"]; + async runSafe() { const apiKey = await this.getCredentials(); diff --git a/src/commands/paas/snapshots/dump.ts b/src/commands/paas/snapshots/dump.ts index 50bdf540..738866c2 100644 --- a/src/commands/paas/snapshots/dump.ts +++ b/src/commands/paas/snapshots/dump.ts @@ -4,7 +4,7 @@ import { PaasKommand } from "../../../support/PaasKommand"; class PaasSnapshotsDump extends PaasKommand { public static description = - "List all snapshots for a given kuzzle application in a environment"; + "Create a new snapshot of the current application state"; public static flags = { help: flags.help(), @@ -30,6 +30,8 @@ class PaasSnapshotsDump extends PaasKommand { } ]; + static examples = ["kourou paas:snapshots:dump --project paas-project-myproject api main"]; + async runSafe() { const apiKey = await this.getCredentials(); diff --git a/src/commands/paas/snapshots/restore.ts b/src/commands/paas/snapshots/restore.ts index 0a396030..f52f0405 100644 --- a/src/commands/paas/snapshots/restore.ts +++ b/src/commands/paas/snapshots/restore.ts @@ -4,7 +4,7 @@ import { PaasKommand } from "../../../support/PaasKommand"; class PaasSnapshotsRestore extends PaasKommand { public static description = - "List all snapshots for a given kuzzle application in a environment"; + "Restore a snapshot of the current application state"; public static flags = { help: flags.help(), @@ -35,6 +35,8 @@ class PaasSnapshotsRestore extends PaasKommand { } ]; + static examples = ["kourou paas:snapshots:restore --project paas-project-myproject api main snapshot-id"]; + async runSafe() { const apiKey = await this.getCredentials(); diff --git a/src/support/execute.ts b/src/support/execute.ts index 19f84c3c..1a1c14c2 100644 --- a/src/support/execute.ts +++ b/src/support/execute.ts @@ -47,10 +47,7 @@ export function execute(...args: any[]): ProcessExecutor { let stdout = ""; let stderr = ""; - // eslint-disable-next-line process.stdout.on("data", (data) => (stdout += data.toString())); - - // eslint-disable-next-line process.stderr.on("data", (data) => (stderr += data.toString())); const executor: any = new Promise((resolve, reject) => { diff --git a/src/support/kuzzle.ts b/src/support/kuzzle.ts index 9c134c7a..1553f004 100644 --- a/src/support/kuzzle.ts +++ b/src/support/kuzzle.ts @@ -224,7 +224,10 @@ export class KuzzleSDK { const options = { method: "POST", headers: { + Accept: "application/json", + "Accept-Encoding": "identity", Authorization: `Bearer ${this.sdk.jwt}`, + Connection: "keep-alive", "Content-Length": Buffer.byteLength(body), "Content-Type": "application/json", }, diff --git a/test/commands/app/scaffold.test.ts b/test/commands/app/scaffold.test.ts index cda9bc62..a7bd112c 100644 --- a/test/commands/app/scaffold.test.ts +++ b/test/commands/app/scaffold.test.ts @@ -5,7 +5,7 @@ import should from "should"; import { kourou } from "../../support"; describe("app:scaffold", () => { - it("creates desired files and install packages", () => { + it("should create generic flavor if not specified", () => { execSync("rm -rf blackmesa/"); kourou("app:scaffold blackmesa"); @@ -13,10 +13,44 @@ describe("app:scaffold", () => { should(fs.existsSync("./blackmesa/.eslintignore")).be.eql(true); should(fs.existsSync("./blackmesa/.eslintrc.json")).be.eql(true); should(fs.existsSync("./blackmesa/.gitignore")).be.eql(true); - should(fs.existsSync("./blackmesa/.mocharc.json")).be.eql(true); + should(fs.existsSync("./blackmesa/Dockerfile")).be.eql(true); + should(fs.existsSync("./blackmesa/docker-compose.yml")).be.eql(true); should(fs.existsSync("./blackmesa/app.ts")).be.eql(true); should(fs.existsSync("./blackmesa/package.json")).be.eql(true); should(fs.existsSync("./blackmesa/README.md")).be.eql(true); should(fs.existsSync("./blackmesa/tsconfig.json")).be.eql(true); + should(fs.existsSync("./blackmesa/jest.config.ts")).be.eql(true); + }).timeout("60s"); + + it("should create generic flavor when specified", () => { + execSync("rm -rf blackmesa/"); + + kourou("app:scaffold blackmesa --flavor generic"); + + should(fs.existsSync("./blackmesa/.eslintignore")).be.eql(true); + should(fs.existsSync("./blackmesa/.eslintrc.json")).be.eql(true); + should(fs.existsSync("./blackmesa/.gitignore")).be.eql(true); + should(fs.existsSync("./blackmesa/Dockerfile")).be.eql(true); + should(fs.existsSync("./blackmesa/docker-compose.yml")).be.eql(true); + should(fs.existsSync("./blackmesa/app.ts")).be.eql(true); + should(fs.existsSync("./blackmesa/package.json")).be.eql(true); + should(fs.existsSync("./blackmesa/README.md")).be.eql(true); + should(fs.existsSync("./blackmesa/tsconfig.json")).be.eql(true); + should(fs.existsSync("./blackmesa/jest.config.ts")).be.eql(true); + }).timeout("60s"); + + it("should create iot flavor when specified", () => { + execSync("rm -rf blackmesa/"); + + kourou("app:scaffold blackmesa --flavor iot"); + + should(fs.existsSync("./blackmesa/tsconfig.node.json")).be.eql(true); + should(fs.existsSync("./blackmesa/tsconfig.web.json")).be.eql(true); + should(fs.existsSync("./blackmesa/.gitignore")).be.eql(true); + should(fs.existsSync("./blackmesa/docker-compose.yml")).be.eql(true); + should(fs.existsSync("./blackmesa/package.json")).be.eql(true); + should(fs.existsSync("./blackmesa/README.md")).be.eql(true); + should(fs.existsSync("./blackmesa/turbo.json")).be.eql(true); + should(fs.existsSync("./blackmesa/start.sh")).be.eql(true); }).timeout("60s"); }); diff --git a/test/support.ts b/test/support.ts index d1aebd29..21b9709a 100644 --- a/test/support.ts +++ b/test/support.ts @@ -9,7 +9,7 @@ export function kourou(command: string) { } catch (error: any) { console.log(error); console.log("STDOUT: ", error.stdout.toString()); - console.log("STDOUT: ", error.stderr.toString()); + console.log("STDERR: ", error.stderr.toString()); throw error; } }