diff --git a/.ci/doc/config.yml b/.ci/doc/config.yml index 4dc83e7d8..7c5714937 100644 --- a/.ci/doc/config.yml +++ b/.ci/doc/config.yml @@ -14,10 +14,10 @@ runners: lint: global: true cmd: eslint -c /mnt/.ci/doc/eslint.json {{ snippet.dir }} - before: timeout -t 600 ash -c 'until stat /tmp/runner_ready_to_lint; do sleep 1; done' + before: timeout 600 ash -c 'until stat /tmp/runner_ready_to_lint; do sleep 1; done' run: cmd: node {{ snippet.source }} - before: timeout -t 600 ash -c 'until stat /tmp/runner_is_ready && curl -f -s -o /dev/null http://kuzzle:7512/_now; do sleep 1; done' + before: timeout 600 ash -c 'until stat /tmp/runner_is_ready && curl -f -s -o /dev/null http://kuzzle:7512/_now; do sleep 1; done' web: service: doc-runner-web @@ -43,5 +43,3 @@ runners: run: cmd: node puppeteer.js /tmp/{{ snippet.name }}/index.html before: timeout 600 bash -c 'until curl -f -s -o /dev/null http://kuzzle:7512/_now; do sleep 1; done' - - diff --git a/codecov.yml b/codecov.yml index 6da146875..a4d6a68dc 100644 --- a/codecov.yml +++ b/codecov.yml @@ -6,7 +6,5 @@ coverage: default: threshold: 1 - patch: - default: - branches: - - master \ No newline at end of file + patch: false + changes: false diff --git a/package-lock.json b/package-lock.json index afd31f111..22fcc8b59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "kuzzle-sdk", - "version": "7.0.0-beta.2", + "version": "7.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -13,18 +13,18 @@ } }, "@babel/core": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.4.tgz", - "integrity": "sha512-Rm0HGw101GY8FTzpWSyRbki/jzq+/PkNQJ+nSulrdY6gFGOsNseCqD6KHRYe2E+EdzuBdr2pxCp6s4Uk6eJ+XQ==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", + "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.4", - "@babel/helpers": "^7.6.2", - "@babel/parser": "^7.6.4", - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.3", - "@babel/types": "^7.6.3", - "convert-source-map": "^1.1.0", + "@babel/generator": "^7.7.2", + "@babel/helpers": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.7.2", + "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", "lodash": "^4.17.13", @@ -34,56 +34,90 @@ }, "dependencies": { "@babel/generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", - "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", "requires": { - "@babel/types": "^7.6.3", + "@babel/types": "^7.7.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, "@babel/parser": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", - "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==" + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" }, "@babel/template": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", - "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0" + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" } }, "@babel/traverse": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", - "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.3", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.3", - "@babel/types": "^7.6.3", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", - "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "requires": { + "safe-buffer": "~5.1.1" + } } } }, @@ -91,6 +125,7 @@ "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==", + "dev": true, "requires": { "@babel/types": "^7.5.5", "jsesc": "^2.5.1", @@ -102,60 +137,300 @@ "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true } } }, "@babel/helper-annotate-as-pure": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz", - "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.0.tgz", + "integrity": "sha512-k50CQxMlYTYo+GGyUGFwpxKVtxVJi9yh61sXZji3zYHccK9RYliZGSTOgci85T+r+0VFN2nWbGM04PIqwfrpMg==", "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz", - "integrity": "sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.7.0.tgz", + "integrity": "sha512-Cd8r8zs4RKDwMG/92lpZcnn5WPQ3LAMQbCw42oqUh4s7vsSN5ANUZjMel0OOnxDLq57hoDDbai+ryygYfCTOsw==", "requires": { - "@babel/helper-explode-assignable-expression": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/helper-explode-assignable-expression": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-call-delegate": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz", - "integrity": "sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.7.0.tgz", + "integrity": "sha512-Su0Mdq7uSSWGZayGMMQ+z6lnL00mMCnGAbO/R0ZO9odIdB/WNU/VfQKqMQU0fdIsxQYbRjDM4BixIa93SQIpvw==", "requires": { - "@babel/helper-hoist-variables": "^7.4.4", - "@babel/traverse": "^7.4.4", - "@babel/types": "^7.4.4" + "@babel/helper-hoist-variables": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/generator": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", + "requires": { + "@babel/types": "^7.7.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/traverse": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.2.tgz", + "integrity": "sha512-pAil/ZixjTlrzNpjx+l/C/wJk002Wo7XbbZ8oujH/AoJ3Juv0iN/UTcPUHXKMFLqsfS0Hy6Aow8M31brUYBlQQ==", + "requires": { + "@babel/helper-regex": "^7.4.4", + "regexpu-core": "^4.6.0" } }, "@babel/helper-define-map": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz", - "integrity": "sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.7.0.tgz", + "integrity": "sha512-kPKWPb0dMpZi+ov1hJiwse9dWweZsz3V9rP4KdytnX1E7z3cTNmFGglwklzFPuqIcHLIY3bgKSs4vkwXXdflQA==", "requires": { - "@babel/helper-function-name": "^7.1.0", - "@babel/types": "^7.5.5", + "@babel/helper-function-name": "^7.7.0", + "@babel/types": "^7.7.0", "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-explode-assignable-expression": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz", - "integrity": "sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.7.0.tgz", + "integrity": "sha512-CDs26w2shdD1urNUAji2RJXyBFCaR+iBEGnFz3l7maizMkQe3saVw9WtjG1tz8CwbjvlFnaSLVhgnu1SWaherg==", "requires": { - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/generator": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", + "requires": { + "@babel/types": "^7.7.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/traverse": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-function-name": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.0.0", "@babel/template": "^7.1.0", @@ -171,48 +446,131 @@ } }, "@babel/helper-hoist-variables": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz", - "integrity": "sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.0.tgz", + "integrity": "sha512-LUe/92NqsDAkJjjCEWkNe+/PcpnisvnqdlRe19FahVapa4jndeuJ+FBiTX1rcAKWKcJGE+C3Q3tuEuxkSmCEiQ==", "requires": { - "@babel/types": "^7.4.4" + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-member-expression-to-functions": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz", - "integrity": "sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.0.tgz", + "integrity": "sha512-QaCZLO2RtBcmvO/ekOLp8p7R5X2JriKRizeDpm5ChATAFWrrYDcDxPuCIBXKyBjY+i1vYSdcUTMIb8psfxHDPA==", "requires": { - "@babel/types": "^7.5.5" + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-module-imports": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", - "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.7.0.tgz", + "integrity": "sha512-Dv3hLKIC1jyfTkClvyEkYP2OlkzNvWs5+Q8WgPbxM5LMeorons7iPP91JM+DU7tRbhqA1ZeooPaMFvQrn23RHw==", "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-module-transforms": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz", - "integrity": "sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw==", - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "@babel/helper-simple-access": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/template": "^7.4.4", - "@babel/types": "^7.5.5", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.7.0.tgz", + "integrity": "sha512-rXEefBuheUYQyX4WjV19tuknrJFwyKw0HgzRwbkyTbB+Dshlq7eqkWbyjzToLrMZk/5wKVKdWFluiAsVkHXvuQ==", + "requires": { + "@babel/helper-module-imports": "^7.7.0", + "@babel/helper-simple-access": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0", "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-optimise-call-expression": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz", - "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz", + "integrity": "sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg==", "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-plugin-utils": { @@ -229,112 +587,406 @@ } }, "@babel/helper-remap-async-to-generator": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz", - "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==", - "requires": { - "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-wrap-function": "^7.1.0", - "@babel/template": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.0.tgz", + "integrity": "sha512-pHx7RN8X0UNHPB/fnuDnRXVZ316ZigkO8y8D835JlZ2SSdFKb6yH9MIYRU4fy/KPe5sPHDFOPvf8QLdbAGGiyw==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.7.0", + "@babel/helper-wrap-function": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/generator": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", + "requires": { + "@babel/types": "^7.7.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/traverse": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-replace-supers": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz", - "integrity": "sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg==", - "requires": { - "@babel/helper-member-expression-to-functions": "^7.5.5", - "@babel/helper-optimise-call-expression": "^7.0.0", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz", + "integrity": "sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg==", + "requires": { + "@babel/helper-member-expression-to-functions": "^7.7.0", + "@babel/helper-optimise-call-expression": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/generator": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", + "requires": { + "@babel/types": "^7.7.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/traverse": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-simple-access": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz", - "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.7.0.tgz", + "integrity": "sha512-AJ7IZD7Eem3zZRuj5JtzFAptBw7pMlS3y8Qv09vaBWoFsle0d1kAn5Wq6Q9MyBXITPOKnxwkZKoAm4bopmv26g==", "requires": { - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helper-split-export-declaration": { "version": "7.4.4", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, "requires": { "@babel/types": "^7.4.4" } }, "@babel/helper-wrap-function": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz", - "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==", - "requires": { - "@babel/helper-function-name": "^7.1.0", - "@babel/template": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.2.0" + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.7.0.tgz", + "integrity": "sha512-sd4QjeMgQqzshSjecZjOp8uKfUtnpmCyQhKQrVJBBgeHAB/0FPi33h3AbVlVp07qQtMD4QgYSzaMI7VwncNK/w==", + "requires": { + "@babel/helper-function-name": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" + }, + "dependencies": { + "@babel/generator": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", + "requires": { + "@babel/types": "^7.7.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/traverse": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/helpers": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.2.tgz", - "integrity": "sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.0.tgz", + "integrity": "sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g==", "requires": { - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.2", - "@babel/types": "^7.6.0" + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" }, "dependencies": { "@babel/generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", - "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", "requires": { - "@babel/types": "^7.6.3", + "@babel/types": "^7.7.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, "@babel/parser": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", - "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==" + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" }, "@babel/template": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", - "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0" + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" } }, "@babel/traverse": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", - "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.3", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.3", - "@babel/types": "^7.6.3", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", - "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -389,22 +1041,23 @@ "@babel/parser": { "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==" + "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", + "dev": true }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz", - "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.0.tgz", + "integrity": "sha512-ot/EZVvf3mXtZq0Pd0+tSOfGWMizqmOohXmNZg6LNFjHOV+wOPv7BvVYh8oPR8LhpIP3ye8nNooKL50YRWxpYA==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.1.0", + "@babel/helper-remap-async-to-generator": "^7.7.0", "@babel/plugin-syntax-async-generators": "^7.2.0" } }, "@babel/plugin-proposal-dynamic-import": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz", - "integrity": "sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.0.tgz", + "integrity": "sha512-7poL3Xi+QFPC7sGAzEIbXUyYzGJwbc2+gSD0AkiC5k52kH2cqHdqxm5hNFfLW3cRSTcx9bN0Fl7/6zWcLLnKAQ==", "requires": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0" @@ -438,13 +1091,12 @@ } }, "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.6.2.tgz", - "integrity": "sha512-NxHETdmpeSCtiatMRYWVJo7266rrvAC3DTeG5exQBIH/fMIUK7ejDNznBbn3HQl/o9peymRRg7Yqkx6PdUXmMw==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.0.tgz", + "integrity": "sha512-mk34H+hp7kRBWJOOAR0ZMGCydgKMD4iN9TpDRp3IIcbunltxEY89XSimc6WbtSLCDrwcdy/EEw7h5CFCzxTchw==", "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.6.0" + "@babel/helper-create-regexp-features-plugin": "^7.7.0", + "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-syntax-async-generators": { @@ -487,6 +1139,14 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.0.tgz", + "integrity": "sha512-hi8FUNiFIY1fnUI2n1ViB1DR0R4QeK4iHcTlW6aJkrPoTdb8Rf1EMQ6GT3f67DDkYyWgew9DFoOZ6gOoEsdzTA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, "@babel/plugin-transform-arrow-functions": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz", @@ -496,13 +1156,13 @@ } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz", - "integrity": "sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.0.tgz", + "integrity": "sha512-vLI2EFLVvRBL3d8roAMqtVY0Bm9C1QzLkdS57hiKrjUBSqsQYrBsMCeOg/0KK7B0eK9V71J5mWcha9yyoI2tZw==", "requires": { - "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-module-imports": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.1.0" + "@babel/helper-remap-async-to-generator": "^7.7.0" } }, "@babel/plugin-transform-block-scoped-functions": { @@ -523,18 +1183,71 @@ } }, "@babel/plugin-transform-classes": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz", - "integrity": "sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg==", - "requires": { - "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-define-map": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-optimise-call-expression": "^7.0.0", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.0.tgz", + "integrity": "sha512-/b3cKIZwGeUesZheU9jNYcwrEA7f/Bo4IdPmvp7oHgvks2majB5BoT5byAql44fiNQYOPzhk2w8DbgfuafkMoA==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.7.0", + "@babel/helper-define-map": "^7.7.0", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-optimise-call-expression": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.5.5", - "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/helper-replace-supers": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", "globals": "^11.1.0" + }, + "dependencies": { + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/plugin-transform-computed-properties": { @@ -554,13 +1267,12 @@ } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.6.2.tgz", - "integrity": "sha512-KGKT9aqKV+9YMZSkowzYoYEiHqgaDhGmPNZlZxX6UeHC4z30nC1J9IrZuGqbYFB1jaIGdv91ujpze0exiVK8bA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.0.tgz", + "integrity": "sha512-3QQlF7hSBnSuM1hQ0pS3pmAbWLax/uGNCbPBND9y+oJ4Y776jsyujG2k0Sn2Aj2a0QwVOiOFL5QVPA7spjvzSA==", "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.6.0" + "@babel/helper-create-regexp-features-plugin": "^7.7.0", + "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-duplicate-keys": { @@ -589,12 +1301,57 @@ } }, "@babel/plugin-transform-function-name": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz", - "integrity": "sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.0.tgz", + "integrity": "sha512-P5HKu0d9+CzZxP5jcrWdpe7ZlFDe24bmqP6a6X8BHEBl/eizAsY8K6LX8LASZL0Jxdjm5eEfzp+FIrxCm/p8bA==", "requires": { - "@babel/helper-function-name": "^7.1.0", + "@babel/helper-function-name": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0" + }, + "dependencies": { + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/parser": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.2.tgz", + "integrity": "sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w==" + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/types": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } } }, "@babel/plugin-transform-literals": { @@ -624,41 +1381,41 @@ } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz", - "integrity": "sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.0.tgz", + "integrity": "sha512-KEMyWNNWnjOom8vR/1+d+Ocz/mILZG/eyHHO06OuBQ2aNhxT62fr4y6fGOplRx+CxCSp3IFwesL8WdINfY/3kg==", "requires": { - "@babel/helper-module-transforms": "^7.4.4", + "@babel/helper-module-transforms": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-simple-access": "^7.1.0", + "@babel/helper-simple-access": "^7.7.0", "babel-plugin-dynamic-import-node": "^2.3.0" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz", - "integrity": "sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.0.tgz", + "integrity": "sha512-ZAuFgYjJzDNv77AjXRqzQGlQl4HdUM6j296ee4fwKVZfhDR9LAGxfvXjBkb06gNETPnN0sLqRm9Gxg4wZH6dXg==", "requires": { - "@babel/helper-hoist-variables": "^7.4.4", + "@babel/helper-hoist-variables": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", "babel-plugin-dynamic-import-node": "^2.3.0" } }, "@babel/plugin-transform-modules-umd": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz", - "integrity": "sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.0.tgz", + "integrity": "sha512-u7eBA03zmUswQ9LQ7Qw0/ieC1pcAkbp5OQatbWUzY1PaBccvuJXUkYzoN1g7cqp7dbTu6Dp9bXyalBvD04AANA==", "requires": { - "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-module-transforms": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.6.3.tgz", - "integrity": "sha512-jTkk7/uE6H2s5w6VlMHeWuH+Pcy2lmdwFoeWCVnvIrDUnB5gQqTVI8WfmEAhF2CDEarGrknZcmSFg1+bkfCoSw==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.0.tgz", + "integrity": "sha512-+SicSJoKouPctL+j1pqktRVCgy+xAch1hWWTMy13j0IflnyNjaoskj+DwRQFimHbLqO3sq2oN2CXMvXq3Bgapg==", "requires": { - "regexpu-core": "^4.6.0" + "@babel/helper-create-regexp-features-plugin": "^7.7.0" } }, "@babel/plugin-transform-new-target": { @@ -697,9 +1454,9 @@ } }, "@babel/plugin-transform-regenerator": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz", - "integrity": "sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.0.tgz", + "integrity": "sha512-AXmvnC+0wuj/cFkkS/HFHIojxH3ffSXE+ttulrqWjZZRaUOonfJc60e1wSNT4rV8tIunvu/R3wCp71/tLAa9xg==", "requires": { "regenerator-transform": "^0.14.0" } @@ -755,13 +1512,12 @@ } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.6.2.tgz", - "integrity": "sha512-orZI6cWlR3nk2YmYdb0gImrgCUwb5cBUwjf6Ks6dvNVvXERkwtJWOQaEOjPiu0Gu1Tq6Yq/hruCZZOOi9F34Dw==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.0.tgz", + "integrity": "sha512-RrThb0gdrNwFAqEAAx9OWgtx6ICK69x7i9tCnMdVrxQwSDp/Abu9DXFU5Hh16VP33Rmxh04+NGW28NsIkFvFKA==", "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.6.0" + "@babel/helper-create-regexp-features-plugin": "^7.7.0", + "@babel/helper-plugin-utils": "^7.0.0" } }, "@babel/polyfill": { @@ -775,55 +1531,56 @@ } }, "@babel/preset-env": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.6.3.tgz", - "integrity": "sha512-CWQkn7EVnwzlOdR5NOm2+pfgSNEZmvGjOhlCHBDq0J8/EStr+G+FvPEiz9B56dR6MoiUFjXhfE4hjLoAKKJtIQ==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.7.1.tgz", + "integrity": "sha512-/93SWhi3PxcVTDpSqC+Dp4YxUu3qZ4m7I76k0w73wYfn7bGVuRIO4QUz95aJksbS+AD1/mT1Ie7rbkT0wSplaA==", "requires": { - "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-module-imports": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-async-generator-functions": "^7.2.0", - "@babel/plugin-proposal-dynamic-import": "^7.5.0", + "@babel/plugin-proposal-async-generator-functions": "^7.7.0", + "@babel/plugin-proposal-dynamic-import": "^7.7.0", "@babel/plugin-proposal-json-strings": "^7.2.0", "@babel/plugin-proposal-object-rest-spread": "^7.6.2", "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.6.2", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.0", "@babel/plugin-syntax-async-generators": "^7.2.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-syntax-json-strings": "^7.2.0", "@babel/plugin-syntax-object-rest-spread": "^7.2.0", "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", + "@babel/plugin-syntax-top-level-await": "^7.7.0", "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.5.0", + "@babel/plugin-transform-async-to-generator": "^7.7.0", "@babel/plugin-transform-block-scoped-functions": "^7.2.0", "@babel/plugin-transform-block-scoping": "^7.6.3", - "@babel/plugin-transform-classes": "^7.5.5", + "@babel/plugin-transform-classes": "^7.7.0", "@babel/plugin-transform-computed-properties": "^7.2.0", "@babel/plugin-transform-destructuring": "^7.6.0", - "@babel/plugin-transform-dotall-regex": "^7.6.2", + "@babel/plugin-transform-dotall-regex": "^7.7.0", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", "@babel/plugin-transform-for-of": "^7.4.4", - "@babel/plugin-transform-function-name": "^7.4.4", + "@babel/plugin-transform-function-name": "^7.7.0", "@babel/plugin-transform-literals": "^7.2.0", "@babel/plugin-transform-member-expression-literals": "^7.2.0", "@babel/plugin-transform-modules-amd": "^7.5.0", - "@babel/plugin-transform-modules-commonjs": "^7.6.0", - "@babel/plugin-transform-modules-systemjs": "^7.5.0", - "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.3", + "@babel/plugin-transform-modules-commonjs": "^7.7.0", + "@babel/plugin-transform-modules-systemjs": "^7.7.0", + "@babel/plugin-transform-modules-umd": "^7.7.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/plugin-transform-object-super": "^7.5.5", "@babel/plugin-transform-parameters": "^7.4.4", "@babel/plugin-transform-property-literals": "^7.2.0", - "@babel/plugin-transform-regenerator": "^7.4.5", + "@babel/plugin-transform-regenerator": "^7.7.0", "@babel/plugin-transform-reserved-words": "^7.2.0", "@babel/plugin-transform-shorthand-properties": "^7.2.0", "@babel/plugin-transform-spread": "^7.6.2", "@babel/plugin-transform-sticky-regex": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-unicode-regex": "^7.6.2", - "@babel/types": "^7.6.3", + "@babel/plugin-transform-unicode-regex": "^7.7.0", + "@babel/types": "^7.7.1", "browserslist": "^4.6.0", "core-js-compat": "^3.1.1", "invariant": "^2.2.2", @@ -832,9 +1589,9 @@ }, "dependencies": { "@babel/types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", - "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", "requires": { "esutils": "^2.0.2", "lodash": "^4.17.13", @@ -847,6 +1604,7 @@ "version": "7.4.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.4.4", @@ -857,6 +1615,7 @@ "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", + "dev": true, "requires": { "@babel/code-frame": "^7.5.5", "@babel/generator": "^7.5.5", @@ -872,7 +1631,8 @@ "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true } } }, @@ -1161,7 +1921,7 @@ }, "ansi-styles": { "version": "2.2.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, @@ -1636,9 +2396,9 @@ "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==" }, "glob": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", - "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1948,13 +2708,13 @@ }, "commander": { "version": "2.15.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, "commondir": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "component-emitter": { @@ -1964,7 +2724,7 @@ }, "concat-map": { "version": "0.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { @@ -1992,6 +2752,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -2021,9 +2782,9 @@ "dev": true }, "core-js-compat": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.3.6.tgz", - "integrity": "sha512-YnwZG/+0/f7Pf6Lr3jxtVAFjtGBW9lsLYcqrxhYJai1GfvrP8DEyEpnNzj/FRQfIkOOfk1j5tTBvPBLWVVJm4A==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.4.0.tgz", + "integrity": "sha512-pgQUcgT2+v9/yxHgMynYjNj7nmxLRXv3UC39rjCjDwpe63ev2rioQTju1PKLYUBbPCQQvZNWvQC8tBJd65q11g==", "requires": { "browserslist": "^4.7.2", "semver": "^6.3.0" @@ -2038,7 +2799,7 @@ }, "core-util-is": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cp-file": { @@ -2206,7 +2967,7 @@ }, "deep-is": { "version": "0.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, @@ -2356,9 +3117,9 @@ } }, "electron-to-chromium": { - "version": "1.3.302", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.302.tgz", - "integrity": "sha512-1qConyiVEbj4xZRBXqtGR003+9tV0rJF0PS6aeO0Ln/UL637js9hdwweCl07meh/kJoI2N4W8q3R3g3F5z46ww==" + "version": "1.3.305", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.305.tgz", + "integrity": "sha512-jBEhRZ3eeJWf3eAnGYB1vDy09uBQpZWshC5fxiiIRofA9L3vkpa3SxsXleVS2MvuYir15oTVxzWPsOwj7KBzUw==" }, "elliptic": { "version": "6.5.1", @@ -2382,7 +3143,7 @@ }, "emojis-list": { "version": "2.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" }, "end-of-stream": { @@ -2520,7 +3281,7 @@ }, "escape-string-regexp": { "version": "1.0.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { @@ -2836,7 +3597,7 @@ }, "esutils": { "version": "2.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "events": { @@ -3027,7 +3788,7 @@ }, "fast-levenshtein": { "version": "2.0.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, @@ -3057,7 +3818,7 @@ }, "fill-keys": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", "dev": true, "requires": { @@ -3205,7 +3966,7 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { @@ -3797,9 +4558,9 @@ "dev": true }, "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.5.tgz", + "integrity": "sha512-0Ce31oWVB7YidkaTq33ZxEbN+UDxMMgThvCe8ptgQViymL5DPis9uLdTA13MiRPhgvqyxIegugrP97iK3JeBHg==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -3827,7 +4588,7 @@ }, "has-ansi": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { @@ -4018,7 +4779,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { "once": "^1.3.0", @@ -4027,7 +4788,7 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "inquirer": { @@ -4251,7 +5012,7 @@ }, "is-object": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", "dev": true }, @@ -4536,7 +5297,7 @@ }, "levn": { "version": "0.3.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { @@ -4668,7 +5429,7 @@ "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha1-V0Dhxdbw39pK2TI7UzIQfva0xAo=", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "requires": { "chalk": "^2.0.1" }, @@ -4676,7 +5437,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { "color-convert": "^1.9.0" } @@ -4702,9 +5463,9 @@ } }, "lolex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", - "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.1.tgz", + "integrity": "sha512-dEwHz1CJ8DsdgfpiimgQQEhEJYOEiJ69a0s4aJDNHajaTqOJuF34vBAWVa/sS0V8aQvt72p+KgQ3pRmEVJM+iA==", "dev": true }, "loose-envify": { @@ -4807,7 +5568,7 @@ }, "merge-descriptors": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", "dev": true }, @@ -4887,7 +5648,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mississippi": { @@ -4928,7 +5689,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -5013,7 +5774,7 @@ }, "module-not-found-error": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", "dev": true }, @@ -5116,6 +5877,14 @@ "just-extend": "^4.0.2", "lolex": "^4.1.0", "path-to-regexp": "^1.7.0" + }, + "dependencies": { + "lolex": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", + "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", + "dev": true + } } }, "no-case": { @@ -5392,7 +6161,7 @@ }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1" @@ -5426,7 +6195,7 @@ }, "optionator": { "version": "0.8.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { @@ -5665,7 +6434,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -5738,13 +6507,13 @@ }, "pinkie": { "version": "2.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { @@ -5772,7 +6541,7 @@ }, "prelude-ls": { "version": "1.1.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, @@ -5933,7 +6702,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -6126,7 +6895,7 @@ "dependencies": { "acorn-jsx": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { @@ -6135,7 +6904,7 @@ "dependencies": { "acorn": { "version": "3.3.0", - "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true } @@ -6195,7 +6964,7 @@ }, "eslint": { "version": "4.19.1", - "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { @@ -6559,7 +7328,7 @@ "should-equal": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", - "integrity": "sha1-YHLPgwRzYIZ+aOmLCdcRQ9BO4MM=", + "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", "dev": true, "requires": { "should-type": "^1.4.0" @@ -6567,7 +7336,7 @@ }, "should-format": { "version": "3.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", "dev": true, "requires": { @@ -6578,19 +7347,19 @@ "should-sinon": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/should-sinon/-/should-sinon-0.0.6.tgz", - "integrity": "sha1-vgQafJKPRKycz13AQtAyYYzin4Q=", + "integrity": "sha512-ScBOH5uW5QVFaONmUnIXANSR6z5B8IKzEmBP3HE5sPOCDuZ88oTMdUdnKoCVQdLcCIrRrhRLPS5YT+7H40a04g==", "dev": true }, "should-type": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=", "dev": true }, "should-type-adaptors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", - "integrity": "sha1-QB5/M7VTMDOUTVzYvytlAneS4no=", + "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", "dev": true, "requires": { "should-type": "^1.3.0", @@ -6599,13 +7368,13 @@ }, "should-util": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz", "integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=", "dev": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "sinon": { @@ -6623,6 +7392,12 @@ "supports-color": "^5.5.0" }, "dependencies": { + "lolex": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", + "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", + "dev": true + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -7011,7 +7786,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -7038,7 +7813,7 @@ }, "supports-color": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, @@ -7201,7 +7976,7 @@ }, "text-table": { "version": "0.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, @@ -7316,7 +8091,8 @@ "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true }, "tslib": { "version": "1.10.0", @@ -7330,7 +8106,7 @@ }, "type-check": { "version": "0.3.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { @@ -7349,20 +8125,20 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.4.tgz", + "integrity": "sha512-9Yc2i881pF4BPGhjteCXQNaXx1DCwm3dtOyBaG2hitHjLWOczw/ki8vD1bqyT3u6K0Ms/FpCShkmfg+FtlOfYA==", "dev": true, "optional": true, "requires": { - "commander": "~2.20.0", + "commander": "~2.20.3", "source-map": "~0.6.1" }, "dependencies": { "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "optional": true }, @@ -7687,7 +8463,7 @@ }, "wordwrap": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, @@ -7733,7 +8509,7 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write": { diff --git a/package.json b/package.json index 97e906b3e..68434a363 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-sdk", - "version": "7.0.0-beta.2", + "version": "7.0.0", "description": "Official Javascript SDK for Kuzzle", "author": "The Kuzzle Team ", "repository": { @@ -54,6 +54,7 @@ "eslint": "^5.16.0", "eslint-friendly-formatter": "^4.0.1", "eslint-loader": "^2.2.1", + "lolex": "^5.1.1", "mocha": "6.2.0", "mock-require": "^3.0.3", "nyc": "^14.1.1", diff --git a/src/Kuzzle.js b/src/Kuzzle.js index 1a37f1727..ba039be47 100644 --- a/src/Kuzzle.js +++ b/src/Kuzzle.js @@ -406,14 +406,16 @@ class Kuzzle extends KuzzleEventEmitter { request.requestId = uuidv4(); } - // we follow the api but allow some more logical "mistakes" (the only allowed value for refresh arg is "wait_for") - if (request.refresh) { + // we follow the api but allow some more logical "mistakes" + // (the only allowed value for refresh arg is "wait_for") + if (request.refresh || options.refresh) { request.refresh = 'wait_for'; } - if (!request.volatile) { + if (! request.volatile) { request.volatile = this.volatile; - } else if ( + } + else if ( typeof request.volatile !== 'object' || Array.isArray(request.volatile) ) { diff --git a/src/controllers/collection.js b/src/controllers/collection.js index acb1f9739..1efe54d28 100644 --- a/src/controllers/collection.js +++ b/src/controllers/collection.js @@ -12,21 +12,23 @@ class CollectionController extends BaseController { } create (index, collection, mappings = {}, options = {}) { - return this.query({ + const request = { index, collection, body: mappings, action: 'create' - }, options) + }; + return this.query(request, options) .then(response => response.result); } deleteSpecifications (index, collection, options = {}) { - return this.query({ + const request = { index, collection, action: 'deleteSpecifications' - }, options) + }; + return this.query(request, options) .then(response => response.result); } @@ -97,12 +99,12 @@ class CollectionController extends BaseController { } truncate (index, collection, options = {}) { - return this.query({ + const request = { index, collection, - action: 'truncate', - refresh: options.refresh - }, options) + action: 'truncate' + }; + return this.query(request, options) .then(response => response.result); } diff --git a/src/controllers/document.js b/src/controllers/document.js index 6fa829d02..451fae5c9 100644 --- a/src/controllers/document.js +++ b/src/controllers/document.js @@ -16,10 +16,8 @@ class DocumentController extends BaseController { index, collection, body, - action: 'count', - includeTrash: options.includeTrash + action: 'count' }; - delete options.includeTrash; return this.query(request, options) .then(response => response.result.count); @@ -31,11 +29,8 @@ class DocumentController extends BaseController { collection, _id, body: document, - action: 'create', - refresh: options.refresh + action: 'create' }; - delete options.refresh; - return this.query(request, options) .then(response => response.result); } @@ -46,10 +41,8 @@ class DocumentController extends BaseController { collection, _id, body, - action: 'createOrReplace', - refresh: options.refresh + action: 'createOrReplace' }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -60,10 +53,8 @@ class DocumentController extends BaseController { index, collection, _id, - action: 'delete', - refresh: options.refresh + action: 'delete' }; - delete options.refresh; return this.query(request, options) .then(response => response.result._id); @@ -74,10 +65,8 @@ class DocumentController extends BaseController { index, collection, body, - action: 'deleteByQuery', - refresh: options.refresh + action: 'deleteByQuery' }; - delete options.refresh; return this.query(request, options) .then(response => response.result.ids); @@ -100,10 +89,8 @@ class DocumentController extends BaseController { index, collection, _id, - action: 'get', - includeTrash: options.includeTrash + action: 'get' }; - delete options.includeTrash; return this.query(request, options) .then(response => response.result); @@ -114,10 +101,8 @@ class DocumentController extends BaseController { index, collection, body: {documents}, - action: 'mCreate', - refresh: options.refresh + action: 'mCreate' }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -128,10 +113,8 @@ class DocumentController extends BaseController { index, collection, body: {documents}, - action: 'mCreateOrReplace', - refresh: options.refresh + action: 'mCreateOrReplace' }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -142,10 +125,8 @@ class DocumentController extends BaseController { index, collection, body: {ids}, - action: 'mDelete', - refresh: options.refresh + action: 'mDelete' }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -156,10 +137,8 @@ class DocumentController extends BaseController { index, collection, body: {ids}, - action: 'mGet', - includeTrash: options.includeTrash + action: 'mGet' }; - delete options.includeTrash; return this.query(request, options) .then(response => response.result); @@ -170,10 +149,8 @@ class DocumentController extends BaseController { index, collection, body: {documents}, - action: 'mReplace', - refresh: options.refresh + action: 'mReplace' }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -184,10 +161,8 @@ class DocumentController extends BaseController { index, collection, body: {documents}, - action: 'mUpdate', - refresh: options.refresh + action: 'mUpdate' }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -199,10 +174,8 @@ class DocumentController extends BaseController { collection, _id, body, - action: 'replace', - refresh: options.refresh + action: 'replace' }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -216,7 +189,7 @@ class DocumentController extends BaseController { action: 'search', }; - for (const opt of ['from', 'size', 'scroll', 'includeTrash']) { + for (const opt of ['from', 'size', 'scroll']) { request[opt] = options[opt]; delete options[opt]; } @@ -237,10 +210,8 @@ class DocumentController extends BaseController { _id, body, action: 'update', - refresh: options.refresh, retryOnConflict: options.retryOnConflict }; - delete options.refresh; delete options.retryOnConflict; return this.query(request, options) diff --git a/src/controllers/index.js b/src/controllers/index.js index 6c7602630..ebd66435c 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -9,23 +9,25 @@ class IndexController extends BaseController { super(kuzzle, 'index'); } - create (index, options) { - return this.query({ + create (index, options = {}) { + const request = { index, - action : 'create' - }, options) + action: 'create' + }; + return this.query(request, options) .then(response => response.result); } - delete (index, options) { - return this.query({ + delete (index, options = {}) { + const request = { index, - action : 'delete' - }, options) + action: 'delete' + }; + return this.query(request, options) .then(response => response.result.acknowledged); } - exists (index, options) { + exists (index, options = {}) { return this.query({ index, action : 'exists' @@ -40,13 +42,15 @@ class IndexController extends BaseController { .then(response => response.result.indexes); } - mDelete (indexes, options) { - return this.query({ + mDelete (indexes, options = {}) { + const request = { action: 'mDelete', body: { indexes } - }, options) + }; + + return this.query(request, options) .then(response => response.result.deleted); } } diff --git a/src/controllers/security/index.js b/src/controllers/security/index.js index 1591bd94d..ec3de7759 100644 --- a/src/controllers/security/index.js +++ b/src/controllers/security/index.js @@ -42,10 +42,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'createOrReplaceProfile', - refresh: options.refresh + action: 'createOrReplaceProfile' }; - delete options.refresh; return this.query(request, options) .then(response => new Profile(this.kuzzle, response.result._id, response.result._source.policies)); @@ -55,10 +53,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'createOrReplaceRole', - refresh: options.refresh + action: 'createOrReplaceRole' }; - delete options.refresh; return this.query(request, options) .then(response => new Role(this.kuzzle, response.result._id, response.result._source.controllers)); @@ -68,10 +64,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'createProfile', - refresh: options.refresh + action: 'createProfile' }; - delete options.refresh; return this.query(request, options) .then(response => new Profile(this.kuzzle, response.result._id, response.result._source.policies)); @@ -85,10 +79,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'createRestrictedUser', - refresh: options.refresh + action: 'createRestrictedUser' }; - delete options.refresh; return this.query(request, options) .then(response => new User(this.kuzzle, response.result._id, response.result._source)); @@ -98,10 +90,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'createRole', - refresh: options.refresh + action: 'createRole' }; - delete options.refresh; return this.query(request, options) .then(response => new Role(this.kuzzle, response.result._id, response.result._source.controllers)); @@ -111,45 +101,48 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'createUser', - refresh: options.refresh + action: 'createUser' }; - delete options.refresh; return this.query(request, options) .then(response => new User(this.kuzzle, response.result._id, response.result._source)); } deleteCredentials (strategy, _id, options = {}) { - return this.query({ + const request = { strategy, _id, action: 'deleteCredentials' - }, options) + }; + + return this.query(request, options) .then(response => response.result); } deleteProfile (_id, options = {}) { - return this.query({ + const request = { _id, action: 'deleteProfile' - }, options) + }; + return this.query(request, options) .then(response => response.result); } deleteRole (_id, options = {}) { - return this.query({ + const request = { _id, action: 'deleteRole' - }, options) + }; + return this.query(request, options) .then(response => response.result); } deleteUser (_id, options = {}) { - return this.query({ + const request = { _id, action: 'deleteUser' - }, options) + }; + return this.query(request, options) .then(response => response.result); } @@ -259,10 +252,8 @@ class SecurityController extends BaseController { mDeleteProfiles (ids, options = {}) { const request = { action: 'mDeleteProfiles', - body: {ids}, - refresh: options.refresh + body: {ids} }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -271,10 +262,8 @@ class SecurityController extends BaseController { mDeleteRoles (ids, options = {}) { const request = { action: 'mDeleteRoles', - body: {ids}, - refresh: options.refresh + body: {ids} }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -283,10 +272,8 @@ class SecurityController extends BaseController { mDeleteUsers (ids, options = {}) { const request = { action: 'mDeleteUsers', - body: {ids}, - refresh: options.refresh + body: {ids} }; - delete options.refresh; return this.query(request, options) .then(response => response.result); @@ -312,11 +299,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'replaceUser', - refresh: options.refresh + action: 'replaceUser' }; - delete options.refresh; - return this.query(request, options) .then(response => new User(this.kuzzle, response.result._id, response.result._source)); } @@ -377,11 +361,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'updateProfile', - refresh: options.refresh + action: 'updateProfile' }; - delete options.refresh; - return this.query(request, options) .then(response => new Profile(this.kuzzle, response.result._id, response.result._source.policies)); } @@ -398,10 +379,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'updateRole', - refresh: options.refresh + action: 'updateRole' }; - delete options.refresh; return this.query(request, options) .then(response => new Role(this.kuzzle, response.result._id, response.result._source.controllers)); @@ -419,11 +398,8 @@ class SecurityController extends BaseController { const request = { _id, body, - action: 'updateUser', - refresh: options.refresh + action: 'updateUser' }; - delete options.refresh; - return this.query(request, options) .then(response => new User(this.kuzzle, response.result._id, response.result._source)); } diff --git a/src/protocols/abstract/realtime.js b/src/protocols/abstract/realtime.js index 30d9203de..08d499dac 100644 --- a/src/protocols/abstract/realtime.js +++ b/src/protocols/abstract/realtime.js @@ -4,7 +4,6 @@ const KuzzleAbstractProtocol = require('./common'); class RTWrapper extends KuzzleAbstractProtocol { - constructor (host, options = {}) { super(host, options); @@ -52,7 +51,7 @@ class RTWrapper extends KuzzleAbstractProtocol { * * @param {Error} error */ - clientNetworkError(error) { + clientNetworkError (error) { this.state = 'offline'; this.clear(); @@ -60,19 +59,35 @@ class RTWrapper extends KuzzleAbstractProtocol { connectionError.internal = error; this.emit('networkError', connectionError); + if (this.autoReconnect && !this.retrying && !this.stopRetryingToConnect) { this.retrying = true; + if ( typeof window === 'object' + && typeof window.navigator === 'object' + && window.navigator.onLine === false + ) { + window.addEventListener( + 'online', + () => { + this.retrying = false; + this.connect().catch(err => this.clientNetworkError(err)); + }, + { once: true }); + return; + } + setTimeout(() => { this.retrying = false; - this.connect(this.host).catch(err => this.clientNetworkError(err)); + this.connect().catch(err => this.clientNetworkError(err)); }, this.reconnectionDelay); - } else { + } + else { this.emit('disconnect'); } } - isReady() { + isReady () { return this.state === 'connected'; } } diff --git a/src/protocols/websocket.js b/src/protocols/websocket.js index 09ea205a6..97a57929e 100644 --- a/src/protocols/websocket.js +++ b/src/protocols/websocket.js @@ -90,8 +90,10 @@ class WSNode extends RTWrapper { let err = error; if (!(error instanceof Error)) { - err = error ? - new Error(error.message || error) : new Error('Unexpected error'); + // browser-side, the payload sent to this event is a generic "Event" + // object bearing no information about the cause of the error + err = error && (typeof Event === 'undefined' || !(error instanceof Event)) ? + new Error(error.message || error) : new Error('Connection error'); } this.clientNetworkError(err); diff --git a/test.js b/test.js new file mode 100644 index 000000000..1500a87d7 --- /dev/null +++ b/test.js @@ -0,0 +1,54 @@ +// Loads the Kuzzle SDK modules +const { + Kuzzle, + WebSocket, + Http +} = require('./index'); + +// Instantiates a Kuzzle client with the Http protocol +// Replace 'kuzzle' with your Kuzzle server hostname (e.g. 'localhost') +const kuzzle = new Kuzzle( + new WebSocket('localhost') +); + +let i = 0; +// Adds a listener to detect any connection problems +kuzzle.on('disconnected', () => { + console.log('disconnected') + if (i > 5) { + console.log('Max tries') + kuzzle.disconnect() + } + i++; +}) +kuzzle.on('reconnected', () => console.log('reconnected')) + +const run = async () => { + try { + // Connects to the Kuzzle server + await kuzzle.connect(); + // await kuzzle.index.create('nyc-open-data') + // await kuzzle.collection.create('nyc-open-data', 'yellow-taxi') + + // const documents = [ + // { + // _id: 'some-id', + // body: { 'capacity': 4 } + // }, + // { + // body: { this: 'document id is auto-computed' } + // } + // ]; + // const response = await kuzzle.document.mCreate( + // 'nyc-open-data', + // 'yellow-taxi', + // documents + // ); + + // console.log(JSON.stringify(response, null, 2)); + } catch (error) { + console.error(error); + } +}; + +run(); \ No newline at end of file diff --git a/test.sh b/test.sh new file mode 100644 index 000000000..153404505 --- /dev/null +++ b/test.sh @@ -0,0 +1,3 @@ + +if [[ $TRAVIS_BRANCH =~ ^master|[0-9]+-stable$ ]]; then BRANCH=stable; else BRANCH=dev; fi +echo $BRANCH diff --git a/test/controllers/collection.test.js b/test/controllers/collection.test.js index 724b2a2df..0d810c397 100644 --- a/test/controllers/collection.test.js +++ b/test/controllers/collection.test.js @@ -295,8 +295,7 @@ describe('Collection Controller', () => { controller: 'collection', action: 'truncate', index: 'index', - collection: 'collection', - refresh: undefined + collection: 'collection' }, options); should(res.acknowledged).be.a.Boolean().and.be.true(); diff --git a/test/controllers/document.test.js b/test/controllers/document.test.js index d4f4275a0..58c3a8abe 100644 --- a/test/controllers/document.test.js +++ b/test/controllers/document.test.js @@ -28,33 +28,12 @@ describe('Document Controller', () => { action: 'count', index: 'index', collection: 'collection', - body: {foo: 'bar'}, - includeTrash: undefined + body: {foo: 'bar'} }, options); should(res).be.a.Number().and.be.equal(1234); }); }); - - it('should inject the "includeTrash" option into the request', () => { - kuzzle.query.resolves({result: {count: 1234}}); - - return kuzzle.document.count('index', 'collection', {foo: 'bar'}, {includeTrash: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'count', - index: 'index', - collection: 'collection', - body: {foo: 'bar'}, - includeTrash: true - }, {}); - - should(res).be.a.Number().and.be.equal(1234); - }); - }); }); describe('create', () => { @@ -76,39 +55,12 @@ describe('Document Controller', () => { index: 'index', collection: 'collection', _id: 'document-id', - body: {foo: 'bar'}, - refresh: undefined + body: {foo: 'bar'} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = { - _id: 'document-id', - _version: 1, - _source: {foo: 'bar'} - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.create('index', 'collection', {foo: 'bar'}, 'document-id', {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'create', - index: 'index', - collection: 'collection', - _id: 'document-id', - body: {foo: 'bar'}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('createOrReplace', () => { @@ -131,40 +83,12 @@ describe('Document Controller', () => { index: 'index', collection: 'collection', _id: 'document-id', - body: {foo: 'bar'}, - refresh: undefined + body: {foo: 'bar'} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = { - _id: 'document-id', - _version: 1, - _source: {foo: 'bar'}, - created: false - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.createOrReplace('index', 'collection', 'document-id', {foo: 'bar'}, {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'createOrReplace', - index: 'index', - collection: 'collection', - _id: 'document-id', - body: {foo: 'bar'}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('delete', () => { @@ -180,33 +104,12 @@ describe('Document Controller', () => { action: 'delete', index: 'index', collection: 'collection', - _id: 'document-id', - refresh: undefined + _id: 'document-id' }, options); should(res).equal('document-id'); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({result: {_id: 'document-id'}}); - - return kuzzle.document.delete('index', 'collection', 'document-id', {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'delete', - index: 'index', - collection: 'collection', - _id: 'document-id', - refresh: true - }, {}); - - should(res).equal('document-id'); - }); - }); }); describe('deleteByQuery', () => { @@ -222,8 +125,7 @@ describe('Document Controller', () => { action: 'deleteByQuery', index: 'index', collection: 'collection', - body: {foo: 'bar'}, - refresh: undefined + body: {foo: 'bar'} }, options); should(res).be.an.Array(); @@ -233,30 +135,6 @@ describe('Document Controller', () => { should(res[2]).be.equal('baz'); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({result: {ids: ['foo', 'bar', 'baz']}}); - - return kuzzle.document.deleteByQuery('index', 'collection', {foo: 'bar'}, {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'deleteByQuery', - index: 'index', - collection: 'collection', - body: {foo: 'bar'}, - refresh: true - }, {}); - - should(res).be.an.Array(); - should(res.length).be.equal(3); - should(res[0]).be.equal('foo'); - should(res[1]).be.equal('bar'); - should(res[2]).be.equal('baz'); - }); - }); }); describe('get', () => { @@ -279,8 +157,7 @@ describe('Document Controller', () => { action: 'get', index: 'index', collection: 'collection', - _id: 'document-id', - includeTrash: undefined + _id: 'document-id' }, options); should(res._id).be.equal('document-id'); @@ -289,36 +166,6 @@ describe('Document Controller', () => { should(res._source.foo).be.equal('bar'); }); }); - - it('should inject the "includeTrash" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'document-id', - _index: 'index', - _type: 'collection', - _source: {foo: 'bar'} - } - }); - - return kuzzle.document.get('index', 'collection', 'document-id', {includeTrash: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'get', - index: 'index', - collection: 'collection', - _id: 'document-id', - includeTrash: true - }, {}); - - should(res._id).be.equal('document-id'); - should(res._index).be.equal('index'); - should(res._type).be.equal('collection'); - should(res._source.foo).be.equal('bar'); - }); - }); }); describe('mCreate', () => { @@ -342,41 +189,12 @@ describe('Document Controller', () => { action: 'mCreate', index: 'index', collection: 'collection', - body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]}, - refresh: undefined + body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = { - hits: [{ - _id: 'document-id', - _version: 1, - _source: {foo: 'bar'} - }], - total: 1 - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.mCreate('index', 'collection', [{_id: 'document-id', body: {foo: 'bar'}}], {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'mCreate', - index: 'index', - collection: 'collection', - body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('mCreateOrReplace', () => { @@ -400,41 +218,12 @@ describe('Document Controller', () => { action: 'mCreateOrReplace', index: 'index', collection: 'collection', - body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]}, - refresh: undefined + body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = { - hits: [{ - _id: 'document-id', - _version: 1, - _source: {foo: 'bar'} - }], - total: 1 - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.mCreateOrReplace('index', 'collection', [{_id: 'document-id', body: {foo: 'bar'}}], {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'mCreateOrReplace', - index: 'index', - collection: 'collection', - body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('mDelete', () => { @@ -451,34 +240,12 @@ describe('Document Controller', () => { action: 'mDelete', index: 'index', collection: 'collection', - body: {ids: ['document1', 'document2']}, - refresh: undefined + body: {ids: ['document1', 'document2']} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = ['document1', 'document2']; - kuzzle.query.resolves({result}); - - return kuzzle.document.mDelete('index', 'collection', ['document1', 'document2'], {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'mDelete', - index: 'index', - collection: 'collection', - body: {ids: ['document1', 'document2']}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('mGet', () => { @@ -501,40 +268,12 @@ describe('Document Controller', () => { action: 'mGet', index: 'index', collection: 'collection', - body: {ids: ['document1', 'document2']}, - includeTrash: undefined + body: {ids: ['document1', 'document2']} }, options); should(res).be.equal(result); }); }); - - it('should inject the "includeTrash" option into the request', () => { - const result = { - hits: [ - {_id: 'document1', _version: 1, _source: {foo: 'bar'}}, - {_id: 'document2', _version: 3, _source: {foo: 'baz'}}, - ], - total: 2 - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.mGet('index', 'collection', ['document1', 'document2'], {includeTrash: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'mGet', - index: 'index', - collection: 'collection', - body: {ids: ['document1', 'document2']}, - includeTrash: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('mReplace', () => { @@ -558,41 +297,12 @@ describe('Document Controller', () => { action: 'mReplace', index: 'index', collection: 'collection', - body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]}, - refresh: undefined + body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = { - hits: [{ - _id: 'document-id', - _version: 1, - _source: {foo: 'bar'} - }], - total: 1 - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.mReplace('index', 'collection', [{_id: 'document-id', body: {foo: 'bar'}}], {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'mReplace', - index: 'index', - collection: 'collection', - body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('mUpdate', () => { @@ -616,41 +326,12 @@ describe('Document Controller', () => { action: 'mUpdate', index: 'index', collection: 'collection', - body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]}, - refresh: undefined + body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = { - hits: [{ - _id: 'document-id', - _version: 1, - _source: {foo: 'bar'} - }], - total: 1 - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.mUpdate('index', 'collection', [{_id: 'document-id', body: {foo: 'bar'}}], {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'mUpdate', - index: 'index', - collection: 'collection', - body: {documents: [{_id: 'document-id', body: {foo: 'bar'}}]}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('replace', () => { @@ -673,40 +354,12 @@ describe('Document Controller', () => { index: 'index', collection: 'collection', _id: 'document-id', - body: {foo: 'bar'}, - refresh: undefined + body: {foo: 'bar'} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = { - _id: 'document-id', - _version: 1, - _source: {foo: 'bar'}, - created: false - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.replace('index', 'collection', 'document-id', {foo: 'bar'}, {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'replace', - index: 'index', - collection: 'collection', - _id: 'document-id', - body: {foo: 'bar'}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('search', () => { @@ -734,8 +387,7 @@ describe('Document Controller', () => { body: {foo: 'bar'}, from: 0, size: 10, - scroll: undefined, - includeTrash: undefined + scroll: undefined }, options); should(res).be.an.instanceOf(DocumentSearchResult); @@ -746,42 +398,6 @@ describe('Document Controller', () => { }); }); - it('should inject the "includeTrash" option into the request', () => { - const result = { - scrollId: 'scroll-id', - hits: [ - {_id: 'document1', _score: 0.9876, _source: {foo: 'bar'}}, - {_id: 'document2', _score: 0.6789, _source: {foo: 'barbar'}}, - {_id: 'document3', _score: 0.6543, _source: {foo: 'barbaz'}} - ], - total: 3 - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.search('index', 'collection', {foo: 'bar'}, {includeTrash: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'search', - index: 'index', - collection: 'collection', - body: {foo: 'bar'}, - from: 0, - size: 10, - scroll: undefined, - includeTrash: true - }, {}); - - should(res).be.an.instanceOf(DocumentSearchResult); - should(res._options).be.empty(); - should(res._response).be.equal(result); - should(res.fetched).be.equal(3); - should(res.total).be.equal(3); - }); - }); - it('should inject the "from", "size", "scroll" options into the request', () => { const result = { scrollId: 'scroll-id', @@ -805,8 +421,7 @@ describe('Document Controller', () => { body: {foo: 'bar'}, from: 1, size: 2, - scroll: '1m', - includeTrash: undefined + scroll: '1m' }, {}); should(res).be.an.instanceOf(DocumentSearchResult); @@ -880,7 +495,6 @@ describe('Document Controller', () => { collection: 'collection', _id: 'document-id', body: {foo: 'bar'}, - refresh: undefined, retryOnConflict: undefined }, options); @@ -888,34 +502,6 @@ describe('Document Controller', () => { }); }); - it('should inject the "refresh" option into the request', () => { - const result = { - _id: 'document-id', - _version: 1, - _source: {foo: 'bar'}, - created: false - }; - kuzzle.query.resolves({result}); - - return kuzzle.document.update('index', 'collection', 'document-id', {foo: 'bar'}, {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'document', - action: 'update', - index: 'index', - collection: 'collection', - _id: 'document-id', - body: {foo: 'bar'}, - refresh: true, - retryOnConflict: undefined - }, {}); - - should(res).be.equal(result); - }); - }); - it('should inject the "retryOnConflict" option into the request', () => { const result = { _id: 'document-id', @@ -936,7 +522,6 @@ describe('Document Controller', () => { collection: 'collection', _id: 'document-id', body: {foo: 'bar'}, - refresh: undefined, retryOnConflict: true }, {}); diff --git a/test/controllers/security.test.js b/test/controllers/security.test.js index 31cd71ee9..2b90744ec 100644 --- a/test/controllers/security.test.js +++ b/test/controllers/security.test.js @@ -123,8 +123,7 @@ describe('Security Controller', () => { _id: 'profileId', body: {foo: 'bar'}, controller: 'security', - action: 'createOrReplaceProfile', - refresh: undefined + action: 'createOrReplaceProfile' }, options); should(profile).be.an.instanceOf(Profile); @@ -132,36 +131,6 @@ describe('Security Controller', () => { should(profile.policies).be.eql(['foo', 'bar']); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'profileId', - _index: '%kuzzle', - _type: 'profiles', - _version: 1, - _source: { policies: ['foo', 'bar'] }, - created: false - } - }); - - return kuzzle.security.createOrReplaceProfile('profileId', {foo: 'bar'}, {refresh: true}) - .then(profile => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'profileId', - body: {foo: 'bar'}, - controller: 'security', - action: 'createOrReplaceProfile', - refresh: true - }, {}); - - should(profile).be.an.instanceOf(Profile); - should(profile._id).be.eql('profileId'); - should(profile.policies).be.eql(['foo', 'bar']); - }); - }); }); describe('createOrReplaceRole', () => { @@ -185,8 +154,7 @@ describe('Security Controller', () => { _id: 'roleId', body: {foo: 'bar'}, controller: 'security', - action: 'createOrReplaceRole', - refresh: undefined + action: 'createOrReplaceRole' }, options); should(role).be.an.instanceOf(Role); @@ -194,36 +162,6 @@ describe('Security Controller', () => { should(role.controllers).be.eql({foo: {actions: {bar: true}}}); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'roleId', - _index: '%kuzzle', - _type: 'profiles', - _version: 1, - _source: { controllers: {foo: {actions: {bar: true}}} }, - created: false - } - }); - - return kuzzle.security.createOrReplaceRole('roleId', {foo: 'bar'}, {refresh: true}) - .then(role => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'roleId', - body: {foo: 'bar'}, - controller: 'security', - action: 'createOrReplaceRole', - refresh: true - }, {}); - - should(role).be.an.instanceOf(Role); - should(role._id).be.eql('roleId'); - should(role.controllers).be.eql({foo: {actions: {bar: true}}}); - }); - }); }); describe('createProfile', () => { @@ -247,8 +185,7 @@ describe('Security Controller', () => { _id: 'profileId', body: {foo: 'bar'}, controller: 'security', - action: 'createProfile', - refresh: undefined + action: 'createProfile' }, options); should(profile).be.an.instanceOf(Profile); @@ -256,36 +193,6 @@ describe('Security Controller', () => { should(profile.policies).be.eql(['foo', 'bar']); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'profileId', - _index: '%kuzzle', - _type: 'profiles', - _version: 1, - _source: { policies: ['foo', 'bar'] }, - created: true - } - }); - - return kuzzle.security.createProfile('profileId', {foo: 'bar'}, {refresh: true}) - .then(profile => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'profileId', - body: {foo: 'bar'}, - controller: 'security', - action: 'createProfile', - refresh: true - }, {}); - - should(profile).be.an.instanceOf(Profile); - should(profile._id).be.eql('profileId'); - should(profile.policies).be.eql(['foo', 'bar']); - }); - }); }); describe('createRole', () => { @@ -309,8 +216,7 @@ describe('Security Controller', () => { _id: 'roleId', body: {foo: 'bar'}, controller: 'security', - action: 'createRole', - refresh: undefined + action: 'createRole' }, options); should(role).be.an.instanceOf(Role); @@ -318,36 +224,6 @@ describe('Security Controller', () => { should(role.controllers).be.eql({foo: {actions: {bar: true}}}); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'roleId', - _index: '%kuzzle', - _type: 'profiles', - _version: 1, - _source: { controllers: {foo: {actions: {bar: true}}} }, - created: true - } - }); - - return kuzzle.security.createRole('roleId', {foo: 'bar'}, {refresh: true}) - .then(role => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'roleId', - body: {foo: 'bar'}, - controller: 'security', - action: 'createRole', - refresh: true - }, {}); - - should(role).be.an.instanceOf(Role); - should(role._id).be.eql('roleId'); - should(role.controllers).be.eql({foo: {actions: {bar: true}}}); - }); - }); }); describe('createUser', () => { @@ -378,8 +254,7 @@ describe('Security Controller', () => { _id: 'userId', body, controller: 'security', - action: 'createUser', - refresh: undefined + action: 'createUser' }, options); should(user).be.an.instanceOf(User); @@ -388,44 +263,6 @@ describe('Security Controller', () => { should(user.profileIds).be.eql(['profileId']); }); }); - - it('should inject the "refresh" option into the request', () => { - const body = { - content: {foo: 'bar'}, - credentials: { - strategy: {foo: 'bar'} - } - }; - - kuzzle.query.resolves({ - result: { - _id: 'kuid', - _index: '%kuzzle', - _source: { profileIds: ['profileId'], name: 'John Doe' }, - _type: 'users', - _version: 1, - created: true - } - }); - - return kuzzle.security.createUser('userId', body, {refresh: true}) - .then(user => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'userId', - body, - controller: 'security', - action: 'createUser', - refresh: true - }, {}); - - should(user).be.an.instanceOf(User); - should(user._id).be.eql('kuid'); - should(user.content).be.eql({name: 'John Doe', profileIds: ['profileId']}); - should(user.profileIds).be.eql(['profileId']); - }); - }); }); describe('createRestrictedUser', () => { @@ -456,8 +293,7 @@ describe('Security Controller', () => { body, _id: 'userId', controller: 'security', - action: 'createRestrictedUser', - refresh: undefined + action: 'createRestrictedUser' }, options); should(user).be.an.instanceOf(User); @@ -466,44 +302,6 @@ describe('Security Controller', () => { should(user.profileIds).be.eql(['profileId']); }); }); - - it('should inject the "refresh" option into the request', () => { - const body = { - content: {foo: 'bar'}, - credentials: { - strategy: {foo: 'bar'} - } - }; - - kuzzle.query.resolves({ - result: { - _id: 'kuid', - _index: '%kuzzle', - _source: { profileIds: ['profileId'], name: 'John Doe' }, - _type: 'users', - _version: 1, - created: true - } - }); - - return kuzzle.security.createRestrictedUser(body, null, {refresh: true}) - .then(user => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - body, - _id: null, - controller: 'security', - action: 'createRestrictedUser', - refresh: true - }, {}); - - should(user).be.an.instanceOf(User); - should(user._id).be.eql('kuid'); - should(user.content).be.eql({name: 'John Doe', profileIds: ['profileId']}); - should(user.profileIds).be.eql(['profileId']); - }); - }); }); describe('deleteCredentials', () => { @@ -918,32 +716,12 @@ describe('Security Controller', () => { .be.calledWith({ controller: 'security', action: 'mDeleteProfiles', - body: {ids: ['profile1', 'profile2']}, - refresh: undefined + body: {ids: ['profile1', 'profile2']} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = ['profile1', 'profile2']; - kuzzle.query.resolves({result}); - - return kuzzle.security.mDeleteProfiles(['profile1', 'profile2'], {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'security', - action: 'mDeleteProfiles', - body: {ids: ['profile1', 'profile2']}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('mDeleteRoles', () => { @@ -958,32 +736,12 @@ describe('Security Controller', () => { .be.calledWith({ controller: 'security', action: 'mDeleteRoles', - body: {ids: ['role1', 'role2']}, - refresh: undefined + body: {ids: ['role1', 'role2']} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = ['role1', 'role2']; - kuzzle.query.resolves({result}); - - return kuzzle.security.mDeleteRoles(['role1', 'role2'], {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'security', - action: 'mDeleteRoles', - body: {ids: ['role1', 'role2']}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('mDeleteUsers', () => { @@ -998,32 +756,12 @@ describe('Security Controller', () => { .be.calledWith({ controller: 'security', action: 'mDeleteUsers', - body: {ids: ['user1', 'user2']}, - refresh: undefined + body: {ids: ['user1', 'user2']} }, options); should(res).be.equal(result); }); }); - - it('should inject the "refresh" option into the request', () => { - const result = ['user1', 'user2']; - kuzzle.query.resolves({result}); - - return kuzzle.security.mDeleteUsers(['user1', 'user2'], {refresh: true}) - .then(res => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - controller: 'security', - action: 'mDeleteUsers', - body: {ids: ['user1', 'user2']}, - refresh: true - }, {}); - - should(res).be.equal(result); - }); - }); }); describe('mGetProfiles', () => { @@ -1117,8 +855,7 @@ describe('Security Controller', () => { _id: 'userId', body: {foo: 'bar'}, controller: 'security', - action: 'replaceUser', - refresh: undefined + action: 'replaceUser' }, options); should(user).be.an.instanceOf(User); @@ -1127,37 +864,6 @@ describe('Security Controller', () => { should(user.profileIds).be.eql(['profileId']); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'kuid', - _index: '%kuzzle', - _source: { profileIds: ['profileId'], name: 'John Doe' }, - _type: 'users', - _version: 1, - created: true - } - }); - - return kuzzle.security.replaceUser('userId', {foo: 'bar'}, {refresh: true}) - .then(user => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'userId', - body: {foo: 'bar'}, - controller: 'security', - action: 'replaceUser', - refresh: true - }, {}); - - should(user).be.an.instanceOf(User); - should(user._id).be.eql('kuid'); - should(user.content).be.eql({name: 'John Doe', profileIds: ['profileId']}); - should(user.profileIds).be.eql(['profileId']); - }); - }); }); describe('searchProfiles', () => { @@ -1399,8 +1105,7 @@ describe('Security Controller', () => { _id: 'profileId', body: {foo: 'bar'}, controller: 'security', - action: 'updateProfile', - refresh: undefined + action: 'updateProfile' }, options); should(profile).be.an.instanceOf(Profile); @@ -1408,36 +1113,6 @@ describe('Security Controller', () => { should(profile.policies).be.eql(['foo', 'bar']); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'profileId', - _index: '%kuzzle', - _type: 'profiles', - _version: 2, - _source: { policies: ['foo', 'bar'] }, - created: false - } - }); - - return kuzzle.security.updateProfile('profileId', {foo: 'bar'}, {refresh: true}) - .then(profile => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'profileId', - body: {foo: 'bar'}, - controller: 'security', - action: 'updateProfile', - refresh: true - }, {}); - - should(profile).be.an.instanceOf(Profile); - should(profile._id).be.eql('profileId'); - should(profile.policies).be.eql(['foo', 'bar']); - }); - }); }); describe('updateProfileMapping', () => { @@ -1480,8 +1155,7 @@ describe('Security Controller', () => { _id: 'roleId', body: {foo: 'bar'}, controller: 'security', - action: 'updateRole', - refresh: undefined + action: 'updateRole' }, options); should(role).be.an.instanceOf(Role); @@ -1489,36 +1163,6 @@ describe('Security Controller', () => { should(role.controllers).be.eql({foo: {actions: {bar: true}}}); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'roleId', - _index: '%kuzzle', - _type: 'roles', - _version: 2, - _source: { controllers: {foo: {actions: {bar: true}}} }, - created: false - } - }); - - return kuzzle.security.updateRole('roleId', {foo: 'bar'}, {refresh: true}) - .then(role => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'roleId', - body: {foo: 'bar'}, - controller: 'security', - action: 'updateRole', - refresh: true - }, {}); - - should(role).be.an.instanceOf(Role); - should(role._id).be.eql('roleId'); - should(role.controllers).be.eql({foo: {actions: {bar: true}}}); - }); - }); }); describe('updateRoleMapping', () => { @@ -1561,8 +1205,7 @@ describe('Security Controller', () => { _id: 'userId', body: {foo: 'bar'}, controller: 'security', - action: 'updateUser', - refresh: undefined + action: 'updateUser' }, options); should(user).be.an.instanceOf(User); @@ -1571,37 +1214,6 @@ describe('Security Controller', () => { should(user.profileIds).be.eql(['profileId']); }); }); - - it('should inject the "refresh" option into the request', () => { - kuzzle.query.resolves({ - result: { - _id: 'kuid', - _index: '%kuzzle', - _source: { profileIds: ['profileId'], name: 'John Doe' }, - _type: 'users', - _version: 2, - created: false - } - }); - - return kuzzle.security.updateUser('userId', {foo: 'bar'}, {refresh: true}) - .then(user => { - should(kuzzle.query) - .be.calledOnce() - .be.calledWith({ - _id: 'userId', - body: {foo: 'bar'}, - controller: 'security', - action: 'updateUser', - refresh: true - }, {}); - - should(user).be.an.instanceOf(User); - should(user._id).be.eql('kuid'); - should(user.content).be.eql({name: 'John Doe', profileIds: ['profileId']}); - should(user.profileIds).be.eql(['profileId']); - }); - }); }); describe('updateUserMapping', () => { diff --git a/test/mocks/window.mock.js b/test/mocks/window.mock.js new file mode 100644 index 000000000..b1bd8f5ea --- /dev/null +++ b/test/mocks/window.mock.js @@ -0,0 +1,36 @@ +const + sinon = require('sinon'), + KuzzleEventEmitter = require('../../src/eventEmitter'); + +// A class to mock the global window object +class WindowMock extends KuzzleEventEmitter { + constructor () { + super(); + + if (typeof window !== 'undefined') { + throw new Error('Cannot mock add a global "window" object: already defined'); + } + + this.navigator = { + onLine: true + }; + + this.addEventListener = this.addListener; + sinon.spy(this, 'addEventListener'); + } + + static restore () { + delete global.window; + } + + static inject () { + Object.defineProperty(global, 'window', { + value: new this(), + enumerable: false, + writable: false, + configurable: true + }); + } +} + +module.exports = WindowMock; diff --git a/test/protocol/socketio.test.js b/test/protocol/socketio.test.js index 33dceb257..5ea75c8ed 100644 --- a/test/protocol/socketio.test.js +++ b/test/protocol/socketio.test.js @@ -1,11 +1,8 @@ const should = require('should'), sinon = require('sinon'), - SocketIO = require('../../src/protocols/socketio'); - -/** - * @global window - */ + SocketIO = require('../../src/protocols/socketio'), + windowMock = require('../mocks/window.mock'); describe('SocketIO networking module', () => { let @@ -15,6 +12,7 @@ describe('SocketIO networking module', () => { beforeEach(() => { clock = sinon.useFakeTimers(); + socketStub = { events: {}, eventOnce: {}, @@ -74,11 +72,13 @@ describe('SocketIO networking module', () => { }); socketIO.socket = socketStub; - window = {io: sinon.stub().returns(socketStub)}; // eslint-disable-line + windowMock.inject(); + window.io = sinon.stub().returns(socketStub); }); afterEach(() => { clock.restore(); + windowMock.restore(); }); it('should expose an unique identifier', () => { @@ -225,8 +225,6 @@ describe('SocketIO exposed methods', () => { socketIO = new SocketIO('address'); socketIO.socket = socketStub; - - window = {io: sinon.stub().returns(socketStub)}; // eslint-disable-line }); it('should be able to listen to an event just once', () => { diff --git a/test/protocol/websocket.test.js b/test/protocol/websocket.test.js index 84f5ac9f6..64c3accf0 100644 --- a/test/protocol/websocket.test.js +++ b/test/protocol/websocket.test.js @@ -1,8 +1,10 @@ const should = require('should'), sinon = require('sinon'), + lolex = require('lolex'), NodeWS = require('ws'), - WS = require('../../src/protocols/websocket'); + WS = require('../../src/protocols/websocket'), + windowMock = require('../mocks/window.mock'); describe('WebSocket networking module', () => { let @@ -12,13 +14,13 @@ describe('WebSocket networking module', () => { clientStub; beforeEach(() => { - clock = sinon.useFakeTimers(); + clock = lolex.install(); clientStub = { send: sinon.stub(), close: sinon.stub() }; - window = 'foobar'; // eslint-disable-line + windowMock.inject(); WebSocket = function (...args) { // eslint-disable-line wsargs = args; return clientStub; @@ -32,9 +34,9 @@ describe('WebSocket networking module', () => { }); afterEach(() => { - clock.restore(); + clock.uninstall(); WebSocket = undefined; // eslint-disable-line - window = undefined; // eslint-disable-line + windowMock.restore(); }); it('should expose an unique identifier', () => { @@ -156,6 +158,59 @@ describe('WebSocket networking module', () => { return should(promise).be.rejectedWith('foobar'); }); + it('should stop reconnecting if the browser goes offline', () => { + const cb = sinon.stub(); + + websocket.retrying = false; + websocket.addListener('networkError', cb); + should(websocket.listeners('networkError').length).be.eql(1); + + websocket.connect(); + websocket.connect = sinon.stub().rejects(); + clientStub.onopen(); + clientStub.onerror(); + + should(websocket.retrying).be.true(); + should(cb).be.calledOnce(); + should(websocket.connect).not.be.called(); + + window.navigator.onLine = false; + + return clock.tickAsync(100) + .then(() => { + should(websocket.retrying).be.true(); + should(cb).be.calledTwice(); + should(websocket.connect).be.calledOnce(); + + should(window.addEventListener).calledWith( + 'online', + sinon.match.func, + { once: true }); + + return clock.tickAsync(100); + }) + .then(() => { + // the important bit is there: cb hasn't been called since the last + // tick because the SDK does not try to connect if the browser is + // marked offline + should(cb).be.calledTwice(); + + should(websocket.retrying).be.true(); + should(websocket.connect).be.calledOnce(); + + window.emit('online'); + return clock.tickAsync(100); + }) + .then(() => { + // And it started retrying to connect again now that the browser is + // "online" + should(cb).be.calledThrice(); + + should(websocket.retrying).be.true(); + should(websocket.connect).be.calledTwice(); + }); + }); + it('should call listeners on a "disconnect" event', () => { const cb = sinon.stub(); @@ -359,6 +414,26 @@ describe('WebSocket networking module', () => { should(websocket.wasConnected).be.false(); }); + it('should reject with a proper error if onerror is called with an event (browser)', () => { + const Event = sinon.stub(); + Object.defineProperty(global, 'Event', { + value: Event, + enumerable: false, + writable: false, + configurable: true + }); + + const promise = websocket.connect(); + websocket.client.onerror(new Event()); + + return should(promise).rejectedWith(Error, {message: 'Connection error'}) + .then(() => delete global.Event) + .catch(e => { + delete global.Event; + throw e; + }); + }); + describe('#constructor', () => { it('should throw if an invalid host is provided', () => { const invalidHosts = [undefined, null, 123, false, true, [], {}, '']; @@ -371,7 +446,7 @@ describe('WebSocket networking module', () => { it('should fallback to the ws module if there is no global WebSocket API', () => { WebSocket = undefined; // eslint-disable-line - window = undefined; // eslint-disable-line + windowMock.restore(); const client = new WS('foobar'); @@ -391,7 +466,7 @@ describe('WebSocket networking module', () => { it('should initialize pass allowed options to the ws ctor when using it', () => { WebSocket = undefined; // eslint-disable-line - window = undefined; // eslint-disable-line + windowMock.restore(); let client = new WS('foobar'); @@ -413,7 +488,7 @@ describe('WebSocket networking module', () => { it('should throw if invalid options are provided', () => { WebSocket = undefined; // eslint-disable-line - window = undefined; // eslint-disable-line + windowMock.restore(); const invalidHeaders = ['foo', 'false', 'true', 123, []]; diff --git a/test1.js b/test1.js new file mode 100644 index 000000000..63cbc2e8b --- /dev/null +++ b/test1.js @@ -0,0 +1,41 @@ +// Loads the Kuzzle SDK module and the websocket protocol +const { + Kuzzle, + WebSocket +} = require('kuzzle-sdk'); + +// Instantiates a Kuzzle client +const + kuzzle = new Kuzzle( + new WebSocket('kuzzle', { autoReconnect: false }) + ); + +// Adds a listener to detect any connection problems +kuzzle.on('networkError', error => { + console.error(`Network Error: ${error.message}`); +}); + +(async () => { + try { + await kuzzle.connect(); + } catch (error) { + console.log(`Can not connect to Kuzzle: ${error.message}`); + } + try { + const count = await kuzzle.document.count( + 'nyc-open-data', + 'yellow-taxi', + { + query: { + match: { license: 'valid' } + } + } + ); + + console.log(`Found ${count} documents matching license:valid`); + } catch (error) { + console.error(error.message); + } finally { + kuzzle.disconnect(); + } +})();