diff --git a/.eslintignore b/.eslintignore index 5de5456ec..82aa7052a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ build/*.js config/*.js test/e2e/nightwatch.conf.js +node_modules/**/* \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 41e781d42..f21ec6779 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "kuzzle-admin-console", - "version": "4.3.0", + "version": "4.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1535,7 +1535,7 @@ }, "@types/parse-json": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "resolved": "https://packages.app.kuzzle.io/@types%2fparse-json/-/parse-json-4.0.0.tgz", "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "optional": true }, @@ -1922,87 +1922,6 @@ "tslint": "^5.20.1", "webpack": "^4.0.0", "yorkie": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "optional": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "optional": true - }, - "fork-ts-checker-webpack-plugin-v5": { - "version": "npm:fork-ts-checker-webpack-plugin@5.2.1", - "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz", - "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==", - "optional": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@types/json-schema": "^7.0.5", - "chalk": "^4.1.0", - "cosmiconfig": "^6.0.0", - "deepmerge": "^4.2.2", - "fs-extra": "^9.0.0", - "memfs": "^3.1.2", - "minimatch": "^3.0.4", - "schema-utils": "2.7.0", - "semver": "^7.3.2", - "tapable": "^1.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "optional": true - }, - "schema-utils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", - "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", - "optional": true, - "requires": { - "@types/json-schema": "^7.0.4", - "ajv": "^6.12.2", - "ajv-keywords": "^3.4.1" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, "@vue/cli-plugin-unit-mocha": { @@ -2128,6 +2047,16 @@ "unique-filename": "^1.1.1" } }, + "chalk": { + "version": "4.1.2", + "resolved": "https://packages.app.kuzzle.io/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -2161,6 +2090,12 @@ "universalify": "^0.1.0" } }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://packages.app.kuzzle.io/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "optional": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -2169,6 +2104,17 @@ "graceful-fs": "^4.1.6" } }, + "loader-utils": { + "version": "2.0.2", + "resolved": "https://packages.app.kuzzle.io/loader-utils/-/loader-utils-2.0.2.tgz", + "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -2191,6 +2137,15 @@ "minipass": "^3.1.1" } }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://packages.app.kuzzle.io/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + }, "terser-webpack-plugin": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz", @@ -2212,6 +2167,17 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.8.3", + "resolved": "https://packages.app.kuzzle.io/vue-loader/-/vue-loader-16.8.3.tgz", + "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + } + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -3021,7 +2987,7 @@ }, "audit": { "version": "0.0.6", - "resolved": "https://registry.npmjs.org/audit/-/audit-0.0.6.tgz", + "resolved": "https://packages.app.kuzzle.io/audit/-/audit-0.0.6.tgz", "integrity": "sha1-/vF92Erx3NKlYz/UbTsa3LCEvzs=" }, "autoprefixer": { @@ -4906,7 +4872,7 @@ }, "cosmiconfig": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "resolved": "https://packages.app.kuzzle.io/cosmiconfig/-/cosmiconfig-6.0.0.tgz", "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", "optional": true, "requires": { @@ -4919,7 +4885,7 @@ "dependencies": { "path-type": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "resolved": "https://packages.app.kuzzle.io/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "optional": true } @@ -7421,6 +7387,87 @@ } } }, + "fork-ts-checker-webpack-plugin-v5": { + "version": "npm:fork-ts-checker-webpack-plugin@5.2.1", + "resolved": "https://packages.app.kuzzle.io/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz", + "integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==", + "optional": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@types/json-schema": "^7.0.5", + "chalk": "^4.1.0", + "cosmiconfig": "^6.0.0", + "deepmerge": "^4.2.2", + "fs-extra": "^9.0.0", + "memfs": "^3.1.2", + "minimatch": "^3.0.4", + "schema-utils": "2.7.0", + "semver": "^7.3.2", + "tapable": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://packages.app.kuzzle.io/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "optional": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://packages.app.kuzzle.io/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://packages.app.kuzzle.io/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "optional": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://packages.app.kuzzle.io/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "optional": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://packages.app.kuzzle.io/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "optional": true + }, + "schema-utils": { + "version": "2.7.0", + "resolved": "https://packages.app.kuzzle.io/schema-utils/-/schema-utils-2.7.0.tgz", + "integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==", + "optional": true, + "requires": { + "@types/json-schema": "^7.0.4", + "ajv": "^6.12.2", + "ajv-keywords": "^3.4.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://packages.app.kuzzle.io/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", @@ -7492,7 +7539,7 @@ }, "fs-monkey": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", + "resolved": "https://packages.app.kuzzle.io/fs-monkey/-/fs-monkey-1.0.3.tgz", "integrity": "sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==", "optional": true }, @@ -7633,6 +7680,21 @@ "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" }, + "getmac": { + "version": "5.20.0", + "resolved": "https://packages.app.kuzzle.io/getmac/-/getmac-5.20.0.tgz", + "integrity": "sha512-O9T855fb+Hx9dsTJHNv72ZUuA6Y18+BO/0ypPXf6s/tunzXqhc3kbQkNAl+9HVKVlwkWmglHS4LMoJ9YbymKYQ==", + "requires": { + "@types/node": "^16.4.7" + }, + "dependencies": { + "@types/node": { + "version": "16.11.25", + "resolved": "https://packages.app.kuzzle.io/@types%2fnode/-/node-16.11.25.tgz", + "integrity": "sha512-NrTwfD7L1RTc2qrHQD4RTTy4p0CO2LatKBEKEds3CaVuhoM/+DJzmWZl5f+ikR8cm8F5mfJxK+9rQq07gRiSjQ==" + } + } + }, "getos": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", @@ -9274,6 +9336,14 @@ "safe-buffer": "^5.0.1" } }, + "kepler-companion": { + "version": "1.1.5", + "resolved": "https://packages.app.kuzzle.io/kepler-companion/-/kepler-companion-1.1.5.tgz", + "integrity": "sha512-BIIoaMfNNPpWZ5ml+qniRMsilNIMttPWbKM9VGMU4d2j/milxrVLDWVEi4nksD09mHfSE+s6wnM/UlWEi4kttA==", + "requires": { + "getmac": "^5.20.0" + } + }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", @@ -9765,7 +9835,7 @@ }, "kuzzle-sdk-v6": { "version": "npm:kuzzle-sdk@6.2.8", - "resolved": "https://registry.npmjs.org/kuzzle-sdk/-/kuzzle-sdk-6.2.8.tgz", + "resolved": "https://packages.app.kuzzle.io/kuzzle-sdk/-/kuzzle-sdk-6.2.8.tgz", "integrity": "sha512-mu5VBB1DACke0vcdNyztIhFrjsNc7D/d04iEHpEbXKGhePhz5wDGGBrNGJJnFyLVW8S1JaE3TFkHQmjhSeCMPg==", "requires": { "@babel/core": "^7.6.0", @@ -9780,7 +9850,7 @@ "dependencies": { "ws": { "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "resolved": "https://packages.app.kuzzle.io/ws/-/ws-6.2.2.tgz", "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", "requires": { "async-limiter": "~1.0.0" @@ -9789,18 +9859,18 @@ } }, "kuzzle-sdk-v7": { - "version": "npm:kuzzle-sdk@7.7.6", - "resolved": "https://registry.npmjs.org/kuzzle-sdk/-/kuzzle-sdk-7.7.6.tgz", - "integrity": "sha512-fxF9cvgNTyxFGWeD7H86vtn44xn5Y4HKHfiFpPCAZKJAmyKUJiKqGIgRTJiJ4JLbLDpnc6/yVNTfTfjLzKIRZA==", + "version": "npm:kuzzle-sdk@7.8.4", + "resolved": "https://packages.app.kuzzle.io/kuzzle-sdk/-/kuzzle-sdk-7.8.4.tgz", + "integrity": "sha512-yS57O6CTEcOkBidft8EiwtR8rk8pYAtibp9aQXUtiVqjj0p9awLpcu60DRKRRz3nI//vN9G57CpnMZ/VFS1+WA==", "requires": { "min-req-promise": "^1.0.1", - "ws": "^8.2.2" + "ws": "^8.4.2" }, "dependencies": { "ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==" + "version": "8.5.0", + "resolved": "https://packages.app.kuzzle.io/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==" } } }, @@ -10509,9 +10579,9 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "memfs": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.3.0.tgz", - "integrity": "sha512-BEE62uMfKOavX3iG7GYX43QJ+hAeeWnwIAuJ/R6q96jaMtiLzhsxHJC8B1L7fK7Pt/vXDRwb3SG/yBpNGDPqzg==", + "version": "3.4.1", + "resolved": "https://packages.app.kuzzle.io/memfs/-/memfs-3.4.1.tgz", + "integrity": "sha512-1c9VPVvW5P7I85c35zAdEr1TD5+F11IToIHIlrVIcflfnzPkJa0ZoYEoEdYDP8KgPFoSZ/opDrUsAoZWym3mtw==", "optional": true, "requires": { "fs-monkey": "1.0.3" @@ -16641,79 +16711,6 @@ } } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.8.2", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.2.tgz", - "integrity": "sha512-Nkq+z9mAsMEK+qkXgK+9Ia7D8w9uu9j4ut0IMT5coMfux3rCgIp1QBB1CYwY0M34A1nRMSONEaWXxAAw6xSl/Q==", - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "optional": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "optional": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "optional": true - }, - "loader-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.1.tgz", - "integrity": "sha512-g4miPa9uUrZz4iElkaVJgDFwKJGh8aQGM7pUL4ejXl6cu7kSb30seQOVGNMP6sW8j7DW77X68hJZ+GM7UGhXeQ==", - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "vue-multipane": { "version": "0.9.5", "resolved": "https://registry.npmjs.org/vue-multipane/-/vue-multipane-0.9.5.tgz", diff --git a/package.json b/package.json index c6ddb98b1..725ab8822 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-admin-console", - "version": "4.3.0", + "version": "4.3.1", "description": "A handy administrative console for Kuzzle", "author": "The Kuzzle team ", "scripts": { @@ -44,6 +44,7 @@ "eslint-plugin-vue": "^6.0.0", "execa": "^4.0.2", "json-formatter-js": "^1.3.0", + "kepler-companion": "^1.1.5", "kuzzle-sdk-v6": "npm:kuzzle-sdk@^6.2.7", "kuzzle-sdk-v7": "npm:kuzzle-sdk@^7.7.6", "leaflet": "^1.7.1", diff --git a/src/App.vue b/src/App.vue index fecf562ce..5a4a5a164 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,19 +15,7 @@ /> - - - Your request could not be sent to Kuzzle. Check the browser console for - more details. - + @@ -39,13 +27,15 @@ import {} from './assets/global.scss' import ModalCreateOrUpdate from './components/Common/Environments/ModalCreateOrUpdate' import ModalDelete from './components/Common/Environments/ModalDelete' import ModalImport from './components/Common/Environments/ModalImport' +import TelemetryBanner from './components/TelemetryBanner' export default { name: 'KuzzleAdminConsole', components: { ModalCreateOrUpdate, ModalDelete, - ModalImport + ModalImport, + TelemetryBanner }, data() { return { diff --git a/src/components/TelemetryBanner.vue b/src/components/TelemetryBanner.vue new file mode 100644 index 000000000..94a9fc6bd --- /dev/null +++ b/src/components/TelemetryBanner.vue @@ -0,0 +1,71 @@ + + + diff --git a/src/routes/index.ts b/src/routes/index.ts index 524ea7322..bb7b46fe9 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -17,6 +17,8 @@ import ApiAction from '../components/ApiAction.vue' import SecuritySubRoutes from './children/security' import DataSubRoutes from './children/data' +import KeplerCompanion from 'kepler-companion' +import telemetryCookies from '../services/telemetryCookies' Vue.use(VueRouter) @@ -152,5 +154,26 @@ export default function createRoutes(log) { ] }) + const analytics = new KeplerCompanion() + router.afterEach((to, _) => { + const shouldAddTelemetry = + telemetryCookies.get() === null || telemetryCookies.get() === 'false' + ? false + : true + + if (shouldAddTelemetry) { + analytics + .add({ + action: to.name as string, + product: 'admin-console', + version: require('../../package.json').version, + tags: { + environment: window.location.hostname + } + }) + .catch(() => {}) + } + }) + return router } diff --git a/src/services/telemetryCookies.ts b/src/services/telemetryCookies.ts new file mode 100644 index 000000000..30a02dbc4 --- /dev/null +++ b/src/services/telemetryCookies.ts @@ -0,0 +1,21 @@ +export default { + set: (value, expires) => { + let date = new Date() + date.setDate(date.getDate() + expires) + + document.cookie = `telemetry=${JSON.stringify( + value + )}; expires=${date.toUTCString()}` + }, + get: () => { + const telemetrySetting = document.cookie.split('telemetry=')[1] + if (telemetrySetting !== undefined) { + return JSON.parse(telemetrySetting) + } + + return null + }, + delete: () => { + document.cookie = 'telemetry=; expires=Thu, 01 Jan 1970 00:00:00 UTC' + } +} diff --git a/test/e2e/cypress/integration/single-backend/collections.spec.js b/test/e2e/cypress/integration/single-backend/collections.spec.js index f7f0007f7..a05e8f0f8 100644 --- a/test/e2e/cypress/integration/single-backend/collections.spec.js +++ b/test/e2e/cypress/integration/single-backend/collections.spec.js @@ -9,6 +9,7 @@ describe('Collection management', function() { cy.request('POST', `${kuzzleUrl}/${indexName}/_create`) cy.initLocalEnv(Cypress.env('BACKEND_VERSION')) + cy.setCookie('telemetry', 'false') }) it('Should render a visual feedback and prevent submitting when input is not valid', () => { diff --git a/test/e2e/cypress/integration/single-backend/login.spec.js b/test/e2e/cypress/integration/single-backend/login.spec.js index f701e3aaf..36dd62751 100644 --- a/test/e2e/cypress/integration/single-backend/login.spec.js +++ b/test/e2e/cypress/integration/single-backend/login.spec.js @@ -6,6 +6,7 @@ const validEnvName = 'valid' describe('Login', function() { beforeEach(() => { cy.initLocalEnv(Cypress.env('BACKEND_VERSION'), null) + cy.setCookie('telemetry', 'false') }) it('Should be able to login as anonymous', () => { diff --git a/test/e2e/cypress/integration/single-backend/profiles.spec.js b/test/e2e/cypress/integration/single-backend/profiles.spec.js index cf5945f4f..5a4e324f6 100644 --- a/test/e2e/cypress/integration/single-backend/profiles.spec.js +++ b/test/e2e/cypress/integration/single-backend/profiles.spec.js @@ -4,6 +4,7 @@ describe('Profiles', () => { beforeEach(function() { cy.request('POST', `${kuzzleUrl}/admin/_resetSecurity`) cy.initLocalEnv(Cypress.env('BACKEND_VERSION')) + cy.setCookie('telemetry', 'false') }) it('Should be able to delete a profile', () => { diff --git a/test/e2e/cypress/integration/single-backend/roles.spec.js b/test/e2e/cypress/integration/single-backend/roles.spec.js index 71c1717b8..f0ee9f80f 100644 --- a/test/e2e/cypress/integration/single-backend/roles.spec.js +++ b/test/e2e/cypress/integration/single-backend/roles.spec.js @@ -13,6 +13,7 @@ describe('Roles', () => { } }) cy.initLocalEnv(Cypress.env('BACKEND_VERSION')) + cy.setCookie('telemetry', 'false') }) afterEach(() => { diff --git a/test/e2e/cypress/integration/single-backend/search.spec.js b/test/e2e/cypress/integration/single-backend/search.spec.js index 54b62f9b5..17e64fd2f 100644 --- a/test/e2e/cypress/integration/single-backend/search.spec.js +++ b/test/e2e/cypress/integration/single-backend/search.spec.js @@ -58,6 +58,7 @@ describe('Search', function() { `search-filter-current:${indexName}/${collectionName}`, '{}' ) + cy.setCookie('telemetry', 'false') }) it('perists the Quick Search query in the URL', function() { diff --git a/test/e2e/cypress/integration/single-backend/users.spec.js b/test/e2e/cypress/integration/single-backend/users.spec.js index 5fc9fdc66..999d797b6 100644 --- a/test/e2e/cypress/integration/single-backend/users.spec.js +++ b/test/e2e/cypress/integration/single-backend/users.spec.js @@ -12,6 +12,7 @@ describe('Users', function() { beforeEach(function() { cy.request('POST', `${kuzzleUrl}/admin/_resetSecurity`) cy.initLocalEnv(Cypress.env('BACKEND_VERSION')) + cy.setCookie('telemetry', 'false') }) it('Should be able to search users via the quick search', () => {